query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
bb72d27d0e57849c6d6ef46ffab447de
Name the dommodule ID that should be targeted for the element template
[ { "docid": "8affce6005f04681877dc32df796ea3c", "score": "0.0", "text": "static get is() { return 'lingo-live-text-chat'; }", "title": "" } ]
[ { "docid": "ff353667b54457341508aedc671b8df0", "score": "0.6370663", "text": "function set_id (component_reference, idname)\n {\n component_reference.style.idName = idname;\n }", "title": "" }, { "docid": "a57ba4b1ca5a4821049f63192bfc2043", "score": "0.63467485", "text": "function defineId() {\n _id = _dom.mainInput.id;\n if (!_id) {\n _id = (\"i\" + Math.round(Math.random() * 100000));\n _dom.mainInput.id = _id;\n }\n }", "title": "" }, { "docid": "3ca0f22018cf08021dc5d49f9beb794a", "score": "0.599174", "text": "function getElementId(name) {\n var local = name.split(' ').join('');\n return local;\n }", "title": "" }, { "docid": "6989bbcb6639fecca69ca32605bfcee0", "score": "0.59870136", "text": "function id(semanticId) {\n return '#' + namespace + semanticId;\n }", "title": "" }, { "docid": "8b40e6ed9f0f24ec9f778bf158a7c27d", "score": "0.59757376", "text": "getId() {\n const scopeVersion = this.scope ? this.scope.version() : '';\n return this.templateName + scopeVersion;\n }", "title": "" }, { "docid": "ed5dc9e7ae3b4a3bd02f54828d410b39", "score": "0.59001327", "text": "generateHTMLID(fieldOrBtnName, dataItem) {\n const prefix = this.props.fieldPrefix;\n const key = dataItem[this.props.htmlIDKeyField];\n\n // See NOTE above\n return `${prefix}|key=${key}|name=${fieldOrBtnName}`;\n }", "title": "" }, { "docid": "63a7592ab79928dfeb6bcc94939eb15b", "score": "0.5865081", "text": "name()\n {\n if (this.id) return this.id;\n\n if (this.labelTitle) return this.labelTitle.toLowerCase().replaceAll(' ', '_');\n\n return `id-${parseInt(window.performance.now())}`;\n }", "title": "" }, { "docid": "cb32b6a709dd880549255afd76234e45", "score": "0.58108664", "text": "static setID(element)\n {\n const id = `${element.nodeName.toLowerCase()}-${counter++}`;\n element.setAttribute(\"id\", id);\n return id;\n }", "title": "" }, { "docid": "dabbc4ef55d58c9cc333301c4effc90c", "score": "0.5796768", "text": "get baseName() {\n return `${this.cssname}_ID${this.ID}`;\n }", "title": "" }, { "docid": "1fea0fa6cf065dab757519682965ac68", "score": "0.57436436", "text": "function dwc(domain, moduleId, widgetName, elemName) {\n return domain + '--' + moduleId + '--' + widgetName + '--' + elemName;\n}", "title": "" }, { "docid": "a3c97be3072e0fbeb73dc21e73426549", "score": "0.56750363", "text": "function rename_id(curr_name, next_name, justName, isTop)\r\n{\r\n /**Get the duplicate Element (cloned and clone)**/\r\n var dup_Elements = document.getElementsByName(curr_name);\r\n var temp_Element;\r\n //Decide which Element you wish to rename\r\n if(isTop)\r\n {\r\n temp_Element = dup_Elements[0];\r\n }else{\r\n\r\n temp_Element = dup_Elements[1];\r\n } \r\n //Set the name\r\n temp_Element.setAttribute('name', next_name);\r\n //Set the id of that same element\r\n if(!justName)\r\n {\r\n temp_Element.setAttribute('id', next_name)\r\n }\r\n return temp_Element; \r\n}", "title": "" }, { "docid": "e49a6b324c1deb013eb5bd3992ea3689", "score": "0.56663924", "text": "generateDivId() {\n let uuid = this.uuid();\n return uuid.replace(/-/g, '');\n }", "title": "" }, { "docid": "e6189bf5cc4561036f49422db34f84a7", "score": "0.5638619", "text": "function getUniqueID() {\n if (window.flareID === undefined) {\n window.flareID = 0;\n }\n window.flareID = window.flareID + 1;\n return \"flare-component-\" + window.flareID.toString();\n }", "title": "" }, { "docid": "e6189bf5cc4561036f49422db34f84a7", "score": "0.5638619", "text": "function getUniqueID() {\n if (window.flareID === undefined) {\n window.flareID = 0;\n }\n window.flareID = window.flareID + 1;\n return \"flare-component-\" + window.flareID.toString();\n }", "title": "" }, { "docid": "0c412049ef2642612d44f4403ed28671", "score": "0.5634265", "text": "function createFullnameComponent(id) {\n return '<li class=\"fullname\" id=\"' + id + '\" ><div class=\"alignment-block-text\"><h6 id=\"question-text\">Name</h6></div><div class=\"alignment-block-input\"><div class=\"firstname\" style=\"display:inline-block\"><input type=\"text\" style=\"\"></input><p id=\"firstname\">Firstname</p></div><div class=\"lastname\" style=\"display:inline-block;margin-left:20px;\"><input type=\"text\" style=\"\"></input><p id=\"lastname\">Lastname</p></div></div></li>';\n\n}", "title": "" }, { "docid": "728368427f2748ae83905c339d4d8784", "score": "0.5630645", "text": "setupId() {\n if (this.elt.hasAttribute('id')) {\n let elt_id = this.elt.getAttribute('id');\n if (elt_id.trim() !== '') {\n this.id = elt_id;\n } else {\n this.elt.setAttribute('id', this.id);\n }\n } else {\n this.elt.setAttribute('id', this.id);\n }\n }", "title": "" }, { "docid": "ea34a27e6ff16ad4ca791e0040bdf6f3", "score": "0.5625101", "text": "getReplacementElementFor(replacementName){\n let replacement = this.replacements.getReplacementFor(replacementName);\n if(replacement){\n let newId = `${this.props.id}_${replacement}`;\n return h('div', {id: newId, key: newId, 'data-maq-key': newId}, []);\n }\n return null;\n }", "title": "" }, { "docid": "4de923bc3bc3c84ccbea554b3a472a86", "score": "0.56134826", "text": "id() {\n return this.name();\n }", "title": "" }, { "docid": "4de923bc3bc3c84ccbea554b3a472a86", "score": "0.56134826", "text": "id() {\n return this.name();\n }", "title": "" }, { "docid": "d19fdc2df8af2e3638919573d01b467d", "score": "0.5597699", "text": "get autoId()\n {\n var autoId = this.form.autoId;\n if (autoId)\n {\n autoId = \"\"+autoId;\n if (autoId.indexOf(\"{0}\") != -1)\n {\n return autoId.format(this.htmlName);\n }\n else\n {\n return this.htmlName;\n }\n }\n return \"\";\n }", "title": "" }, { "docid": "015da817c393dd2d813db4e6f53963fd", "score": "0.5595653", "text": "enterJsx_element_name(ctx) {\n\t}", "title": "" }, { "docid": "8b86fbcd0ef99fd0ebd7fb8aba84011a", "score": "0.5589401", "text": "getElmNameProp (elm) {\n if (!elm.hasAttribute('id') && elm.name) {\n return '[name=\"' + escapeSelector(elm.name) + '\"]';\n }\n }", "title": "" }, { "docid": "693c75a1438c48d519f0d842b2b749e8", "score": "0.55782425", "text": "function generateNameForImportOrExportDeclaration(node) {\n var expr = ts.getExternalModuleName(node);\n var baseName = expr.kind === 9 /* StringLiteral */ ?\n ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : \"module\";\n return makeUniqueName(baseName);\n }", "title": "" }, { "docid": "4e7653b55befbdc9906486c62b37762d", "score": "0.5514345", "text": "id() {\n return this._type.id() + ':' + this.name();\n }", "title": "" }, { "docid": "c176fd02862b1f31704d44378417dc62", "score": "0.550235", "text": "static _assignPanelId(node) {\n const slotChildren = node.children && node.children.filter(child => _.has(child.attribs, 'slot'));\n const headerSlot = slotChildren.find(child => child.attribs.slot === 'header');\n\n if (headerSlot) {\n const header = NodeProcessor._findHeaderElement(headerSlot);\n if (!header) {\n return;\n }\n\n if (!header.attribs || !_.has(header.attribs, 'id')) {\n throw new Error('Found a panel heading without an assigned id.\\n'\n + 'Please report this to the MarkBind developers. Thank you!');\n }\n\n node.attribs.id = header.attribs.id;\n }\n }", "title": "" }, { "docid": "8b5005ea99e37aec81508a0d96b56d0e", "score": "0.5498818", "text": "get name() {return this._idn }", "title": "" }, { "docid": "e6507a321b1aabe867600fe7967b2dd3", "score": "0.54879135", "text": "function uid() {\n return '#shadow-root:' + counter++ + '.' + (Math.random() * new Date);\n }", "title": "" }, { "docid": "53f9d07e1c494b2eed98d1343c1abb56", "score": "0.5462995", "text": "function renameComponent(node) {\n var oldNameNode = $(node).parent().find('span').first();\n var newName = $(node).find('input').val();\n oldNameNode.text(newName);\n $(node).parent().attr('id', newName);\n $(node).remove();\n}", "title": "" }, { "docid": "4e1fe5c82a87d35629eb93975cba120a", "score": "0.5455958", "text": "function setNewProdId(){\n //Connecting to HTML location\n const newProdID = document.getElementById(\"new-prod-id\");\n //Inserts informaton to HTML location as \"placeholder value\".\n newProdID.placeholder = ProductModule.getNextId();\n}", "title": "" }, { "docid": "a0844e3ad11602d28ff41c6f4e6a0b58", "score": "0.5444269", "text": "function generateEventIdentifier() {\n return this.event + this.trigger + this.domEvent + (this.wantedTrigger ? this.wantedTrigger : \"\");\n }", "title": "" }, { "docid": "35b98cf3ea346ea6f59fdcdab37a0c45", "score": "0.5438557", "text": "pinIdentifiers(jdom) {\n if (!jdom) jdom = this.container;\n for (let el of jdom.find(this.contextual_sel)) {\n $(el).attr('data-name', $(el).text());\n }\n }", "title": "" }, { "docid": "15b5cd3f2bc6793e97488f73384a308d", "score": "0.5424928", "text": "function createHeaderComponent(id) {\n return '<li class=\"header\" id=\"' + id + '\" ><div class=\"header-content\"><p contenteditable=\"true\" id=\"component-heading\">Heading</p><p contenteditable=\"true\" id=\"component-subheading\">Type a subheader</p></div></li>';\n\n}", "title": "" }, { "docid": "280a1841a7a756c85e57bdb43f36946a", "score": "0.5397325", "text": "get idAttribute () { return \"ID\" }", "title": "" }, { "docid": "d75a4b5a71d848290824193dec066049", "score": "0.5394639", "text": "$_elementId() { \n \treturn key => this.component.id ? (this.component.id + ( key || '' )) : null \n }", "title": "" }, { "docid": "81ff020f4fba9f1569d58864d626d174", "score": "0.5391704", "text": "function getContentAttribute(compId) {\r\n return `_ngcontent-${compId}`;\r\n}", "title": "" }, { "docid": "bdd5292a8c6a23c363186ea2a7f5cd70", "score": "0.5389068", "text": "get _id() {\n if (!this.__id) {\n this.__id = `ui5wc_${++autoId}`;\n }\n\n return this.__id;\n }", "title": "" }, { "docid": "96042a40fdd7b4f0edc6c9bde70aec2a", "score": "0.53753316", "text": "static get tag() {\n return \"elmsln-studio-main\";\n }", "title": "" }, { "docid": "75c5c9592e385b2a779fd37fe0cbe926", "score": "0.5371973", "text": "get _idPrefix() { return \"Node#Scene\" }", "title": "" }, { "docid": "8366e9fc6778f3541fce66b0df00225f", "score": "0.5367146", "text": "get id() {\n\t\tif (!this._id) {\n\t\t\tthis._id = 'DropDownButton' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t\t}\n\n\t\treturn this._id;\n\t}", "title": "" }, { "docid": "e212852395018bb86907138a89a29410", "score": "0.5359361", "text": "static element(dto) {\n return tardigrade.createElement(ProjectPanel.html(dto));\n }", "title": "" }, { "docid": "4792efd223557c1b2270ee3d7fd09133", "score": "0.5353283", "text": "function templateCommentIntro(name) {\n return '<div id=\"' + name + '\">\\n'+\n ' <div class=\"container\">\\n'+\n ' <h3>' + name + '</h3>\\n'+\n ' </div>\\n'+\n '</div>';\n}", "title": "" }, { "docid": "b5aa80c643dd8c7235e1c03142494add", "score": "0.53407377", "text": "updateChartId() {\n var currentTime = new Date().getTime().toString();\n var randomInt = this.getRandomInt(0, currentTime);\n this.chartId = `div_${randomInt}`;\n }", "title": "" }, { "docid": "8f7d2fe8728ec374df3f6a578763f62a", "score": "0.5330811", "text": "static mechPanelId(mechId) {\n return mechId + \"-mechPanel\";\n }", "title": "" }, { "docid": "eff6e8f5f97d76c14bbf9dcea2c79868", "score": "0.53306013", "text": "function createID(heading) {\n\theading.id = heading.textContent.replace(/\\W+/g, '-').toLowerCase();\n}", "title": "" }, { "docid": "869ab584181375081afafb52d738ea5e", "score": "0.532595", "text": "function setNewMemberToDom(name, id, task, tasksId) {\n tBody.insertAdjacentHTML(\n \"afterbegin\",\n `<div \n class=\"col-sm-4 dropzone tBody\" \n ondragover=\"onDragOver(event)\"\n ondrop=\"onDrop(event)\"\n id=\"${name}\"\n >\n <div class=\"row p-3 justify-content-center nameHeader\">\n <span class=\"nameSpan\">${name} \n <i class=\"fas fa-user-minus fa-xs\" onclick=\"deleteMember(${id})\"></i>\n </span>\n </div>\n </div>\n `\n );\n setNewTaskToDom(name, task, tasksId);\n}", "title": "" }, { "docid": "7c9d37d1a1e9ae7eb01ce15c191acf73", "score": "0.5319256", "text": "function tplName(tpl) {\n var nm = 'text!/template/' + tpl.replace(/\\_/g, '/') + '.html';\n return(nm);\n}", "title": "" }, { "docid": "c3cfc783ce2f3b34e30b6fe2e665f1c8", "score": "0.5315198", "text": "function getHostAttribute(compId) {\r\n return `_nghost-${compId}`;\r\n}", "title": "" }, { "docid": "82e013a89346300fdcf96da635be4861", "score": "0.5314264", "text": "giveId(index){\n return 'anchor'+index\n }", "title": "" }, { "docid": "48f7558046acc094fff3697381a9eb08", "score": "0.53009295", "text": "static get is() { return 'dom-repeat'; }", "title": "" }, { "docid": "48f7558046acc094fff3697381a9eb08", "score": "0.53009295", "text": "static get is() { return 'dom-repeat'; }", "title": "" }, { "docid": "48f7558046acc094fff3697381a9eb08", "score": "0.53009295", "text": "static get is() { return 'dom-repeat'; }", "title": "" }, { "docid": "48f7558046acc094fff3697381a9eb08", "score": "0.53009295", "text": "static get is() { return 'dom-repeat'; }", "title": "" }, { "docid": "48f7558046acc094fff3697381a9eb08", "score": "0.53009295", "text": "static get is() { return 'dom-repeat'; }", "title": "" }, { "docid": "48f7558046acc094fff3697381a9eb08", "score": "0.53009295", "text": "static get is() { return 'dom-repeat'; }", "title": "" }, { "docid": "8d0b6937a446c25d619e925dd258b9e3", "score": "0.5299471", "text": "constructor(template_name, dom_template_target)\n {\n var template = document.querySelector(template_name);\n this.template_clone = template.content.cloneNode(true);\n this.set_template_target(dom_template_target);\n\n }", "title": "" }, { "docid": "dd919726efcfe852b360ba25ac9d1c20", "score": "0.52962625", "text": "get id() {\n\t\tif (!this._id) {\n\t\t\tthis._id = 'MultilineTextBox' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t\t}\n\n\t\treturn this._id;\n\t}", "title": "" }, { "docid": "c834b50e4878583ee0fa4dfbdd68b769", "score": "0.5294154", "text": "function makeIdentifierFromModuleName(moduleName) {\n return ts.getBaseFileName(moduleName).replace(/^(\\d)/, \"_$1\").replace(/\\W/g, \"_\");\n }", "title": "" }, { "docid": "c834b50e4878583ee0fa4dfbdd68b769", "score": "0.5294154", "text": "function makeIdentifierFromModuleName(moduleName) {\n return ts.getBaseFileName(moduleName).replace(/^(\\d)/, \"_$1\").replace(/\\W/g, \"_\");\n }", "title": "" }, { "docid": "c1a552bcc85e3773294de08dde29d512", "score": "0.52937", "text": "cloneProjectHtml (templateId, newId) {\n let template = document.getElementById(templateId)\n let projectHtml = template.cloneNode(true)\n projectHtml.setAttribute('id', newId)\n return projectHtml\n }", "title": "" }, { "docid": "27e75ccaa986f374fdce5f82a0c09890", "score": "0.52836645", "text": "function assignPanelId(node) {\n const slotChildren = node.children\n && node.children.filter(child => getVslotShorthandName(child) !== '');\n\n const headerSlot = slotChildren.find(child => getVslotShorthandName(child) === 'header');\n\n if (headerSlot) {\n const header = _findHeaderElement(headerSlot);\n if (!header) {\n return;\n }\n\n if (!header.attribs || !_.has(header.attribs, 'id')) {\n throw new Error('Found a panel heading without an assigned id.\\n'\n + 'Please report this to the MarkBind developers. Thank you!');\n }\n\n node.attribs.id = header.attribs.id;\n }\n}", "title": "" }, { "docid": "1e3482c092036571c0cac79a9f5d0e52", "score": "0.52831614", "text": "function addClickOnRenameTemplate() {\n $(\".rename-template\").click(evt => {\n evt.stopImmediatePropagation();\n let parentNode = null;\n if ($(evt.target).hasClass(\"template\")) {\n parentNode = evt.target;\n } else {\n parentNode = $(evt.target).parents(\".template\")[0];\n }\n setTID($(parentNode).attr(\"id\"));\n let templateName = $(parentNode).find(\".template_name\").eq(0).html();\n putTemplateNameInModal(templateName);\n });\n}", "title": "" }, { "docid": "6d940c07339c4f5c1d06f8ef86e22ccd", "score": "0.52817345", "text": "function setPackageID(packageNode, packageID) {\r\n\tpackageNode.setAttribute(\"id\", packageID);\r\n}", "title": "" }, { "docid": "52e57bf217a9d5d32e19a020b79c80df", "score": "0.52685434", "text": "static get tag(){return\"example-hax-element\"}", "title": "" }, { "docid": "043bef10c07c91489f2c765c262a3eb4", "score": "0.52644247", "text": "setId(){\n\t\tif(this.domelement.hasAttribute(\"vr-id\"))\n\t\t\tthis.id = this.domelement.getAttribute(\"vr-id\");\n\t\telse\n\t\t\tthis.id = \"ge_\"+ (++element_id);\n\t\tthis.aelement.setAttribute(\"id\",this.id);\n\n\t\tif(this.domelement.hasAttribute(\"vr-class\"))\n\t\t\tthis.aelement.setAttribute(\"class\",this.domelement.getAttribute(\"vr-class\"));\n\n\t\tthis.aelement.domelement = this.domelement;\n\t\tthis.domelement.aelement = this.aelement;\n\t}", "title": "" }, { "docid": "243e98123b34437befda85134e98ac6d", "score": "0.5258929", "text": "makeId() {\n\t\treturn `temp_${ uuid('_') }`;\n\t}", "title": "" }, { "docid": "0dcf5b92eba52fb2669d549f21a3b630", "score": "0.5258198", "text": "get renderElement() {\n\t\treturn this.layout.renderer.elementId;\n\t}", "title": "" }, { "docid": "3c7dfea769a66f04d055cd1130a5bd41", "score": "0.5251746", "text": "constructor(id=\"body\", name=\"usini-panels\"){\n this.nb_panels = 0;\n this.panels = {};\n this.name = name;\n this.id = id;\n this.template = new UsiniTemplate();\n }", "title": "" }, { "docid": "7da6c6e7fe988d7b12ed26c589c15264", "score": "0.52512294", "text": "function createEmailComponent(id) {\n return '<li class=\"email\" id=\"' + id + '\"><div class=\"alignment-block-text\"><h6 id=\"email-question-text\">Email</h6></div><div class=\"alignment-block-input\"><div class=\"email\"><input type=\"text\" style=\"\"></input><p id=\"component-emailsubLabel\">[email protected]</p></div></div></li>';\n\n\n}", "title": "" }, { "docid": "07abd31d781188a3c03dd39774386397", "score": "0.52484035", "text": "id() {\n return this._types[0].name() + '<:' + this.name();\n }", "title": "" }, { "docid": "1fcf9da469442add55102cfca81d747c", "score": "0.52293277", "text": "static getID(element)\n {\n return element.getAttribute(\"id\") || IOElement.setID(element);\n }", "title": "" }, { "docid": "746284cccf05932013306e1d0c500cf5", "score": "0.5220474", "text": "getID() {\n return '';\n }", "title": "" }, { "docid": "35c72e74e2711e891111cadeef1df155", "score": "0.5218978", "text": "_element( id ) {\n return this.shadowRoot.getElementById( this._id(id) )\n }", "title": "" }, { "docid": "d612f9a4c0ee81cca6b33b4fdffe6bdc", "score": "0.5211269", "text": "htmlTemp(id) {\n return `\n <div class=\"card repo\" id=\"repo-${id}\">\n <div class=\"card-body\">\n <h3 class=\"repo-name\">${this.name}</h3>\n <a class=\"repo-link\" href=\"${this.url}\" target=\"_blank\">Go to project</a>\n <p class=\"repo-link\" >${this.languages}</p>\n </div>\n </div>\n `\n }", "title": "" }, { "docid": "342f6d25193d452a7e138607ea59854a", "score": "0.5210948", "text": "_melement( id ) {\n return this.shadowRoot.getElementById( this._mid(id) )\n }", "title": "" }, { "docid": "72b556a70a8089440c362b34240555fa", "score": "0.52093875", "text": "setID() {\n return \"RES\" + Date.now();\n }", "title": "" }, { "docid": "a44ec912b18a4f3e44765d467ed5cee5", "score": "0.52084565", "text": "function ElementFactory() {\n this._uid = 12;\n}", "title": "" }, { "docid": "a44ec912b18a4f3e44765d467ed5cee5", "score": "0.52084565", "text": "function ElementFactory() {\n this._uid = 12;\n}", "title": "" }, { "docid": "93a35e772e5488bdaa395cccb349530f", "score": "0.51934654", "text": "_getIdForElement(el, type) {\n switch (type) {\n case 'function':\n case 'name':\n case 'title':\n case 'summary':\n case 'params':\n case 'return':\n case 'implems':\n case 'tests':\n case 'examples':\n return type\n default:\n }\n return super._getIdForElement(el, type)\n }", "title": "" }, { "docid": "6150285069f6f6d15bbaff20cb84f57e", "score": "0.51881164", "text": "function getId(idname) {\n return document.querySelector(\".box\" + idname).id; // returning id name.\n}", "title": "" }, { "docid": "f71fdf815613ef48e6f71039893c6ab4", "score": "0.5187024", "text": "function CssModulesStyleName() {\n return (\n <div styleName=\"myBlock\" />\n );\n}", "title": "" }, { "docid": "d8dcb5f25f67ebc6af9116e4562a67c1", "score": "0.517925", "text": "getId() {\n return '';\n }", "title": "" }, { "docid": "560ce6fc09bcd60291d6cee61f6c2715", "score": "0.51721716", "text": "render() {\n return html`\n <style>\n :host{ \n margin: 5px; \n }\n \n .response { margin-top: 10px; } \n </style>\n <div>Tag name doesn't match the JS module name<div>inner</div></div> <div id='test' class='response'>Web components like you, too.</div>\n `;\n }", "title": "" }, { "docid": "e4df885a7b78b1978e687a8f19d81973", "score": "0.51597095", "text": "get name() {\n\t\treturn this.nativeElement ? this.nativeElement.name : undefined;\n\t}", "title": "" }, { "docid": "0d36a61c9886e61ef2c601beea67c761", "score": "0.51553243", "text": "getModuleName() {\n return 'tooltip';\n }", "title": "" }, { "docid": "cc6e990bd2bc2ed135d02ce4401be70e", "score": "0.5154895", "text": "function mkid(ob, name) { // {{{2\r\n\treturn 'GLBHP_' + ob.id + '_' + name;\r\n}", "title": "" }, { "docid": "0fa4e676006715d4bf6f72e4992f921c", "score": "0.51524067", "text": "function el (name, el) {\n return html`\n <section class=\"fl w-100 w-50-m w-25-l pr4 pt4\">\n <h2 class=\"f3\">${name}</h2>\n ${el}\n </section>\n `\n}", "title": "" }, { "docid": "8d9ee948bbe22f5655cb96a3a8f8f691", "score": "0.5148007", "text": "function _(id){\n return document.getElementById(id);\n}", "title": "" }, { "docid": "4ba07e78698fce50d55e8e4aef77ecc8", "score": "0.51441234", "text": "function appendTaskIdToElementId(element, taskId) {\n element.id = element.id + taskId;\n}", "title": "" }, { "docid": "d5af55cbe562501d6fe91ceee80b51bd", "score": "0.51360667", "text": "setIds(template) {\r\n return template\r\n .replace(/(id=\"\\w+)Id(\")/g, '$11$2')\r\n .replace(/(target=\"\\w+)Id(\")/g, '$11$2');\r\n }", "title": "" }, { "docid": "08a35479302d78ed9d729664e7d693f0", "score": "0.51339376", "text": "setIdName(idName) {\n\t\tthis._()[_idName] = idName;\n\t}", "title": "" }, { "docid": "ef3b872a0b61e9400e9c9471b42594df", "score": "0.51295316", "text": "function randomIdent() {\n return \"xxxHTMLLINKxxx\" + Math.random() + Math.random() + \"xxx\";\n }", "title": "" }, { "docid": "aeacb24df89b75d576276133c475a23f", "score": "0.5126275", "text": "function elementGenerator(typeName, className, content, idName) {\n const element = document.createElement(typeName);\n if (className) {\n element.className = className;\n }\n if (content) {\n element.textContent = content;\n }\n if (idName) {\n element.id = idName;\n }\n return element;\n}", "title": "" }, { "docid": "9538667f2e7bcc2ded62202116fa9dcf", "score": "0.51174927", "text": "element(element) {\n if(element.tagName=='title'){\n \n element.prepend(\"CL Project\");\n }\n \n else if(element.getAttribute('id')=='title'){\n element.prepend(\"CL Project\");\n }\n \n else if(element.getAttribute('id')=='description'){\n element.prepend(\"CL Project\")\n }\n \n else if(element.getAttribute('id')=='url'){\n element.setAttribute('href','https://www.linkedin.com/in/pawan-saggu-06589b157/');\n element.setInnerContent(\"Welcome to the Linkedin Profile of Pawan Saggu\");\n }\n }", "title": "" }, { "docid": "520960c161a79ba3293391f3379ed203", "score": "0.5114487", "text": "#setTitles() {\n const identifier = Math.floor(10000 + Math.random() * 90000);\n this.pane?.setAttribute('title', `ids-accordion-pane-${identifier}`);\n }", "title": "" }, { "docid": "365f3a1eed6e6654de852699c771e9a3", "score": "0.51137537", "text": "function setNewTaskToDom(name, task, tasksId) {\n memberDiv = $.getElementById(name);\n memberDiv.insertAdjacentHTML(\n \"beforeend\",\n ` \n <div \n class=\"col-sm-4 dragAble\" \n draggable=\"true\" \n ondragstart=\"onDragStart(event)\" \n id=${tasksId}\n >\n <div class=\"row p-3 justify-content-center nameHeader\">\n <span class=\"taskSpan\">${task}\n <i class=\"far fa-edit fa-xs\" onclick=\"editThisTask(${tasksId})\"></i>\n <i class=\"far fa-trash-alt fa-xs\" onclick=\"deleteTask(${tasksId})\"></i>\n </span>\n </div>\n </div>\n `\n );\n}", "title": "" }, { "docid": "f5fe907590303820d3981c65d323e16e", "score": "0.5113403", "text": "generate(id, config) {\n let dom = document.createElement(\"div\"),\n handle = this.__init__($(dom), config);\n $(tools.identify(id)).append(dom);\n return handle;\n }", "title": "" }, { "docid": "e70a28793fbb5512323543e5a216251d", "score": "0.51083726", "text": "getModuleName() {\n return 'dataBind';\n }", "title": "" }, { "docid": "35ac523af96155408caa055c699a7e37", "score": "0.5104428", "text": "function getNodeId(d) {\n var id = 'node-' + getId(d);\n return id;\n }", "title": "" }, { "docid": "3ca4211dadf6908a871e78b51a67c5cc", "score": "0.5103879", "text": "renderDog(){\n this.main.innerHTML = `\n Name: ${this.name}\n Age: ${this.age}\n Breed: ${this.breed}\n <button id='${this.name}'>Happy Birthday to ${this.name}!</button>\n `\n }", "title": "" }, { "docid": "e442082eb2c97c1f943f6704cd61a04f", "score": "0.5100462", "text": "static get tag() {\n return \"lrndesign-gallery-grid\";\n }", "title": "" }, { "docid": "1df4e43387ed458ba6cc14e731ce2a81", "score": "0.50981885", "text": "setDefaultPanelId(id) {\n this.defaultPanelId = id;\n }", "title": "" } ]
4f4e1f6d24c076fc6e503c3bb5899d36
check if user came to BR from a SR/BR
[ { "docid": "951b2154e6c843696698722b6a273d24", "score": "0.4711564", "text": "function checkUserEntry(user) {\n\tvar promise = onBreakRef.once('value');\n\tvar ms = 1000 * 5;\n\tsetPromiseTimeout(ms, promise)\n\t.then((snapshot) => {\n\t\tif (snapshot.child(user.uid).exists()) { // user record exists under /on-break\n\t\t\treturn;\n\t\t} else { // user came from URL\n\t\t\t// redirect to study-rooms.html\n\t\t\twindow.location.href = \"/study-rooms.html\";\n\t\t}\n\t}).catch((error) => {\n\t\tif (error == 'promiseTO') {\n\t\t\treloadPage(user.uid);\n\t\t\talert('データベースが読み込めないため、ページを更新します');\n\t\t}\n\t});\n}", "title": "" } ]
[ { "docid": "905c8d4ed0ff12a987a6aa37bd79e676", "score": "0.5576734", "text": "function originIsAllowed(origin, r) {\n console.log(\"r:\" , r);\n logit(\"originIsAllowed: \" + origin);\n if(r.BLP == '8653') return true;\n return false;\n}", "title": "" }, { "docid": "8015fed7454b9df5d1678dfbcfc07219", "score": "0.5443124", "text": "function viewBackFromOther() {\n logInfo('Back send info user approve');\n flagLoad = false;\n}", "title": "" }, { "docid": "e22f3e7fe6bfa9afdc22dad9aa2bbc15", "score": "0.5401259", "text": "async _checkIfBoarded() {\n return this._mindConnectAgent.IsOnBoarded();\n }", "title": "" }, { "docid": "6f121086f11781f0da9c7bbedc000182", "score": "0.5375091", "text": "function GoRegionalKeyboard()\n{\n var bReturnValue = false;\n\n if (!StatusObj.get_LanguageCompleted())\n {\n if (DirObj.get_DoRegionalKeyboard() == 1)\n {\n g.navigate(\"regkb.htm\");\n bReturnValue = true;\n }\n }\n // return if we navigated to the page or not.\n return bReturnValue;\n}", "title": "" }, { "docid": "9002a771bf59a1e0f075bb066428564a", "score": "0.5372668", "text": "function testTLToBR() {\n return (TLBRPlayer(1) || TLBRPlayer(2));\n}", "title": "" }, { "docid": "626559068200ebd80ce61b079e72b138", "score": "0.5329164", "text": "function redirectToRallyPoint() {\r\n function contains(str, substr) {\r\n return str.indexOf(substr) >= 0;\r\n }\r\n let href = window.location.href;\r\n let isRallyPoint = contains(href, 'screen=place') && (contains(href, 'mode=command') || !contains(href, 'mode='));\r\n if (isRallyPoint) {\r\n return false;\r\n } else {\r\n if (confirm('Redirecting to rally point.')) {\r\n let targetUrl = `/game.php?village=${game_data.village.id}&screen=place&mode=command`\r\n window.location.href = targetUrl;\r\n }\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "de646f348713a2eed974f44ad8c9f834", "score": "0.53168446", "text": "isBotNext() {\n\t\treturn this.gameType == \"botVbot\" || this.gameType == \"humanVbot\" && this.player.name[0] == \"b\";\n\t}", "title": "" }, { "docid": "40882bc99a681d4935b146fb33e82f80", "score": "0.5228814", "text": "function EnumCB_Renter_PRE() {\n ENUMCB.updateDKRefVisibility(\"Renter\");\n CB.toggleFlag(\"ExitSurveyEnabled\",\"true\");\n\n var questFlags = pega.ui.ClientCache.find(\"pyWorkPage.QuestFlags\");\n var isGoingBack = questFlags.get(\"IsGoingBack\").getValue();\n\n var dkRef = pega.ui.ClientCache.find(\"pyWorkPage.Respondent.DKRefused\");\n var renter = dkRef.get(\"Renter\");\n if(renter) {\n renter = renter.getValue();\n } else {\n renter = \"\";\n }\n\n if(isGoingBack == \"true\" && renter != \"\"){\n questFlags.put(\"IsDKRefVisible\",\"true\");\n }\n}", "title": "" }, { "docid": "1f82b2b075b48a3b980083bac65406a3", "score": "0.520624", "text": "function checkLocation() {\r\n\t\t\r\n\t\t$scope.isRussia = false;\r\n\t\t\r\n\t\tangular.forEach($rootScope.locations, function(loc){\r\n\t\t\t\r\n\t\t\tif($rootScope.location == loc.id && loc.isRussia){\r\n\t\t\t\t$scope.isRussia = true;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "c1b648a78604403833ddf5da93edecdf", "score": "0.5190499", "text": "function isBucuresti() {\n return (mainLocation.indexOf('aleph20') > -1);\n}", "title": "" }, { "docid": "70f7a2b37297adb79eead9636289d4b5", "score": "0.51788574", "text": "function checkUETLoad() {\n //alert(\"checkUETLOad was called\")\n //counter ++;\n if (uetq.domain === \"bat.bing.com\" && uetq) {\n //alert(uetq);\n //alert(\"checking if uetq exists with bat.bing.com\");\n // clearInterval(handle);\n return true\n //renderStatus(true);\n }\n return false;\n}", "title": "" }, { "docid": "ddeb5025262fa0a95bd37067d5a280bc", "score": "0.51764506", "text": "canPlaceBridge(bridge) {\n for (let i = 0; i < this.bridges.length; i++) {\n if (this.bridges[i].amount === 0) continue;\n if (bridge.crosses(this.bridges[i])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "f7ad296cfaa58f98ea0dd484be5b64a7", "score": "0.50754267", "text": "function isBusinessLogIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n {\n if (!(typeof req.user.local.businessname == 'undefined'))\n {\n return next();\n }\n }\n // if they aren't redirect them to the home page\n res.redirect('/Business/login');\n}", "title": "" }, { "docid": "45c481241b78f52bee78c212060c2326", "score": "0.5056313", "text": "function checkSwitch(){ //used in main\r\n\tgetCounterverse();\r\n\tfor(i=0;i<_counterverses.length;i++){\r\n\t\tif (_counterverses[i]==GM_getValue(\"parentuniverse\",univ))return false; //univ will make it match = false;\r\n\t}\r\n\treturn true; //current and previous universe are different\r\n}", "title": "" }, { "docid": "72495259fa3c4de2452e0edcf2e630fb", "score": "0.50474364", "text": "function is(screen_label)\n{\n\treturn get_current_breakpoint() == screen_label;\n}", "title": "" }, { "docid": "6064c3a81c065c96a53f0875885ecd19", "score": "0.50307167", "text": "function havePreviouslyConnectedWith(user)\n{\n\tfor (var i=0; i<gConnections.length; i++)\n\t{\n\t\tif (gConnections.firstUser==user || gConnections.secondUser==user)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "0855eeb6fe921e0fc8d7282b88d2b290", "score": "0.50253874", "text": "livesInUS() {\n return !!(this.address && this.address.inUS());\n }", "title": "" }, { "docid": "75e1d7792112d6de794d0808f820f0ec", "score": "0.5002297", "text": "function gTYLS() {\n //prevent errors and mishaps\n if (!ls.enabled) {return; }\n if (url.pathname.indexOf(\"thank\") < 0) {return; }\n console.log('thankyou');\n //code here\n }", "title": "" }, { "docid": "0e74f01e244350a5004e87ec38725d8d", "score": "0.5000597", "text": "function isFollower(station) {\n return regExps.NOT_MASTER_REGEXP.test(station);\n}", "title": "" }, { "docid": "d7081483ad0f8b9c707fe158a651a8d4", "score": "0.4995502", "text": "function CLC_SR_ShouldFocus(){\r\n var oldFocusable = CLC_FindFocusable(CLC_SR_PrevAtomicObject);\r\n var newFocusable = CLC_FindFocusable(CLC_SR_CurrentAtomicObject);\r\n if (oldFocusable == newFocusable){\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "3206e63dc2dbb76abc0ebe9d0818163e", "score": "0.49872524", "text": "is_guesser(sid) {\n console.assert(sid);\n return this.guesser === sid;\n }", "title": "" }, { "docid": "a205539b250fa1113fd9bd82547f046d", "score": "0.49851596", "text": "function goToBacOnline() {\r\n\ttry {\r\n\t\tscrn = \"BACOnline\";\r\n\r\n\t\tcleanUp();\t\r\n\r\n\t\tif (getScreenName().indexOf(scrn) == -1) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\twindow.external.Document.Screens(getScreenName()).Children(getScreenName() + \"_browser\").CurrentBrowser.WebBrowser.Navigate2(sucurl);\r\n\t\t\t} catch (e) {\r\n\t\t\t\t// alert(e.description);\r\n\t\t\t}\r\n\r\n\t\t\tsafeChangeScreen(scrn);\r\n\r\n\t\t}\r\n\r\n\t} catch (e) {\r\n\t\t//alert(e.description);\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "32b7ff2bd65a4c6e0ed9f4c028e137be", "score": "0.49829647", "text": "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "title": "" }, { "docid": "5db96730ba490efaa97444d704bf6195", "score": "0.49783242", "text": "function IsOutlookLaptopClient()\n{\n\n// Pages compiled without the RC directive may be light client pages or IE client pages depending on the existence of a cookie\nreturn (document.cookie.indexOf(\"FullClient\")!= -1);\n\n}", "title": "" }, { "docid": "d00debc577721d9788554f73d9c7fc9f", "score": "0.49571162", "text": "checkRemoteInvitation(){\n const queryParams = queryString.parse(window.location.search);\n \n return queryParams[REMOTE_ID_PARAM_NAME] != null;\n }", "title": "" }, { "docid": "4c6fb48f9085b7daf87e7e47e22ae74e", "score": "0.49136654", "text": "function didSomeoneWin(){(winPossibP1 || winPossibP2) ? true: false ;}", "title": "" }, { "docid": "eccfd9c32df9c4ce94c3053727f2c7f3", "score": "0.4905428", "text": "isNavigating(event) {\n // when the cmd or ctrl keys are used, the user doesn't navigate the storefront\n if (event.metaKey) {\n return false;\n }\n // when the tab key is used, users are for navigating away from the current (form) element\n if (event.code === 'Tab') {\n return true;\n }\n // If the user fill in a form, we don't considering it part of storefront navigation.\n if (['INPUT', 'TEXTAREA'].includes(event.target.tagName)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "3c784df0c053b71209f78dcd28cf2a03", "score": "0.49044454", "text": "function isExtraneousPopstateEvent(event){return event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "title": "" }, { "docid": "14dc3f3611616f4fbc932c386815fe67", "score": "0.48965576", "text": "function playedRequiredMatches(user) {\n if ((user.aboveUser != null) && (user.aboveResult == \"\"))\n return false;\n if ((user.belowUser != null) && (user.belowResult == \"\"))\n return false;\n return true;;\n}", "title": "" }, { "docid": "a9224fdf24eb5c58a5703f7b1954b5ed", "score": "0.48954374", "text": "function checkLoginStatus(){\n if(localStorage.getItem(\"ndsAccount\") != \"undefined\" && localStorage.getItem(\"ndsAccount\") != null){\n if(document.documentElement.lang == \"de\"){\n if(_checkStringFormat(localStorage.getItem(\"ndsAccount\"))){\n UtilityController.measureStep(\"Correct NDS Login\", 0);\n mainView.router.loadPage(myApp.loginUrl);\n }else{\n FMApp.alert(\"Kein gültiger NDS-Account. Bitte versuchen Sie es erneut.\");\n }\n }else{\n if(_checkStringFormat(localStorage.getItem(\"ndsAccount\"))){\n UtilityController.measureStep(\"Correct NDS Login\", 0);\n mainView.router.loadPage(myApp.loginUrl);\n }else{\n FMApp.alert(\"Not a correct NDS-account. Please try again.\");\n }\n }\n }\n }", "title": "" }, { "docid": "4769accfc52e15764cefc2bd2d1166a9", "score": "0.48950258", "text": "isNavigating(event) {\r\n // when the cmd or ctrl keys are used, the user doesn't navigate the storefront\r\n if (event.metaKey) {\r\n return false;\r\n }\r\n // when the tab key is used, users are for navigating away from the current (form) element\r\n if (event.code === 'Tab') {\r\n return true;\r\n }\r\n // If the user fill in a form, we don't considering it part of storefront navigation.\r\n if (['INPUT', 'TEXTAREA'].includes(event.target.tagName)) {\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "57310f41a23465ccc10f3eb0618510e3", "score": "0.4894727", "text": "function testBLToTR() {\n return (BLTRPlayer(1) || BLTRPlayer(2));\n}", "title": "" }, { "docid": "b03f62d1ee0827d8a7a0571cc70dbfa9", "score": "0.48943758", "text": "function checkUserFlow() {\n if (window.location.pathname != getPathFromHash(getCurrentHash())) {\n redirect();\n }\n}", "title": "" }, { "docid": "5b5760f20fe594919c1acb7c0bc0387b", "score": "0.48493266", "text": "_bcc() {\n if (!(this._status & this._CARRY)) this._branchTaken();\n }", "title": "" }, { "docid": "01be886f66781b951b16d1e701caef6d", "score": "0.48457602", "text": "function check_branchingSession(startSessionInt, primaryKeyword) {\r\n var tempProgressionInt = startSessionInt;\r\n if (tempInput.toLowerCase().includes(primaryKeyword))\r\n load_txtChatSession(tempProgressionInt + 1);\r\n else\r\n load_txtChatSession(tempProgressionInt);\r\n}", "title": "" }, { "docid": "0289d0f69b55deeeb3f48aa90ab2d434", "score": "0.48433214", "text": "function is(screen_label)\n{\n return get_current_breakpoint() == screen_label;\n}", "title": "" }, { "docid": "ba036a6edd2a6dd315207c6f1452d120", "score": "0.48431617", "text": "checkBallStatus(status) {\n\t\tthis.ballInAir = false;\n\t\t// Ball is caught by WR 1\n\t\tif(status == \"caught\") {\n\t\t\tthis.swapWRAndPlayer();\n\t\t}\n\t\t// Ball is caught by WR 2\n\t\telse if(status == \"caught-2\") {\n\t\t\tthis.swapWRAndPlayer(true);\n\t\t}\n\t\t// If the ball is intercepted, dropped or incomplete, the play is immediately stopped\n\t\telse if(status == \"intercepted\") {\n\t\t\tthis.stopPlay(Enums.playEndedBy.interception);\n\t\t}\n\t\telse if(status == \"dropped\") {\n\t\t\tthis.stopPlay(Enums.playEndedBy.dropped);\n\t\t}\n\t\telse {\n\t\t\tthis.stopPlay(Enums.playEndedBy.incomplete);\n\t\t}\n\t}", "title": "" }, { "docid": "a7025be6c1b386e7166c5f70a569e0d7", "score": "0.48328474", "text": "function Vb(b){var c=!1;return a.accessibleSubscriberLocationForPaymentMade&&!e.isEmpty(a.accessibleSubscriberLocationForPaymentMade)&&a.accessibleSubscriberLocationForPaymentMade.forEach(function(a){if(a&&b&&a.id==b.id)return c=!0}),c}", "title": "" }, { "docid": "f8bbaa4fc79c3a1a8366f43d1654d0cc", "score": "0.48303038", "text": "function isSCActive(){\n\t\t\n\t\treturn(typeof SC != \"undefined\");\t\n\t}", "title": "" }, { "docid": "94ebe3d6dd06e20dd128be7aa11ae353", "score": "0.48212683", "text": "function selectedSiteVISNorNATIONAL(state) {\n // return true is user selected a VISN or NATIONAL site\n // console.log('in selectedSiteVISNorNATIONAL and state is: ', state)\n return /VISN|NATIONAL/.test(state.selectedSite) ? true : false;\n}", "title": "" }, { "docid": "b89c4148a0853002ad5aba1783f4d3a9", "score": "0.48155272", "text": "function is(screen_label) {\n return get_current_breakpoint() == screen_label;\n}", "title": "" }, { "docid": "ebfc78631c56cc3a95636dccaf40d103", "score": "0.48118258", "text": "function follow_link(l) {\n\t\n\tif (AIR) {\n\t\twindow.parentSandboxBridge.nav_in_browser(l);\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\t\n}", "title": "" }, { "docid": "318c6404bc7501e799e68009f64e64a2", "score": "0.4799806", "text": "function checkBranching() {\n var isBranchingEnabled = false;\n if (trackObjects[SeqID].optionlevelfeedback == \"yes\" && trackObjects[SeqID].singleqtnperpage == \"yes\") {\n var pgType = getCoValues(\"Qtype\").toLowerCase();\n if (pgType == \"singleselect\" || pgType == \"truefalse\") {\n $('input[name=radio][id^=\"inst_op\"]').each(function () {\n //debugger;\n if ($(this).attr(\"branchedPageId\") != \"\") {\n isBranchingEnabled = true;\n }\n });\n }\n }\n return isBranchingEnabled;\n}", "title": "" }, { "docid": "cd00c85d560663a44e8ab1f62a1bba05", "score": "0.4798452", "text": "isACTRRunning() {\n if (this.use3DAvatar == true && window.inAvatar != false) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "cd00c85d560663a44e8ab1f62a1bba05", "score": "0.4798452", "text": "isACTRRunning() {\n if (this.use3DAvatar == true && window.inAvatar != false) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "5088906d65e5e1e5e966fc5f8c04014f", "score": "0.4786056", "text": "function bwiConnected() {\n\n\treturn rosAvailable >= 0;\n\n}", "title": "" }, { "docid": "68e6760fdd5b24514685e066f8c600ec", "score": "0.47756976", "text": "function isGameOver(checkIsFromPlayer) {\n if($scope.activeChessGame.game_over()) {\n $scope.gameOver = true;\n $scope.win = checkIsFromPlayer;\n // this logic isnt working, we are just going to see who is calling the check now.\n // $scope.win = !(($scope.placing == $scope.me) && $scope.activeChessGame.in_checkmate());\n $scope.openInfoModal();\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "da61ffcf14be7b41db9f207f04c3c380", "score": "0.47748667", "text": "function Verbandseinsatz()\r\n{\r\n var User=\"X\";\r\n var ret=false;\r\n\r\n var Obj = getByID(\"navigation_top\");\r\n if (Obj) Obj = Obj.getElementsByTagName(\"ul\")[0];\r\n if (Obj) Obj = Obj.getElementsByTagName(\"ul\")[0];\r\n if (Obj) Obj = Obj.getElementsByTagName(\"li\")[0];\r\n if (Obj) Obj = Obj.getElementsByTagName(\"a\")[0];\r\n if (Obj) Obj = Obj.innerHTML;\r\n if (Obj) User = Obj.replace(/Benutzer: /,\"\");\r\n\r\n Obj = getByID(\"mission_content\");\r\n if (Obj) Obj = Obj.getElementsByTagName(\"table\")[0];\r\n if (Obj)\r\n { var TRs=Obj.getElementsByTagName(\"tr\");\r\n for (var t=0;t<TRs.length;t++)\r\n { var TR=TRs[t];\r\n if (TR.getElementsByTagName(\"td\").length == 0) {continue;}\r\n var THText = TR.getElementsByTagName(\"td\")[0].innerHTML;\r\n if (THText == \"Einsatz von\")\r\n { var UserEinsatz=\"Y\";\r\n Obj = TR.getElementsByTagName(\"td\")[1];\r\n if (Obj) Obj = Obj.getElementsByTagName(\"a\")[0];\r\n if (Obj) UserEinsatz=Obj.innerHTML;\r\n if (User != UserEinsatz) ret=true;\r\n }\r\n }\r\n }\r\n\r\n return ret;\r\n}", "title": "" }, { "docid": "2722a7917b7818447166c3c19ed854b0", "score": "0.476286", "text": "function carrierCheckError(tracklink,carrierName){\n // display a nice error...\n if( $('#arrivedAtAgent').text() != \"\" ){\n $('#carrierStatus').text('Delivered');\n }\n else{\n if( carrierStatus ){\n $('#carrierStatus').text(carrierStatus);\n }else{\n if( typeof tracklink != 'undefined' ){\n $('#carrierStatus').replaceWith('<span id=\"carrierStatus\">In Transit: <a target=\"_blank\" href=\"'+tracklink+'\">Check '+carrierName+'.</a></span>');\n }else{\n $('#carrierStatus').text('In Transit');\n }\n }\n }\n $('.unknown').hide();\n }", "title": "" }, { "docid": "275b4d55e9fd35a3b59c145a2689c6df", "score": "0.47627693", "text": "function isBotTurn(){\r\n return !isUserTurn();\r\n}", "title": "" }, { "docid": "438198986786ea7400e427e80f911ba1", "score": "0.4760744", "text": "function checkIfMatches(){\n\tif( currentProfile - 1 >= 0 ){\n\t\tif (myBigArray[currentProfile - 1].name === \"Bubbles\") {\n\t\t\tdisplayMatchDialog();\n\t\t displayMatchImages();\n\t\t\tdisplayMatchOptions();\n\t\t\tdisplayMatchName();\n\t\t\tdisplayMatchMessage();\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "513269c317fec554abefcfb5f3cf78e7", "score": "0.47579208", "text": "theLineIsBusy(msg, session, next) {\n const contactId = msg.contactId;\n const userId = session.uid;\n if (!contactId || !userId) {\n const message = \"Some params is invalid.\";\n next(null, { code: Code_1.default.FAIL, message });\n return;\n }\n const param = {\n route: Code_1.default.sharedEvents.onTheLineIsBusy,\n data: { from: userId },\n };\n accountService.getOnlineUser(contactId).then((user) => {\n const uidsGroup = new Array();\n const userInfo = {\n uid: user.uid,\n sid: user.serverId,\n };\n uidsGroup.push(userInfo);\n channelService.pushMessageByUids(param.route, param.data, uidsGroup);\n }).catch((err) => {\n const msg = \"The contactId is not online.\";\n console.warn(msg);\n });\n next(null, { code: Code_1.default.OK });\n }", "title": "" }, { "docid": "28bc662e014aa92bed621f4421c18431", "score": "0.4757418", "text": "function islink(req, res) {\n var sid = req.cookies[_cookieKey]\n if (!sid) {\n return res.sendStatus(401)\n }\n var username = _sessionUser[sid][0].username\n getAuth_(username, function(items) {\n if (items[0] == undefined) {\n res.send({\n result: 'no'\n })\n return\n }\n if (items[0].facebook == username) {\n res.send({\n result: 'no'\n })\n return\n } else {\n res.send({\n result: 'yes'\n })\n return\n }\n })\n}", "title": "" }, { "docid": "4057517ebafa14bbd59e93f82e9324bb", "score": "0.47544965", "text": "isUserInCheckoutRoute(semanticRoute) {\r\n return semanticRoute === null || semanticRoute === void 0 ? void 0 : semanticRoute.toLowerCase().startsWith('checkout');\r\n }", "title": "" }, { "docid": "811d3c667da5a1477a86228ff0cd3e03", "score": "0.47429055", "text": "function renderLanding() {\n if(!callRejected && !callAccepted && !callingFriend)\n return 'block'\n return 'none'\n }", "title": "" }, { "docid": "d946edbb2bfd7bb4c867f09dfc863d1c", "score": "0.47374955", "text": "function determineReturnStatus(user_id, dbResults) {\n //console.log('DetermineReturnStatus:', dbResults);\n var { status, sender_id } = dbResults;\n\n if(status == ACCEPTED) {\n //user and sender are friends, so option is to terminate relationship\n return 'End';\n } else if (status == PENDING) {\n //one of them sent a friend request\n if(user_id == sender_id) {\n //if the user is the sender, then they should see Pending\n //if the user was not the one who sent the request, they should see Accept\n return 'Cancel';\n } else {\n return 'Accept';\n }\n } else {\n //If status is cancelled, rejected, or terminated the users should have the option to make a friend request again.\n return 'Make';\n }\n}", "title": "" }, { "docid": "7b880c5849c926ca9557e61761890488", "score": "0.47369576", "text": "function ruulCheckIsOnScreen() {\n\t\t\t//get width and height of viewport\n\t\t\truulBrowser();\n\t\t\tvar screenTop = document.body.scrollTop;\n\t\t\tvar screenTopNew = screenTop + 50;\n\t\t\tvar screenBottom = screenTop + ruulBrowserHeightScreen;\n\t\t\t//If ruul is below screen this puts it back on screen\n\t\t\tif (localStorage.getItem(currentRuul + 'y') > screenBottom) {\n\t\t\t\t$(target).css('top', screenTopNew + 'px');\n\t\t\t\truulDataSave();\n\t\t\t}\n\t\t\t//If ruul is above screen this puts it back on screen\n\t\t\tif (localStorage.getItem(currentRuul + 'y') < screenTop) {\n\t\t\t\t$(target).css('top', screenTopNew + 'px');\n\t\t\t\truulDataSave();\n\t\t\t}\n\t}", "title": "" }, { "docid": "8c60959d52096ce225e600f467d7d767", "score": "0.4730378", "text": "function checkUrl() {\n urlLocal = window.location.href;\n var urlcountry = urlLocal.split(\"#\")[1];\n\n if (urlcountry == undefined || urlcountry == '') {\n //set the map to world view\n filterdata(\"W1\")\n } else {\n areacode = urlcountry;\n filterdata(urlcountry)\n highlightcountry(urlcountry)\n disableHoverEvents();\n }\n }", "title": "" }, { "docid": "46fc24753a2e05152671d67cd3efeec9", "score": "0.4723557", "text": "function ka(){1!=localStorage.getItem(\"isUserReady\")&&(\n//updateConvId\nlocalStorage.setItem(\"isUserReady\",!0),a.conusrObj={},a.conusrObj.isUserReady=!0,a.conusrObj.conversationLog={id:a.skype.convId},a.conusrObj.user={id:a.skype.userId},\"DOCTOR\"==La?(a.conusrObj.userType=\"DOCTOR\",a.conusrObj.id=a.doctorConvUserId):(a.conusrObj.userType=\"PATIENT\",a.conusrObj.id=a.patientConvUserId),d.updateConvUserIsReady(a.conusrObj,function(b){b&&(a.convUserFlag=!0)},function(a){e.isNullOrEmpty(errorResponse.data.message[0])||g(\"alert\",h.instant(errorResponse.data.message[0]))}))}", "title": "" }, { "docid": "fd78e1ef71180fcd14a91864fcbdd155", "score": "0.47161072", "text": "function checkHeadsetConnected () { return !!getVRDisplay(); }", "title": "" }, { "docid": "f81deb596a7bbfbc240af3fdc22a3b3d", "score": "0.47038972", "text": "function IsOutlookWorkstationClient()\n{\n\n// Pages compiled without the RC directive may be light client pages or IE client pages depending on the existence of a cookie\nreturn (document.cookie.indexOf(\"LightClient\")!= -1);\n\n}", "title": "" }, { "docid": "e3e5cb3575e0cf12a769c043a3226a93", "score": "0.46998143", "text": "async function checkRefer(ctx, next) {\n const routeBack = ctx.request.header.referer.split('/');\n // eslint-disable-next-line no-restricted-globals\n if ((routeBack[routeBack.length - 1]) && !isNaN(routeBack[routeBack.length - 1])) {\n ctx.session.routeBack = [routeBack[routeBack.length - 2], routeBack[routeBack.length - 1]];\n } else if (ctx.session.routeBack) {\n const rtBk = ctx.session.routeBack;\n ctx.session.routeBack = rtBk;\n }\n return next();\n}", "title": "" }, { "docid": "8545607cd2548eddbffb52b95d638451", "score": "0.46982893", "text": "function WPAI_1_V7__RB2Library__isValid() {\n // Block#: 27Xs)+-sake0^RKl?bn4\n if((com.fc.JavaScriptDistLib.Dictionary.getDictValue(_that.RB2LibraryWPAI_1_V7_singlechoice_form, 'required')) && _that.RB2LibraryWPAI_1_V7_singlechoice_chosen == null) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "a007cca124a3accf0ddfb7352d7b000d", "score": "0.46970755", "text": "function checkWMEPH_KBSconflict(KBS) {\r\n var LSString = '';\r\n if (!isDevVersion) {\r\n LSString = devVersStringMaster;\r\n }\r\n if ( localStorage.getItem('WMEPH-KeyboardShortcut'+LSString) === null || localStorage.getItem('WMEPH-KBSModifierKey'+LSString) === null ) {\r\n return false;\r\n } else if ( parseKBSShift(localStorage.getItem('WMEPH-KeyboardShortcut'+LSString)) === KBS && localStorage.getItem('WMEPH-KBSModifierKey'+devVersStringMaster) === localStorage.getItem('WMEPH-KBSModifierKey') ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "fdf736f144fc25be52abdfece51c52f3", "score": "0.4695924", "text": "_fromYandexPartner(referrer) {\n if (referrer) {\n var urlBegin = referrer.replace(/https?:\\/\\//, '');\n\n if (this._blacklist.yandexBlackList) {\n for (var i = 0; i < this._blacklist.yandexBlackList.length; i++) {\n if (urlBegin.indexOf(this._blacklist.yandexBlackList[i]) === 0) {\n return true;\n }\n }\n }\n\n return this._siteInfo.isBlacklistedByReferrer();\n }\n return false;\n }", "title": "" }, { "docid": "2a2f3c04881dee777a04fe169fe2efb1", "score": "0.46941924", "text": "isFirstSigninStep(uiStep, canGaiaGoBack, isSaml) {\n return !this.isClosable_ && POSSIBLE_FIRST_SIGNIN_STEPS.includes(uiStep) &&\n !canGaiaGoBack && !(isSaml && !this.isDefaultSsoProvider_);\n }", "title": "" }, { "docid": "3ba414c5c199cd46a17b1de161323f42", "score": "0.46917033", "text": "enterAppCountry() {\n console.log('entered as country');\n this.nation.countries(parity.bonds.me).then(s => {\n console.log('Das ist in s:', s.c[0]);\n if(s.c[0]>0){\n this.setState({entered: true, userType: 'country',countryForVisa: s.c[0]});\n }\n else this.setState({snackOpen: true});\n });\n }", "title": "" }, { "docid": "a701a3f44054eabf315215371e77b0ca", "score": "0.4687218", "text": "function llegaBordeSuperior() {\n // para saber si un carro (de bajada) ha llegado a la parte superior\n // del puente, se obtienen las coordenadas en donde se encuentra su\n // \"trompa\" y se compara si estan en la misma corrdenada donde inicia \n // el puente.\n return self.top + self.height >= puente.top;\n }", "title": "" }, { "docid": "e73ad511b7b34f13bae8d3f144b27a48", "score": "0.46859476", "text": "function isUserTurn(){\r\n var ret = false;\r\n \r\n var MSGcount = processMsgCount();\r\n \r\n //if odd, then it's the User's turn\r\n if(MSGcount%2 != 0){\r\n ret = true\r\n }\r\n \r\n \r\n return ret;\r\n}", "title": "" }, { "docid": "1bc41c1e543d9050c2bb758137480a76", "score": "0.46798933", "text": "function _inFrame() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n }", "title": "" }, { "docid": "8ceb56f812abff6f0f383ab73cff92fb", "score": "0.46788025", "text": "function checkCarrierTerm()\t{\n //alert(\"inside carrier term\");\n var carrierTerm = document.getElementById(\"carrierPayMethodId\").selectedIndex;\n //var intlFlag4=document.DynaShipmentShipSaveForm.intlFlag.value;\n //alert(\"inside carrier term\"+carrierTerm);\n //alert(\"inside intlFlag4 term\"+intlFlag4);\n\n// if(carrierTerm =='3'&& document.DynaShipmentShipSaveForm.intlFlag.value==\"Y\" )\n// {\n// alert(\"International Shipments Does Not Support Third Party Billing\");\n// document.DynaShipmentShipSaveForm.carrierPayMethod.focus();\n// return ;\n//\n// }\n\n }", "title": "" }, { "docid": "c40c055f5f4fff2200496d746c768079", "score": "0.46772537", "text": "function IsGuard(keyFeatures, rerankFeatures, documentPosition, entityMatchScoreThreshold, maxDRscorePos, iSiteConsMatchDomain, sumIntentMatchTop5) {\n // if (rerankFeatures[c_FeatureId_RankomaticScore] >= 5) {\n // return true;\n // }\n\t// if (documentPosition == 0 && markers[c_MarkerId_NumberOfPerfectMatches_BingClick] > 0) {\n\t\t// return true;\n\t// }\n\tvar con1 = false;\n\tif(documentPosition != maxDRScorePos) { \n\t\tcon1 = true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n\t\n\tvar con2 = false;\n\tif(documentPosition < 5 && keyFeatures.entityMatchScore >= entityMatchScoreThreshold && keyFeatures.intentMatchScore === 0 && keyFeatures.constraintMatchScore !== c_constraintMatchScoreOpposed && keyFeatures.lowQualitySiteScore === 0 && (keyFeatures.guardingScore === 1000 || IsSiteConsMatchDomain === 1000)){\n\t\tcon2 = true;\n\t}\n\tvar con3 = false;\n\tif(keyFeatures.guardingScore !== 1000 && !(sumIntentMatchTop5 > 0 && con2)){\n\t\tcon3 = true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n\t\n\treturn con3;\n}", "title": "" }, { "docid": "b230f92cc4a65ecbf649f00c7309577a", "score": "0.46732235", "text": "function canApplyServerBehavior(sbObj)\r\n{\r\n var success = true;\r\n return success;\r\n}", "title": "" }, { "docid": "d4f1af1786006b8a336252a2f0d76b3d", "score": "0.46691936", "text": "function checkTypeOfReg() {\n\tvar spnsrIndex = getMainSponsorIndex();\n\tvar tpaObj = null;\n\tif (spnsrIndex == 'P')\n\t\ttpaObj = getPrimarySponsorObj();\n\telse if (spnsrIndex == 'S')\n\t\ttpaObj = getSecondarySponsorObj();\n\n\tvar group = document.mrnoform.group.value;\n\tif (group == \"ipreg\") {\n\t\tvisitType = \"I\";\n\t\tif (document.mainform.bill_type) setBillType(defaultIpBillType);\n\t\tdocument.getElementById('prevVisitTag').style.display = 'block';\n\t\tdocument.getElementById('bedAdvance').innerHTML = \"\";\n\t\tdocument.getElementById('availabelBeds').innerHTML = \"\";\n\t}\n\tif (group == \"opreg\") {\n\t\tvisitType = \"O\";\n\t\tif (document.mainform.bill_type) setBillType(defaultOpBillType);\n\t\tif (document.getElementById('regTypenew').checked == true) {\n\t\t\tdocument.getElementById('prevVisitTag').style.display = 'none';\n\t\t} else {\n\t\t\tdocument.getElementById('prevVisitTag').style.display = 'block';\n\t\t}\n\n\t\tif (tpaObj != null) {\n\t\t\tif (tpaObj.value == \"\" && allowBillNowInsurance == 'true' ||\n\t\t\t\t\t(document.mainform.bill_type != null && document.mainform.bill_type.value == 'C')) {\n\t\t\t\ttpaObj.selectedIndex = 0;\n\t\t\t}\n\t\t}\n\t}\n\t// If new registration disable close previous active visit check box.\n\tvar newReg = isNewReg();\n\tif (allowMultipleActiveVisits == 'Y' && document.mrnoform.close_last_active_visit != null)\n\t\tdocument.mrnoform.close_last_active_visit.disabled = newReg;\n\n\testimateTotalAmount();\n}", "title": "" }, { "docid": "2f73f01a9e2d8dcc1e7be9ee3905517b", "score": "0.46683517", "text": "function check_state() {\n var previous_state = current_state;\n current_state = get_current_state();\n\n if ( previous_state !== current_state) {\n $doc.trigger('mqbe');\n $doc.trigger('leave.' + previous_state + '.mqbe');\n $doc.trigger('enter.' + current_state + '.mqbe');\n }\n return current_state;\n }", "title": "" }, { "docid": "50940e2b6972612c76d8f25738fce9e7", "score": "0.4664565", "text": "function canApplyServerBehavior(sbObj)\n{\n var success = true;\n\n if (success)\n {\n success = rsName.canApplyServerBehavior(sbObj);\n }\n \n if (success)\n {\n success = dwscripts.canApplySB(sbObj, false); // preventNesting is false\n }\n \n if (success && !sbObj)\n {\n var parameters = getExistingParameters();\n if (parameters == null)\n {\n success = false;\n alert (MM.MSG_RequiresMoveTo);\n }\n }\n\n return success;\n}", "title": "" }, { "docid": "56e798d22f7d9917d5a592c529f0711e", "score": "0.46620527", "text": "function _checkForRoomcode(){\n roomCode = location.search.split(\"&\").toString();\n if(roomCode.length > 0){\n if(document.documentElement.lang == \"de\"){\n FMApp.alert(\"Raumdaten wurden erkannt und werden automatisch im Störungsformular eingefügt.\");\n }else{\n FMApp.alert(\"Room data has been recognized and will be automatically inserted into the malfunction report form.\");\n }\n roomCode = roomCode.substring(1);\n sessionStorage.setItem(\"qrCode\", roomCode);\n }\n }", "title": "" }, { "docid": "28c88b7f4fb9456d49df736150d3307e", "score": "0.46614656", "text": "function checkConsentAgreement(){\n\t//todo: check if page contains i aggree , i accept,\n\treturn true;\n}", "title": "" }, { "docid": "c933760f5b7314231fa4212238300c7b", "score": "0.46583572", "text": "function inspectServerBehavior(sbObj)\n{\n var success = true;\n\n if (success) \n {\n var parameters = getExistingParameters();\n if (parameters == null)\n {\n alert (MM.MSG_RequiresMoveTo);\n success = false;\n }\n }\n\n if (success)\n success = rsName.inspectServerBehavior(sbObj);\n}", "title": "" }, { "docid": "f7db0889d3b93bdf374d64b89a03bdc6", "score": "0.46510553", "text": "function check_user_lanes() \n{\n RMPApplication.debug(\"begin check_user_lanes : login = \" + login);\n c_debug(debug.init, \"=> check_user_lanes: login = \", login);\n\n\tvar options = {};\n\tvar pattern = {};\n\n // CAPI for checking if user belong to some lanes\n\tid_check_user_lanes_api.trigger (pattern, options , check_user_lanes_ok, check_user_lanes_ko); \n\tRMPApplication.debug(\"end check_user_lanes\");\n}", "title": "" }, { "docid": "d0746c297f9fbd25303d97e92485f2d2", "score": "0.46492794", "text": "function userNotKnown(){\n killSession(); \n if(document.location.href.lastIndexOf(app_page_not_connected) < 0){\n top.location.href = app_url_not_connected; \n } \n}", "title": "" }, { "docid": "c1bead825cefc202333705dade66b460", "score": "0.46430254", "text": "function renderContinueButton()\n{\n\tif (useRcmScoNavigation) {\n\t\tif (rcmLMSHasNext()) {\n\t\t\treturn 'true';\n\t\t} else {\n\t\t\treturn 'false';\n\t\t}\t\t\n\t} else {\n \t\tvar value = retrieveDataValue( \"adl.nav.request_valid.continue\" );\n \t\treturn value;\t\t\n\t}\n}", "title": "" }, { "docid": "0476caf64804a3d7c0b6591f77a0952c", "score": "0.4637453", "text": "function hasRightSideBr() {\n\t\t\t\tvar walker = new TreeWalker(container, parentBlock), node;\n\n\t\t\t\twhile (node = walker.current()) {\n\t\t\t\t\tif (node.nodeName == 'BR') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode = walker.next();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "0476caf64804a3d7c0b6591f77a0952c", "score": "0.4637453", "text": "function hasRightSideBr() {\n\t\t\t\tvar walker = new TreeWalker(container, parentBlock), node;\n\n\t\t\t\twhile (node = walker.current()) {\n\t\t\t\t\tif (node.nodeName == 'BR') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode = walker.next();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1d1635f1e9e25abf8fb1ab5b70137d88", "score": "0.4637435", "text": "function isPixieStatusCompany(){\r\n return isPixie() && $(\"#user_pixie_billing_status\").val() === \"company\";\r\n }", "title": "" }, { "docid": "d39fee5db9e1269a5b61789adbc0cf5b", "score": "0.4634027", "text": "function event_pay_bribe(r) { \n var amt = (pd.stats.seller_rps * pd.widget_roi) * r;\n amt -= get_safe_cash();\n if(amt < 1) { \n return false;\n }\n if(amt > pd.cash.amount) { \n amt = pd.cash.amount;\n }\n pd.cash.amount -= amt;\n bad_message('You had to pay off a government official with $'+pretty_bigint(amt));\n return true;\n }", "title": "" }, { "docid": "a503f7b7670df5be5aa012e600b231d1", "score": "0.46317774", "text": "function check_if_user_already_has_asession() {\n\t\t\t/**\n\t\t\t * IF THE USER ALREADY HAS THE SESSION STARTED THE SEND IT TO \n\t\t\t * PHP PAGES TO ALLOW USE TO USE THE SYSTEM WITHOUT HAVING TO LOGIN\n\t\t\t */\n\t\t\tif (sessionStorage.getItem('user_log') != null){\n\t\t\t\tvar user_session = sessionStorage.getItem(\"user_log\");\n\t\t\t\tsend_user_started_session(user_session);\n\t\t \t\t// deliver_message('user session ' + sessionStorage.getItem(\"user_log\"), 'msg_info');\n\t\t \t}\n\t\t}", "title": "" }, { "docid": "f44cf295cb16161df992f96db6105349", "score": "0.46256053", "text": "function returnToOSS() {\n var result = false;\n if (typeof pLoader.pLogic.ossEnabled != \"undefined\") {\n // If we were in product selection catalog and going back to step 1\n if (pLoader.pLogic.shop.stepNum == 1.5 && stepBackTo == 1) {\n result = true;\n pLoader.pLogic.shop.selectedItem = null;\n\n }\n // If we were in the normal preview and are going back to step 1\n if (pLoader.pLogic.shop.stepNum == 2 && stepBackTo == 1) {\n result = true;\n }\n // If we're going back to step 2 and our checkoutstyle is express, i.e., back from shipping address\n if (stepBackTo == 2 && (pLoader.pLogic.ossEnabled.checkoutStyle == \"express\" || pLoader.pLogic.ossEnabled.checkoutStyle == \"skipPreview\")) {\n result = true;\n }\n }\n return result;\n }", "title": "" }, { "docid": "4abc0909a35d6f688b044825a09ec767", "score": "0.4623378", "text": "enterAppImmigration() {\n console.log('entered as immigration');\n this.immigration.immigrationOfCountry(parity.bonds.me).then(s => {\n console.log('Das ist in s:', s.c[0]);\n if(s.c[0]>0){\n this.setState({entered: true, userType: 'immigration', countryForVisa: s.c[0]});\n }\n else this.setState({snackOpen: true});\n });\n }", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" }, { "docid": "d0c8edb7259912bf0711e33d9cfe10ef", "score": "0.4616755", "text": "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "title": "" } ]
e2aba2a5a20cd89139018fafb10094a8
Handles selectmenu input/chosen option
[ { "docid": "7f7f45742b9e6440136f71760c06f2f1", "score": "0.0", "text": "function parseSelect(elementTag) {\r\n const selectItems = document.querySelector(elementTag);\r\n const item = selectItems.options[selectItems.selectedIndex];\r\n\r\n if (!item.value) {\r\n return \"\";\r\n }\r\n\r\n return item.value;\r\n }", "title": "" } ]
[ { "docid": "4b151012fa9403a1d353c24a359c81cb", "score": "0.68471575", "text": "_onSelectedOptionClick(event) {\n this._openSelect()\n this._toggleHide()\n this.input.focus()\n }", "title": "" }, { "docid": "d03de2a5c1381d82041f94d96233a333", "score": "0.65849483", "text": "function menuChanged() {\n\treturn menu.select.value;\n}", "title": "" }, { "docid": "b2bd26b9469eb40243103b5bd746f9d3", "score": "0.64763236", "text": "function handleSelect() {\n var $dropDown = $('select.room-list');\n\n $dropDown.on('change', function(e) {\n var id = e.target.value;\n\n handleDisplay(id);\n handleSelection(id);\n });\n}", "title": "" }, { "docid": "17c950738d5c2c8b848a33a252bf83e2", "score": "0.64506274", "text": "onUpKey() {\r\n\t\t\t\t\tvar len = this.opt.choices.realLength;\r\n\t\t\t\t\tthis.selected =\r\n\t\t\t\t\t\tthis.selected > 0 ? this.selected - 1 : len - 1;\r\n\t\t\t\t\tthis.render();\r\n\t\t\t\t}", "title": "" }, { "docid": "e085ffa02bc3b33b1079b319179faa3e", "score": "0.63700205", "text": "function markingMenuOnSelect(selectedItem){\r\n if (selectedItem.type === undefined) {\r\n tracker.recordSelectedItem(selectedItem.name);\r\n document.getElementById(\"selectedItem\").innerHTML = selectedItem.name;\r\n } else {\r\n if (selectedItem.type === 'select') {\r\n var selection = selectedItem.selection;\r\n tracker.recordSelectedItem(selection.name);\r\n document.getElementById(\"selectedItem\").innerHTML = selection.name;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "78ee3c09b1ef4954abcac9b199c9bd8d", "score": "0.63693625", "text": "function handleSelect(item)\n{\n\t//two cases:\n\t//case 1: we're _not_ halfway through selecting\n\tif(wfSelectStart==null || wfSelectEnd != null)\n\t{\n\t\t$('#wfSelectbar').hide();\n\t\t\n\t\twfSelectStart = item;\n\t\twfSelectEnd = null;\n\t\t\n\t\t//indicate it was selected\n\t\twfSelectStart.addClass('wfSelected');\n\t}\n\telse\n\t{\n\t\t//if the user has selected a different wave\n\t\tif(item.parent().get(0) !== wfSelectStart.parent().get(0))\n\t\t{\n\t\t\tcancelAllMods();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twfSelectEnd = item;\n\t\t\t\n\t\t\tshowSelectBar();\n\t\t}\n\t\t\n\t\t\n\t}\n}", "title": "" }, { "docid": "d205651e4cea0648e992eda6b1275013", "score": "0.6327343", "text": "onUpKey() {\n var len = this.opt.choices.realLength;\n this.selected = this.selected > 0 ? this.selected - 1 : len - 1;\n this.render();\n }", "title": "" }, { "docid": "d205651e4cea0648e992eda6b1275013", "score": "0.6327343", "text": "onUpKey() {\n var len = this.opt.choices.realLength;\n this.selected = this.selected > 0 ? this.selected - 1 : len - 1;\n this.render();\n }", "title": "" }, { "docid": "ec55a3c0df4da97c977308353b4cf56c", "score": "0.6315349", "text": "function SelectChoice(){\n optionSelect=$('#select-choice-1 option:selected').val();\n $('#Option-select-choise').text(optionSelect);// change the option in the span tag \n if($('#productsToSearch').val()==\"Enter a product\")//empty search\n\t{\n\t ArrayByCriteria= storesArray.slice();\n\t if(optionSelect==\"BestMatch\"){\n\t\tShowAllProducts();\n\t }\n\t if(optionSelect==\"Price\"){\n\t\t//sort by price\n\t\tArrayByCriteria.sort(function(a,b){\n\t\t return a[4]-b[4];\t\n\t\t});\n\t\tShowAllProductsSortByPrice();\n\t\t\n\t }\n\t if(optionSelect==\"Featured\"){\n\t\t//empty\n\t }\n\t}\n\t\n else {\n\tfindProducts();\n\t} \n }", "title": "" }, { "docid": "4148bb48f6c67ad377326c6ad45e4e87", "score": "0.6300555", "text": "changeSelectedType(e) {\n\t\tglobals.selected = e.target.value.toLowerCase();\n\t\tif (globals.selected == \"customers\") {\n\t\t\tsearchFunctions.hideSearch();\n\t\t}\n\t\telse {\n\t\t\tsearchFunctions.showSearch();\n\t\t}\n\t}", "title": "" }, { "docid": "4a53f4045bba67714f6f84269d3ea8ed", "score": "0.62952775", "text": "function onSelectInput(event) {\n\t\t\t// Only if pressing ENTER\n\t\t\tif (event.keyCode!=13) return true;\n\t\t\tif (this.value=='') return true;\n\n\t\t\tvar inputText = $(this),\n\t\t\t\tselect = inputText.closest('div.habtm').find('select'),\n\t\t\t\tvalue = this.value,\n\t\t\t\tsource = inputText.autocomplete('option', 'source'),\n\t\t\t\tid = null;\n\n\t\t\t// Hiding the autocomplete\n\t\t\tinputText.autocomplete('close');\n\n\t\t\t// Getting the id of a value already in the source\n\t\t\tfor(var i in source) {\n\t\t\t\tif (source[i].value.toLowerCase()!=value.toLowerCase()) continue;\n\t\t\t\tid = source[i].id;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Already in source, we just add it\n\t\t\tif (id) {\n\t\t\t\tselectItem(id, select);\n\t\t\t\tinputText.val('');\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Not in source, so we need to request the server to add a new one\n\t\t\t$.ajax({\n\t\t\t\turl: 'http://'+document.domain+'/admin/editors/habtm.json',\n\t\t\t\tdata: {\n\t\t\t\t\t'value' : this.value,\n\t\t\t\t\t'model' : select.data('modelName')\n\t\t\t\t},\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\tif (data.error) return false;\n\t\t\t\t\t// We add this entry to the select\n\t\t\t\t\tselect.append('<option value=\"'+data.id+'\">'+data.value+'</option>');\n\t\t\t\t\t// We update the autocomplete source\n\t\t\t\t\tsource.push({'value' : data.value, 'id' : data.id});\n\t\t\t\t\tinputText.autocomplete('option', 'source', source);\n\t\t\t\t\t// And we select this item\n\t\t\t\t\tinputText.val('');\n\t\t\t\t\tselectItem(data.id, select);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinputText.val('');\n\t\t\tevent.preventDefault();\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "e712644ae862cec7c7af6862b0a55c50", "score": "0.62872696", "text": "function activateOptions(choice) {\r\n\t\t\t$('#valSelect').change(function() {\r\n\t\t\t\tdoQuery(this.value, choice);\r\n\t\t\t});\r\n\t\t\tvar mapClick = view.on(\"click\", function(evt){getCounty(evt.mapPoint, choice)});\r\n\t\t}", "title": "" }, { "docid": "c47062cc0e42a895729b74cf342f2e02", "score": "0.6282563", "text": "selectOption( e ) {\n\n\t\tthis.setState( { select_option: e.target.value } );\n\t}", "title": "" }, { "docid": "a87bb3b7408f02ac22050373f0602fac", "score": "0.6270445", "text": "clickedOption (e) {\n e.preventDefault();\n e.stopPropagation();\n var value = this.props.multiple ? this.toggleValue($(e.currentTarget).attr('data-value')) : $(e.currentTarget).attr('data-value');\n // console.log('new Value:', value);\n if (this.props.value == undefined) {\n //use defaultValue\n this.setState({\n value\n }, () => {\n this.props.onChange && this.props.onChange({\n target: {\n name: $(this.refs.select)[0].name,\n value: $(this.refs.select).val()\n },\n originalTarget: $(this.refs.select)[0]\n });\n });\n } else {\n //use value\n this.props.onChange && this.props.onChange({\n target: {\n name: this.props.name || undefined,\n value\n },\n originalTarget: $(this.refs.select)[0]\n });\n }\n\n\n\n }", "title": "" }, { "docid": "645e630f38d3d9f45dea853011523d99", "score": "0.6264254", "text": "function gs_select_change() {\n\n var el = $$( \"gs_site_list\" );\n var selection = el.value;\n var url_text = $$('site_url');\n\n if (selection == \"add_site\") {\n\t// Special value for adding new site\n\turl_text.value = \"\";\n }\n else {\n\t// Load existing site values into form\n\tvar site = db.getSite(selection);\n\tif (site == null) return;\n\n\turl_text.value = site.url;\n\n\tif (site.rule == -1) return;\n\t// Set the radio selection\n\tvar radio = null;\n\tradio = $$('gs_radio_' + site.rule);\n\tif (radio != undefined) radio.checked = true;\n\n\t// Load stored values\n\tif (site.max_time > 0) {\n\t $$('gs_max_time').value = site.max_time;\n\t}\n\tif (site.max_visits > 0) {\n\t $$('gs_max_visits').value = site.max_visits;\n\t}\n } \n}", "title": "" }, { "docid": "4c872c6af1724812e13547feb42a0988", "score": "0.6211368", "text": "function OptionInput () {}", "title": "" }, { "docid": "39568475c00adeaa768b0b7507af1e48", "score": "0.6187891", "text": "function staticMenuSelect(sel, item){\n\t\t$(sel).val(item);\n\t}", "title": "" }, { "docid": "454ac44ca957fb6e98f9dbc647dfb505", "score": "0.61842453", "text": "function OnSelectOption(options) {\n 'use strict';\n return 0; //index od option\n}", "title": "" }, { "docid": "12a2db5f9c796f31c94d8f175838f53a", "score": "0.6181791", "text": "function _controlselect(inst,name,option)\n{\n\tinst.svcomm.SendActionEvent( 'dropdown', name, option )\n}", "title": "" }, { "docid": "64189bc2dcf69d692c597d1a6c1ed754", "score": "0.6173008", "text": "_handleSelect() {\n this._innerElement.click(function() {\n if ($(this).hasClass('selected')) {\n $(this).removeClass('selected');\n } else {\n $(this).addClass('selected');\n }\n });\n }", "title": "" }, { "docid": "4ccc940baef3b555652e2bac047aeb75", "score": "0.617116", "text": "function NativeMenuOnSelect( evt )\n\t{\n\t\t// log to debug\n\t\tair.trace(\"Selected command: PRE\"); \n\t\tair.trace(\"Selected command: \" + evt.target.label); \n\t\tair.trace(\"Selected command: POST\"); \n\t\n\t\tif( evt.target.label == \"Quit\" ){\n\t\t\tif( configOpt.onQuit )\tconfigOpt.onQuit(evt)\n\t\t}\n\t\tif( configOpt.onMenuSelect )\tconfigOpt.onMenuSelect(evt)\n\t}", "title": "" }, { "docid": "fbf31d9b301d434f0131b5f42ff9b9f7", "score": "0.61689824", "text": "singleSelectOptionClick(e, item) {\n this.internalOptions = this.internalOptions.map((x) => {\n if (item.label === x.label) {\n x.selected = true;\n } else {\n x.selected = false;\n }\n return x;\n });\n\n if (this.hideByItemClick) {\n this.toggleDropdown();\n }\n\n if (this.isInput) {\n this.setInputValue();\n }\n\n // 使用户传入的v-model 生效\n this.$emit(\"input\", this.internalOptions);\n\n this.$emit(EMIT_EVENTS.ITEM_SELECT_CHANGE, this.internalOptions);\n }", "title": "" }, { "docid": "dbc6dbb2fd4b7e95908deacdd75ebb27", "score": "0.61684626", "text": "handleOptionSelect(selectedOption) {\n this.setState({ selectedOption: selectedOption, userInput: \"\" });\n }", "title": "" }, { "docid": "4a89cb9fbcbe1a9918b6ead40ab89236", "score": "0.6157938", "text": "function handleEventSelection() {\n \n $(\".eventOption\").click(function() {\n $(\".selectedEvent\").removeClass(\"selectedEvent\");\n $(this).addClass(\"selectedEvent\");\n $(\"#eventDropdown\").text($(this).text());\n $(\"#eventDropdown\").val($(this).text());\n \n });\n \n}", "title": "" }, { "docid": "de8d5304165e79d441a1d35858514939", "score": "0.61376673", "text": "function handleSelect(e) {\n changeLanguage(e.target.value);\n }", "title": "" }, { "docid": "9230ac3484445f0f17f421e0052b7347", "score": "0.610889", "text": "onOptionMenuItemSelect(option) {\n switch (option.title) {\n case 'All':\n this.handleClose();\n this.props.selectAllTodo();\n break;\n case 'None':\n this.handleClose();\n this.props.getUnselectedAllTodo();\n break;\n case 'Starred':\n this.handleClose();\n this.props.selectStarredTodo();\n break;\n case 'Unstarred':\n this.handleClose();\n this.props.selectUnStarredTodo();\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "ea840e574469d7ace0ad863afdc27f79", "score": "0.60825956", "text": "function inputHandler(evt) {\n\t\t\tvar s2data = s2inst.data(\"select2\");\n\t\t\tif ($(this).val().trim().length > 0) {\n\t\t\t\ts2data.$dropdown.addClass(\"searching-result\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\ts2data.$dropdown.removeClass(\"searching-result\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7fe428d24378de0559483d7c9ea921b", "score": "0.60656476", "text": "change() {\n showCorrectSubsiteIDDropdown(this.value);\n }", "title": "" }, { "docid": "b5bf269787ba66c0454552e59c0cad48", "score": "0.60646147", "text": "function selectOption(e) {\n const wrapper = e.target.parentNode.parentNode.parentNode;\n const input_search = wrapper.querySelector(\".selected-input\");\n const option = wrapper.querySelector(`select option[value=\"${e.target.dataset.value}\"]`);\n\n option.setAttribute(\"selected\", \"\");\n createToken(wrapper, e.target.dataset.value);\n if (input_search.value) {\n input_search.value = \"\";\n }\n\n input_search.focus();\n\n e.target.remove();\n const autocomplete_list = wrapper.querySelector(\".autocomplete-list\");\n\n\n if (!autocomplete_list.children.length) {\n const li = document.createElement(\"li\");\n li.classList.add(\"not-cursor\");\n li.innerText = \"No options found\";\n autocomplete_list.appendChild(li);\n }\n\n const event = new Event('keyup');\n input_search.dispatchEvent(event);\n e.stopPropagation();\n}", "title": "" }, { "docid": "5caa8e819d26f13f20b7809a35e7dbc7", "score": "0.6050128", "text": "selectOption(value) {\n // send a custom action to the parent, passing the value of the selected option as parameter\n this.sendAction(this.get('action'), value);\n // highlight current option\n this.set('selectedOption', value);\n // close the dropdown\n this.send('setDropdownStatus', false);\n }", "title": "" }, { "docid": "bceb43951ccdc67faaaaed277e27ef90", "score": "0.60436654", "text": "function selectMenu(countryPopObj,selection){\n if('none'==selection){\n // DEFAULT SELECTION ON LOAD\n $('select.dc-select-menu option:first').text('-- COUNTRY --');\n $('#hidden').remove();\n $('.init-hide').hide();\n // HANDLE CHANGES IN SELECTION\n selectMenuChange(countryPopObj);\n }else{\n // display the correct country\n $('select.dc-select-menu').val(selection);\n $('select.dc-select-menu option:first').text('-- COUNTRY --');\n // HANDLE CHANGES IN SELECTION\n selectMenuChange(countryPopObj);\n }\n}", "title": "" }, { "docid": "b9c12b6ed8a29f43cf17a37de43adc4f", "score": "0.6041119", "text": "function eventOptionSelected( event ) {\n\t$(\".popup\").hide();\n\tvar selectedOption = event.target;\n\t\n\tevent.data.handlerMethod(event.data.you, selectedOption);\n}", "title": "" }, { "docid": "411a00dc3140bd1b78a6d0cb6bb5b47b", "score": "0.60382223", "text": "function handleProcessDataSelection() {\n var projectDataSelectionType = $('select[data-projdataseltype]').val();\n if( projectDataSelectionType === 'fixedStructure' ) {\n loadProjDataOptions();\n }\n else {\n displaySelectionType('input');\n }\n}", "title": "" }, { "docid": "4b237e500cdf521e4a79c2b23463c9cc", "score": "0.6034546", "text": "function tocSelectLogic() {\n if (this.value !== \"placeholder\") {\n window.location = this.value;\n getById(\"firstOption\").selected = \"true\";\n }\n }", "title": "" }, { "docid": "ca2fc7db8f7b54eb464464165fabe403", "score": "0.6030546", "text": "handleChange(event) {\n // Get the string of the \"value\" attribute on the selected option\n this.selectedOption = event.detail.value;\n this.callMethod();\n }", "title": "" }, { "docid": "8c166d59d60ff8ab4f7e997d69af83ae", "score": "0.60273325", "text": "function HandleSelectDropDown(e) {\n var dropdown = FindParentWithClass(e.target, 'dropdown');\n if (dropdown) {\n\n // Check if click target is a list-item or a child of a list-item\n if (e.target.classList.contains('list-item') || FindParentWithClass(e.target, 'list-item')) {\n var parentDropdown = FindParentWithClass(e.target, 'dropdown-select');\n // If dropdown can't be found then return\n if (!parentDropdown) return;\n\n // If no content container is found in dropdown then return \n var parentDropdownContent = parentDropdown.getElementsByClassName('dropdown-content')[0];\n if (!parentDropdownContent) return;\n\n // Hide content after list-item is clicked\n if (parentDropdownContent.classList.contains('dropdown-active')) parentDropdownContent.classList.remove('dropdown-active');\n\n //\n if (parentDropdown.getElementsByClassName('dropdown-trigger')[0]) {\n var parentDropdownInput = parentDropdown.getElementsByClassName('dropdown-trigger')[0].getElementsByTagName('input')[0];\n\n // If no text input field is found then return\n if (!parentDropdownInput || parentDropdownInput.type != 'text') return;\n parentDropdownInput.value = e.target.innerHTML;\n /* Fire change event because programmatic changes to input value do not\n * cause the change event to fire\n */\n parentDropdownInput.dispatchEvent(customChangeEvent);\n }\n }\n }\n}", "title": "" }, { "docid": "2bf584647b460632186494ce7035a08e", "score": "0.60193205", "text": "function GetSelectedValue() {\n let e = document.getElementById(\"option-menu\");\n let result = e.options[e.selectedIndex].value;\n // $(e).focus();\n $(result).toggleClass('active');\n searchTheAPI(result);\n}", "title": "" }, { "docid": "11787e389305d6e7e9d6d69cc2141a9d", "score": "0.6014748", "text": "function handleSelect(selection) {\n switch(selection){\n case 'first': {\n handleStarSelect(1);\n return;\n }\n case 'second': {\n handleStarSelect(2);\n return;\n }\n case 'third': {\n handleStarSelect(3);\n return;\n }\n case 'fourth': {\n handleStarSelect(4);\n return;\n }\n case 'fifth': {\n handleStarSelect(5);\n return;\n }\n default: {\n handleStarSelect(0);\n }\n }\n}", "title": "" }, { "docid": "b2efa8656cf659870cfa30f3e84bf612", "score": "0.6005712", "text": "optionClickHandler(entity, element, event) {\n if (!this.disabled && !element.disabled) {\n this.selectOption(entity, element);\n }\n }", "title": "" }, { "docid": "470ef3178bbca90094c7a2feab521cf3", "score": "0.6003485", "text": "function observeOptionSelect(element, handler) {\n var toolbar = this;\n element.observe('change', function(event) {\n handler[element.value](toolbar.editor);\n toolbar.editor.fire(\"wysihat:change\");\n toolbar.editor.fire(\"wysihat:cursormove\");\n Event.stop(event);\n });\n }", "title": "" }, { "docid": "88db8c99f45e1f6634e1dc3012eca012", "score": "0.6000923", "text": "function _onSelect(event)\n {\n _log(\"onSelect: \", this[_config['searchKey']]);\n\n /* Update Label */\n var label = this[_config['searchKey']][_config['searchKey']];\n _bootElement.val(label);\n\n /* TODO: Update Model */\n _lastSelection = label;\n\n _hideAvailableList();\n\n event.selected = this[_config['searchKey']];\n\n /* Calling Scope Method */\n if(typeof(this.$parent[_config['onSelect']]) == \"function\") this.$parent[_config['onSelect']].call(this, event);\n }", "title": "" }, { "docid": "66f1f949ca9eaf0633a46b401fefbc81", "score": "0.59946084", "text": "function handleDropdownClick (e) {\n /*jshint validthis:true */\n var clicked = $(this);\n var clickedItem;\n for (var i = 0; i < a.items.length; i++) {\n var itemValue = typeof a.items[i] === 'object' ? a.items[i][a.params.valueProperty] : a.items[i];\n var value = clicked.attr('data-value');\n if (itemValue === value || itemValue * 1 === value * 1) {\n clickedItem = a.items[i];\n }\n }\n if (a.params.updateInputValueOnSelect) {\n a.input.val(typeof clickedItem === 'object' ? clickedItem[a.params.valueProperty] : clickedItem);\n a.input.trigger('input change');\n }\n \n if (a.params.onChange) {\n a.params.onChange(a, clickedItem);\n }\n \n a.close();\n }", "title": "" }, { "docid": "96684e5616be574c769c9ab8bedc209b", "score": "0.59899276", "text": "function updateSelect(option) {\n\t\t\tself.setState({ inputSelect: option });\n\t\t}", "title": "" }, { "docid": "f358fd2ee9a51d422b47e613e50c0e02", "score": "0.5984503", "text": "function selectChange(){\n relay_types.forEach(function(value, index, array){\n console.log(\"SELECT:\"+select.value+ \" NAME:\"+value.name);\n if (select.value == value.name) {\n descDiv.textContent = value.description;\n descDiv.href = value.url;\n relay_type_id = value.id;\n }\n });\n }", "title": "" }, { "docid": "a46e270224ad5db2a9f6c4020ddad132", "score": "0.5981803", "text": "_handleOptionFocus(e){this._setActiveOption(e.detail.id)}", "title": "" }, { "docid": "8aac53a53c125701141f034aba0e099d", "score": "0.5981089", "text": "function onChange(control, oldValue, newValue, isLoading) {\n var choice = g_form.getValue('options', notes); // doAlert is our callback function\n}", "title": "" }, { "docid": "d46f75d7cf4e25b937fbcbcf1053e8ef", "score": "0.59766084", "text": "function customSelect() {\n\tvar firstItem = $('.js-choiseItem > li:nth-child(1) > a').text();\n\t$('.js-currentItem').text(firstItem);\n\tjQuery('body').on('click', '.js-choiseItem a', function(e) {\n\t\te.preventDefault();\n\t\t$('.js-currentItem').text($(this).text());\n\t});\n}", "title": "" }, { "docid": "29cedbc9f52b5026c6731b929a5a72ff", "score": "0.59726954", "text": "function handleSelect (event) {\n setSelected(event.target.value);\n }", "title": "" }, { "docid": "f29a1dfd202da655685b7ab3f08faa77", "score": "0.5969484", "text": "handleOptionClick(option, e) {\n if (this.props.onSelectionChange) {\n if (this.props.selectedOptions) {\n this.props.onSelectionChange([...this.props.selectedOptions, option]);\n } else {\n this.props.onSelectionChange(option);\n }\n }\n this.refs.filter.focus();\n }", "title": "" }, { "docid": "aef3cbc4d9411b3f40f6cd72d31763c2", "score": "0.5958007", "text": "function selectMenuChange(countryPopObj){\n $('select.dc-select-menu').on('change',function(){\n if($('select.dc-select-menu').val()==''){\n $('.init-hide').fadeOut('slow');\n }else{\n // RETRIEVE THE COUNTRY SELECTION AND FIND THE CORRESPONDNG POPULATION TO DISPLAY\n var country = $('select.dc-select-menu').val();\n var pop=countryPopObj[country];\n $('#population').text(addCommas(pop));\n $('.init-hide').fadeIn('slow');\n }\n });\n}", "title": "" }, { "docid": "c6bde58c0db952c98005bfd419731af7", "score": "0.5950019", "text": "function onDropdownChange(evt) {\n var elem = $(evt.target);\n\n var optionSelected = elem.find(\"option:selected\");\n var valueSelected = optionSelected.val();\n var textSelected = optionSelected.text();\n\n var channelID = optionSelected.data('channel');\n var meshID = optionSelected.data('mesh');\n\n channelSwitch(channelID, meshID);\n }", "title": "" }, { "docid": "fa9beacc3c81aff115a58cd0665bde2d", "score": "0.59485304", "text": "changeOption(e) {\n var val = e.currentTarget.value;\n this.props.changeOption(val);\n }", "title": "" }, { "docid": "f6723adf48e0f96bbcb85086c46e4449", "score": "0.5941496", "text": "function optionSelected(sender) {\n\n flag.value = 1;\n console.log(\"this is selected option: \" + JSON.stringify(sender.data));\n\n //if(sender.data.term.length > 25){\n //lista.getAt(senderIndex.value).medicinename.value = sender.data.term.substring(0,25)+\" ...\";\n lista.getAt(senderIndex.value).medicinename.value = sender.data.term;\n lista.getAt(senderIndex.value).matchData.clear();\n\n // }\n\n // else{\n // lista.getAt(senderIndex.value).medicinename.value = sender.data.term;\n // lista.getAt(senderIndex.value).matchData.clear();\n\n // } \n}", "title": "" }, { "docid": "1b4e9e4bcad0da1a823e09e2bc75011e", "score": "0.5940581", "text": "function handleOptionPressed(idx, option, question) {\n \n }", "title": "" }, { "docid": "47ba536eebfb88cf578ef57528a5aa28", "score": "0.5932409", "text": "optionWasSelected() {\n this.setState({\n filterText: this.props.multiple ? '' : this.state.filterText,\n empty: false,\n dropdownOpen: false,\n highlightedOption: null\n }, () => {\n this.handleDropdownPosition();\n\n if (this.props.multiple) {\n this.focusInput();\n }\n });\n }", "title": "" }, { "docid": "ed33580a9c81ca3a120163a3cb201355", "score": "0.59113306", "text": "onOptionSelected(event) {\r\n const selectEvent = event.detail.event;\r\n const target = selectEvent.target ? selectEvent.target.activeElement : selectEvent.target;\r\n if (target.classList.contains(this.selectorMonth)) {\r\n this.onMonthSelected(Number(selectEvent.target.value));\r\n }\r\n if (target.classList.contains(this.selectorYear)) {\r\n this.onYearSelected(Number(selectEvent.target.value));\r\n }\r\n }", "title": "" }, { "docid": "643ce4e5546773fca413a48800c5f664", "score": "0.5910505", "text": "function handleOptionClick(evt) {\n let type = $(evt.target).attr('id').split('-link')[0];\n\n prepPage(`Browse by ${capitalize(type)}`);\n\n let optionArray = [];\n $apiData.villagers.forEach(function(vill) {\n if (!optionArray.includes(vill[type])) {\n optionArray.push(vill[type]);\n }\n });\n \n sortAlphabetically(optionArray);\n optionArray.forEach(function(animal) {\n renderOption(animal, type);\n });\n}", "title": "" }, { "docid": "34c02ee1207b0a43952bd6ad70b37d3d", "score": "0.59082156", "text": "function onSelectMenu() {\n if (asideController.openmenu === MENU_SELECCIONADO) {\n asideController.openmenu = true;\n } else {\n asideController.openmenu = false;\n }\n }", "title": "" }, { "docid": "1f3dbc3d36c6c684a5cc26e0d1a85445", "score": "0.5898972", "text": "function selectionSite() {\n let option = $(this).val();\n\n siteSelected = siteSearch(option);\n}", "title": "" }, { "docid": "5e1ee2be06de862c8471b05d1156913a", "score": "0.5894262", "text": "function optionChanged(newSubjectID) {\n console.log(\"User selected subject ID:\", newSubjectID);\n populatePage(newSubjectID);\n}", "title": "" }, { "docid": "51b02c26dd4e1ff608954ca9f6bff56a", "score": "0.58884174", "text": "function initOptions(){\n\n var inputOptions=document.getElementById(\"input-options\");\n inputOptions.addEventListener(\"click\",function(e){\n if(e.target&& e.target.nodeName.toUpperCase()==\"BUTTON\"){\n handleOptions(e.target.value);\n }\n });\n}", "title": "" }, { "docid": "4cd71c1487ffe7de72fb646293aac211", "score": "0.58831626", "text": "function selectsug(selected_val){\n jQuery('#'+searchBoxId).val(selected_val);\n jQuery('#'+sugMenuId).css(\"display\",\"none\");\n}//EOF selectsug()", "title": "" }, { "docid": "709cccfff662941a187b6cc1d2f74713", "score": "0.58774495", "text": "function cp_handle_form_category_select() {\n\t\t//if on page load the parent category is already selected, load up the child categories\n\t\t$( '#catlvl0' ).attr( 'level', 0 );\n\n\t\t//bind the ajax lookup event to #ad_cat_id object\n\t\t$( document ).on( 'change', '#ad_cat_id', function() {\n\t\t\tvar currentLevel = parseInt( $( this ).parent().attr( 'level' ), 10 );\n\t\t\tcp_get_subcategories( $( this ), 'catlvl', currentLevel + 1, cpSettings.ad_parent_posting );\n\n\t\t\t//rebuild the entire set of dropdowns based on which dropdown was changed\n\t\t\t$.each( $( this ).parent().parent().children(), function( childLevel, childElement ) {\n\t\t\t\tif ( currentLevel + 1 < childLevel )\n\t\t\t\t\t$( childElement ).remove();\n\n\t\t\t\tif ( currentLevel + 1 === childLevel )\n\t\t\t\t\t$( childElement ).removeClass( 'hasChild' );\n\t\t\t} );\n\n\t\t\t//find the deepest selected category and assign the value to the \"chosenCateory\" field\n\t\t\tif ( $( this ).val() > 0 ) {\n\t\t\t\t$( '#chosenCategory input:first' ).val( $( this ).val() );\n\t\t\t} else if ( $( '#catlvl' + ( currentLevel - 1 ) + ' select' ).val() > 0 ) {\n\t\t\t\t$( '#chosenCategory input:first' ).val( $( '#catlvl' + ( currentLevel - 1 ) + ' select' ).val() );\n\t\t\t} else {\n\t\t\t\t$( '#chosenCategory input:first' ).val( '-1' );\n\t\t\t}\n\t\t} );\n\t}", "title": "" }, { "docid": "ba7300eb522275466ebb73457b62ac99", "score": "0.58722216", "text": "function handleMoveSearch(e) {\n var selected = document.querySelector(\"#moveSelect\".concat(i));\n searchMove(selected, data, i, obj.id, e.target.value.trim().toLowerCase(), childMove);\n } //set up onchange event for the select list", "title": "" }, { "docid": "a80c1ddb9bca68b71fdadabb89b88799", "score": "0.5869391", "text": "function onSelectButtonClicked() {\r\n\t\r\n}", "title": "" }, { "docid": "ea6e95a17d1bcea8f2eaa554dda86fda", "score": "0.5851661", "text": "_onChoiceChange(option, index) {\n\n if (this.props.multiSelect) {\n //Case Multi Select\n // Option info has the new selection state info for a specific item. \n // Option.selected has its new selection state, true or false. Index is its index. \n this._onChangeMulti(option);\n }\n else {\n //Case Single Select\n // Option info is undefined. The Index is the index of the newly selected item. \n this._onChangeSingle(index + 1);\n }\n }", "title": "" }, { "docid": "d9f3f2b3043e302977ea1adf35db38d8", "score": "0.585142", "text": "function change() {\n\t fetchComboData(value(), function() {\n\t _selected = null;\n\t var val = input.property('value');\n\n\t if (_suggestions.length) {\n\t if (input.property('selectionEnd') === val.length) {\n\t _selected = tryAutocomplete();\n\t }\n\n\t if (!_selected) {\n\t _selected = val;\n\t }\n\t }\n\n\t if (val.length) {\n\t var combo = context.container().selectAll('.combobox');\n\t if (combo.empty()) {\n\t show();\n\t }\n\t } else {\n\t hide();\n\t }\n\n\t render();\n\t });\n\t }", "title": "" }, { "docid": "492983c00eb5470d152e3af09c0eb0ee", "score": "0.5845643", "text": "_onKeyDownSelect(evt) {\n\n\t\tconst state = this.state;\n\n\t\t// when user use arrow up select value search\n\t\tif(evt.keyCode === 38 && state.indexSelect > 0) {\n\n\t\t\tthis.setState({\n\t\t\t\tindexSelect: state.indexSelect - 1,\n\t\t\t})\n\n\t\t\t// when user use arrow down select value search\n\t\t} else if(evt.keyCode === 40 && state.indexSelect < (state.dataSearch.length - 1)) {\n\n\t\t\tthis.setState({\n\t\t\t\tindexSelect: state.indexSelect + 1\n\t\t\t})\n\n\t\t\t// when user select value search and enter\n\t\t} else if(evt.keyCode === 13) {\n\n\t\t\tlet valSearch = state.dataSearch && state.dataSearch.length > 0 ? state.dataSearch[state.indexSelect] : state.inputSearch;\n\n\t\t\tthis.setState({\n\t\t\t\tinputSearch: valSearch,\n\t\t\t\tdataSearch: []\n\t\t\t})\n\n\t\t\tthis._handleSearch(valSearch);\n\t\t}\n\t}", "title": "" }, { "docid": "ff81cb1d253b27f72810b25afc705733", "score": "0.58416545", "text": "function inputChange(e) {\n const wrapper = e.target.parentNode.parentNode;\n const select = wrapper.querySelector(\"select\");\n const dropdown = wrapper.querySelector(\".dropdown-icon\");\n\n const input_val = e.target.value;\n\n if (input_val) {\n dropdown.classList.add(\"active\");\n populateAutocompleteList(select, input_val.trim());\n } else {\n dropdown.classList.remove(\"active\");\n const event = new Event('click');\n dropdown.dispatchEvent(event);\n }\n}", "title": "" }, { "docid": "654def98b081e2337290ed9cfab2b36a", "score": "0.5834169", "text": "_onSelect(option, isUserInput) {\n const wasSelected = this._selectionModel.isSelected(option);\n if (option.value == null && !this._multiple) {\n option.deselect();\n this._selectionModel.clear();\n this._propagateChanges(option.value);\n }\n else {\n if (wasSelected !== option.selected) {\n option.selected ? this._selectionModel.select(option) :\n this._selectionModel.deselect(option);\n }\n if (isUserInput) {\n this._keyManager.setActiveItem(option);\n }\n if (this.multiple) {\n this._sortValues();\n if (isUserInput) {\n // In case the user selected the option with their mouse, we\n // want to restore focus back to the trigger, in order to\n // prevent the select keyboard controls from clashing with\n // the ones from `mat-option`.\n this.focus();\n }\n }\n }\n if (wasSelected !== this._selectionModel.isSelected(option)) {\n this._propagateChanges();\n }\n this.stateChanges.next();\n }", "title": "" }, { "docid": "efac99b27144767505e48d09933ab488", "score": "0.5832452", "text": "function changeTypeEvent(wSelect){\n\t$('#action_field').find('option').remove();\n\tif (wSelect.selectedIndex==0) return ;\n\tevent_in_use = VARIABLES_AUTO[wSelect.options[wSelect.selectedIndex].value];\n\tvar field = document.getElementById(\"action_field\");\n\tvar index = 1;\n\tfor (var key in event_in_use) field[index++] = new Option(event_in_use[key][0],key);\n\n\t$('#action_operation').find('option').remove();\n}", "title": "" }, { "docid": "0455ea1ba48196c0d802a21169ef9612", "score": "0.5829847", "text": "selectItem(){\n \n }", "title": "" }, { "docid": "2a3a255fbd79f3e02237bd5c2ae25b3f", "score": "0.5825129", "text": "function reflectChange(e){\n\t\t\t\t\to._stackOverflow++;\n\n\t\t\t\t\to.dom.$selectedOption = o.dom.$el.find('option:selected');\n\t\t\t\t\tvar index = o.dom.$selectedOption.index();\n\t\t\t\t\to.dom.$fauxSelectedOption = o.dom.$fauxOptions.eq(index);\n\t\t\t\t\tvar text = o.dom.$fauxSelectedOption.text();\n\n\t\t\t\t\to.dom.$fauxSelectedOption.addClass(o.elAttrNames.typeCustom.activeItemClass).data('plusui-selected', 'selected')\n\t\t\t\t\t\t.siblings().removeClass(o.elAttrNames.typeCustom.activeItemClass).data('plusui-selected', null);\n\t\t\t\t\to.dom.$placeholder.text(text);\n\n\t\t\t\t\t// Change selected item on the select menu\n\t\t\t\t\to.dom.$elOptions.prop('selected', false)\n\t\t\t\t\t\t.eq(index).prop('selected', true);\n\t\t\t\t\to.dom.$fauxOptions.data(PlusUIApp.namespace + 'selected', false)\n\t\t\t\t\t\t.eq(index).data(PlusUIApp.namespace + 'selected', true);\n\n\t\t\t\t\tif(typeof o.onChange === 'function' && o._stackOverflow <= 1) {\n\t\t\t\t\t\to.onChange(o.dom.$el, o.dom.$fauxSelect, o);\n\t\t\t\t\t};\n\n\t\t\t\t\to._stackOverflow = 0;\n\t\t\t\t}", "title": "" }, { "docid": "65369867b35920f0ccf0f378fcef8ccd", "score": "0.5821416", "text": "registerSelectDishOption() {\n this.$modalContainer.on('change', '#validationCustom03', function () {\n $('#validationCustom03 option').each(function () {\n if ($(this).is(':selected')) {\n $('#validationCustom04').val($(this).data('price') + '$');\n return;\n }\n });\n });\n }", "title": "" }, { "docid": "e35f4f06ab47875e07595a8865a86a02", "score": "0.58205813", "text": "handleOptionsChange(key, e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (key.action && this[key.action]) {\n this[key.action](key.loan);\n }\n }", "title": "" }, { "docid": "f9a7b908e4d24fde42e1fd81013f017b", "score": "0.58172566", "text": "_onSelect(option, isUserInput) {\n const wasSelected = this._selectionModel.isSelected(option);\n if (option.value == null && !this._multiple) {\n option.deselect();\n this._selectionModel.clear();\n if (this.value != null) {\n this._propagateChanges(option.value);\n }\n }\n else {\n if (wasSelected !== option.selected) {\n option.selected ? this._selectionModel.select(option) :\n this._selectionModel.deselect(option);\n }\n if (isUserInput) {\n this._keyManager.setActiveItem(option);\n }\n if (this.multiple) {\n this._sortValues();\n if (isUserInput) {\n // In case the user selected the option with their mouse, we\n // want to restore focus back to the trigger, in order to\n // prevent the select keyboard controls from clashing with\n // the ones from `mat-option`.\n this.focus();\n }\n }\n }\n if (wasSelected !== this._selectionModel.isSelected(option)) {\n this._propagateChanges();\n }\n this.stateChanges.next();\n }", "title": "" }, { "docid": "f9a7b908e4d24fde42e1fd81013f017b", "score": "0.58172566", "text": "_onSelect(option, isUserInput) {\n const wasSelected = this._selectionModel.isSelected(option);\n if (option.value == null && !this._multiple) {\n option.deselect();\n this._selectionModel.clear();\n if (this.value != null) {\n this._propagateChanges(option.value);\n }\n }\n else {\n if (wasSelected !== option.selected) {\n option.selected ? this._selectionModel.select(option) :\n this._selectionModel.deselect(option);\n }\n if (isUserInput) {\n this._keyManager.setActiveItem(option);\n }\n if (this.multiple) {\n this._sortValues();\n if (isUserInput) {\n // In case the user selected the option with their mouse, we\n // want to restore focus back to the trigger, in order to\n // prevent the select keyboard controls from clashing with\n // the ones from `mat-option`.\n this.focus();\n }\n }\n }\n if (wasSelected !== this._selectionModel.isSelected(option)) {\n this._propagateChanges();\n }\n this.stateChanges.next();\n }", "title": "" }, { "docid": "f9a7b908e4d24fde42e1fd81013f017b", "score": "0.58172566", "text": "_onSelect(option, isUserInput) {\n const wasSelected = this._selectionModel.isSelected(option);\n if (option.value == null && !this._multiple) {\n option.deselect();\n this._selectionModel.clear();\n if (this.value != null) {\n this._propagateChanges(option.value);\n }\n }\n else {\n if (wasSelected !== option.selected) {\n option.selected ? this._selectionModel.select(option) :\n this._selectionModel.deselect(option);\n }\n if (isUserInput) {\n this._keyManager.setActiveItem(option);\n }\n if (this.multiple) {\n this._sortValues();\n if (isUserInput) {\n // In case the user selected the option with their mouse, we\n // want to restore focus back to the trigger, in order to\n // prevent the select keyboard controls from clashing with\n // the ones from `mat-option`.\n this.focus();\n }\n }\n }\n if (wasSelected !== this._selectionModel.isSelected(option)) {\n this._propagateChanges();\n }\n this.stateChanges.next();\n }", "title": "" }, { "docid": "f9a7b908e4d24fde42e1fd81013f017b", "score": "0.58172566", "text": "_onSelect(option, isUserInput) {\n const wasSelected = this._selectionModel.isSelected(option);\n if (option.value == null && !this._multiple) {\n option.deselect();\n this._selectionModel.clear();\n if (this.value != null) {\n this._propagateChanges(option.value);\n }\n }\n else {\n if (wasSelected !== option.selected) {\n option.selected ? this._selectionModel.select(option) :\n this._selectionModel.deselect(option);\n }\n if (isUserInput) {\n this._keyManager.setActiveItem(option);\n }\n if (this.multiple) {\n this._sortValues();\n if (isUserInput) {\n // In case the user selected the option with their mouse, we\n // want to restore focus back to the trigger, in order to\n // prevent the select keyboard controls from clashing with\n // the ones from `mat-option`.\n this.focus();\n }\n }\n }\n if (wasSelected !== this._selectionModel.isSelected(option)) {\n this._propagateChanges();\n }\n this.stateChanges.next();\n }", "title": "" }, { "docid": "81148cdcf70d515f695f236ece981a02", "score": "0.5814226", "text": "function selectOption($fauxOption){\n\t\t\t\t\tvar index = $fauxOption.index(),\n\t\t\t\t\t\ttext = $fauxOption.text();\n\n\t\t\t\t\t// Change selected item on the select menu\n\t\t\t\t\to.dom.$elOptions.prop('selected', false)\n\t\t\t\t\t\t.eq(index).prop('selected', true);\n\n\t\t\t\t\t// Force the default element change event to fire\n\t\t\t\t\t// This is for consistency with the defaultDropdown option\n\t\t\t\t\to.dom.$el.change();\n\t\t\t\t}", "title": "" }, { "docid": "d04873739dee7266c06cb1df564b91f3", "score": "0.58138496", "text": "function handleClick2(event){\n shaping_column = \"Select\";\n color_column = \"Select\";\n myForm.searchText.value = 0;\n myForm1.transpText.value = 0;\n myForm1.opacityMatch.value = 0;\n myForm1.opacityNoMatch.value = 0;\n dropDown4.property( \"value\", \"Select\" );\n dropDown.property( \"value\", \"Select\" );\n highlighting(\"\", \"\", \"\");\n return false;\n}", "title": "" }, { "docid": "afe1f86fb4ca215f0672525d846c6949", "score": "0.5808904", "text": "function js_select_init(selects) {\n var i = 0;\n var l = selects.length;\n for (i; i < l; i++) {\n init(selects[i]);\n }\n\n function init(defaultSelect) {\n defaultSelect.style.display = \"none\";\n var defaultOptons = defaultSelect.getElementsByTagName(\"option\");\n ///*CREATING NEW SELECT*///\n var $newSelect = $(document.createElement(\"div\")).addClass(\"js_select\").text(defaultOptons[0].text);\n\n ///*CREATING WRAPPER DIV*///\n var $wrapper = $(document.createElement(\"div\")).addClass(\"js_select_wrapper\");\n\n ///*CREATING NEW OPTIONS*///\n var $optionsList = $(document.createElement(\"div\")).addClass(\"js_select_list\").hide();\n\n ///*ADDING CLICK HANDLERS*///\n $optionsList.on(\"click\", \".js_select_option\", handleOptionClick($newSelect, $optionsList, defaultSelect));\n $newSelect.click(handleSelectClick($newSelect, $optionsList, $wrapper));\n\n ///*COPYING OPTIONS OVER*///\n var i = 0;\n var l = defaultOptons.length;\n for (i; i < l; i++) {\n $(document.createElement(\"div\")).addClass(\"js_select_option\").html(defaultOptons[i].innerHTML).attr(\"value\", defaultOptons[i].value).appendTo($optionsList);\n }\n l > 6 && $optionsList.addClass(\"js_select_list_scrollable\");\n\n $(defaultSelect).after($wrapper.append($newSelect, $optionsList)).data(\"js_select_initiated\", true);\n }\n\n function handleSelectClick($newSelect, $optionsList, $wrapper) {\n return function () {\n $optionsList.slideToggle(\"fast\");\n $newSelect.toggleClass(\"js_select_oppened\");\n\n // On click outside\n if ($newSelect.hasClass(\"js_select_oppened\")) {\n $wrapper.onClickOutside(function () {\n $optionsList.slideUp(\"fast\");\n $newSelect.removeClass(\"js_select_oppened\");\n });\n }\n return false;\n };\n }\n\n function handleOptionClick($newSelect, $optionsList, defaultSelect) {\n return function () {\n //Set ne value\n defaultSelect.value = this.getAttribute(\"value\");\n //Triger change event on original select element\n defaultSelect.dispatchEvent(new Event(\"change\")); // Dispatch it.\n //Do other stuff\n $newSelect.removeClass(\"js_select_oppened\").html(this.innerHTML);\n $optionsList.slideUp(\"fast\");\n return false;\n };\n }\n }", "title": "" }, { "docid": "c524b046c36f6172d08ef8f414814c36", "score": "0.58080494", "text": "function bind_search_field_select_control(){\n\t$('#search-field-select-combo')\n\t.on('change',function(){\n\t\t$('form')\n\t\t.find('.default-hidden-row')\n\t\t.hide();\n\t\t\n\t\t$('form')\n\t\t.find('.'+$(this).val())\n\t\t.show();\n\t});\n}", "title": "" }, { "docid": "5646fb63df06f9f39c4ea04c46d77475", "score": "0.58036965", "text": "onSiteChanged(event) {\n this.setState({\n selectedOption: event.target.value\n });\n }", "title": "" }, { "docid": "8d66f25a7a0894093061090c968b1d1b", "score": "0.57990354", "text": "function select(d) {\n input\n .property('value', d.value)\n .trigger('change');\n event.accept(d);\n hide();\n }", "title": "" }, { "docid": "c30cf21c5670474da515ec3ec49abc51", "score": "0.57979405", "text": "handleOptionChange(event) {\n this.state.currentView = event.target.value;\n this.setState({\n selectedOption: event.target.value\n });\n }", "title": "" }, { "docid": "2ef185fb1e8ce3c8289a5b9bc63b9f7b", "score": "0.57848567", "text": "function setupCloth() {\nvar clothOptions = '<option id=\"clothNone\" value=\"None\" class=\"\">Grass Cloth Options</option>';\nfor (var i=1; i < cloth.length; i++) {\n\t \t\t\t\n\t\t\t\tclothOptions += '<option id=\"cloth' + i + '\" value=\"' + cloth[i].name + '\" class=\"cloth' + i + '\">' + cloth[i].name + '</option>';\n\t\t\t\t\n\t\t\t}\n \n\t\t\t$('#cloth').append(clothOptions);\n\t \t\t\n\t\t\t$('select#cloth').selectmenu({\n\t\t\t\tstyle:'dropdown',\n\t\t\t\ticons: clothIcons,\n\t\t\t\twidth:225,\n\t\t\t\tmaxHeight:300\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tshowclothIcons();\n\t\t\t\n\t\t\t/* Setup Cloth Samples */\n\t\t\tvar clothSamples = '<p>Choose a Grasscloth for the face of the Circa50.</p><ul class=\"col\">' \n\t\t\tfor (var i=1; i< cloth.length; i++) {\n\t\t\t\n\t\t\tclothSamples +='<li class=\"option large\"><a href=\"#\" class=\"Sample_link\" style=\"border: 1px solid gray; background: url(css/images/fabrics/grasscloth.jpg) 0 ' + cloth[i].sprite + 'px no-repeat\"><span class=\"optionText optionTextbg\">&nbsp;</span><span class=\"optionText\">' + cloth[i].name + '</span></a><input type=\"hidden\" name=\"' + cloth[i].name + '\" value=\"' + cloth[i].name + '\" /></li>'\n\t\t\t\n\t\t\t}\n\t\t\tclothSamples += '</ul>'\n\t\t\t//console.info(clothSamples);\n\t\t\t$('#dialog_cloth').append(clothSamples);\n\n}", "title": "" }, { "docid": "ffe8b30c23e6a13286aaab22fa4167d0", "score": "0.57837623", "text": "set select(value) {\n let originalChoose = value.actions.choose;\n\n value.actions.choose = selected => originalChoose(selected);\n\n this._select = value;\n }", "title": "" }, { "docid": "c2659280fe37c1ed1bbcd143a19bb60c", "score": "0.5782703", "text": "function newCountrySelection(event) {\n //Invoke function sending the value of selection\n displayCountryInfo(event.target.value);\n}", "title": "" }, { "docid": "6f56b48526ac3bad750177eb7b08e7a1", "score": "0.57793224", "text": "function switchMenuSelection(key, options, e) {\n\n\tswitch(key) {\n\t\tcase \"all-var\":\n\t\tallVar();\n\t\tbreak;\n\t\tcase \"all-val\":\n\t\tallVal();\n\t\tbreak;\n\t\tcase \"all-call\":\n\t\tallCall();\n\t\tbreak;\n\t\tcase \"all-con\":\n\t\tallCon();\n\t\tbreak;\n\t\tcase \"all-condep\":\n\t\tallConDep();\n\t\tbreak;\n\t\tcase \"all-datdep\":\n\t\tallDatDep();\n\t\tbreak;\n\t\tcase \"goto-var\":\n\t\tgotoVar(e);\n\t\tbreak;\n\t\tcase \"goto-val\":\n\t\tgotoVal(e);\n\t\tbreak;\n\t\tcase \"find-var\":\n\t\tfindVar(e);\n\t\tbreak;\n\t\tcase \"find-val\":\n\t\tfindVal(e);\n\t\tbreak;\n\t\tcase \"sli-line\":\n\t\tsliLine();\n\t\tbreak;\n\t\tcase \"erase\":\n\t\terase();\n\t\tbreak;\n\t\tcase \"unslice\":\n\t\tunsliceAndStay(e);\n\t\tbreak;\n\t}\n\n}", "title": "" }, { "docid": "912a1c5615b502217756ca8fa55dd9d9", "score": "0.57773864", "text": "function handleInputValue (e) {\n var query = a.input.val();\n if (a.params.source) {\n a.params.source(a, query, function (items) {\n var itemsHTML = '';\n var limit = a.params.limit ? Math.min(a.params.limit, items.length) : items.length;\n a.items = items;\n var i, j, regExp;\n if (a.params.highlightMatches) {\n query = query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n regExp = new RegExp('('+query+')', 'i');\n }\n \n for (i = 0; i < limit; i++) {\n var itemValue = typeof items[i] === 'object' ? items[i][a.params.valueProperty] : items[i];\n var itemText = typeof items[i] !== 'object' ? items[i] : items[i][a.params.textProperty];\n itemsHTML += a.dropdownItemTemplate({\n value: itemValue,\n text: a.params.highlightMatches ? itemText.replace(regExp, '<b>$1</b>') : itemText\n });\n }\n if (itemsHTML === '' && query === '' && a.params.dropdownPlaceholderText) {\n itemsHTML += a.dropdownPlaceholderTemplate({\n text: a.params.dropdownPlaceholderText,\n });\n }\n a.dropdown.find('ul').html(itemsHTML);\n });\n }\n }", "title": "" }, { "docid": "68b2c2572612ec0374b9894de85366e2", "score": "0.57731575", "text": "function selectClicked() {\n controller.selectMenu.isClicked = true;\n}", "title": "" }, { "docid": "44eb272b7293f443bd23c83eb3986452", "score": "0.5773053", "text": "function handleSelectEvent(event) {\n var selectedElement = event.target;\n \n var targetURL = selectedElement.getAttribute(\"selectTargetURL\");\n if (!targetURL) {\n return;\n }\n \n targetURL = baseURL + targetURL;\n\n \n if (selectedElement.tagName == \"menuItem\") {\n updateMenuItem(selectedElement, targetURL);\n }\n else {\n pushPage(targetURL);\n }\n}", "title": "" }, { "docid": "0deab92b79f2a75a904d6926812801cb", "score": "0.57685846", "text": "function read_input(){\n\n menu.on(\"change\",read_userinput);\n menu.on(\"click\",read_userinput);\n //console.log(user_option);\n\n}", "title": "" }, { "docid": "269da5334fb9ac938af927c71e75e477", "score": "0.5768535", "text": "function addChosen(){\r\n $(\"form select.leveraged\").each(function(){\r\n $(this).chosen({\r\n search_contains : true\r\n });\r\n });\r\n}", "title": "" }, { "docid": "cf07251b0eb10a589325d44a8becb604", "score": "0.57652074", "text": "static getOptionVal(event) {\n let selection = event.target.value;\n\n let Chosen_Citation = file_Citations.find(\n ({ title }) => title === selection\n );\n\n UI.displayCitation(Chosen_Citation);\n }", "title": "" }, { "docid": "7f8aba79efe23f3af90c20a9019522ac", "score": "0.57639223", "text": "function selected() {\n\n $('select').append('<option value=\"all\" id=\"option\"> Search by keywords</option>');\n\n for (let i = 0; i < infoArray.length; i++) {\n\n let option = $('#option').clone();\n $('select').append(option);\n option.html(infoArray[i]);\n option.removeAttr('id');\n option.attr('value', infoArray[i]);\n\n }\n $('#select').on('change', function () {\n $('div').css({ 'display': 'none' });\n\n $('.' + this.value).css({ 'display': 'inline-block' })\n })\n\n}", "title": "" }, { "docid": "40737cb0f6e8a21cc0692cfe5c493b6a", "score": "0.57627726", "text": "function onOptionsClick(){\n optionsListener();\n }", "title": "" }, { "docid": "17660daf33c42d978381a51e8144df4a", "score": "0.57610464", "text": "function change(){\n\t\t\t\tvar index = $firstSelect.prop('selectedIndex') - opts.index;\n\t\t\t\t$selectResults.hide();\n\t\t\t\tif(index >= 0){\n\t\t\t\t\t$emptySelect.hide();\n\t\t\t\t\t$selectResults.eq(index).show();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$emptySelect.show();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "2632aabe1d1e1c29eaf1685188f6b024", "score": "0.5758513", "text": "function selectMenu ( menu ) {\n self.selected = angular.isNumber(menu) ? $scope.menus[menu] : menu;\n }", "title": "" }, { "docid": "6e30b44cbb82f435670c61b6bffda921", "score": "0.5757818", "text": "function listenForSelectChange() {\n $(`${config.selectors.scope} select`).on('change', () => {\n submitForm();\n });\n}", "title": "" } ]
86d3ce19f5eaa5ccf4709e8eaf299a57
addNumbersAPI() This function should perform the calculation in the app.py file Write a function that will retrieve the values from the text box elements on the page form a url string with the values as arguments Use callAPI() function to form and send a request object
[ { "docid": "76fdcdbfe89d7b24480271f06a7e6176", "score": "0.8423562", "text": "function addNumbersAPI(){\n let num1 = Number(document.getElementById(\"add1\").value);\n let num2 = Number(document.getElementById(\"add2\").value);\n let pythonRoute = \"http://127.0.0.1:5000/api/add?num1=\" + num1 + \"&num2=\" + num2;\n callAPI(pythonRoute, \"inputAdd\");\n}", "title": "" } ]
[ { "docid": "bf90d96e44bc02c69f7ffbe7dbea5bcf", "score": "0.7718387", "text": "function multiplyNumbersAPI(){\n let num1 = Number(document.getElementById(\"multi1\").value);\n let num2 = Number(document.getElementById(\"multi2\").value);\n let pythonRoute = \"http://127.0.0.1:5000/api/multiply?num1=\" + num1 + \"&num2=\" + num2;\n callAPI(pythonRoute, \"inputMultiply\")\n}", "title": "" }, { "docid": "7c0a91b8b93beefda630de1c29f1c293", "score": "0.7595071", "text": "function subtractNumbersAPI(){\n let num1 = Number(document.getElementById(\"sub1\").value);\n let num2 = Number(document.getElementById(\"sub2\").value);\n let pythonRoute = \"http://127.0.0.1:5000/api/subtract?num1=\" + num1 + \"&num2=\" + num2;\n callAPI(pythonRoute, \"inputSubtract\")\n}", "title": "" }, { "docid": "fa35dd7ef34a2362070279ede7e3e93f", "score": "0.7243786", "text": "function divideNumbersAPI(){\n let num1 = Number(document.getElementById(\"divi1\").value);\n let num2 = Number(document.getElementById(\"divi2\").value);\n let pythonRoute = \"http://127.0.0.1:5000/api/divide?num1=\" + num1 + \"&num2=\" + num2;\n callAPI(pythonRoute, \"inputDivide\")\n}", "title": "" }, { "docid": "d178e13cba3def3e35a8182928d293f8", "score": "0.6326319", "text": "function addNumber() {\n var number1 = document.getElementById(\"number1\").value;\n var number2 = document.getElementById(\"number2\").value;\n var prefixUrl = \"?number1=\" + number1 + \"&number2=\" + number2;\n var complete = url+prefixUrl;\n\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var sum = JSON.parse(this.responseText);\n document.getElementById(\"sum\").innerHTML = \"The sum of \" + number1 + \" and \" + number2 + \" is \" + sum;\n }\n };\n xmlhttp.open(\"GET\", complete, true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "0e002809a020b67cec0dc8a5e29ffeaf", "score": "0.6096617", "text": "function sendNumberInputData(){\n if(validateInputs() ) {\n let number1 = $('#number1Input').val();\n let number2 = $('#number2Input').val();\n Number(number1);\n Number(number2);\n\n $.ajax({\n method: 'POST',\n url: '/calculations',\n data: { number1,\n number2,\n clickOperator\n \n }\n }).then( function (response){\n getCalculatedHistory();\n clearInputs();\n }).catch( function(error){\n console.log('numberInputData Response Error');\n alert(`Sorry! There was an error in sending your numbers!`);\n })\n}\nelse {\n alert(`Please complete all input fields!`);\n}\n}", "title": "" }, { "docid": "ef24e15c508f030c6f808be769f4f9c0", "score": "0.6004324", "text": "function insertNumbers(num){\n const insertNumber = getInputValue('calculate-numbers');\n document.getElementById('calculate-numbers').value = insertNumber + num;\n}", "title": "" }, { "docid": "6f5557fd1e8b7571618f24db3f113350", "score": "0.5985976", "text": "function add_to_database() {\n var add_to_database_url = '/courierMB/actions/add_to_database/';\n user_input_value = $_admin_panel_add_packages_input.val();\n if (user_input_value){\n user_input_value = parseInt(user_input_value);\n if (user_input_value > 0){\n var number_of_packages_obj = {number_of_packages : user_input_value};\n request(\"POST\", add_to_database_url, number_of_packages_obj, update_database_status);\n }\n }\n}", "title": "" }, { "docid": "9b60ba364b3b5c74e927e0d509c52942", "score": "0.5982118", "text": "function get_rates_for_page(page_number)\n{\n fade_in_loader_and_fade_out_form(\"loader\", \"list_table\"); \n var bearer = \"Bearer \" + localStorage.getItem(\"worker_access_token\"); \n url = worker_api_rates_get_rate_list_url + page_number;\n send_restapi_request_to_server_from_form(\"get\", url, bearer, \"\", \"json\", get_rates_for_page_success_response_function, get_rates_for_page_error_response_function);\n}", "title": "" }, { "docid": "807955b0f00c1dc6c1cdf49e52e35969", "score": "0.5941046", "text": "function handler(req, res){\n\n var form = '';\n\n if(req.method == \"GET\"){\n form = '\\\n<!doctype html> \\\n<html lang=\"en\"> \\\n<head> \\\n <meta charset=\"UTF-8\"> \\\n <title>Form Calculator Add Example</title> \\\n</head> \\\n<body> \\\n<input type=\"text\" name=\"A\" id=\"A\" onkeyup=\"test()\" method=\"post\"> \\\n<span id=\"result\"> </span> \\\n<script> \\\n function test() { \\\n var a = document.getElementById(\"A\").value; \\\n \\\n xmlhttp = new XMLHttpRequest(); \\\n xmlhttp.onreadystatechange=function(){ \\\n if(xmlhttp.readyState==4 && xmlhttp.status==200){ \\\n document.getElementById(\"result\").innerHTML=xmlhttp.responseText; \\\n }; \\\n }; \\\n xmlhttp.open(\"POST\",\"\",true); \\\n xmlhttp.send(a); \\\n } \\\n function ajax(){ \\\n var a = document.getElementById(\"A\").value; \\\n var formdata = \"A=\"+a; \\\n \\\n xmlhttp = new XMLHttpRequest(); \\\n xmlhttp.onreadystatechange=function(){ \\\n if(xmlhttp.readyState==4 && xmlhttp.status==200){ \\\n document.getElementById(\"result\").innerHTML=xmlhttp.responseText; \\\n }; \\\n }; \\\n xmlhttp.open(\"POST\",\"\",true); \\\n xmlhttp.send(formdata); \\\n return false; \\\n} \\\n</script> \\\n</body> \\\n</html>';\n //respond\n res.setHeader('Content-Type', 'text/html');\n res.writeHead(200);\n res.end(form);\n\n } else if(req.method == 'POST'){\n\n //read form data\n req.on('data', function(chunk) {\n\n //grab form data as string\n var a = chunk.toString();\n\n if(a.substr(a.length-1) === ' ') {\n //get user input\n var raw = a.split(\" \").slice(0, -1);\n\n //populated interpretted using raw array\n promisesArr = new Array(raw.length);\n interpretted = new Array();\n\n for(var i = 0; i < raw.length; i++) {\n promisesArr[i] = synonymize(raw[i]);\n }\n Q.allSettled(promisesArr).then(function(results) {\n results.forEach(function(result) {\n if(result.state === \"fulfilled\") {\n interpretted.push(result.value);\n } else {\n interpretted.push(result.reason);\n }\n });\n\n //convert interpretted to a printable string\n var interprettedStr = \"\";\n for(var i = 0; i < interpretted.length; i++) {\n interprettedStr += interpretted[i] + \" \";\n };\n var result = interprettedStr;\n\n //fill in the result and form values\n form = result.toString();\n\n //update raw\n raw = a.split(\" \");\n\n //respond\n res.setHeader('Content-Type', 'text/html');\n res.writeHead(200);\n res.end(form);\n\n //exit\n return;\n });\n return;\n };\n\n //respond\n res.setHeader('Content-Type', 'text/html');\n res.writeHead(200);\n res.end(form);\n\n });\n\n } else {\n res.writeHead(200);\n res.end();\n };\n\n }", "title": "" }, { "docid": "1ead047d331b4245ef8d5419ebf5f746", "score": "0.5908746", "text": "function submit(){\n $.ajax({\n method: \"POST\",\n url: \"/userinput\",\n data: {\n numberOne: numOne,\n numberTwo: numTwo,\n operator: operator\n }\n })\n .done(function (response){\n console.log('You did such a great job :)');\n getresults();\n \n });\n\n}", "title": "" }, { "docid": "648556c2390774cbb573bf9ea478a13f", "score": "0.57501686", "text": "function addNumbers() {\n\t//INPUT\n\t\tlet x = parseFloat(document.getElementById(\"number1\").value);\n\t\tlet y = parseFloat(document.getElementById(\"number2\").value);\n\t//PROCESSING\n\t\tlet sum = x + y;\n\t//OUTPUT\n\t\tdocument.getElementById(\"output\").innerHTML = \"The sum of \" + x + \" and \" + y + \" equals \" + sum + \"!\";\n}", "title": "" }, { "docid": "b086883457d387bf8d5b4b586ec0c349", "score": "0.57097936", "text": "function home(response, data)\n{\n response.writeHead(200, {\"Content-Type\": \"text/html\"}); \n response.write(\"Please input the numbers to be added: <br/>\");\n response.write(addModule.getForm());\n response.end();\n}", "title": "" }, { "docid": "803c9bfe30046b7333f4d1d23728ffef", "score": "0.5703228", "text": "function add(response, data)\n{\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\n\n try\n {\n num1 = addModule.extractNumber1(data);\n num2 = addModule.extractNumber2(data);\n\n var result = addModule.add(num1, num2);\n response.write(\"Result of addition is: \" + result);\n }\n catch(ex)\n {\n response.write(ex.name + \": \" + ex.message);\n }\n\n response.write(\"<br/> <br/> <a href='/'> Go Home </a>\");\n response.end();\n}", "title": "" }, { "docid": "43e307e68e3e7ae115f8b9ccdec3a33e", "score": "0.5700401", "text": "function call_api(input,functionName) {\n // Step 1\n // console.log(input);\n var request = new XMLHttpRequest(); // Prep to make an HTTP request\n\n // Step 2\n request.onreadystatechange = function() {\n if( this.readyState == 4 && this.status == 200 ) {\n actionFunction(this, functionName);\n }\n }\n // Step 3\n url=urlFunction(input,functionName);\n request.open(\"GET\", url, true);\n // Step 4\n request.send();\n}", "title": "" }, { "docid": "36e81711f9954f0eb756b537e76d58ec", "score": "0.56855816", "text": "function App() {\n\t// #13 Create num1 & num2 from useState\n\tconst [num1, setNum1] = useState(\"\");\n\tconst [num2, setNum2] = useState(\"\");\n\t//#18A Create sum in state\n\tconst [sum, setSum] = useState();\n\n\t// #11 Create my onclick function and console.log to make sure it's wired\n\tconst add1 = () => {\n\t\t// #12 Have the problem where I can't access what's been typed in\n\t\t// #17 add console.log(num1, num2) to make sure they come out when the button is pressed\n\t\t// #18B Use setSum to make sure we can show result\n\t\t// #20 Get rid of all the code in this function and start from scratch to use endpoint instead\n\t\t// #21 Look at our backend code to get the proper route & figure out how to send data (route params)\n\t\t// #22 Use URL/endpoint/route template literal to dump in numbers from inputs (state) to the URL\n\t\tfetch(`http://localhost:3001/add/${num1}/${num2}`)\n\t\t\t.then((res) => {\n\t\t\t\t// #23 Data comes back as response that we extract the text from\n\t\t\t\treturn res.text();\n\t\t\t})\n\t\t\t.then((text) => {\n\t\t\t\t// #24 Update the state based off the now accessible text from the response\n\t\t\t\tsetSum(text);\n\t\t\t});\n\t};\n\n\tconst add2 = () => {\n\t\tfetch(`http://localhost:3001/add2?firstNum=${num1}&secondNum=${num2}`)\n\t\t\t.then((res) => {\n\t\t\t\treturn res.text();\n\t\t\t})\n\t\t\t.then((text) => {\n\t\t\t\tsetSum(text);\n\t\t\t});\n\t};\n\n\tconst add3 = () => {\n\t\tfetch(`http://localhost:3001/add3`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({ num1: num1, num2: num2 }),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t},\n\t\t})\n\t\t\t.then((res) => {\n\t\t\t\treturn res.json();\n\t\t\t})\n\t\t\t.then((data) => {\n\t\t\t\tconsole.log(data);\n\t\t\t\tsetSum(data.sum);\n\t\t\t});\n\t};\n\n\t// let sumToShow = null;\n\t// if (sum) {\n\t// \tsumToShow = <p>Sum: {sum}</p>;\n\t// }\n\n\treturn (\n\t\t<div className=\"App\">\n\t\t\t{/* #6 Add container & hello world to make sure CSS/bootstrap is working */}\n\t\t\t<div className=\"container\">\n\t\t\t\t<h1>Hello World</h1>\n\t\t\t\t{/* {sumToShow} */}\n\t\t\t\t{/* #19 Add sum (ternary operator optional) to show up from state when we change it in the onClick */}\n\t\t\t\t{sum ? <p>Sum: {sum}</p> : null}\n\t\t\t\t{/* #8 Add labels for input */}\n\t\t\t\t<label>Num1: </label>\n\t\t\t\t{/* #7 Create two inputs with type number & className for styling */}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t//#15 Add onChange that sets event target value into state\n\t\t\t\t\t\tsetNum1(event.target.value);\n\t\t\t\t\t}}\n\t\t\t\t\tvalue={num1} //#16 Add value from state\n\t\t\t\t/>\n\t\t\t\t<label>Num2: </label>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tsetNum2(event.target.value);\n\t\t\t\t\t}}\n\t\t\t\t\tvalue={num2}\n\t\t\t\t/>\n\t\t\t\t{/* #9 Create button with classNames for styling */}\n\t\t\t\t{/* #10 Add my onClick */}\n\t\t\t\t<button className=\"btn btn-primary\" onClick={add1}>\n\t\t\t\t\tAdd em up 1\n\t\t\t\t</button>\n\t\t\t\t<button className=\"btn btn-primary\" onClick={add2}>\n\t\t\t\t\tAdd em up 2\n\t\t\t\t</button>\n\t\t\t\t<button className=\"btn btn-primary\" onClick={add3}>\n\t\t\t\t\tAdd em up 3\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "3297f1fc9276b8e86cb1057e203d6472", "score": "0.56814766", "text": "function addsubOne(what) {\n var num = button.getAttribute('firstpage')\n if ( what == 'plus') {\n num = button.getAttribute('nextpage')\n } else if (what == 'minus') {\n num = button.getAttribute('prevpage')\n }\n if (num == 'null') {\n if ( what == 'plus') {\n num = button.getAttribute('firstpage')\n } else if (what == 'minus'){\n num = button.getAttribute('lastpage')\n }\n }\n wholepath = button.getAttribute('nextpage')\n \n // Clean content of page \n cleanUp(0)\n // get the new api url \n request.open('GET',num, true)\n request.send() \n}", "title": "" }, { "docid": "b4582e3119f13adbf7838c373deb6b14", "score": "0.56432635", "text": "function getFactFetch(){\n let number = numberInput.value;\n \n if(number != ''){\n fetch('http://numbersapi.com/'+number)\n .then(response => response.text())\n .then(data => {\n fact.style.display = 'block';\n factText.innerText = data;\n })\n .catch(err => console.log(err)); \n }\n }", "title": "" }, { "docid": "f2a4260c2c64dc84d3f9545960282728", "score": "0.5624772", "text": "function submitTotal() {\n let totalToSend = {\n firstNumber: $('#firstNumber').val(),\n secondNumber: $('#secondNumber').val(),\n operator: operator \n }\n console.log(' sending submitTotal:', totalToSend);\n $.ajax({\n type: 'POST',\n url: '/equations',\n data: totalToSend\n }).then(function (response) {\n // console.log('back from POST:', response);\n // update DOM with new equations\n // empty number inputs\n $('#submitButton').val(''); \n appendTotal();\n })\n \n}", "title": "" }, { "docid": "a41c7f834ecb50b99085cbfd49ebae67", "score": "0.56235796", "text": "function submitApi(e) {\n\t\te.preventDefault();\n\n\t\tlet ColorNumOne = e.currentTarget.ColorNumOne.value\n\t\tlet ColorNumTwo = e.currentTarget.ColorNumTwo.value\n\t\tlet ColorNumThree = e.currentTarget.ColorNumThree.value\n\t\tlet ColorNumFour = e.currentTarget.ColorNumFour.value\n\t\tlet userHandle = users.name;\n\t\tlet uID = user.uid;\n\t\t\tconsole.log('color1', ColorNumOne);\n\t\t\tconsole.log('color2', ColorNumTwo);\n\t\t\tconsole.log('color3', ColorNumThree);\n\t\t\tconsole.log('color4', ColorNumFour);\n\t\t\tconsole.log('userHandle', userHandle);\n\n\t\taxios.get(`https://alteriormotive.herokuapp.com/submit?ColorNumOne=${ColorNumOne}&ColorNumTwo=${ColorNumTwo}&ColorNumThree=${ColorNumThree}&ColorNumFour=${ColorNumFour}&userHandle=${userHandle}&userID=${uID}`)\n\t\t.then(function(res) {\n\t\t // do something, maybe reroute\n\t\t console.log('response', res)\n\t\t return res;\n\t\t})\n\t}", "title": "" }, { "docid": "b0bb234481f26bb96dc5364f2d0a15c9", "score": "0.5609658", "text": "function generateAns(pageID, pageNum, event, isAjax) {\n var _url = '/api/v1/experiment/' + pageNum;\n // var submitBtn = pageID + \" input:submit\";\n // var $submitBtn = $(submitBtn);\n // var form = pageID + \" form\";\n // var $form = $(form);\n if (isAjax) return;\n isAjax = true;\n $.mobile.loading(\"show\");\n event.preventDefault();\n event.stopPropagation();\n $.get(_url, function(data) {\n console.log(data);\n console.log(typeof(data));\n var html = \"\";\n $.each(data, function(key, val) {\n $.each(data[key], function(index, val) {\n data[key][index] = data[key][index].toFixed(2);\n // console.log(data[key][index]);\n });\n console.log(typeof(data[key]));\n if (typeof(data[key]) == \"number\") {\n var v = data[key];\n } else {\n var v = data[key].join();\n };\n\n var li = '<li class=\"ui-field-contain ui-li-static ui-body-inherit\"><label>' + key + ':</label><div class=\"ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset\"><input type=\"text\" name=' + key + ' value=' + v + '></div></li>';\n html += li;\n });\n var $answersList = $(pageID).find('.answersList');\n $(html).appendTo($answersList);\n $answersList.listview('refresh');\n\n return false;\n });\n isAjax = false;\n $.mobile.loading(\"hide\");\n return isAjax;\n}", "title": "" }, { "docid": "d586fd309fa8229c387a9ac13da2b0b9", "score": "0.5602906", "text": "function get_workers_for_page(page_number)\n{\n fade_in_loader_and_fade_out_form(\"loader\", \"list_table\"); \n var bearer = \"Bearer \" + localStorage.getItem(\"worker_access_token\"); \n url = worker_api_workers_get_workers_list_url + page_number;\n send_restapi_request_to_server_from_form(\"get\", url, bearer, \"\", \"json\", get_workers_for_page_success_response_function, get_workers_for_page_error_response_function);\n}", "title": "" }, { "docid": "69b3b4bc448d36a6b2c13de97823327b", "score": "0.5599308", "text": "function postIt() {\n var data = {\n name: input.value(),\n num: numput.value(),\n }\n // Post the data to a route and also a callback\n httpPost('/save', data, getResponse);\n}", "title": "" }, { "docid": "d2e90517111702b309c643958a50d6eb", "score": "0.5577036", "text": "function ProcessRequest(response) {\n //parse json object to a dictionary\n var json_data = JSON.parse(response);\n \n //get the formatted address from the dictionary\n var lol = json_data.results[0]['formatted_address'];\n\n //splits the string into fields and store it in an array\n var add = lol.split(',');\n window.document.getElementById(\"street\").value = \"add[0]\";\n window.document.getElementById(\"area\").value = add[2];\n document.getElementById(\"city\").value = add[3];\n document.getElementById(\"country\").value = add[4];\n //document.getElementById(\"demo\").\n //response;\n }", "title": "" }, { "docid": "5fd9c7346aaf9f24266c11bb23f16ef1", "score": "0.55482626", "text": "function currencyConverter(){\t\t\n\t\tvar amount = document.getElementById(\"input1\").value;\n\t\tvar fromcurrency = document.getElementById(\"from_currency\");\n\t\tfromcurrency = fromcurrency.options[fromcurrency.selectedIndex].value;\n\t\tvar tocurrency = document.getElementById(\"to_currency\");\n\t\ttocurrency = tocurrency.options[tocurrency.selectedIndex].value;\n\t\tvar query = fromcurrency + \"_\" + tocurrency;\n\t\t\n\t\tvar url = \"https://free.currconv.com/api/v7/convert?q=\" + query + \"&compact=ultra&apiKey=ecd96f38ab9cbbe978b7\";\n\t\t\n\t\t// This is to make api call for currency converter.\n\t\tvar request = new XMLHttpRequest()\n\nrequest.open('GET', url, true)\nrequest.onload = function () {\n var data = JSON.parse(this.response);\n if (request.status >= 200 && request.status < 400) {\n\t document.getElementById(\"displayvalue\").innerHTML = parseInt(amount) * data[query];\n } else {\n alert('error')\n }\n}\n\nrequest.send();\n\t\t\n\t}", "title": "" }, { "docid": "681c095681b1a61b354c16c497194351", "score": "0.55429786", "text": "function calculateNumbers() {\n //Create object with numbers/operator entered\n console.log('in calculateNumbers');\n console.log('number 1:', numberOne, 'number 2:', numberTwo);\n var calculationVariables = {\n numberOne: numberOne,\n type: type,\n numberTwo: numberTwo,\n operator: operator\n }\n console.log('operator:', operator);\n //POST\n $.ajax({\n method: 'POST',\n url: '/calculate',\n data: calculationVariables\n //Appends result from server to DOM\n }).done(function(response) {\n console.log('Success!')\n $('#result').text(response.result);\n $('#history').append('<td>', response.numberOne, ' ', response.operator, ' ',\n response.numberTwo, ' = ', response.result, '</td>');\n }).fail(function(message) {\n console.log('Error', status)\n });\n //Clear fields\n \n}", "title": "" }, { "docid": "3f26a62e6cc15292028267bb324646ab", "score": "0.55342567", "text": "function handler(req, res){\n\n var form = '';\n\n if(req.method == \"GET\"){ \n \n form = '<!doctype html> \\\n<html lang=\"en\"> \\\n<head> \\\n <meta charset=\"UTF-8\"> \\\n <title>Form Calculator Add Example</title> \\\n</head> \\\n<body> \\\n <form name=\"myForm\" action=\"\" onsubmit=\"return ajax();\"method=\"post\">\\\n <input type=\"text\" name=\"A\"> + \\\n <input type=\"text\" name=\"B\"> = \\\n <span id=\"result\"></span> \\\n <br> \\\n <input type=\"submit\" value=\"Submit\"> \\\n </form> \\\n <script> \\\n function ajax(){ \\\n var a = document.forms[\"myForm\"][\"A\"].value; \\\n var b = document.forms[\"myForm\"][\"B\"].value; \\\n var formdata = \"A=\"+a+\"&B=\"+b; \\\n \\\n xmlhttp = new XMLHttpRequest(); \\\n xmlhttp.onreadystatechange=function(){ \\\n if(xmlhttp.readyState==4 && xmlhttp.status==200){ \\\n document.getElementById(\"result\").innerHTML=xmlhttp.responseText; \\\n }; \\\n }; \\\n xmlhttp.open(\"POST\",\"\",true); \\\n xmlhttp.send(formdata); \\\n return false; \\\n } \\\n </script> \\\n</body> \\\n</html>';\n\n //respond\n res.setHeader('Content-Type', 'text/html');\n res.writeHead(200);\n res.end(form);\n \n } else if(req.method == 'POST'){\n\n //read form data\n req.on('data', function(chunk) {\n\n //grab form data as string\n var formdata = chunk.toString();\n\n //grab A and B values\n var a = eval(formdata.split(\"&\")[0]);\n var b = eval(formdata.split(\"&\")[1])\n\n var result = calc(a,b);\n\n //fill in the result and form values\n form = result.toString();\n\n //respond\n res.setHeader('Content-Type', 'text/html');\n res.writeHead(200);\n res.end(form);\n\n });\n\n } else {\n res.writeHead(200);\n res.end();\n };\n\n}", "title": "" }, { "docid": "77ebc993986d86312b20f564e4c70a18", "score": "0.5532947", "text": "function getInputForPhone(inputId,isUpdate,totalId,price){\n const phoneInput=document.getElementById(inputId);\n let phoneInputvale=phoneInput.value;\n \n if(isUpdate==true){\n const number=parseInt(phoneInputvale)+1;\n phoneInputvale=number;\n }\n else if(isUpdate==false && phoneInputvale>0){\n const number=parseInt(phoneInputvale)-1;\n phoneInputvale=number;\n \n }\n phoneInput.value=phoneInputvale;\n \n const money=document.getElementById(totalId);\n const moneyValue=parseInt(money.innerText);\n const moneyTotal=price*phoneInputvale;\n money.innerText=moneyTotal;\n getTotal();\n \n\n}", "title": "" }, { "docid": "432ae8417b11c2bd985ce74ba127221e", "score": "0.55210346", "text": "function callAPI(inputPara) {\n\tvar url = 'http://127.0.0.1:5000/';\n\t\n\t// Clearing the eventText variable\n\tquestionText = \"\";\n\n\t// Request Lua server to get questions\n\tmakeAJAXCall(url, inputPara);\n}", "title": "" }, { "docid": "5dd6d50b1051302f3547dcbadb7f1acc", "score": "0.5499736", "text": "function GetAPPendingExp(val) {\n var url1 = 'Invoice.ashx?func=10&preappr=' + val;\n GetAPPendingExpenses(url1, 'pendParkCnt');\n}", "title": "" }, { "docid": "92e1483188b0c6e0a19dc5c693a62cad", "score": "0.5492124", "text": "async function addRows(){\n await fetchAPI(\"\\\"/rest/api/frontEnd\\\"\")\n}", "title": "" }, { "docid": "10789b51b335ac2a0940d57f3f1ae509", "score": "0.54892427", "text": "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.GET) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"GET is not supported, perform a POST to add GL Master Entries\"\n\t\t\t}));\n\t\t} else {\n\t\t\t//Perform Table Entry to be created in GL Master Table\n\t\t\ttry {\n\t\t\t\t_createMasterEntry();\n\t\t\t} catch (errorObj) {\n\t\t\t\tgvTableUpdate = \"Error during table insert:\" + errorObj.message;\n\t\t\t}\n\t\t\t//Delete all entries older than 90 days\n\t\t\ttry {\n\t\t\t\t//GL Master Table\n\t\t\t\t_deleteHistoricEntries();\n\t\t\t} catch (errorObj) {\n\t\t\t\tgvTableUpdate += \"Error during deletion of historic entries:\" + errorObj.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tTableUpdateStatus: gvTableUpdate\n\t\t\t}));\n\t\t}\n\t}", "title": "" }, { "docid": "71a0922a8abe5628a6820ad7e3c1c444", "score": "0.5487482", "text": "function displayUtility() {\r\n\tjQuery.support.cors = true;\r\n\t//DISPLAY A LOADING ICON TO LET THE USER KNOW THE APPLICATION IS RUNNING\r\n\t$(\"#\" + idUtilityBill).html (\"<div style='text-align: center;'><img alt='loading animation image' title='Please wait while the utility bill information is retrieved.' src='/static_files/assets/images/preload.gif'> Please wait while the utility bill information is retrieved.</div>\");\r\n\t$(\"#\" + idUtilityBill).removeClass(\"hide\");\r\n\tscrollToAnchor(idUtilityAnchor);\r\n\r\n\t//GRAB THE ENTERED VARIABLE ON THE CURRENT WEB PAGE\r\n\tvar aNum = $(\"#\" + idAccountNo).val();\r\n\t//var sNum = aNum.substring(0, 9);\r\n\tvar lName = $(\"#\" + idLastName ).val();\r\n\tvar pCode = $(\"#\" + idPostalCode).val();\r\n\tvar pMethod = $(\"#\" + idPaymentMethod).val();\r\n\tvar strData = \"\";\r\n\r\n\t//if (aNum.length==20) {aNum = aNum.substring(0,9) + \"-\" + aNum.substring(9,18) + \"-\" + aNum.substring(18,20);}\r\n\r\n\t//CREATE THE JSON REQUEST DATA STRING\r\n\tstrData += '{\"accountType\": \"UtilityAccount\",\"accountNumber\": \"' + getFullAcctNumber() + '\",';\r\n\tstrData += '\"QAList\": [{\"question\":\"SERVICE_NUMBER\",\"answer\": \"' + aNum + '\"},';\r\n\tstrData += '{\"question\": \"LAST_NAME\",\"answer\": \"' + lName + '\"}, ';\r\n\tstrData += '{\"question\": \"POSTAL_CODE\",\"answer\": \"' + pCode + '\"}, ';\r\n\tstrData += '{\"question\": \"LAST_PAYMENT_METHOD\",\"answer\": \"' + pMethod + '\"}]}';\r\n\r\n\t//MAKE A POST TO THE REST API SERVICE\r\n\tvar strURL = strAPIHost + \"/validate\";\r\n\r\n\tvar browser = navigator.userAgent;\r\n\tvar IEversion = 99; //Give a default value for non-IE browsers\r\n\r\n\tif (browser.indexOf(\"MSIE\") > 1) { //Detects if IE\r\n\t\tIEversion = parseInt(browser.substr(browser.indexOf(\"MSIE\")+5, 5));\r\n\t}\r\n\tif (IEversion < 10) {\r\n\t\txdr = new XDomainRequest();\r\n\t\tif (xdr) {\r\n\t\t\txdr.onerror = failPost;\r\n\t\t\txdr.ontimeout = timeout;\r\n\t\t\txdr.onload = IEProcessToken;\r\n\t\t\txdr.timeout = 10000;\r\n\t\t\txdr.open('POST',strURL + '?validateRequest=' + encodeURIComponent(strData));\r\n\t\t\txdr.send();\r\n\t\t} else {\r\n\t\t\tfailpost();\r\n\t\t}\r\n\t} else {\r\n\t\t$.ajax({\r\n\t\t\ttype: 'POST',\r\n\t\t\turl: strURL,\r\n\t\t\tcrossDomain: true,\r\n\t\t\tdataType: 'json',\r\n\t\t\tdata: 'validateRequest=' + strData,\r\n\t\t\tsuccess: function (data) {\r\n\t\t\t\tprocessToken(data);\r\n\t\t\t},\r\n\t\t\terror: function (jqXHR, textStatus, errorThrown) {\r\n\t\t\t failPost();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "099a949394dbb5b2f358364a26da0ef1", "score": "0.5484784", "text": "addNewNumbers() {\n\t\tconsole.log(\"Running addNewNumbers!\")\n\n\t\tlet numbers = this.props.numbers\n\t\tlet user_id = this.props.user.id\n\n\n\t\tconsole.log(\"numbers\")\n\n\n\n\t\tfetch( this.props.urlReact + \"/\", {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tuser_id: user_id,\n\t\t\t\tfirst_number: numbers[0],\n\t\t\t\tsecond_number: numbers[1],\n\t\t\t\tthird_number: numbers[2],\n\t\t\t\tfourth_number: numbers[3],\n\t\t\t\tfifth_number: numbers[4],\n\t\t\t})\n\t\t})\n\t\t.then((response) => {\n\t\t\tconsole.log('&&&&&& ' + JSON.stringify(response))\n\t\t\treturn response.json()\n\t\t})\n\t\t.then((body) => {\n\t\t\tthis.props.updateOldTake5Numbers( JSON.stringify(body) )\n\t\t\tconsole.log('~~~~~~~~~~~~~' + JSON.stringify(body))\n\t\t});\n\n\t\t// this.props.updateOldTake5Numbers()\n\t\t// this.props.resetTake5NewNumbersArr()\n\n\n\n\t}", "title": "" }, { "docid": "ce331a6217cb3753a37e710156c3a6ac", "score": "0.54802704", "text": "function addQuery(a, b) {\n apiUrlInput.sendKeys('https://www.kimonolabs.com/api/asmpbme8?apikey=WsyckNRjMTAqCPdYCkxImCwX2jSN0sk8&kimseries=1');\n newNameInput.sendKeys('sample api');\n addQueryBtn.click();\n }", "title": "" }, { "docid": "43108c7fa2175529494b7857da20d603", "score": "0.54789805", "text": "function Calculate () {\n\tvar loanAmount = $(\"#loanAmount\").val();\n\tvar term = $(\"#term\").val();\n\tvar payment = $(\"#payment\").val();\n\tvar startValue = 0;\n\tvar toValue = -1 * payment;\n\tvar maxIter = 20; // maximum iteration\n\tvar tolerance = 0.00001; // solution is found when result is within tolerance\n\tvar i = 0; // iteration number\n\tvar inputList = [\n\t\tapi.createSingleInput('LoanAmount', loanAmount),\n\t\tapi.createSingleInput('TermInMonths', term),\n\t\tapi.createSingleInput('InterestRate', startValue)\n\t];\n\tvar Xn = startValue; // initial x-value\n\tvar Xn1 = 0;\n\tvar Fx = 0;\n\tvar F_x = 0; // derivative of function\n\t\t\t\t // it can be calculated by this formula: (F(x + h) - F(x))/h \n\t\t\t\t // you can add this function in excel \n\t\t\t\t // or call API for x + h input but this approach will double up API call number\n\t\t\t\t // it was added in excel in this case\n(function GetResultRecur() {\n\tapi.Calculate({\n\t\t'Inputs': inputList\n\t\t, 'Outputs':outputs\n\t\t, 'SaveInformation': {\n\t\t\t'Save': false\n\t\t}\n\t}, function(data){\n\t\t\t\n\t\t\tFx = data.Outputs[0].Value[0][0].Value;\n\t\t\tF_x = data.Outputs[1].Value[0][0].Value;\n\t\t\tXn1 = Xn - ((Fx - toValue) / F_x);\n\t\t\tif (Math.abs(Xn - Xn1) <= tolerance) {\n\t\t\t\t$(\"#output\").show();\n\t\t\t\t$(\"#oRate\").html((Xn * 100).toFixed(2) + \"%\");\n\t\t\t\t$(\"#oSteps\").html(i+1);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tXn = Xn1;\n\t\t\t}\n\t\t\tinputList = [\n\t\t\t\tapi.createSingleInput('LoanAmount', loanAmount),\n\t\t\t\tapi.createSingleInput('TermInMonths', term),\n\t\t\t\tapi.createSingleInput('InterestRate', Xn)\n\t\t\t];\n\t\t\t\n\n\t\t\tif (i < maxIter) {\n\t\t\t\ti++;\n\t\t\t\tGetResultRecur();\n\t\t\t};\n\t});\n\n})();\n}", "title": "" }, { "docid": "7928f5ad1571e4e76c0786fe18a9b929", "score": "0.5470466", "text": "function getCalculate(){\n const phonePrice = getInputValue('phone')*1219;\n const casePrice = getInputValue('case')*59;\n\n // subtotal price upadate\n const subtotalPrice = phonePrice+casePrice;\n document.getElementById('subtotal_price').innerText = subtotalPrice;\n\n // tax update\n const tax = parseInt((subtotalPrice/100)*10);\n document.getElementById('total_tax').innerText = tax;\n\n // total price update\n document.getElementById('total_pice').innerText = subtotalPrice + tax;\n}", "title": "" }, { "docid": "ed2593ce11de952215f6637de57e3b52", "score": "0.5468617", "text": "function getmain()\n {\n var ajr = document.getElementById('ajreq');\n ajr.respfunc =function(doc)\n {\n \n var frm = document.getElementById('storeform');\n if(typeof doc._id !== 'undefined') \n {\n \n frm.querySelector('#id').value = doc._id;\n }\n frm.querySelector('#sname').value=doc.storename;\n frm.querySelector('#curr').value = doc.maincurrency;\n frm.querySelector('#loclink').href = \"/store/locations/\"+doc._id\n } \n ajr.dataurl = \"\";\n ajr.dataurl = '/store/getmain';\n \n }", "title": "" }, { "docid": "d758762edaf37d4bde1452898b22a5fc", "score": "0.546408", "text": "function addNumbers(){\n let result;\n let num1 = Number(document.getElementById(\"add1\").value);\n let num2 = Number(document.getElementById(\"add2\").value);\n result = num1 + num2;\n document.getElementById(\"inputAdd\").setAttribute(\"value\", result);\n}", "title": "" }, { "docid": "542c25943df20a50818f9bd81bf1867c", "score": "0.5461325", "text": "function answer() {\n $.ajax({\n type: 'GET',\n url: '/calculate',\n success: function(response) {\n $('#current-number').val(response);\n clear();\n firstValue += response;\n }\n })\n}", "title": "" }, { "docid": "fab2a8f0eba1b43a0bf0f609c2bea8ee", "score": "0.54588115", "text": "async function sendApiRequest() {\n loader.style.display = \"block\";\n let response = await fetch(\n `https://opentdb.com/api.php?amount=1&type=multiple`\n );\n let data = await response.json();\n useApiData(data);\n}", "title": "" }, { "docid": "21d1a2e418a2990a86ffcc495d768b58", "score": "0.5446104", "text": "function send_request() {\n var a = document.api_keys;\n var f = document.params;\n \n // Complete it with the signature and send\n f.api_key.value = a.api_key.value;\n f.api_sig.value = calc_signature(a.api_sec.value);\n f.submit();\n}", "title": "" }, { "docid": "31b1a17f71f8ebf32dad1cce4410511a", "score": "0.5441975", "text": "function askProduct() {\n var url = api + input.value()+ apiKey ;\n loadJSON(url, gotData);\n\n}", "title": "" }, { "docid": "07aada05a40b42336e0a73e11b2cc1e5", "score": "0.54398483", "text": "function addNumbers() {\n\tlet addend1 = document.getElementById(\"addend1\").value;\n\tlet addend2 = document.getElementById(\"addend2\").value;\n\tlet addend1_parsed = parseInt(addend1);\n\tlet addend2_parsed = parseInt(addend2);\n\tconsole.log(addend1_parsed);\n\tconsole.log(addend2_parsed);\n\tlet addition = add(addend1_parsed, addend2_parsed);\n\tlet additionSt = addition.toString();\n\tconsole.log(addition);\n\tconsole.log(additionSt);\n\tsumHtml.value = additionSt;\n}", "title": "" }, { "docid": "319ad61af01753c5e8f90e20961d44be", "score": "0.5435977", "text": "function getResults() {\n let budget = document.querySelector(\"#budget\").value\n let arrayproducts = document.querySelector(\"#products\").value.split('\\n');\n\n\n let data = { \"budget\": budget };\n\n arrayproducts.forEach(function (item, index) {\n data['url' + index.toString()] = item;\n });\n\n let sendData = JSON.stringify(data);\n document.querySelector(\"#budget\").value = \"\";\n document.querySelector(\"#products\").value = \"\";\n ajaxPostRequest(\"/scanProducts\", sendData, postQuickResults);\n}", "title": "" }, { "docid": "6ace8eee3550e760e99d339d5b7e6985", "score": "0.5430732", "text": "function transmitnumber(url, number) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('POST', 'http://kayali.io:1513/', true);\n\txhr.onload = function () {\n\t\tcurrent_session_contributions += 1\n\t};\n var index = url.split(\"?\")[1]\n xhr.send(index + \",\" + number);\n\tconsole.log(\"Told db about the contents of \" + index + \" which where: '\" + number + \"'\");\n\n\t// we're greedy: try to get another number\n\taskforatarget();\n}", "title": "" }, { "docid": "2922829f03a3d9b923c467af029a0250", "score": "0.5429814", "text": "function submitBtnCalculate(e){\n e.preventDefault();\n var inputs = {};\n\n /**\n * Parse and collect inputs\n */\n\n /** parse input fields */\n $('#inputs input').each( function(){\n var id = $(this).attr('id');\n inputs[id.split('-')[id.split('-').length-1]] = $(this).val();\n });\n\n /** parse select fields */\n $('#inputs select').each( function(){\n var id = $(this).attr('id');\n inputs[id.split('-')[id.split('-').length-1]] = $(this).find(\":selected\").val();\n });\n\n /** parse button-numberselect fields */\n $('#inputs button.dropdown-toggle').each(function(){\n var id = $(this).attr('id');\n inputs[id.split('-')[id.split('-').length-1]] = $(this).attr('value');\n });\n\n\n /**\n * Make AJAX-request to server\n */\n $.getJSON($(location).attr('pathname') + '/inputs',inputs)\n .done(function(data) {\n\n\n // stop wait spinner and remove overlay class\n app.spinner.stop();\n $('#wrapper').removeClass('overlay');\n\n // get, compile and fill results template\n if (!(data === null) && (typeof data.id === 'string')) { // case where everything is alright\n\n if (data._1)\n app.helpers.compileTemplate('#results-1', '#main-results-template', data);\n\n if (data._2)\n app.helpers.compileTemplate('#results-2', '#' + data.id + '-results-2-template', data._2);\n\n if (data._3)\n app.helpers.compileTemplate('#results-3', '#' + data.id + '-results-3-template', data._3);\n\n // compile charts\n if (data._chart1){\n app.charts.create(data._chart1, '#results-11');\n }\n\n // compile charts\n if (data._chart2){\n app.charts.create(data._chart2, '#results-12');\n }\n\n // compile feedback template and add button event handler\n app.helpers.compileTemplate('#feedback', '#main-results-feedback-template', data);\n $('#btn-feedback').on('click', submitBtnFeedback);\n\n // initialize new tooltips\n $('[data-toggle=\"tooltip\"]').tooltip();\n\n } else if (!(data === null) && Array.isArray(data)){ // case where an errorMap is returned\n app.helpers.compileTemplate('#results-1','#main-results-error-template',{errors: data});\n\n } else {\n app.helpers.compileTemplate('#results-1','#main-results-error-template',{});\n }\n })\n .fail(function(e){\n // stop wait spinner and remove overlay class\n app.spinner.stop();\n $('#wrapper').removeClass('overlay');\n\n app.helpers.compileTemplate('#results-1','#main-results-servererror-template',{});\n })\n .always(function(e){\n /** re-set output containers given adjusted height */\n var $container = $('.masonry-container');\n $container.masonry({});\n /** attach event handlers for generated panels */\n $('#btn-pdf').on('click', submitGeneratePdf);\n });\n\n\n // run spinner to bridge waiting times\n app.spinner.spin($('#wrapper')[0]);\n $('#wrapper').toggleClass('overlay');\n\n\n }", "title": "" }, { "docid": "88c8d37f62b07b44d41f5763661626e7", "score": "0.54150593", "text": "function search_for_rates(url_fetch_type)\n{\n if(url_fetch_type == 1){\n var url = document.getElementById(\"previous_btn\").getAttribute(\"data-link\");\n } else if(url_fetch_type == 2){\n var url = document.getElementById(\"next_btn\").getAttribute(\"data-link\");\n } else {\n var url = worker_api_rates_search_for_rates_url + document.getElementById(\"search_form_input\").value;\n }\n fade_in_loader_and_fade_out_form(\"loader\", \"search_form\"); \n var bearer = \"Bearer \" + localStorage.getItem(\"worker_access_token\"); \n document.getElementById(\"table_body_list\").innerHTML = \"\";\n document.getElementById(\"pagination_buttons\").innerHTML = \"\";\n show_log_in_console(\"url: \" + url);\n send_restapi_request_to_server_from_form(\"get\", url, bearer, \"\", \"json\", search_for_rates_success_response_function, search_for_rates_error_response_function);\n\n}", "title": "" }, { "docid": "6c004a916cab925980facc5cf4e8f708", "score": "0.54118073", "text": "function submitUserInput() {\n $('#submit-button').on('click', function(event) {\n event.preventDefault();\n initializeView();\n const caseName = $('#victimNameId').val(); \n const resultsCount = $('#searchResultsCounts').val(); \n makeListenAPIRequest(caseName, resultsCount);\n makeNewsAPIRequest(caseName, resultsCount);\n makeRedditAPIRequest(caseName, resultsCount);\n //manageView(listenResults, newsResults, redditResults);\n });\n}", "title": "" }, { "docid": "e6f1eecddca88bc015ce114194919699", "score": "0.5405985", "text": "async function addRow(){\n //Getting values\n const name = document.getElementById('name').value;\n const age = parseInt(document.getElementById('age').value, 10 );\n const classes = document.getElementById('classes').value;\n\n// validation of inputs here\n if((name != null && name.length !== 0 && \"string\" === typeof(name)) &&\n (classes != null && classes.length !== 0 && \"string\" === typeof(classes))) {\n //Create post\n postData(name, age, classes);\n const table = document.getElementsByTagName('table')[0];\n const newRow = table.insertRow(1);\n\n\n //Adding new row\n const cell1 = newRow.insertCell(0);\n const cell2 = newRow.insertCell(1);\n const cell3 = newRow.insertCell(2);\n\n //Adding new data into new row\n cell1.innerHTML = name;\n cell2.innerHTML = age;\n cell3.innerHTML = classes;\n }\n else{\n console.log(\"Invalid Input detected\")\n throw new Error\n }\n /* here's what should happen. I kind-of see what you're doing.\n 1) extract and validate inputs (not empty, no injections, correct data type varying on your input tag's attributes)\n 2) call the fetchAPI function -- see comment below. It should be in a function.\n */\n\n\n}", "title": "" }, { "docid": "c77061bc70334f161709e00c29c93319", "score": "0.5396593", "text": "function callajaxreq(inputid, type, url, resultsid){\n \n // Setup AJAX request onclick\n var query_input = document.getElementById(inputid);\n\n query_input.onkeyup = function(event){\n \n var query_value = document.getElementById(inputid).value;\n var request = $.ajax({\n url: url,\n type: \"GET\",\n data: { params : query_value },\n dataType: \"html\"\n }); //end var request\n \n request.done(function( msg ) {\n $( \"#\" + resultsid ).html( msg );\n }); //end request.done\n\n }// end query_input.onkeyup\n\n} //end callajaxreq", "title": "" }, { "docid": "fbe89097908d82bf0a5beacb9119c60b", "score": "0.5393285", "text": "function myFunction(){\n let url = 'https://newsapi.org/v2/everything?' +\n 'q='+inputele.value+'&' +\n 'pageSize=80&' +\n 'from=2020-04-10&' +\n 'sortBy=popularity&' +\n 'apiKey=f95bc5db28994a1da7895f7e38cdb7f3';\n display(url);\n \n}", "title": "" }, { "docid": "15d2c7c092a0b6dd47504ebc19da7ead", "score": "0.5385502", "text": "function generate_po_number() {\n $.ajax({\n url: \"getPONoIncrement.htm\",\n type: \"POST\",\n cache: false,\n async: false,\n data: ({uid: \"dummy\"}),\n success: function (poNo) {\n //alert(poNo);\n $(\"#poNumber\").val(poNo);\n }, complete: function (data) {\n }\n });\n }", "title": "" }, { "docid": "3b5319f927f46b6882c1480324f095f8", "score": "0.53851223", "text": "function postToApi(urlGet, url){\n\t\t\t\t\t\tRequest({\n\t\t\t\t\t\t\t//TODO :: Change the url from a local API to a one hosted online!\n\t\t\t\t\t\t\turl: 'http://127.0.0.1:8000/publishers/' + urlGet + '/?format=json',\n\t\t\t\t\t\t\tonComplete: function(response) {\n\t\t\t\t\t\t\t\t//When we get no response from server, set the badge to hidden, show default screen\n\t\t\t\t\t\t\t\tif(response.json[0] == undefined){\n\t\t\t\t\t\t\t\t\tbutton.badge = '';\n\t\t\t\t\t\t\t\t\tverifiedOrNot = \"No data\";\n\t\t\t\t\t\t\t\t\tworker.port.emit(\"changeView\", verifiedOrNot, DOAJurl);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t//Otherwise, we have a responce. Find which of the given journals matches the URL.\n\t\t\t\t\t\t\t\t\tDOAJapproved = false;\n\t\t\t\t\t\t\t\t\tOASPAapproved = false;\n\t\t\t\t\t\t\t\t\tDOAJurl = '';\n\t\t\t\t\t\t\t\t\tfor (var i = response.json.length - 1; i >= 0; i--) {\n\t\t\t\t\t\t\t\t\t\tif(response.json[i][\"URL\"].substring(1, response.json[i][\"URL\"].length - 1) == '/'){\n\t\t\t\t\t\t\t\t\t\t\tvar apiURL = response.json[i][\"URL\"].substring(0, response.json[i].length - 1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tvar apiURL = response.json[i][\"URL\"];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//Set the variables to the ones given by the API\n\t\t\t\t\t\t\t\t\t\tif(url.indexOf(apiURL) > -1){\n\t\t\t\t\t\t\t\t\t\t\tDOAJapproved = response.json[i][\"DOAJapproved\"];\n\t\t\t\t\t\t\t\t\t\t\tOASPAapproved = response.json[i][\"OASPAapproved\"];\n\t\t\t\t\t\t\t\t\t\t\tDOAJurl = response.json[i][\"DOAJurl\"];\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tchangeBadge(DOAJapproved, OASPAapproved);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).get();\n\t\t\t\t\t}", "title": "" }, { "docid": "3fc2209dc5f50e3d08a79fbf97f2d264", "score": "0.5380966", "text": "function numberFormatsEndpoint(){\n request.get({\n headers: {\n 'content-type': 'application/json',\n 'arena_session_id': accessToken\n },\n url: 'https://api.arenasolutions.com/v1/items/numberformats',\n body: JSON.stringify({\n \"email\": email,\n \"password\": password,\n \"workspaceId\": workspace\n })\n }, individualNumberFormats);\n}", "title": "" }, { "docid": "0663eff533cc4059bedbce9de79630a2", "score": "0.5377616", "text": "handleSubmit(){\n console.log('Number entered : ' + number);\n console.log('Delay entered : ' + delay);\n axios.post(api_url + '/call', {\n number: number,\n delay: delay\n }).then(function(response){\n console.log('Request successful');\n }).catch(function(err){\n console.log('Error occured : ' + err);\n });\n }", "title": "" }, { "docid": "48e072ac3d74796363d57fca24c8b98c", "score": "0.5365427", "text": "function doMath(){\n $.ajax({\n type: 'POST',\n url: '/calculate',\n data: values,\n success: function(response){\n $('#resultVal').text(response.result);\n },\n error: function(error){\n alert('Uh oh');\n }\n });\n }", "title": "" }, { "docid": "6ed6392d010be7580b8478be402886ad", "score": "0.536184", "text": "function GetPendingExp(val) {\n var url1 = 'Invoice.ashx?func=9&preappr=' + val;\n GetPendingExpenses(url1, 'pendParkCnt');\n}", "title": "" }, { "docid": "71315f777c256199769d441cb16200cd", "score": "0.5360749", "text": "function createURL() {\n URL = \"https://api.yummly.com/v1/api/recipes?_app_id=87e47442&_app_key=11e4aadcc3dddb10fa26ae2968e1ce03&q=\" + userInput + allergyRequest + dietRequest + \"&maxResult=20\";\n callAjax(URL);\n }", "title": "" }, { "docid": "83e021e6b32ff8129f5345622d113f48", "score": "0.5360122", "text": "function makeRequest() {\r\n qs(\"#joke h4\").textContent = \"Response Loading ...\";\r\n id(\"response\").innerHTML = \"\";\r\n qs(\"#joke button\").disabled = true;\r\n let number = qs(\"#joke input\").value;\r\n\r\n let url = BASE_URL + \"/\" + number;\r\n fetch(url)\r\n .then(checkStatus)\r\n .then(resp => resp.json())\r\n .then(processData)\r\n .catch(handleRequestError);\r\n }", "title": "" }, { "docid": "80270a80175ec7115f0069621ca4c4cf", "score": "0.5359308", "text": "function getValues() {\n // get values from the page\n let fizzValue = document.getElementById('startValue').value;\n let buzzValue = document.getElementById('endValue').value;\n\n // need to validate input\n // parse into Integers\n fizzValue = parseInt(fizzValue);\n buzzValue = parseInt(buzzValue);\n\n if (Number.isInteger(fizzValue) && Number.isInteger(buzzValue)) {\n // call fizzBuzz\n let fbArray = fizzBuzz(fizzValue, buzzValue);\n // call displayNumbers \n displayData(fbArray);\n } else {\n alert(\"You must enter integers\");\n }\n}", "title": "" }, { "docid": "0d033cd75bf6c30c02b65b345708fb87", "score": "0.53401613", "text": "function sendCalcuInfo(event) {\n //event.preventDefault();\n let newFirstNumber = firstNumber;\n let newSymbol = symbol;\n let newSecondNumber = secondNumber;\n let newSolution = solution;\n\n// requires user to fill in all feilds before request to server is sent\n if (newFirstNumber == '' || newSecondNumber == '') {\n alert('Please fill in all fields')\n return false;\n }\n console.log(`Sending calculation info firstNumber: ${newFirstNumber} \n operation: ${newSymbol} secondNumber: ${newSecondNumber}`);\n\n $.ajax({\n method: 'POST',\n url: '/calculationinfo',\n data: {\n firstNumber: newFirstNumber,\n operation: newSymbol,\n secondNumber: newSecondNumber,\n solution: newSolution\n }\n }).then(function (response) {\n console.log('sent calculation info');\n // gets the calculation from the server once the calculation info is received\n getCalcutionSolution();\n })\n\n}", "title": "" }, { "docid": "043acaaebe92df6093c6cb422ef326de", "score": "0.5327068", "text": "function onClickButtonDice() {\r\n // console.log(\"IM button Dice\");\r\n // console.log(\"I will read data below : \");\r\n // onLoadingPage(); //call function on Loading\r\n\r\n // if input data success i will call api\r\n if (validateData()) {\r\n readData(); // read data from action input\r\n callNewDiceAPI(); // call api to take new dice\r\n };\r\n}", "title": "" }, { "docid": "43932db8d81f0e5f023db6ce92cf5e02", "score": "0.5326221", "text": "function send(op, num1, num2=0) {\n let url = \"/calculate/op/\" + op + \"/num1/\" + num1 + \"/num2/\" + num2;\n console.log(url);\n $.get(url, success);\n}", "title": "" }, { "docid": "1cbd0809a4c98b071cf7a355961108ef", "score": "0.5318203", "text": "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method !== $.net.http.GET) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"Only GET Operation is supported, \" +\n\t\t\t\t\t\"with parameters sapDocument, fiscalYear(YYYY), \" +\n\t\t\t\t\t\"companyCode, postingDate(YYYYMMDD), optionally\"\n\t\t\t}));\n\t\t} else if ($.request.method === $.net.http.GET) {\n\t\t\t//Perform Read to get entries\n\t\t\ttry {\n\t\t\t\t_getEntries();\n\t\t\t} catch (errorObj) {\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\tresult: gvErrorMessage\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "2d6161010dd51523384988c3e5b86aec", "score": "0.5301743", "text": "function add() {\n var num1 = parseInt(document.getElementById(\"number1\").value)\n var num2 = parseInt(document.getElementById(\"number2\").value)\n var result = num1 + num2\n cleanForm()\n addResultToTable(num1, num2, result)\n addResultToStorage(num1, num2, result)\n\n}", "title": "" }, { "docid": "dca9124db2eb6e4aae7cbdc0005d8c13", "score": "0.5301599", "text": "function submitFlight() {\n xmlhttpPost(URL_SUBMIT, null, \"ADD\");\n}", "title": "" }, { "docid": "c9433eb4e34852cadb2ae0139cc3d19b", "score": "0.5274602", "text": "async function getNewRequests() {\n\tvar params = `type=${document.querySelector('#type').value}&description=${document.querySelector('#desc').value}&amount=${document.querySelector('#amt').value}`;\n\t(async () => {\n \t\tconst rawResponse = await fetch('/Project_1/JSONServlet/newreq.json', {\n \t\tmethod: 'POST',\n \t\t\theaders: {'Content-Type': 'application/x-www-form-urlencoded'},\n\t \tbody: params\n\t });\n\t\tawait rawResponse.text();\n\t\t\n\tclearHtml();\n\tgetRequests();\n\t\n\t})();\n\t\n}", "title": "" }, { "docid": "34c8885735d811dd6d7f389584d567f5", "score": "0.5252714", "text": "function callApi(url, request, measureType, fDate, tDate, displayFn) {\n// Récupération de la dernière valeur d'un type de mesure\n //Construction de l'url selon les appels (avec ou sans dates)\n if (fDate !== null && tDate !== null) {\n urlFull = url + '/' + request + '?measure-type=' + measureType + '&start-date=' + fDate + '&end-date=' + tDate;\n } else {\n urlFull = url + '/' + request + '?measure-type=' + measureType;\n }\n fetch(urlFull).then(function (response) {\n response.json().then(function (result) {\n //Execution de la fonction d'affichage envoyée en paramètre\n displayFn(result);\n });\n }).catch(function (error) {\n console.log('Il y a eu un problème avec la récupération de la dernière mesure ' + error.message);\n })\n}", "title": "" }, { "docid": "c1f157143cf7424ba79b592065ff2616", "score": "0.52523726", "text": "function addapikey(){\n\tcall('[[API]]'+'act=apikey&do=add');\n}", "title": "" }, { "docid": "62798484b7d80649f9b81cd5e95b03e1", "score": "0.5249989", "text": "function suma(){\n\tlet p1=document.getElementById(\"x\").value;\n let p2=document.getElementById(\"y\").value;\n let data = {\n x:p1,\n y:p2,\n op:\"+\"\n }\n \n fetch(URL, {mode: \"cors\", method:\"POST\", body:JSON.stringify(data), headers: new Headers({\n \"Content-Type\": \"application/json\",\n \"Access-Control-Allow-Origin\":\"*\"\n })})\n .then(response=>response.json()) \n .catch(error=>console.error(\"Error\",error))\n .then(datos=>document.getElementById(\"txt\").value = datos.resultado);\n\t}", "title": "" }, { "docid": "eab8e7b9706493668b9686310a8808c2", "score": "0.5248286", "text": "function sumNumbers(args) {\n let firstNum=document.getElementById('firstNumber').value;\n let secondNum=document.getElementById('secondNumber').value;\n\n let sum=Number(firstNum)+Number(secondNum);\n\n document.getElementById('result').innerHTML=sum;\n}", "title": "" }, { "docid": "f73fd6e27b790fa06a68893fecf01bce", "score": "0.52477854", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n \n }", "title": "" }, { "docid": "483d3e6dd0b74d96dddd749f762d6fd9", "score": "0.52381027", "text": "function performFunction() {\n let today = new Date();\n let date =\n (today.getMonth() + 1) + \"-\" + today.getDate() + \"-\" + today.getFullYear();\n const zipCode = document.getElementById(\"zip\").value;\n console.log(zipCode);\n const feelings = document.getElementById(\"feelings\").value;\n console.log(feelings);\n let url = baseURL + zipCode + apiKey + units;\n console.log(url);\n getWeather(url).then(function (data) {\n console.log(data);\n postData(\"/add\", {\n date: date,\n icon: data.weather[0].icon,\n city: data.name,\n temp: data.main.temp,\n feelings: feelings,\n });\n updateUI();\n });\n}", "title": "" }, { "docid": "851c4f3ef2e664aa8bfa6b620f2f1502", "score": "0.5236252", "text": "function getQuestions() {\n const totalQuestions = document.getElementById('questions').value\n const categories = document.getElementById('category-selector').value\n const difficulties = document.getElementById('difficult-selector').value\n const types = document.getElementById('type-selector').value\n fetch(`https://opentdb.com/api.php?amount=${totalQuestions}&category=${categories}&difficulty=${difficulties}&type=${types}`)\n .then(response => response.json())\n .then(data => printData(data))\n}", "title": "" }, { "docid": "e0e190f1ba666ad43640542630f30661", "score": "0.5225654", "text": "function ajaxFunc() {\n\n let number = document.getElementById(\"field\").value;\n\n // STEP 1\n let xhr = new XMLHttpRequest();\n // This object is used for asynchronous requests. You will\n // be required to know some of its properties.\n\n /*\n A readyState is a property which signifies that state that\n the request is currently in.\n There are several states:\n\n 0. UNSENT : open() has not yet been called\n 1. OPENED : open() has been called\n 2. HEADERS_RECEIVED : send() has been called, and the headers of\n the response as well as the status are now available\n 3. LOADING : Downloading the response. responseText (the xhr property) holds\n partial data\n 4. DONE : The entire operation is now complete\n */\n\n // STEP 2\n xhr.onreadystatechange = function() {\n // An HTTP status code of 200, means OK\n // This means the request was processed correctly\n // and we should have acceptable data\n // readyState == 4 means that the operation is done\n if(this.readyState == 4 && this.status == 200) {\n let data = JSON.parse(xhr.responseText);\n\n // console.log(data);\n renderHTML(data);\n }\n }\n\n // STEP 3\n // Open the request\n xhr.open(\"GET\", 'https://pokeapi.co/api/v2/pokemon/' + number);\n // This URL is setup to respond with a type of application/json\n // when it receives a GET request\n // GET is an HTTP verb/method which means we will be retrieving data\n // with this request\n // We also have the url\n\n // STEP 4\n // Send the request\n xhr.send();\n}", "title": "" }, { "docid": "8f3af772a18135aea8d98491a11aad13", "score": "0.52234036", "text": "function phIntApi(page, callback) {\n\trequest.post({\n\t\turl: 'http://aserv-cloud.cloudapp.net/phapi/' + page,\n\t\tform: { token: phIntToken }\n\t}, function(err, httpResponse, body){\n\t\tcallback(body);\n\t});\n}", "title": "" }, { "docid": "dfd1687d2201582aae56d902eae113f9", "score": "0.5217754", "text": "function wordRequest(url, callbackSucces, callbackError, indexButton, offset = 0, ) {\n const urlRequest = url + \"&offset=\" + offset;\n let request = new XMLHttpRequest();\n request.open('GET', urlRequest, true);\n request.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n request.addEventListener('readystatechange', function() {\n if (request.readyState === XMLHttpRequest.DONE) {\n if (request.status === 200) {\n const response = JSON.parse(request.responseText);\n if (response['count'] !== 0) {\n nbPages = Math.ceil(response['count']/25);\n nbListOfButton = Math.ceil(nbPages/nbButtonPerPage);\n callbackSucces(response, indexButton, offset);\n }\n else {\n callbackError('Pas de réponse pour cette valeur');\n } \n }\n else {\n callbackError(request.statusText);\n }\n }\n })\n request.send();\n}", "title": "" }, { "docid": "66293abc411b0889c94861ae7e6b222e", "score": "0.5213353", "text": "function mySubmit() {\n\n // Getting values from input boxes and storing in variables\n const $startNum = document.getElementById('startNum').value;\n const $endNum = document.getElementById('endNum').value;\n const $stepNum = document.getElementById('stepNum').value;\n\n // If statement to check condition of returned value\n if (isEmpty($startNum, $endNum, $stepNum) === true) {\n\n // Display values to web page\n document.getElementById('startOutput').innerHTML = 'The generated array is ' + getArray($startNum, $endNum, $stepNum);\n document.getElementById('endOutput').innerHTML = 'The sum is ' + getSum(getArray($startNum, $endNum, $stepNum));\n document.getElementById('stepOutput').innerHTML = 'The binary of absolut element values are: ' + getBinary(getArray($startNum, $endNum, $stepNum));\n }\n}", "title": "" }, { "docid": "a47af1c5d91d611a9fc3317ed40ba934", "score": "0.5211881", "text": "function userInput(id, param, input) {\n $.post(`/api/${id}/${param}/${input}`, function () {\n console.log('created');\n })\n .done(function (data) {\n console.log(data);\n $.get(`/api/market-data/${id}`, function (body) {\n marketInfoGenerator(body);\n console.log('updated');\n })\n .fail(function () {\n alert(\"error\");\n });\n })\n .fail(function (err) {\n console.log(err);\n })\n\n }", "title": "" }, { "docid": "9b4441e9aec549266155ca777769c751", "score": "0.52117836", "text": "function get_latlng_fields(number)\r\n {\r\n var poststr= \"number=\"+number;\r\n \tmakePOSTRequest('src/php/manage_get_latlng_fields.htm', poststr); \r\n }", "title": "" }, { "docid": "a0e3272bcb2ab7d65af99b6814d1d504", "score": "0.5207452", "text": "function assignNumbers(event) {\n event.preventDefault();\n let assign = 'yes';\n\n fetch('/assign', {\n method: 'POST',\n body: JSON.stringify({'service_name': service_name})\n }).then(function (response) {\n return response.json();\n }).then(function (service) {\n console.log('GET response5:');\n console.log(service.service_name);\n document.getElementById('assign_status' ).innerHTML += '<p> Numbers successfully assigned </p>';;\n });\n}", "title": "" }, { "docid": "7d5a4598e154c4fe7324dc709496626f", "score": "0.5203494", "text": "function process_form(GET, response) { //creating function with variables GET and response\n if (typeof GET['purchase'] != 'undefined') { // if what is written in the textbox is defined\n for (i in products) { // for whatever the product number is\n let q = GET[`quantity_textbox${i}`]; // q is equal to the quantity able to get from the textbox for that product\n if (isNonNegInt(q)) { //if quantity is an integer\n receipt += eval('`' + contents + '`'); // render template string\n } else { // if quantity is not an integer\n receipt += `<h3><font color=\"red\">${q} is not a valid quantity for ${model}!</font></h3>`; // say it is not a valid quantity\n }\n }\n response.send(receipt); //sending the receipt\n response.end(); //ending the response\n }\n}", "title": "" }, { "docid": "da2950c5f781699a4251b580424b6d2b", "score": "0.5194165", "text": "function makeOffer() {\n var amount = $(\"#myOffer\").val();\n $.get(\"http://52.57.228.6//man2API/php/BankPhp.php?what=sell&amount=\" + amount + \"&apikey=7e615a98c167b5592497d27b4f1d80af\", function (data) {\n update();\n $(\"#myOffer\").val(\"\");\n });\n}", "title": "" }, { "docid": "4a221c1e9d5c798b866c99d234327bd4", "score": "0.5189823", "text": "async function addName() {\n try {\n let name = document.getElementById('name').value;\n let city = document.getElementById('city').value;\n let date = document.getElementById('date').value;\n let resp = await fetch(`https://60f30ed76d44f300177888b3.mockapi.io/hlist`, { method: 'POST', body: JSON.stringify({ name, city, date }), headers: { \"Content-Type\": \"application/json\" } })\n let data = await resp.json();\n console.log(data);\n document.querySelector('form').reset();\n getList();\n\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "b0f0dbbc9762c9fcf96bfab1d6093ef6", "score": "0.5188513", "text": "function GetNewAmmount() {\n\n $.ajax({\n type: 'GET',\n url: '/api/pcl/1/',\n dataType: \"json\",\n success: function (data) {\n console.log(\"GetNewAmmount is working\");\n console.log(data['PCL_amount']);\n $(\"#amount\").text(data['PCL_amount'] * data['number_of_PCL']);\n $(\"#number_of_PCL\").text(data['number_of_PCL'])\n },\n\n error: function () {\n console.log(\"GetNewAmmount is not working\");\n }\n }\n );\n\n\n}", "title": "" }, { "docid": "4cb1a2d3ab1ed6ed9292fefdb4f6e68b", "score": "0.51883495", "text": "function addproduct(){\n\t\t\t\tvar product_name = encodeURI(document.getElementById(\"product_name\").value);\n\t\t\t\tvar product_qty = encodeURI(document.getElementById(\"product_qty\").value);\n\t\t\t\tvar product_price = encodeURI(document.getElementById(\"product_price\").value);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t var url = \"http://cs.ashesi.edu.gh/~csashesi/class2016/christian-biassey-bogart/MobileWeb/midsem_miniproj/controller.php?cmd=3&product_name=\"+product_name+\"&product_qty=\"+product_qty+\"&product_price=\"+product_price;\n var obj = sendRequest (url);\n\t\t\t if(obj.result==1){\n\t\t\t statusmessages(obj.message);\n\t\t\t $ (\"#display\").html(\"\");\n\t\t\t }\n\t\t\t else{\n\t\t\t errormessage(obj.message);\n\t\t\t }\n\t\t\t \n\t\t\t // $(\"#name\").text('');\n\t\t\t\t//$(\"#entry\").text('');\n\t\t\t }", "title": "" }, { "docid": "99efe15a97dd87eb12ab120cad7c06f6", "score": "0.51838785", "text": "function callAPI(url, elResponse) {\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function()\n {\n if(this.readyState == 4 && this.status == 200)\n {\n var response = JSON.parse(this.responseText);\n document.getElementById(elResponse).setAttribute(\"value\", response.result);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "286ea0be0c20526a33f6a8fd03188bad", "score": "0.5179735", "text": "function etsyAPI() {\n // Create AJAX Etsy request based on user submission\n $.ajax({\n url: queryEtsyURL,\n method: \"GET\"\n }).then(function (resEtsy) {\n etsyResponseObj = resEtsy;\n etsyForLoop(0);\n // Display columns, more-button once for loops start\n $(\".loadingDiv\").css(\"display\", \"none\");\n $(\"#columnone\").css(\"display\", \"inline-block\");\n $(\"#columntwo\").css(\"display\", \"inline-block\");\n $(\".btn-more\").css(\"display\", \"inline-block\");\n });\n }", "title": "" }, { "docid": "871e29e99a8762890158d13b1c029624", "score": "0.5176977", "text": "function add_number(digit) {\n\tif (result !== null) {\n\t\tresult = null;\n\t\tdocument.querySelector('#result').value = '';\n\t} else if (typeof entry_array[number_index] == \"undefined\") {\n\t\tentry_array[number_index] = '';\n\t}\n\tdocument.querySelector('#input').value += digit;\n\t//number_array[number_index] += digit;\n\tentry_array[number_index] += digit;\n\t//\talert(\"u pressed\" + digit);\n\n}", "title": "" }, { "docid": "37fad319e39a65aeec5a7968fe40e6fa", "score": "0.51757663", "text": "function addButton(){ \n document.getElementById('addExercise').addEventListener('click',function(event){\n \n \tvar addExercise = document.getElementById(\"addRoutine\");\n \tif (addExercise.name.value == \"\"){\n \t alert(\"Enter an exercise name\");\n \t return;\n \t}\n \tvar req = new XMLHttpRequest();\n \n\n \tvar query = \"/insert\";\n \tvar values = \"name=\"+addExercise.name.value+\"&reps=\"+addExercise.reps.value+\"&weight=\"+addExercise.weight.value+\"&date=\"+addExercise.date.value+\"&units=\"+addExercise.units.value;\n\t\n// console.log(values);\n\n \treq.open(\"GET\", query +\"?\"+values, true);\n \treq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n \treq.addEventListener('load', function(){\n \t\tif(req.status >= 200 && req.status < 400){\n \t\t\tvar response = JSON.parse(req.responseText);\n \t\t\tvar id = response.inserted;\n \n\t\t\t// create new row to add new exercise\n \t\t\tvar table = document.getElementById(\"table\");\n \t\t\tvar newRow = table.insertRow(-1);\n \t\t\t\n \t\t\t// append values to new row\n \t\t\tvar name = document.createElement('td');\n \t\t\tname.textContent = addExercise.name.value;\n \t\t\tnewRow.appendChild(name);\n \n \t\t\tvar reps = document.createElement('td');\n \t\t\treps.textContent = addExercise.reps.value;\n \t\t\tnewRow.appendChild(reps);\n \n \t\t\tvar weight = document.createElement('td');\n \t\t\tweight.textContent = addExercise.weight.value;\n \t\t\tnewRow.appendChild(weight);\n \n var date = document.createElement('td');\n \t\t\tdate.textContent = addExercise.date.value;\n \t\t\tnewRow.appendChild(date);\n \n console.log(addExercise.units.value);\n \t\t\tvar units = document.createElement('td');\n \t\t\n \t\t\tunits.textContent = addExercise.units.value;\n \t\t\t\n \t\t\tif(units.textContent == \"1\")\n \t\t\t \tunits.textContent = \"lbs\";\n \t\t else\n \t\t\t units.textContent = \"kgs\";\n\n \t\t\tnewRow.appendChild(units);\n \n \n \t\t\n \t\t\tvar update = document.createElement('td');\n \t\t\tvar link = document.createElement('a');\n \t\t\tlink.setAttribute('href','/newupdate/'+id);\n \t\t\tvar updateButton = document.createElement('button');\n \t\t\tupdateButton.textContent = \"Update\";\n \t\t\tlink.appendChild(updateButton);\n\t \tupdate.appendChild(link);\n \t newRow.appendChild(update);\n \n \t var delete_ = document.createElement('td');\n \t\t\tvar deleteButton = document.createElement('input');\n \t\t\n \t\t\tdeleteButton.setAttribute('type','button');\n \t\t\tdeleteButton.setAttribute('id','deleteExercise');\n \t\t\tdeleteButton.setAttribute('value','Delete');\n \t\t\tdeleteButton.setAttribute('onclick', \"deleteExercise(id)\");\n \t \tdelete_.appendChild(deleteButton);\n \t\tnewRow.appendChild(delete_);\n \t\t}\n \t\telse {\n \t\t \"Something bad happened :(. Please restart the app.\";\n \t\t}\n \t});\n\n\n\t\n\t// send request\n \treq.send(query +\"?\"+values);\n \tevent.preventDefault();\n });\n}", "title": "" }, { "docid": "a52025aba74644ee10efbea64c715543", "score": "0.5175159", "text": "function bindButtons(){\r\n\t//Add Value Function:\r\n\tdocument.getElementById('add').addEventListener('click', function(event) {\r\n\t\t//Create a new HTTP request\r\n\t\tvar req = new XMLHttpRequest(); \r\n\r\n\t\t//Get the data from the form to use in the URL\r\n\t\tvar nameValue = document.getElementById('name').value; \r\n\t\tvar repsValue = document.getElementById('reps').value; \r\n\t\tvar weightValue = document.getElementById('weight').value; \r\n\t\tvar dateValue = document.getElementById('date').value; \r\n\t\tvar lbsValue = document.getElementById('lbs').value; \r\n\t\t\r\n\t\t//Contruct a URL that sends a GET request to /insert with all of the necessary data\r\n\t\tvar url = \"http://flip2.engr.oregonstate.edu:\" + port + \"/insert?\" + \"name=\" + nameValue + \"&reps=\" + repsValue + \"&weight=\" + weightValue + \"&date=\" + dateValue + \"&lbs=\" + lbsValue; \r\n\t\t\r\n\t\t//Make the call\r\n\t\treq.open(\"GET\", url, false); \r\n\t\treq.addEventListener('load',function(){\r\n\t\t\t//If the request status is valid, update the table with the new value\r\n\t\t\tif(req.status >= 200 && req.status < 400){\r\n\t\t\t\tconsole.log(req.responseText); \r\n\t\t\t\t\r\n\t\t\t\t//Update the table\r\n\t\t\t\tupdateTable(); \r\n\t\t\t} \r\n\t\t\t//If the request status isn't valid, display an error message with the request status\r\n\t\t\telse {\r\n\t\t\t\tconsole.log(\"Error in network request: \" + req.statusText);\r\n\t\t\t}});\t\t\t\t\r\n\t\treq.send(null); //no need to send additional data\r\n\t\tevent.preventDefault(); //prevent the page from refreshing\r\n\t});\r\n}", "title": "" }, { "docid": "dcb21d9551819e88a3826d88211cda3b", "score": "0.5174699", "text": "function ebayAPI() {\n // Creat AJAX eBay request based on user submission\n $.ajax({\n url: queryEbayURL,\n method: \"GET\"\n }).then(function (resEbay) {\n // API comes back as a string, need to parse \n var ebayobj = JSON.parse(resEbay);\n // Variable for itemArray to run the for loop for\n ebayResponseObj = ebayobj.findItemsByKeywordsResponse[0].searchResult[0].item;\n ebayForLoop(0);\n })\n }", "title": "" }, { "docid": "fb41fab862e875afac5a7d0dde2536e6", "score": "0.51725316", "text": "function onDigitsSuccess(response) {\n console.log('Digits phone number retrieved.');\n //setDigitsNumber(response.phoneNumber);\n verifiedNumber = response.phoneNumber;\n document.getElementById('inputNumber').value = response.phoneNumber;\n\n}", "title": "" }, { "docid": "635fc15b43ead970a39f495b8d97d7a6", "score": "0.51707983", "text": "function ApiCall() {\n this.getValue = function (coin) {\n console.log(\"From External API\");\n switch (coin) {\n case 'Bitcoin':\n return \"$8500\"\n case 'Litecoin':\n return '$50'\n case 'Ethereum':\n return '$175'\n }\n }\n}", "title": "" }, { "docid": "c56b0a57831525c14bd0fb59e0ce8f2a", "score": "0.51699245", "text": "function updateNumber(){\n number = $('.js-form input[name=\"number\"]').val();\n getDogPhotos();\n}", "title": "" }, { "docid": "b20ba48544d852ea8aa24da88d23b639", "score": "0.5169766", "text": "function \tinitiatefieldpage()\n{\n \n \n document.getElementById('getfields').respfunc = function(count)\n {\n tablebar(count);\n //var dispq = document.getElementById('numitems').value;\n document.getElementById('getfields').respfunc=function(doc)\n {\n \n createatable(doc,'fieldtabe',gotoaddfield,false);\n \n \n }\n document.getElementById('getfields').dataurl = \"/productfields/getfieldtable\";\n \n }\n document.getElementById('getfields').dataurl = \"/productfields/getgroupcount\";\n \n //getcatalogtable\n}", "title": "" }, { "docid": "ab9e8e71be0a3bb11e1cadc4a05d8bf8", "score": "0.51673794", "text": "function updateUI() {\n let input = document.getElementById(\"textfield\").value;\n makeCorsRequest(input, 0);\n}", "title": "" }, { "docid": "d2ea1ca8350f0dd05aecf65a6a58309b", "score": "0.51655084", "text": "function addText() {\n let title = document.getElementById(\"titelinput\").value;\n let body = document.getElementById(\"textinput\").value;\n let tags = document.getElementById(\"taginput\").value;\n\n var req = \"/addtext?ttext=\" + title + \"&btext=\" + body + \"&tags=\" + tags + \"&\" + getukstr();\n\n mkxhr(req, atresp);\n}", "title": "" }, { "docid": "3c602920c84beed3425f2e1f189966ef", "score": "0.5165176", "text": "function myFunction(){\n // document.write(\"My function is working fine.\");\n\naccess_token = document.getElementById(\"fname\").value;\n\nsum_ = 0;\n\nfor(i=1;i<5;i++){\n url = \"https://www.zohoapis.in/crm/v2.1/Sales_Orders?page=\"+i+\"&per_page=200\";\n req = httpGet(url,access_token);\n\n status_code = req[0];\n req_text = req[1];\n\n if(status_code!= 200){\n console.log(\"End : Total Records reach to the limits.\");\n break;\n }\n\n else{\n const obj = JSON.parse(req_text);\n l = obj.data.length;\n\n for(j=0; j<l;j++){\n sum_ += obj.data[j].Grand_Total\n //var x = document.getElementById(\"fname\").value;\n console.log(obj.data[j].Grand_Total);\n }\n console.log(sum_);\n //document.getElementById(\"para1\").innerHTML = sum_;\n //document.getElementById(\"para1\").innerHTML = j;\n \n if(l<200){\n string_text0 = \"Successful retrieval for page : \"+i+ \" \\n\"+ \"Total Records : \" +l;\n console.log(string_text0);\n break;\n }\n else{\n string_text1 = \"Successful retrieval for page : \"+i+ \" \\n\"+ \"Total Records : \" +l;\n console.log(string_text1);\n }\n\n\n }\n \n\n}\n\nstring_text3 = \"The total Grand_Total_Sum is:\" + sum_;\nconsole.log(string_text3)\n//document.getElementById(\"header1\").innerHTML = sum_;\n\ndocument.getElementById(\"header1\").innerHTML = sum_;\n}", "title": "" }, { "docid": "63c6f8713fb5d96bbe3045c96c85066f", "score": "0.5160962", "text": "function getAPI(){\n var XHR = new XMLHttpRequest();\n XHR.onreadystatechange = function(){\n if(XHR.readyState == 4 && XHR.status ==200){\n var url = JSON.parse(XHR.responseText).bpi[clickedButtonName].rate;\n price.innerHTML = url\n }\n }\n XHR.open('GET', 'https://api.coindesk.com/v1/bpi/currentprice.json');\n XHR.send();\n}", "title": "" } ]
1918e405a967a53236ce177e34de3273
Turn duration of the movies from hours to minutes
[ { "docid": "2964be2780ac5eecc109d8f8726b2b80", "score": "0.76044226", "text": "function turnHoursToMinutes(movies) {\n //creamos el array para pasar a minutos\n return movies.map(elm => {\n const newMovies = { ...movies };\n //llamamos a la segunda función para tener mas clean la principal\n newMovies.duration = minTransform(elm.duration);\n return newMovies;\n });\n}", "title": "" } ]
[ { "docid": "2e7ca6101d4603cafeaad2ea1a678050", "score": "0.8222426", "text": "function turnHoursToMinutes(movies) {\n\t\n\tmovies.forEach(function(movie){\n\t\tvar theDuration = [];\n\n\t\ttheDuration[0] = movie.duration.split(\"h\");\n\t\ttheDuration[1] = movie.duration[1].split(\"min\")\n\n\t\t// plainHours = parseInt(plainHours);\n\t\t// plainMinutes = parseInt(plainMinutes);\n\n\t\t// movie.duration = ((plainHours * 60) + plainMinutes);\n\t\t\n\t\t// console.log(\"\" + movie.duration + \"min\");\n\t\t// movie.duration[0] = plainHours;\n\t\t// movie.duration[1] = plainMinutes;\n\n\t\t//return movies.duration;\n\t\t//console.log(theDuration);\n\t\treturn theDuration;\n\t});\n\treturn movies;\n}", "title": "" }, { "docid": "a47d24593cecd43d62ae9569420e0746", "score": "0.82001513", "text": "function turnHoursToMinutes(movies) { }", "title": "" }, { "docid": "0452b6dbc00c03330ea9773234eed76c", "score": "0.8104603", "text": "function turnHoursToMinutes(movies){\n let cloneMovie = JSON.parse(JSON.stringify(movies));\n let arrOfTheTime;\n let hoursDuration;\n let minutesDuration;\n let filmDuration = cloneMovie.map((movie)=>{\n if(movie.duration.includes(' ')){\n arrOfTheTime = movie.duration.split(' '); //Now we have ['2h', '22min']\n hoursDuration = arrOfTheTime[0].split('h')[0]; //\n minutesDuration = arrOfTheTime[1].split('min')[0];\n movie.duration = Number(hoursDuration) * 60 + Number(minutesDuration);\n }\n else if(movie.duration.includes('h')){\n hoursDuration = movie.duration.split('h')[0];\n movie.duration = Number(hoursDuration) * 60 \n }\n else{\n minutesDuration = movie.duration.split('min')[0];\n movie.duration = Number(minutesDuration);\n }\n return movie\n });\n return filmDuration;\n}", "title": "" }, { "docid": "25b76fb74afb0c646aa402cfb5e6f624", "score": "0.807917", "text": "function turnHoursToMinutes(movies) {\n return movies.map(movie => {\n const duration = movie.duration.split(\" \");\n let minutes = 0;\n for (let time of duration) {\n if (time.includes(\"h\")) {\n minutes += parseInt(time) * 60;\n } else {\n minutes += parseInt(time);\n }\n }\n return {\n ...movie,\n duration: minutes\n };\n });\n}", "title": "" }, { "docid": "84911e4c9a4ec615c5f5daca8d741ba2", "score": "0.80532396", "text": "function calculateDuration (movie) {\n var hmin=Number(movie.duration.split(\" \")[0].split(\"h\")[0])*60 ; \n var min=Number(movie.duration.split(\" \")[1].split(\"m\")[0]) ; \n return hmin+min ; \n}", "title": "" }, { "docid": "3543986adbbab2554d1527bcc80bd5ac", "score": "0.80478793", "text": "function turnHoursToMinutes(movies){\n return movies.map(function (movie){\n let newDuration=0;\n if(movie.duration.includes('h')){\n newDuration += Number(movie.duration.slice(0, movie.duration.indexOf('h'))) * 60;\n }\n if(movie.duration.includes('min')){\nnewDuration+= Number(movie.duration.slice(movie.duration.indexOf(' ')+1,movie.duration.indexOf('m')));\n }\n return{...movie,duration: newDuration};\n });\n}", "title": "" }, { "docid": "273b1b7d56ec74fca8c28d4c3f1c7bb5", "score": "0.80449516", "text": "function turnHoursToMinutes(movies) {\n return movies.map(function(movie) {\n var newDuration = \"\";\n if (!movie.duration.includes(\"h\")) {\n newDuration = parseInt(movie.duration);\n } else if (!movie.duration.includes(\"min\")) {\n newDuration = parseInt(movie.duration) * 60;\n } else {\n var durationArray = movie.duration.split(\" \");\n newDuration =\n parseInt(durationArray[0]) * 60 + parseInt(durationArray[1]);\n }\n return Object.assign({}, movie, { duration: newDuration });\n });\n }", "title": "" }, { "docid": "a6f9b3e59c45256dfd961e65a028a6f8", "score": "0.79798204", "text": "function turnHoursToMinutes(movies) {\n\n const separateHoursFromMinutes = movies.map( movie => {\n const newMovie = {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: movie.duration,\n genre: movie.genre,\n rate: movie.rate\n }\n \n if (newMovie.duration.includes(\"h\") && newMovie.duration.includes(\"min\")) {\n newMovie.duration = newMovie.duration.slice(0, -3).split(\"h\");\n newMovie.duration = Number(newMovie.duration[0])*60 + Number(newMovie.duration[1])\n } else if (newMovie.duration.includes(\"h\")) {\n newMovie.duration = Number(newMovie.duration.slice(0, -1))*60\n } else {\n newMovie.duration = Number(newMovie.duration.slice(0, -3))\n }\n return newMovie\n })\n return separateHoursFromMinutes;\n}", "title": "" }, { "docid": "8c02198f28063743221b4e01ee2d0a87", "score": "0.7944417", "text": "function calcMinutes (duration){\n duration = duration.split(\" \");\n\n for (i=0, l=movies.length; i<l; i++){\n var toMinutes = parseInt(duration[0],10); //parseInt coge de un string los numeros. 2do arg es en que base 10 ->decimal)\n var minutes = parseInt(duration[1], 10);\n var time = toMinutes*60 + minutes;\n }\n return time;\n}", "title": "" }, { "docid": "4a4dfae52c1fb4795537fced49f44b40", "score": "0.79436415", "text": "function turnHoursToMinutes(movies) {\n const returnValue = movies.map(function(movie) {\n var hours = 0;\n var minutes = 0;\n if (movie.duration.indexOf(\"h\") !== -1)\n hours = movie.duration.substr(0, movie.duration.indexOf(\"h\"));\n if (movie.duration.indexOf(\"m\") !== -1)\n minutes = movie.duration.substr(movie.duration.indexOf(\" \") + 1, 2);\n return { duration: parseFloat(hours) * 60 + parseFloat(minutes) };\n });\n return returnValue;\n}", "title": "" }, { "docid": "34974b4b5fc5e9e45941ec6320c166af", "score": "0.79045844", "text": "function turnHoursToMinutes(movies){\n\n \n var tabWithMinutes = movies.map(function(el){ \n\n var part1= el.duration.split('h');\n var part2= part1[1].split('min');\n var dureeMinut=Number(part1[0])*60+Number(part2[0]);\n\n return {\n \n title: el.title,\n year: el.year,\n director: el.director,\n duration: dureeMinut,\n genre: el.genre,\n rate: el.rate\n \n }\n \n })\n \n return tabWithMinutes;\n\n }", "title": "" }, { "docid": "f603183b9ff1b41c9b926c3d6f3761dd", "score": "0.7903793", "text": "function turnHoursToMinutes(movies){\n return movies.map(movie => {\n var newMovie = Object.assign({}, movie);\n newMovie[\"duration\"] = transformDurationStrToDurationNumber(newMovie[\"duration\"]);\n return newMovie\n })\n}", "title": "" }, { "docid": "705d5eaac2178afea5dc00b2ea55f8e3", "score": "0.78728944", "text": "function turnHoursToMinutes(movies) {\n\n return movies.slice(0).map(function(movie) {\n let timeString = movie.duration\n let splitString = timeString.split(' ')\n let timeHours = 0;\n let timeMinutes = 0;\n\n if (splitString.length === 1) {\n if (splitString[0].includes('h')) {\n timeHours = splitString[0].replace('h', '') * 60\n } else if (splitString[0].includes('min')) {\n timeMinutes = splitString[0].replace('min', '') * 1\n }\n } else {\n timeHours = splitString[0].replace('h', '') * 60\n timeMinutes = splitString[1].replace('min', '') * 1\n }\n\n let totalTimeMinutes = timeHours + timeMinutes\n return { duration: totalTimeMinutes }\n })\n}", "title": "" }, { "docid": "74f0205fe4dd3159e0c93e25e52ede0f", "score": "0.78255576", "text": "function turnHoursToMinutes(moviesDurations) {\n const movieMap = movieDuration => {\n const newMovie = Object.assign({}, movieDuration);\n const durations = newMovie.duration.split(\" \");\n let totalTime = 0;\n durations.forEach(element => {\n if (element.includes(\"h\")) {\n totalTime += parseFloat(element.replace(/\\D/g, \"\")) * 60;\n } else {\n totalTime += parseFloat(element.replace(/\\D/g, \"\"));\n }\n });\n newMovie.duration = totalTime;\n return newMovie;\n };\n console.log(moviesDurations.map(movieMap));\n return moviesDurations.map(movieMap);\n}", "title": "" }, { "docid": "d537c9fa5628fbe9acb408446c128602", "score": "0.7806839", "text": "function turnHoursToMinutes (movies){\n let moviesMin = movies.map(movie => {\n let duracion = movie.duration;\n let newDuration = duracion.split(\" \")\n\n if (duracion.includes(\"h\") && duracion.includes(\"min\") ){\n let horasToMin = parseInt(newDuration[0]) * 60 + parseInt(newDuration[1])\n duracion= horasToMin\n\n } else if (duracion.includes(\"h\") ){\n let calculo = parseInt(newDuration[0]) * 60\n duracion = calculo;\n\n }else if(duracion.includes(\"min\")){\n let minutes = parseInt(newDuration[0])\n duracion = minutes;\n }\n\n return {...movie, duration: parseInt(duracion)}\n\n })\n return moviesMin\n}", "title": "" }, { "docid": "f099b2ca86a10fbdcaecf632fff0dd10", "score": "0.77661604", "text": "function turnHoursToMinutes(movies) {\n let newMovies = movies.map(function (x) {\n let minutes = 0;\n let time = x.duration.split(\" \");\n if (time.length === 2) {\n let hours = parseInt(time[0].slice(0, -1));\n minutes = parseInt(time[1].slice(0, -3));\n minutes += hours * 60;\n } else if (time.length === 1) {\n if (time[0].indexOf(\"h\") > -1) {\n minutes = parseInt(time[0].slice(0, -1) * 60);\n } else if (time[0].indexOf(\"min\") > -1) {\n minutes = parseInt(time[0].slice(0, -3));\n }\n }\n let copyMovies = {x};\n copyMovies.duration = minutes;\n return copyMovies;\n });\n return newMovies;\n}", "title": "" }, { "docid": "8cdab65827934a556a3abefe2e839cb4", "score": "0.7747468", "text": "function turnHoursToMinutes(movies) {\n const moviesCopy = movies.map(movie => {\n // const movieCopy = { ...movie };\n // console.log(movie.duration);\n // if (typeof movie.duration === \"number\") {\n // return { ...movie };\n // }\n let durationArray = movie.duration.split(\" \");\n //console.log(durationArray);\n\n durationArray = durationArray.reduce((ac, position) => {\n // console.log(position);\n let min = 0;\n if (position.indexOf(\"h\") == -1) {\n min = parseInt(position);\n // console.log(min);\n } else if (position.indexOf(\"min\") == -1) {\n min = parseInt(position) * 60;\n // console.log(min);\n }\n return ac + min;\n }, 0);\n // console.log(durationArray);\n // movie.duration = durationArray;\n return { ...movie, duration: durationArray };\n });\n\n return moviesCopy;\n}", "title": "" }, { "docid": "56a68c09ed45f7354959f5d217cf75e6", "score": "0.77398866", "text": "function turnHoursToMinutes(movies) {\n var arr = movies.map(function(movie) {\n var minutes = movie.duration.split(' ').map(function(arrTime) { \n\n var time = parseInt(arrTime);\n\n if (arrTime.endsWith('h')) {\n return time * 60;\n } else {\n return time;\n }\n }).reduce(function(acumulator, current) {\n return acumulator + current;\n }, 0);\n return Object.assign({}, movie, {duration: minutes});\n });\n return arr;\n}", "title": "" }, { "docid": "9803b67bb7608772690674973e55fa3e", "score": "0.77144206", "text": "function turnHoursToMinutes(movies){\n\n let timeArr = []\n \n let move= movies.map(movie => {\n movie.duration= conversion(movie.duration)\n return movie\n })\n\n function conversion(film){\n let timeH= 0\n let timeM= 0\n let time= film.split(\" \")\n if(time.length==1 && time[0].includes(\"h\")){\n timeH += parseFloat(time[0])\n }\n if(time.length==1 && time[0].includes(\"min\")){\n timeM += parseFloat(time[1])\n }\n if (time.length==2){\n timeM = parseFloat(time[1])\n timeH = parseFloat(time[0])\n }\n let minute= Number(timeH * 60 + timeM)\n\n \n return parseInt(minute)\n\n }\n return move\n\n }", "title": "" }, { "docid": "b76040b8f8e3307e5fb485c158601c4c", "score": "0.77109176", "text": "function turnHoursToMinutes(movies) {\n var moviesToMinutes = [...movies]; //create new array\n moviesToMinutes.forEach(function(movie) {\n var sumMinutes = 0;\n var convertedTime = [];\n //If the time has hours (and, or not, minutes)\n if (movie.duration.includes(\"h\")) {\n var hours = movie.duration.split(\"h\");\n convertedTime.push(Number.parseInt(hours[0]) * 60);\n if (hours[1].includes(\"min\")) {\n var minutes = hours[1].split(\"min\");\n convertedTime.push(Number.parseInt(minutes[0]));\n }\n sumMinutes = convertedTime.reduce(function(acc, val) {\n return acc + val;\n });\n movie.duration = sumMinutes;\n //If the time is only minutes\n } else if (movie.duration.includes(\"min\")) {\n let minutes = movie.duration.split(\"min\");\n movie.duration = Number.parseInt(minutes[0]);\n }\n });\n return moviesToMinutes;\n}", "title": "" }, { "docid": "42ed11de968d0e8223f952770e6afc07", "score": "0.7699575", "text": "function turnHoursToMinutes(movies){\n return movies.map(peli => {\n // se hace copia del objeto para evitar que se modigique el objeto original\n let nuevaPeli = Object.assign({}, peli);\n // se invoca funcion para convertir duracion a minutos\n nuevaPeli.duration = convertDuration(nuevaPeli.duration);\n return nuevaPeli;\n })\n}", "title": "" }, { "docid": "a9fb2f2fa1d46424ef8047631c8ddc77", "score": "0.7676472", "text": "function turnHoursToMinutes(movies) {\n let newArray = movies\n newArray.forEach((movie) => { \n let allType = movie.duration.split(\" \")\n if(allType.length === 2) {\n let hours = allType[0].replace(/\\D/g,'')\n let minutes = allType[1].replace(/\\D/g,'')\n movie.duration = Number(hours * 60) + Number(minutes)\n\n } else {\n if(movie.duration.split(\"\").includes(\"h\")){\n let hours = allType[0].replace(/\\D/g,'')\n movie.duration = Number(hours * 60) \n } else {\n let minutes = allType[0].replace(/\\D/g,'')\n movie.duration = Number(minutes)\n }\n }\n })\n return newArray\n}", "title": "" }, { "docid": "9b98e04f097da9b512d64edf752a5619", "score": "0.7674972", "text": "function transformDuration(movieDuration){\n var pattern1 = /(\\d*)h (\\d*)min/gm;\n var pattern2 = /(\\d*)h/gm;\n var pattern3 = /(\\d*)min/gm;\n var res1 = movieDuration.match( /(\\d*)h (\\d*)min/ );\n var res2 = movieDuration.match( /(\\d*)h/ );\n var res3 = movieDuration.match( /(\\d*)min/ );\n\n if(res1){\n var hours = +res1[1]; \n var mins = +res1[2];\n return hours*60 + mins;\n }else if(res2){\n return +res2[1]*60;\n }else if(res3){\n return +res3[1];\n }\n}", "title": "" }, { "docid": "4b7509e1f3b820f7c1c41a2c6e6ac2ac", "score": "0.76146317", "text": "function turnHoursToMinutes(movies){\n var newArray = movies.map(function(e){\n var newDuration = 0;\n var hours = e.duration.split(\"h\");\n if(hours[1]===\"\"){\n newDuration = hours[0] * 60;\n console.log(newDuration)\n } else if(hours.length==1){\n newDuration=hours[0].split(\"min\")\n newDuration = parseInt(newDuration[0])\n console.log(newDuration)\n }else{\n var minutes = hours.join(\"-\");\n \n minutes = minutes.split(\"min\")\n minutes = minutes[0]\n minutes = minutes.split(\"-\")\n console.log(minutes)\n newDuration=(minutes[0] * 60 + parseInt(minutes[1]))\n console.log(e.duration)\n }\n return {title: e.title,\n year: e.year,\n director: e.director,\n duration: newDuration,\n genre: e.genre,\n rate: e.rate\n }\n //return {duration: newDuration}\n })\n return newArray;\n}", "title": "" }, { "docid": "e6fba0b2a8e6eef42b9e0fc24ad52cab", "score": "0.75697064", "text": "function turnHoursToMinutes(moviesArr) {\n\n\n return moviesArr.map(function (movie) {\n\n // if (typeof movie.duration === \"number\") {\n // return;\n // }\n movie = Object.assign({}, movie)\n\n let duration = movie.duration;\n let hours = 0;\n let minutes = 0;\n //console.log(duration)\n //console.log(duration.indexOf(\"h\")===-1)\n if (duration.indexOf(\"h\") === -1) {\n hours = 0\n } else {\n hours = duration.slice((duration.indexOf(\"h\") - 1), duration.indexOf(\"h\"))\n }\n\n if (duration.indexOf(\"min\") === -1) {\n minutes = 0\n } else {\n minutes = duration.slice((duration.indexOf(\"min\") - 2), duration.indexOf(\"min\"))\n }\n \n let durationInMin = parseInt(hours) * 60 + parseInt(minutes)\n \n movie.duration = durationInMin\n\n return movie;\n });\n}", "title": "" }, { "docid": "e7605c72224b7ad35d163279a5efb7a5", "score": "0.7556287", "text": "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n }", "title": "" }, { "docid": "f17b5ad27e8dd11bc1add29797c6af70", "score": "0.7542566", "text": "function turnHoursToMinutes(movies) {\n var newMoviesArr = movies.map(function (movie) {\n var totalMinutes;\n if (movie.duration.includes(' ')) {\n var durationArray = movie.duration.split(' ');\n totalMinutes = (parseInt(durationArray[0].split('h'), 10) * 60) + parseInt(durationArray[1].split('min', 2), 10);\n } else if (movie.duration.includes('h')) {\n totalMinutes = parseInt(movie.duration.split('h', 1), 10) * 60;\n } else if (movie.duration.includes('min')) {\n totalMinutes = parseInt(movie.duration.split('min', 2), 10);\n }\n return Object.assign({}, movie, { duration: totalMinutes });\n });\n return newMoviesArr;\n}", "title": "" }, { "docid": "6342cd2dd1a8bfdc6530f95767a6a73e", "score": "0.7503006", "text": "function turnHoursToMinutes(duration) {\n let totalTime = 0;\n let hours = 0;\n let minutes = 0;\n\n const time = duration.split(\" \");\n\n if (time.length >= 2) {\n hours = parseInt(time[0]);\n minutes = parseInt(time[1]);\n } else {\n // if (time[0].indexOf(\"min\") !== -1) {\n if (time[0].includes(\"min\")) {\n minutes = parseInt(time[0]);\n // } else if (time[0].indexOf(\"h\") !== -1) {\n } else if (time[0].includes(\"h\")) {\n hours = parseInt(time[0]);\n }\n }\n\n totalTime = hours * 60 + minutes;\n return totalTime;\n}", "title": "" }, { "docid": "017f055a7ac68db8107d367011ec7661", "score": "0.74426204", "text": "function turnHoursToMinutes(moviesArray) {\n \n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n \n if(typeof(elem.duration) !== 'number'){\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n }\n else{\n return elem;\n }\n });\n}", "title": "" }, { "docid": "c6245c3dde02bc3d5cdb5a0ed3b92ea3", "score": "0.7421512", "text": "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function(elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.includes(\"h\")) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.includes(\"min\")) {\n minutes = parseInt(\n elem.duration.substring(\n elem.duration.length - 5,\n elem.duration.length - 3\n ),\n 10\n );\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n}", "title": "" }, { "docid": "841e4170b2d4f6283dc811ee4d590893", "score": "0.74157816", "text": "function turnHoursToMinutes(arrMovies){\n \n let newArrMovies = arrMovies;\n \n let finalArrMovies = newArrMovies.map(oneMovie => {\n let movie = Object.assign({},oneMovie);\n var hourMinutes = movie.duration.match(/\\d+/g).map(Number);\n if(hourMinutes.length>1){\n movie.duration=(hourMinutes[0]*60)+hourMinutes[1];\n }else if(hourMinutes.length==1){\n if(hourMinutes>9){\n movie.duration=hourMinutes[0];\n }else{\n movie.duration=hourMinutes[0]*60;\n }\n }\n return movie;\n });\n return finalArrMovies;\n \n}", "title": "" }, { "docid": "fa5ce994e9e9af7554ec245076375744", "score": "0.7387218", "text": "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n}", "title": "" }, { "docid": "208be45f617cbb1d76662cc0ae4972ec", "score": "0.73764724", "text": "function hoursToMinutes(array) {\n\n let moviesInMinutes = []\n let RegexTime = new RegExp(/d+/)\n\n for (let i = 0; i < array.length; i++) {\n\n moviesInMinutes.push({\n title: array[i].title,\n year: array[i].year,\n director: array[i].director,\n duration: array[i].duration,\n genre: array[i].genre,\n score: array[i].score,\n });\n \n }\n for (i = 0; i < moviesInMinutes.length; i++) {\n let him = moviesInMinutes[i].duration.split(' ')\n \n if (him.length == 2) {\n let horas = parseInt(him[0].replace(RegexTime))\n let min = parseInt(him[1].replace(RegexTime))\n let horasMin = horas * 60\n let total = horasMin + min\n moviesInMinutes[i].duration = total\n }\n else if (him.length == 1) {\n if (him[0].includes('min')) {\n min = parseInt(him[0].replace(RegexTime))\n total = min\n moviesInMinutes[i].duration = total\n }\n else\n horas = parseInt(him[0].replace(RegexTime))\n horasMin = horas * 60\n total = horasMin\n moviesInMinutes[i].duration = total\n }\n }\n return moviesInMinutes\n}", "title": "" }, { "docid": "4fd67700e4465da652fb3b204719b0b8", "score": "0.73479235", "text": "function turnHoursToMinutes(arr) {\n let movieLengths = [\n ...arr.map((element) => {\n return element.duration.split(' ');\n })\n ];\n\n let movieHoursinMinutes = movieLengths.map((element) => {\n return element[0].replace('h', '') * 60 + parseInt(element[1]);\n });\n\n let movieCopy = {};\n\n return movieHoursinMinutes;\n}", "title": "" }, { "docid": "7c82c34bd798b107868620441d71f30f", "score": "0.7321739", "text": "function turnHoursToMinutes(arr){\n const movieDurations = arr.map(movie => movie.duration.split(\" \"));\n const justNumbers = movieDurations.map(duration => {\n let hours = duration[0].replace(\"h\", \"\");\n if(duration[1]){\n return duration[1].replace(\"min\", \"\");\n }\n }); return justNumbers;\n }", "title": "" }, { "docid": "778499780b28dd5e67d3253d6343fb53", "score": "0.7307391", "text": "function turnHoursToMinutes(movies) {\n separateArray = movies.map(function(movie, i, movies) {\n return movie.duration.split(' ');\n });\n\n hoursArray = separateArray.map(function(movie, i, separateArray) {\n return movie[0].split('h');\n });\n\n hoursArray1 = hoursArray.map(function(el, i, hoursArray) {\n return parseFloat(el) * 60;\n });\n\n minutesArray = separateArray.map(function(movie, i, separateArray) {\n return movie[1].split('min');\n });\n\n minutesArray1 = minutesArray.map(function(el, i, minutesArray) {\n return parseFloat(el);\n });\n\n durationArray = [];\n for (i = 0; i < hoursArray1.length; i++) {\n durationArray.push(hoursArray1[i] + minutesArray1[i]);\n }\n\n finalArr = [];\n\n finalArr = [];\n\n for (i = 0; i < movies.length; i++) {\n finalArr.push(\n (newObj = {\n title: movies[i].title,\n year: movies[i].year,\n director: movies[i].director,\n duration: durationArray[i],\n genre: movies[i].genre,\n rate: movies[i].rate\n })\n );\n }\n console.log(finalArr);\n}", "title": "" }, { "docid": "d1c2c03bc34b48e55ecc930b285ae5ac", "score": "0.7287937", "text": "function turnHoursToMinutes(arr){\n let minuteMovies = JSON.parse(JSON.stringify(arr));\n let resultMovies = JSON.parse(JSON.stringify(arr));\n minuteMovies.map((movie,index)=>{\n let horas = 0;\n let minutos = 0;\n let duration = movie.duration;\n\n duration_split = duration.split(\" \");\n if (duration_split[0].includes(\"h\")){horas = parseInt(duration_split[0].replace(\"h\",\"\"));}\n if (duration_split[0].includes(\"min\")){minutos = parseInt(duration_split[0].replace(\"min\",\"\"));}\n if (duration_split.length>1){minutos = parseInt(duration_split[1].replace(\"min\",\"\"));}\n\n let duracionMins = minutos + horas*60;\n resultMovies[index].duration = duracionMins;\n });\n return resultMovies;\n}", "title": "" }, { "docid": "d6a8c54f43f02037f331a33d6da91496", "score": "0.7287111", "text": "function turnHoursToMinutes(array){\n return array.map((movie) => {\n var duration = movie.duration;\n var minutes=0, idx;\n\n if (typeof duration === \"number\") return {duration : duration};\n\n if (duration.indexOf(\"h\") != -1 && duration.indexOf(\"m\") != -1) {\n idx = duration.indexOf(\"h\");\n minutes = duration[idx - 1] * 60;\n\n idx = duration.indexOf(\"m\");\n minutes += duration[idx - 2] * 10;\n minutes += parseInt(duration[idx - 1]);\n }\n\n if (duration.indexOf(\"h\") != -1){\n idx = duration.indexOf(\"h\");\n minutes = duration[idx - 1] * 60;\n }\n\n if (duration.indexOf(\"m\") != -1){\n idx = duration.indexOf(\"m\");\n minutes += duration[idx - 2] * 10;\n minutes += parseInt(duration[idx - 1]);\n }\n\n return Object.assign({},movie,{duration:minutes}); \n });\n}", "title": "" }, { "docid": "0ad6b00e590683d472ec75ba217e9b31", "score": "0.72655654", "text": "function turnHoursToMinutes(arrMovie) {\n const convertedArray = arrMovie.map(function (movie) {\n\n if (movie.duration.includes(\"h\") && movie.duration.includes(\"min\")) {\n let minHourArr = movie.duration.split(\"h \");\n let hours = parseInt(minHourArr[0]);\n let minutes = parseInt(minHourArr[1]);\n let minutesComplete = hours * 60 + minutes;\n return {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: minutesComplete,\n genre: movie.genre,\n rate: movie.rate\n };\n } else if (movie.duration.includes(\"min\") && movie.duration.indexOf(\"h\") === -1) {\n return {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: parseInt(movie.duration),\n genre: movie.genre,\n rate: movie.rate\n };\n } else {\n return {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: parseInt(movie.duration) * 60,\n genre: movie.genre,\n rate: movie.rate\n };\n }\n\n });\n return convertedArray;\n}", "title": "" }, { "docid": "09c3b26f36760c62e4fc61f364ab8334", "score": "0.7246979", "text": "function turnHoursToMinutes(movies){\n var newArray=[];\n \n newArray= movies.map(function (movie){\n var newObject={};\n var hours=0;\n var minutes=0;\n \n if (movie.duration.includes(\"h\") && (movie.duration.includes(\"min\")==false))\n {\n hours= parseInt(movie.duration.substring(0,1))\n }\n else if((movie.duration.includes(\"h\")==false) && movie.duration.includes(\"min\"))\n {\n minutes=parseInt(movie.duration.substring(0,3))\n }\n else{\n hours= parseInt(movie.duration.substring(0,1));\n minutes=parseInt(movie.duration.substring(3,5));\n }\n \n newObject.duration= hours*60 + minutes;\n newObject.title = movie.title;\n newObject.year=movie.year;\n newObject.director=movie.director;\n newObject.genre=movie.genre;\n newObject.rate=movie.rate;\n return newObject;\n \n })\n return newArray\n}", "title": "" }, { "docid": "802ec39e7fc3ed5e94b44b4c8c83ef6a", "score": "0.72331965", "text": "function turnHoursToMinutes(movies) {\n const newArr = movies.map(movie => {\n // clone each movie object to newObject\n const newObject = Object.assign({}, movie)\n\n // turn 'Xhr' to min\n if (movie.duration.length < 5) {\n newObject.duration = parseInt(movie.duration[0] * 60);\n // turn 'X min' to min\n } else if (movie.duration.length < 7) {\n newObject.duration = parseInt(movie.duration.split('min')[0]);\n // turn 'Xhr Xmin' to min\n } else {\n newObject.duration = movie.duration[0] * 60 + parseInt(movie.duration.split(' ')[1].split('min')[0]);\n }\n return newObject;\n });\n return newArr;\n}", "title": "" }, { "docid": "afa218a12ffe2b8e840cf2ee9dfe0000", "score": "0.72210336", "text": "function turnHoursToMinutes (magic) {\n\n let objIndex = magic.findIndex(obj => obj === \"duration\");\n let updatedObj = { ...magic[objIndex], duration: §{movies.duration[0] * 2} + ${movies.duration[1]} };\n return updatedObj\n \n let resultArr = [movies.slice(0, objIndex), updatedObj, movies.slice(objIndex + 1),];\n return resultArr\n\n}", "title": "" }, { "docid": "4c9920ad520925373f5672dd5d025442", "score": "0.7215898", "text": "function turnHoursToMinutes(movieArray) {\n var updatedArray = movieArray.map(function (oneMovie) {\n var copiedEntry = Object.assign({}, oneMovie);\n return copiedEntry;\n });\n\n updatedArray.map(function(movie) {\n var hours = 0;\n var minutes = 0;\n if (movie.duration.indexOf(\" \") !== -1) {\n minutes = parseInt(movie.duration.slice(movie.duration.indexOf(\" \")+1, movie.duration.indexOf(\"m\")));\n hours = parseInt(movie.duration.slice(0, movie.duration.indexOf(\"h\")));\n } else {\n if (movie.duration.indexOf(\"h\") !== -1) {\n hours = parseInt(movie.duration.slice(0, movie.duration.indexOf(\"h\")));\n };\n\n if (movie.duration.indexOf(\"m\") !== -1) {\n minutes = parseInt(movie.duration.slice(0, movie.duration.indexOf(\"m\")));\n };\n };\n movie.duration = parseInt(60*hours + minutes);\n });\n return updatedArray;\n}", "title": "" }, { "docid": "a17e5434fcc5d2d81d86bfbd1bd91918", "score": "0.7156089", "text": "function turnHoursToMinutes (array) {\n return array.map(movie => {\n let duration = 0;\n for (let value of durationAsString.split (\"\")) {\n const number = parseInt(value);\n if (value.includes(\"h\")) {\n duration += number * 60;\n } else if (value.includes(\"min\")) {\n duration += number;\n }\n }\n return {\n ...movie,\n duration\n };\n });\n}", "title": "" }, { "docid": "16d41aa35a6da615dd95a62cc31e1f3b", "score": "0.71465683", "text": "function turnHoursToMinutes(films) {\n return films.map(film => {\n let duration = film.duration; // '3h 22min' or '5h' or '22min'\n\n let hours = 0;\n let mins = 0;\n\n //\n // 3 cases: '3h 22min' or '5h' or '22min'\n //\n\n const isH = (duration.indexOf('h') !== -1);\n const isMin = (duration.indexOf('min') !== -1);\n if (isH && isMin) {\n // '3h 22min'\n\n let hSplit = duration.split('h ');\n let minSplit = hSplit[1].split('min');\n\n hours = hSplit[0];\n mins = minSplit[0];\n } else if (isH && !isMin) {\n // '5h'\n hours = duration.split('h')[0];\n } else if (!isH && isMin) {\n // '22min'\n mins = duration.split('min')[0]\n }\n\n let dur = Number(hours)*60+Number(mins);\n return {\n ...film,\n duration: dur\n };\n })\n}", "title": "" }, { "docid": "83f11f42037c6abd78526b86460dc304", "score": "0.71226865", "text": "function hoursToMinutes(array) {\n const hoursToMinutes = array.map((movie) => {\n const toArray = movie.duration.includes(' ')\n ? movie.duration.split(' ')\n : [movie.duration];\n\n let movieObject;\n\n const [hour, minutes] = toArray; //no sirve porque hay veces que no se separa en dos porque es solo un valor Ex \"2h\"\n const hourToMinutes = Math.round(hour.match(/\\d/g)) * 60;\n const minutesWithoutLetters =\n Math.round(minutes?.match(/\\d/g).join('')) || 0;\n const newDuration = hourToMinutes + minutesWithoutLetters;\n\n movieObject = { duration: newDuration };\n\n return { ...movie, ...movieObject };\n });\n console.log('EXERCICE 7 ->', hoursToMinutes);\n return hoursToMinutes;\n}", "title": "" }, { "docid": "dedf268174a5116266b733682ca9e485", "score": "0.70420974", "text": "function turnHoursToMinutes(array){\n \n let newArr = array.map(function(oldmovie){\n let movie ={...oldmovie};\n var strDuration = movie.duration + '';\n if(strDuration.includes(\"h\") && strDuration.includes(\"min\")){\n var durSplit = strDuration.split(' ');\n var hrsMins = parseInt(durSplit[0],10);\n hrsMins = hrsMins * 60;\n var mins = parseInt(durSplit[1],10);\n var totalMins = hrsMins + mins;\n movie.duration = totalMins;\n }\n else if(strDuration.includes(\"h\")){\n var hrsMins = parseInt(strDuration,10);\n totalMins = hrsMins * 60;\n movie.duration = totalMins;\n }\n else if(strDuration.includes(\"min\")){\n var mins = parseInt(strDuration,10);\n totalMins = mins;\n movie.duration = totalMins;\n }\n return movie;\n});\n return newArr;\n}", "title": "" }, { "docid": "7b620ac687f7c1573bf2f739ff51c4b5", "score": "0.7013481", "text": "function hoursToMinutes(array) {\n return array.map(function(movie) {\n if (!movie['duration']) {\n return movie\n }\n\n const durationInMinutes = movie['duration'].split(' ').reduce(function(acc, duration, index) {\n if (index === 0) {\n return parseInt(duration.replace('h', ''))*60\n } else {\n return parseInt(duration.replace('min', ''))+acc\n }\n }, 0)\n\n return {...movie, duration: durationInMinutes}\n })\n}", "title": "" }, { "docid": "18b673fdb7911aa1b8a341ce6ad9e4b5", "score": "0.6996758", "text": "function turnHoursToMinutes(array) {\n\n var newArray = []\n\n newArray = array.map(function (movie) {\n var copiaMovie = Object.assign({}, movie)\n\n var contador = 0\n var arrayDuration = copiaMovie.duration.split(\" \")\n arrayDuration.forEach(function (elemt) {\n if (elemt.includes(\"h\")) {\n contador += parseInt(elemt * 60)\n } else if (elemt.includes(\"min\")) {\n contador += parseInt(elemt)\n }\n\n copiaMovie.duration = parseInt(contador)\n\n return copiaMovie\n })\n\n })\n return newArray\n}", "title": "" }, { "docid": "c33d999e8bec4b91b5c62c27b6b37dee", "score": "0.6988159", "text": "function turnHoursToMinutes(array){\n const copyArray = array.map(ele => {\n let newMovie = {...ele,duration:parseInt(ele.duration[0]) * 60 + ((ele.duration.length < 3 ? 0 : parseInt(ele.duration.replace('min','').slice(3))))};\n return newMovie ;\n }); \n return copyArray\n}", "title": "" }, { "docid": "8397e3d2e54129d513b62480c28d544d", "score": "0.6971517", "text": "function orderByDuration (movies){\n\n \n var tabWithMinutes = movies.map(function(el){ \n\n var part1= el.duration.split('h');\n var part2= part1[1].split('min');\n var dureeMinut=Number(part1[0])*60+Number(part2[0]);\n\n return {\n \n title: el.title,\n year: el.year,\n director: el.director,\n duration: dureeMinut,\n genre: el.genre,\n rate: el.rate\n \n }\n \n })\n\n var tabInOrderDuration = tabWithMinutes.sort(function(a,b){\n return a-b;\n })\n return tabInOrderDuration;\n }", "title": "" }, { "docid": "029d45393022a454607b0183a4973256", "score": "0.6966986", "text": "function turnHoursToMinutes(lista){\n var nuevainfo = lista.map(function(peli){\n var horasmin = peli.duration.split(\" \");\n var horas = 0;\n var minutos = 0;\n horasmin.forEach(function(elemento){\n if (elemento.includes('h')){\n horas = elemento.replace(\"h\",'');\n }\n if (elemento.includes('min')){\n minutos = elemento.replace('min','');\n }\n\n })\n \n var totalmin = parseInt(horas)*60 + parseInt(minutos);\n //peli.duration = totalmin;\n\n return Object.assign({},peli,{duration : totalmin})\n });\n return nuevainfo;\n}", "title": "" }, { "docid": "e675cd44f0bfb9eb0ddadc6116a1a8cf", "score": "0.6962712", "text": "function turnHoursToMinutes(movieArray) {\n let newArr = movieArray.slice();\n\n let movieDuration = newArr.filter((movie) => {\n return movie.duration;\n });\n return movieDuration;\n}", "title": "" }, { "docid": "441439cc110caa3d8d1c98f31bc0801f", "score": "0.6951723", "text": "function turnHoursToMinutes(moviesArray) {\n if (moviesArray.length === 0) return undefined;\n var minutesConverted = moviesArray.map(movie => {\n var newMovieObject = {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: convertToMinutes(movie.duration), \n genre: movie.genre,\n rate: movie.rate\n };\n return newMovieObject;\n });\n return minutesConverted;\n}", "title": "" }, { "docid": "ea280f3cc010cb27c33631f44eb313fe", "score": "0.69411594", "text": "function turnHoursToMinutes(array){\n let newArray = array.map(function(movie){\n let modifiedMovie = {...movie};\n let duration = movie.duration;\n let hour = 0;\n let minutes = 0;\n if (duration.split(\"h\").length !== 1) { // we don't have only minutes\n hour = parseInt(duration.split(\"h\")[0])\n }\n if (duration.length === 8 ) {\n minutes = parseInt(duration.slice(duration.length-5, duration.length-3))\n } else if (duration.length !== 8 && duration.split(\"h\").length === 1) { // we only have minutes\n minutes = parseInt(duration.slice(0,3))\n }\n let newTime = hour*60 + minutes;\n modifiedMovie.duration = newTime\n return modifiedMovie;\n })\n return newArray\n}", "title": "" }, { "docid": "acda2728ecc456fbeae63c16bd993331", "score": "0.6930108", "text": "function turnHoursToMinutes(array){\n let timeFormatChange = movies.map(function(movies){\n let split = movies.duration.split; \n \n return {\n title: movies.title,\n year: movies.year,\n director: movies.director,\n duration: totalMinutes,\n genre: movies.genre,\n rate: movies.rate\n }\n })\n console.log(timeFormatChange)\n\n }", "title": "" }, { "docid": "e85eb9a78fbd6e4ece8b0899d39e164b", "score": "0.69271743", "text": "function changeDuration(duration) {\n const hoursMin = parseInt((duration.split(\" \")[0])) * 60;\n const min = duration.split(\" \").length===2 ? parseInt((duration.split(\" \")[1])) : 0;\n return hoursMin + min;\n}", "title": "" }, { "docid": "661eba14a00a06d71e1c02f3af9fd6e6", "score": "0.6913997", "text": "function turnHoursToMinutes(arr) {\n\n let newArr = arr.map(x => {\n let newMovie = Object.assign({}, x);\n let h = ((x.duration).indexOf('h') > -1) ? Number((x.duration).slice(0, x.duration.indexOf('h'))) : 0;\n let min = ((x.duration).indexOf('m') > -1) ? Number((x.duration).slice(x.duration.indexOf(' ') + 1, x.duration.indexOf('m'))) : 0;\n newMovie.duration = h * 60 + min;\n return newMovie;\n });\n\n return newArr;\n}", "title": "" }, { "docid": "585927136286cc50f761c877e03cafce", "score": "0.68411016", "text": "function turnHoursToMinutes(arr){\n\n let arrayCopy = JSON.parse(JSON.stringify(arr)); // Creating a copy of array.\n\n arrayCopy = arrayCopy.map(function(arr){\n let timeArray = arr.duration.split(' '); // Separating hours and minutes\n let movieDuration = 0;\n if (timeArray.length === 2) { //meaning we have both hours and minutes since we're getting an array of 2 elements\n let hours = timeArray[0].split('h'); //removing letter \"h\" from first element of array\n let minutes = timeArray[1].split('min'); //removing letters \"min\" from second element of array\n movieDuration += parseInt(hours[0]) * 60 + parseInt(minutes[0]); //adding calculation to counter\n } else {\n if (timeArray[0].includes('h')) { //case with only hours\n let hours = timeArray[0].split('h');\n movieDuration += parseInt(hours[0]) * 60;\n } else { \n let minutes = timeArray[0].split('min'); //case with only minutes\n movieDuration += parseInt(minutes[0]);\n }\n }\n arr.duration = movieDuration; //replacing arr.duration values with calculated values\n return arr;\n });\n return arrayCopy;\n }", "title": "" }, { "docid": "993ebfcf0062aa1dec711192a910cbcb", "score": "0.6745557", "text": "function convertDuration (par){\n // se divide la cadena por un espacio, para tener una o dos partes,\n // una con la de horas y otra con la de minutos\n var hrmin = par.split(\" \");\n\n // se genera un nuevo arreglo donde ya se ha recuperado la cantidad de \n // minutos de las horas y los minutos como tal\n var hrminnumber = hrmin.map (function (item){ \n \n // si la cadena tiene 'h', se hace split para elminar la h \n // y recuperar el numero \n if (item.includes('h'))\n return parseInt(item.split('h'))*60\n\n // si la cadena tiene 'min', se hace split para elminar el min\n // y recuperar el numero \n if (item.includes('min'))\n return parseInt(item.split('min'))\n\n }) \n\n // despues de tener el nuevo arreglo, se reduce para devolver una suma\n return hrminnumber.reduce (function(acc,val){\n return acc += val \n },0);\n}", "title": "" }, { "docid": "ca75a72ee3afb3ccf05231837cb3e62a", "score": "0.67144114", "text": "function duration (times) { \n var minutes = parseInt(Math.floor(times/60));\n var second = parseInt(Math.floor(times%60));\n \n return (\"0\" + minutes).slice(-2) + \":\" + (\"0\" + second).slice(-2);\n }", "title": "" }, { "docid": "c4465c10125b1e86c5e9c7a8259a6cf6", "score": "0.66594166", "text": "function turnHoursToMinutes(array) {\n for (i=0; i< array.length; i++) {\n let durations = array[i].duration.split(' ');\n let hours = Number(durations[0].replace('h',''));\n let minutes = 0; \n if(durations[1]){\n minutes = Number(durations[1].replace('min',''));\n }\n array[i].duration = hours*60+minutes;\n }\n return array\n}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "eb4934d6bc14bfaeb225adf9b18cf5bd", "score": "0.6612071", "text": "function duration() {\r\n var video = document.getElementById(\"video\");\r\n var minutes = parseInt(video.duration / 60, 10);\r\n var seconds = parseInt(video.duration % 60);\r\n return minutes + \":\" + seconds;\r\n }", "title": "" }, { "docid": "12459ad12188d0055805c020636e16da", "score": "0.6602538", "text": "function turnHoursToMinutes(array) {\n​\n array.forEach((element) => {\n let hour = parseFloat(element.duration.slice(0, element.duration.indexOf(\"h\")));\n let min = parseFloat(element.duration.slice(element.duration.indexOf(\"h\") + 2, element.duration.indexOf(\"m\")));\n let totalMinutes = hour * 60 + min;\n element.duration = totalMinutes;\n​\n return;\n })\n​\n}", "title": "" }, { "docid": "28ebfed7922d98eb432c3147ef9c8911", "score": "0.66016555", "text": "function durationToMins(duration) {\n return duration.split(\" \").reduce(function (acc, time) {\n if (time.indexOf(\"h\") !== -1) return time.replace(\"h\", \"\") * 60 + acc;\n return Number(time.replace(\"min\", \"\")) + acc;\n }, 0);\n}", "title": "" }, { "docid": "46423cd00249874c2781c25014d06d15", "score": "0.657589", "text": "function turnHoursToMinutes(array) {\n for (i = 0; i < array.length; i++) {\n let durations = array[i].duration.split(\" \");\n let hours = Number(durations[0].replace(\"h\", \"\"));\n let minutes = 0;\n if (durations[1]) {\n minutes = Number(durations[1].replace(\"min\", \"\"));\n }\n array[i].duration = hours * 60 + minutes;\n }\n return array;\n}", "title": "" }, { "docid": "1d287c0757af55eddfd90fe34e1156fb", "score": "0.65733385", "text": "function getScore(duration){//sec\n let hrs = parseInt(duration/3600);\n duration -= hrs*3600;\n let mins = parseInt(duration/60);\n duration -= mins*60;\n\n let score = hrs+\":\"+mins+\":\"+parseInt(duration);\n console.log(score);\n return score;\n}", "title": "" }, { "docid": "1e4613035f4ccc0b588bda6c330605b8", "score": "0.651413", "text": "function turnHoursToMinutes(array) {\n let arrayDuration = array.map(elm => { \n return elm.duration\n })\n \n // let convertDuration = parseInt(elm.duration)\n \n return convertDuration\n \n\n}", "title": "" }, { "docid": "b23bd5b550f1581e3a588b397ae50f86", "score": "0.64922786", "text": "function turnHoursToMinutes(array) {\n\n\tfunction minutesFromHString(hString) {\n\t\tconst num = hString.replace(/h/, '')\n\n\t\treturn Number(num) * 60\n\t}\n\n\tfunction minutesFromMinString(minString) {\n\t\tconst num = minString.replace(/min/, '')\n\n\t\treturn Number(num)\n\t}\n\n\tfunction minutesFromDurationString(duration) {\n\t\tconst durationArr = duration.split(' ')\n\n\t\tif (durationArr.length === 2) {\n\t\t\treturn minutesFromHString(durationArr[0]) +\n\t\t\t\tminutesFromMinString(durationArr[1])\n\t\t}\n\n\t\tif (durationArr[0].includes('h')) {\n\t\t\treturn minutesFromHString(durationArr[0])\n\t\t}\n\n\t\treturn minutesFromMinString(durationArr[0])\n\t}\n\n\tlet newArrWithMin = []\n\tarray.forEach(movie => {\n\t\tlet singleMovie = { ...movie,\n\t\t\tduration: minutesFromDurationString(movie.duration)\n\t\t}\n\t\tnewArrWithMin.push(singleMovie)\n\t})\n\treturn newArrWithMin\n\n}", "title": "" }, { "docid": "4c7bb144a5b34c672dc6213a6e1c3e1d", "score": "0.64616483", "text": "function turnHoursToMinutes(array) {\n let arraynou = []\n var minutos = []\n for (let index = 0; index < array.length; index++) {\n const element = array[index].duration;\n if (element.includes(\"h\") && element.includes(\"min\")) {\n\n minutos = parseInt(element.slice(0, element.indexOf(\"h\"))) * 60\n + parseInt(element.slice(element.indexOf(\"h\") + 2, element.indexOf(\"min\")))\n } else if (element.includes(\"h\")) {\n minutos = parseInt(element.slice(0, element.indexOf(\"h\"))) * 60\n } else {\n minutos = parseInt(element.slice(0, 2))\n\n }\n\n console.log(minutos)\n let temp = {\n \"title\": array[index].title,\n \"year\": array[index].year,\n \"director\": array[index].director,\n \"duration\": minutos,\n \"genre\": array[index].genre,\n \"rate\": array[index].rate\n }\n arraynou.push(temp)\n }\n return arraynou\n\n}", "title": "" }, { "docid": "f592a00d1d764dee26ecff18cf66bd64", "score": "0.64449584", "text": "function turnHoursToMinutes(array){\n array.forEach(function(element) {\n var hour = parseInt(element.duration.substring(0,1));\n var minutes = parseInt(element.duration.split(\"min\")[0].substring(2));\n element.duration = hour * 60 + minutes;\n });\n return array;\n}", "title": "" }, { "docid": "a81f290a077905403605586b87bbd6e0", "score": "0.63906515", "text": "function durationHandler() {\n video.currentTime = (duration.value/100) * video.duration;\n}", "title": "" }, { "docid": "a72f311f14e54246484880617a919409", "score": "0.6383558", "text": "function turnHoursToMinutes(arr) {\n if (!arr || !arr[0]) return null;\n let newMovies = JSON.parse(JSON.stringify(arr)); // The Objects were being copies by reference with [...arr].\n for (let i = 0; i < newMovies.length; i++) {\n let times = newMovies[i].duration.toString().split(' '); // THIS LINE RIGHT HERE BROUGHT ME HELL, toString is needed despite the property being a string.\n let cleanHours = 0;\n let cleanMinutes = 0;\n if (times.length > 1) {\n cleanHours = parseInt(times[0]);\n cleanMinutes = parseInt(times[1]);\n } else if (times[0].includes('h')) {\n cleanHours = parseInt(times);\n } else {\n cleanMinutes = parseInt(times);\n }\n newMovies[i].duration = cleanHours * 60 + cleanMinutes;\n }\n return newMovies;\n}", "title": "" }, { "docid": "77cba306469ccc95d3aacec6efdd2813", "score": "0.6369239", "text": "function setDuration(journey) {\n journey.durationInMin = (Date.parse(journey.arrival) - Date.parse(journey.departure)) / 1000 / 60; //milisec, sec in min\n }", "title": "" }, { "docid": "bb3e199d49e585e03f62c53a52f5947b", "score": "0.63569677", "text": "function turnHoursToMinutes(arr) {\n let newArr = arr.map( movie => {\n return {\n ...movie,\n duration: doTurnHoursToMinutes(movie.duration)\n }\n })\n \n return newArr\n}", "title": "" }, { "docid": "0dd3a27c28993fb003a1f285059025b0", "score": "0.63559276", "text": "duration(tiks) {\n let ms = tiks % 1000;\n let ts = Math.floor(tiks / 1000);\n \n let hh = Math.floor( ts / 3600);\n let mm = Math.floor( (ts % 3600) / 60);\n let ss = (ts % 3600) % 60;\n \n return(''+hh+':'+('0'+mm).slice(-2)+':'+('0'+ss).slice(-2)+'.'+('000'+ms).slice(-3));\n }", "title": "" }, { "docid": "4eb92fc34aedcd4996b3d1826d671aaa", "score": "0.63458735", "text": "function turnHoursToMinutes(movies) {\n const newArray = [...movies];\n //let array = []\n newArray.map(elm2 => {\n let array = elm2.duration.split(\" \");\n console.log(array);\n console.log(array.length);\n\n if (array.length === 1) {\n //array.join()\n console.log(\"me meto en el =1\");\n if (array[0].includes(\"min\")) {\n elm2.duration = +array[0].replace(\"min\", \"\");\n console.log(array);\n } else {\n elm2.duration = +array[0].replace(\"h\", \"\") * 60;\n console.log(array);\n }\n console.log(elm2);\n } else {\n elm2.duration =\n +array[0].replace(\"h\", \"\") * 60 + +array[1].replace(\"min\", \"\");\n console.log(array);\n }\n });\n\n console.log(array);\n //var n = str.split(\"d\");\n //let a = elm.duration.replace(\"h\", \" \")\n //String remplazado = aRemplazar.replace(\"a\", \"\");\n //return newArray\n\n console.log(array);\n return newArray;\n}", "title": "" }, { "docid": "77d91c10d6ea9cf73dd6f9bfdc863ba7", "score": "0.6340683", "text": "function turnHoursToMinutes(arr){\n let hrs = arr.map(elem => parseInt(elem.duration.split(\" \")[0]))\n let minutes = arr.map(elem => parseInt(elem.duration.split(\" \")[1]))\n let time = []\n for (let i=0; i <arr.length; i++){\n time.push(hrs[i] * 60 + minutes[i])\n }\n let newArr = arr.map((elem, index)=> {\n elem.duration = time[index]\n return elem\n })\n return newArr\n }", "title": "" }, { "docid": "9c355478b29296b214bdfac83721a673", "score": "0.633239", "text": "function turnHoursToMinutes(arr) {\n let copy = [...arr];\n return copy.map((movie) => {\n return (movie.duration = convertFormatToMinutes(movie.duration));\n });\n}", "title": "" }, { "docid": "537c36cb3ce7e47c930d3c7acdc54c35", "score": "0.63292915", "text": "getDuration(meal) {\n let startHr = meal.startHr,\n startMin = meal.startMin,\n endHr = meal.endHr,\n endMin = meal.endMin;\n\n let min = endMin - startMin;\n let hr = endHr - startHr;\n\n //alert(JSON.stringify(meal.endMin));\n\n if (min < 0) {\n min = 60 + min;\n }\n\n if( endHr - startHr == 0) {\n return (min) + \" m\";\n }\n else {\n return (hr) + \" h \" + (min) + \" m\";\n }\n }", "title": "" }, { "docid": "498641efdb6d7f4a2e353d8ece2b445a", "score": "0.6303104", "text": "timeConvert(numOfMins){\n let hours = Math.floor(numOfMins / 60);\n let minutes = numOfMins % 60; \n let seconds = minutes % 60;\n\n return (hours + \":\" + minutes +\":\" + seconds);\n \n }", "title": "" }, { "docid": "a8eb49b4119f31a0fe848c70f95cfaee", "score": "0.6299853", "text": "function orderByDuration(movies){\n var standardized = turnHoursToMinutes(movies)\n\n if( standardized.length === 1)\n return movies\n if( standardized.length > 1)\n {\n var sorted = standardized.sort(function(a,b){\n return a.duration - b.duration\n })\n var sortedTitles = sorted.sort(function(x,y){\n if(x.duration - y.duration === 0){\n if(x.title < y.title)\n return -1\n if(x.title > y.title)\n return 1\n return 0\n }else{\n if(x.duration < y.duration)\n return -1\n if(x.duration > y.duration)\n return 1\n }\n })\n return sortedTitles\n }\n}", "title": "" }, { "docid": "45d52dfa2cf3eef9392bf435ef798d73", "score": "0.6294824", "text": "function turnHoursToMinutes(arr) {\n let newArr = []\n\n let m = JSON.parse(JSON.stringify(arr))\n\n m.filter(function (movie) {\n if (movie.duration)\n movie.duration = changeTime(movie.duration)\n console.log(movie)\n return newArr.push(movie)\n })\n\n\n\n function changeTime(time) {\n\n if (time.length <= 2) {\n let timeNumber = time.replace(\"h\", \"\")\n let timeArr = timeNumber.split(\" \").map(Number)\n let timeMin = (timeArr[0] * 60)\n\n return timeMin\n\n } else if (time.length <= 5) {\n let timeNumber = time.replace(\"min\", \"\")\n let timeArr = timeNumber.split(\" \").map(Number)\n let timeMin = timeArr[0]\n\n return timeMin\n\n } else {\n\n let timeNumber = time.replace(\"h\", \"\").replace(\"min\", \"\")\n let timeArr = timeNumber.split(\" \").map(Number)\n let timeMin = (timeArr[0] * 60 + timeArr[1])\n\n return timeMin\n }\n }\n\n return newArr\n}", "title": "" }, { "docid": "a9df237abb39db550435a2542241219d", "score": "0.6261137", "text": "@computed get duration() {\n return this.timespan(this._start, this._end) / 60; \n }", "title": "" }, { "docid": "225dfeb51bf46b54ba1bda17f6901ecf", "score": "0.6239878", "text": "function orderByDuration(movies){\n var minutes = turnHoursToMinutes(movies)\n minutes.sort(function(movieA, movieB){\n var result = movieA.duration - movieB.duration;\n if(result !== 0){\n return result;\n }\n if(movieA.title < movieB.title){\n return -1;\n }\n if (movieA.title > movieB.title ){\n return 1;\n }\n return 0;\n })\n return minutes;\n}", "title": "" }, { "docid": "160ebd32c1ef98c6f7f09088301450d3", "score": "0.6238108", "text": "function displayDurationTime() {\n const { duration } = audio;\n let minutes = Math.floor(duration / 60);\n let seconds = Math.floor(duration % 60);\n\n minutes = minutes < 10 ? `0${minutes}` : minutes;\n seconds = seconds < 10 ? `0${seconds}` : seconds;\n\n durationTimeEl.textContent = `${minutes}:${seconds}`;\n}", "title": "" }, { "docid": "e3d4dfd4afe9968e5e026dc4bb2a9fcc", "score": "0.62273884", "text": "function turnHoursToMinutes(array) {\n const durations = array.map(function(el){\n const durationString = el.duration;\n let indexH = durationString.indexOf(\"h\");\n let indexMin = durationString.indexOf(\"min\");\n let hours = Number(durationString.substring(0, indexH));\n let minutes = 0;\n if (indexMin > 0) {\n minutes = Number(durationString.substring(indexH+1, indexMin));\n }\n return hours * 60 + minutes;\n });\n return durations;\n}", "title": "" }, { "docid": "4d11014b3f597741097fbde951376958", "score": "0.622467", "text": "function calcTime(dist){\n\t//Get duration of the video\n\tvar dur = Popcorn(\"#video\").duration();\n\t//Get width of timeline in pixels\n\tvar wdth = document.getElementById(\"visualPoints\").style.width;\n\t//Trim for calculations\n\twdth = wdth.substr(0,wdth.length - 2);\n\t//Calculate pixel/total ratio\n\tvar ratio = dist / wdth;\n\t//Return time value in seconds calculated using ratio\n\treturn (ratio * dur);\n}", "title": "" }, { "docid": "fe3cdd76443fc6283f45fe846fcb6763", "score": "0.61787117", "text": "timeConvert(num){\n // Divide num by 60\n // Round down\n let hours = Math.floor(num/60);\n // Remainder is minutes\n let minutes = num % 60;\n // Return hours:minutes\n let results = hours + \":\" + minutes;\n return results;\n }", "title": "" }, { "docid": "16cad7a632bd8928636668735e28c700", "score": "0.6166136", "text": "function sessionsToTime(sessionsCount, duration) {\n const totalMins = sessionsCount * duration\n const mins = (totalMins % 60)\n const hours = Math.floor(totalMins / 60)\n // return `${hours} hours ${mins? `and ${mins} minutes` :''}`\n return { hours, mins }\n}", "title": "" }, { "docid": "312cb2d0d8edc67e2763478dd8c93e4e", "score": "0.6165392", "text": "function turnHoursToMinutes(arr) {\n if (arr.length === 0) {\n return [];\n }\n if (arr.duration===undefined){\n return 0;\n }\n\n// method 0 :D\n /*arr=arr.forEach(function (element){\n if(!element.duration.includes(\"min\")){\n element.duration=parseInt(element.duration)*60;\n }\n else if(element.duration.includes(\"min\")){\n if(element.duration.includes(\" \")){\n let time=[];\n time.push(element.duration.split(\" \"));\n time[0]=parseInt(time[0])*60;\n time[1]=parseInt(time[1]);\n element.duration=time[0]+time[1];\n }\n else {\n element.duration=parseInt(element.duration);\n }\n }\n return arr;\n })\n */\n\n //method 1 XDDD\n /* arr=arr.forEach(function (element){\n if(!element.duration.includes(\" \")){\n if(element.duration<15){\n element.duration=parseInt(element.duration)*60;\n return arr;\n }else{\n element.duration=parseInt(element.duration);\n return arr;\n }\n }\n else if(element.duration.includes(\" \")){\n let time=[];\n time.push(element.duration.split(\" \"));\n time[0]=parseInt(time[0])*60;\n time[1]=parseInt(time[1]);\n element.duration=time[0]+time[1];\n return arr;\n }\n \n\n })\n*/\n\n\n//method 2 XD \n //let newArr=[];\n //for(let i=0;i<=arr.length;i++){\n // if(!arr[i].duration.includes(\" \")){\n // if(arr[i].duration<15){\n // arr[i].duration=parseInt(arr[i].duration)*60;\n // }\n // else {\n // arr[i].duration=parseInt(arr[i].duration);\n // }\n // }\n // else if(arr[i].duration.includes(\" \")){\n // let time=[];\n // time.push(arr[i].split(\" \"));\n // time[0]=parseInt(time[0])*60;\n // time[1]=parseInt(time[1]);\n // arr[i].duration=time[1]+time[0];\n // }\n // newArr.push(arr[i]);\n //}\n\n\n\n//method 3 XD \n\n\n arr = arr.map(function(movie){\n let filmTime=movie;\n if (!(filmTime.duration).includes(\" \")) {\n if(parseInt(filmTime.duration)<=25){\n filmTime.duration=parseInt(filmTime.duration);\n }\n else if (parseInt(filmTime.duration)>25){\n filmTime.duration = parseInt(filmTime.duration)*60;\n }\n } else if ((filmTime.duration).includes(\" \")){\n let time = [];\n time.push((filmTime.duration).split(\" \"));\n \n time[0]=parseInt(time[0])*60;\n time[1]=parseInt(time[1]);\n filmTime.duration=time[0]+time[1];\n }\n return filmTime;\n })\n \n}", "title": "" }, { "docid": "1dd31286c53d92aa0b7f8099e76c8b01", "score": "0.6155475", "text": "function turnHoursToMinutes(moviesArray) {\n r = [];\n for (i = 0; i < movies.length; i++) {\n return r; \n}\n}", "title": "" }, { "docid": "e3932d3196fbd56db3948171f4649459", "score": "0.61394167", "text": "function convertRunTimeToMins(runTime) {\n // ParseRunTime: Remove first 2 characters & last 1 character\n runTime = runTime.substr(2);\n runTime = runTime.slice(0, -1);\n \n // Split at H\n runTime = runTime.split('H');\n var h = runTime[0];\n var m = runTime[1];\n\n h = h * 60;\n m = parseInt(m);\n\n m = h + m;\n\n return m;\n}", "title": "" }, { "docid": "87d8974d8c963b95feab756927a33c1c", "score": "0.61351293", "text": "function turnHoursToMinutes(array) {\n return array.map(element => {\n let newElement = { ...element };\n const timeArray = newElement.duration.split(' ');\n if (timeArray.length > 1) {\n const timesAndMinutes = timeArray.map(element => {\n return parseInt(element.replace(/[^0-9]/g, ''));\n });\n const hour = timesAndMinutes[0];\n const minutes = timesAndMinutes[1];\n newElement.duration = hour * 60 + minutes;\n } else {\n const time = timeArray[0];\n if (time.includes('h')) {\n const hour = parseInt(time.replace(/[^0-9]/g, ''));\n newElement.duration = hour * 60;\n } else if (time.includes('min')) {\n const minutes = parseInt(time.replace(/[^0-9]/g, ''));\n newElement.duration = minutes;\n }\n }\n return newElement;\n });\n}", "title": "" }, { "docid": "20ca2c739815e6fa4a1fc9d3003f9409", "score": "0.61347765", "text": "set duration(val) {\n this.hr.duration = val;\n }", "title": "" } ]
40eae1ca585b68352d6a11ae735bd46d
Iterates over all items in the DialerQueue and executes there callback with an error. This causes the entire DialerQueue to be drained
[ { "docid": "0dfad77c8250092ca85ae3ed412c64c0", "score": "0.0", "text": "stop () {\n this.isRunning = false\n // Clear the general queue\n this._queue.clear()\n // Clear the cold call queue\n this._coldCallQueue.clear()\n\n this._cleanInterval.clear()\n\n // Abort the individual peer queues\n const queues = Object.values(this._queues)\n queues.forEach(dialQueue => {\n dialQueue.abort()\n delete this._queues[dialQueue.id]\n })\n }", "title": "" } ]
[ { "docid": "daedb1e4a0be6ad9cc53e7b0fa4e1f91", "score": "0.61996436", "text": "run () {\n if (!this.isRunning) return\n\n if (this._dialingQueues.size < this.switch.dialer.MAX_PARALLEL_DIALS) {\n let nextQueue = { done: true }\n // Check the queue first and fall back to the cold call queue\n if (this._queue.size > 0) {\n nextQueue = this._queue.values().next()\n this._queue.delete(nextQueue.value)\n } else if (this._coldCallQueue.size > 0) {\n nextQueue = this._coldCallQueue.values().next()\n this._coldCallQueue.delete(nextQueue.value)\n }\n\n if (nextQueue.done) {\n return\n }\n\n let targetQueue = this._queues[nextQueue.value]\n\n if (!targetQueue) {\n log('missing queue %s, maybe it was aborted?', nextQueue.value)\n return\n }\n\n this._dialingQueues.add(targetQueue.id)\n targetQueue.start()\n }\n }", "title": "" }, { "docid": "ddd1a23b520203c02e15d68caae63b53", "score": "0.5896048", "text": "function callback(error) {\n\n // If the task handler throws an error then add it to the queue again\n // we allow this for a max of _maxFailures\n // If the error is null then we add the task silently back into the\n // microQueue in reverse... This could be due to pause or throttling\n if (typeof error !== 'undefined' && error !== null) {\n invocation.failures++;\n _failures.inc();\n\n if (invocation.failures < _maxFailures.value) {\n // Add the task again with the increased failures\n self.add(invocation.data, invocation.failures, invocation._id);\n } else {\n _errors.inc();\n self.errorHandler(invocation.data, self.add, invocation.failures);\n }\n\n }\n\n // We use null to throttle pauseable tasks\n if (error === null) {\n // We add this task into the queue, no questions asked\n invocations.insert(invocation._id, invocation);\n }\n\n // Task has ended we remove the task from the process list\n _processList.remove(invocation._id);\n\n // Next task\n self.next();\n }", "title": "" }, { "docid": "aa607506713606046a825593e3ac08fa", "score": "0.58298063", "text": "_processQueue() {\n // If the queue is not already being processed, and there's stuff to process, continue sending them\n if (!this._processTimeout && this._queue.length > 0) {\n this._processTimeout = setTimeout(() => {\n\n // Pull the items we're going to batch out of the queue\n const items = this._queue.splice(0, 255);\n this._saveQueue(false);\n\n // Track the item\n this._batchSend(items, (err, res) => {\n // TODO: If there was an error, consider splicing the batch back into the queue\n\n // Update / Set the metric sid on the publisher\n /* istanbul ignore else: server barks */\n if (res && res.data && res.data.sid) this._updateSid(res.data.sid);\n\n // When this batch is done being tracked, iterate to the next metric then fire it's callback if set\n this._processTimeout = null;\n this._processQueue();\n\n // Fire the event callbacks if there are any\n items.forEach((item) => {\n item.callback && item.callback(err, res);\n });\n });\n\n }, 0); // break event loop, maybe\n }\n }", "title": "" }, { "docid": "50ed79b294d91ddae6b82b17f8a08383", "score": "0.5807476", "text": "function onDrain () {\n if (self.sentCallbackFn.length > 0) {\n var seqFn = self.sentCallbackFn.splice(0, 1)[0];\n if ('function' === typeof seqFn) {\n debug('executing send callback');\n seqFn(self.transport);\n } else if (Array.isArray(seqFn)) {\n debug('executing batch send callback');\n for (var l = seqFn.length, i = 0; i < l; i++) {\n if ('function' === typeof seqFn[i]) {\n seqFn[i](self.transport);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "8cebaee00db91937531ef43d7fb17ab6", "score": "0.57978904", "text": "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "title": "" }, { "docid": "8cebaee00db91937531ef43d7fb17ab6", "score": "0.57978904", "text": "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "title": "" }, { "docid": "8cebaee00db91937531ef43d7fb17ab6", "score": "0.57978904", "text": "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "title": "" }, { "docid": "c60880f5ee9dad9c1070c818edbcce46", "score": "0.57975024", "text": "function processQueue() {\n\t var queue = nextTick.queue;\n\t var digest = nextTick.digest;\n\t\n\t nextTick.queue = [];\n\t nextTick.timeout = null;\n\t nextTick.digest = false;\n\t\n\t queue.forEach(function(queueItem) {\n\t var skip = queueItem.scope && queueItem.scope.$$destroyed;\n\t if (!skip) {\n\t queueItem.callback();\n\t }\n\t });\n\t\n\t if (digest) $rootScope.$digest();\n\t }", "title": "" }, { "docid": "270bea8bb10de1c4b5efa3e39a112922", "score": "0.5795989", "text": "function drainQueue() {\n\t\trunHandlers(handlerQueue);\n\t\thandlerQueue = [];\n\t}", "title": "" }, { "docid": "67584d82b7b04daea82929cb84dfd758", "score": "0.57768154", "text": "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "title": "" }, { "docid": "67584d82b7b04daea82929cb84dfd758", "score": "0.57768154", "text": "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "title": "" }, { "docid": "4fc6c5b29ea3534f51d26a8e5c33869b", "score": "0.5760142", "text": "function freeExpiredQueueItems(callback) {\n const origin = `${id}-throttle-freeExpiredQueueItems`;\n log.spam(origin);\n\n try {\n const status = 'success';\n\n // if timeout is 0, this is handled in finish queue item as that is more efficient\n if (expireTimeout === 0) {\n return callback(status);\n }\n\n const cur = new Date();\n\n // actual call to retrieve the in use turn from the database\n return getQueueItems(dbUtilInst, queueColl, { active: true }, (currentUse, gerror) => {\n if (gerror) {\n return callback(null, gerror);\n }\n\n // if there is nothing to free just return\n if (currentUse.length === 0) {\n return callback(status);\n }\n\n let handled = 0;\n\n // go through the queue items to see if any have expired\n for (let i = 0; i < currentUse.length; i += 1) {\n // if the transaction finished and the end + timeout is less than the current time\n if (currentUse[i].end !== null\n && (Number(currentUse[i].end) + Number(expireTimeout) < cur.getTime())) {\n freeQueueItem(dbUtilInst, queueColl, currentUse[i], (flic, ferror) => {\n if (ferror) {\n return callback(null, ferror);\n }\n\n handled += 1;\n // when we have handled everything - return\n if (handled === currentUse.length) {\n log.spam(`${origin}: ${flic}`);\n return callback(status);\n }\n });\n } else {\n handled += 1;\n }\n // when we have handled everything - return\n if (handled === currentUse.length) {\n return callback(status);\n }\n }\n\n return callback(status);\n });\n } catch (e) {\n // handle any exception\n const errorObj = transUtilInst.checkAndReturn(e, origin, 'Issue freeing queue items');\n return callback(null, errorObj);\n }\n}", "title": "" }, { "docid": "82c18d6b61801579d733b35ca4d2dc4a", "score": "0.57430714", "text": "function drainQueue() {\n var task, i = 0;\n\n while(task = handlerQueue[i++]) {\n task();\n }\n\n handlerQueue = [];\n }", "title": "" }, { "docid": "1e497312eb2ec651ded50cf529c8df49", "score": "0.5738455", "text": "executeQueue() {\n while (this.queue.length > 0) {\n let { message } = this.queue.shift();\n this.sendMessage(message);\n }\n }", "title": "" }, { "docid": "92cb15555ae92bbbdb811ec2753a65e2", "score": "0.57374716", "text": "function onDrain() {\n\t if (self.sentCallbackFn.length > 0) {\n\t var seqFn = self.sentCallbackFn.splice(0,1)[0];\n\t if ('function' == typeof seqFn) {\n\t debug('executing send callback');\n\t seqFn(self.transport);\n\t } else if (Array.isArray(seqFn)) {\n\t debug('executing batch send callback');\n\t for (var l = seqFn.length, i = 0; i < l; i++) {\n\t if ('function' == typeof seqFn[i]) {\n\t seqFn[i](self.transport);\n\t }\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "079aba86d9050c0f5551f7562514d664", "score": "0.5730957", "text": "function processQueue () {\r\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\r\n queue = [];\r\n }", "title": "" }, { "docid": "3bfd820038c1fadfdd8490608d15175f", "score": "0.56984186", "text": "function drainQueue() {\n var task, i = 0;\n\n while(task = handlerQueue[i++]) {\n task();\n }\n\n handlerQueue = [];\n }", "title": "" }, { "docid": "ded3d4db5eaae04bb0759effca8b2a7b", "score": "0.5697819", "text": "async triggerNextQueueItem() {\n\n\t\tif (this.queue.length === 0 || this.checkedOut >= this.checkedOutMax) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst queueItem = this.queue.shift();\n\t\tif (queueItem == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.checkedOut++;\n\n\t\ttry {\n\t\t\tconst response = await this.doQueueItem(queueItem);\n\t\t\tqueueItem.resolve(response);\n\t\t} catch (err) {\n\t\t\tqueueItem.attempts++;\n\t\t\tconst maxAttempts = queueItem.options.maxAttempts || this.maxAttemptsPerRequest;\n\t\t\tconsole.warn(`Failed RequestFactory Request (Attempt ${queueItem.attempts}/${maxAttempts}):`, queueItem, err);\n\t\t\tif (queueItem.attempts >= maxAttempts) {\n\t\t\t\tqueueItem.reject(err);\n\t\t\t} else {\n\t\t\t\tthis.queue.unshift(queueItem);\n\t\t\t\tthis.triggerNextQueueItem();\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.checkedOut--;\n\t\t}\n\n\t}", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.568691", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.568691", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.568691", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.568691", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "a9470e25c8b40c047de9aaadaa2d82be", "score": "0.568691", "text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }", "title": "" }, { "docid": "d26689a32f449c526271bcfd9117fccd", "score": "0.5652439", "text": "retryAllQueueBuffers() {\n this.queueMap.forEach((queue, queueName) => {\n if (queue.type === 'p') {\n queue.retryBuffer();\n }\n });\n let totalBufferCount = 0;\n this.queueMap.forEach((queue, queueName) => {\n if (queue.type === 'p') {\n totalBufferCount += queue.getBufferCount();\n }\n }); \n if (totalBufferCount == 0) {\n this.emit('resume');\n }\n // this.queueMap.forEach((queue, queueName) => {\n // queue.resume();\n // });\n }", "title": "" }, { "docid": "f0b5607542d8dbb52f7596cef6fb1c13", "score": "0.5641581", "text": "async _displayErrors() {\n let cursor;\n while (cursor !== '0') {\n cursor = cursor || '0';\n const result = await redisHelpers.scan(this._redis, cursor, this._handler.errorsPrefix + '*', '50');\n if (result && result.length > 1) {\n cursor = result[0];\n const keys = result[1];\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n try {\n const errorObject = await redisHelpers.readAndDeleteError(this._redis, key);\n console.log(`[${new Date(errorObject.stamp)}]`,\n 'message:', errorObject.message,\n '\\nstack:', errorObject.stack);\n } catch (err) {\n console.error(err);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "550a262e0116473d25c4830b8645ce1a", "score": "0.5640857", "text": "function executeQueue() {\n if (queue.length === 0)\n return;\n\n // Only execute the first item if it's a function.\n if (typeof queue[0] === 'function')\n queue[0]();\n\n // Remove the first item from the queue.\n queue.shift();\n\n // Check for more items.\n if (queue.length > 0)\n executeQueue();\n }", "title": "" }, { "docid": "20150e0fb7f7492a7dff3fb31c96ea4d", "score": "0.5633879", "text": "function drainQueue() {\n\t\tvar task, i = 0;\n\n\t\twhile(task = handlerQueue[i++]) {\n\t\t\ttask();\n\t\t}\n\n\t\thandlerQueue = [];\n\t}", "title": "" }, { "docid": "20150e0fb7f7492a7dff3fb31c96ea4d", "score": "0.5633879", "text": "function drainQueue() {\n\t\tvar task, i = 0;\n\n\t\twhile(task = handlerQueue[i++]) {\n\t\t\ttask();\n\t\t}\n\n\t\thandlerQueue = [];\n\t}", "title": "" }, { "docid": "0ac7f5131207ca005aeca49662369a86", "score": "0.56070906", "text": "function queue (cb) {\n\t\tif (ev.buffer.length > ev.maxQueueLength) {\n\t\t\tconsole.warn('Uhura exceeded maximum queue length, released stale data');\n\t\t\tev.buffer.shift();\n\t\t}\n\t\tev.buffer.push(cb);\n\t}", "title": "" }, { "docid": "2ba88c3bc27e4ad7acc7c939a76d04c8", "score": "0.5596285", "text": "function checkForCompletion() {\n if (queuedObjects.length === 0) {\n returnCallback(derezObj);\n } \n }", "title": "" }, { "docid": "a6b7743418ba2db1f8c6277809f2927c", "score": "0.55922234", "text": "function processQueue () {\n\t queue.forEach(function (func) { $mdUtil.nextTick(func); });\n\t queue = [];\n\t }", "title": "" }, { "docid": "f5fc42fda89527bbce2f6d15f0abb199", "score": "0.55768305", "text": "start() {\n const promises = _.map(this._queue, (promise) => {\n return promise.catch((result) => {\n this._onError();\n\n throw result;\n });\n });\n\n Promise.all(promises).then(() => this.finish());\n }", "title": "" }, { "docid": "868ddbb34dabc6d4250e69806b605005", "score": "0.55445206", "text": "_processQueueItems(items, index) {\n const _self = this;\n return new Promise((resolve, reject) => {\n if (index < items.length) {\n this.options.logger.log(['Simulation engine queue: number of items:', items.length, ', current index:', index].join(' '), this.options.logger.levels.INFO);\n let _messageBody = JSON.parse(items[index].Body);\n this.options.logger.log(['Processing device queue message:', items[index].MessageId].join(' '), this.options.logger.levels.INFO);\n // this.options.logger.log(_messageBody, this.options.logger.levels.ROBUST);\n\n // verify hydrating this request will not exceed hard concurrency limit\n if (_messageBody.action === 'hydrate') {\n this._isLimitExceeded().then((limitCheck) => {\n if (limitCheck) {\n _self._routeMessage(_messageBody);\n _self._deleteQueueMessage(items[index].ReceiptHandle).then((data) => {\n index++;\n _self._processQueueItems(items, index).then((data) => {\n resolve(data);\n });\n });\n } else {\n index++;\n _self._processQueueItems(items, index).then((data) => {\n resolve(data);\n });\n }\n });\n } else {\n this._routeMessage(_messageBody);\n this._deleteQueueMessage(items[index].ReceiptHandle).then((data) => {\n index++;\n this._processQueueItems(items, index).then((data) => {\n resolve(data);\n });\n });\n }\n } else {\n resolve('Batch of queue items processed...');\n }\n });\n\n }", "title": "" }, { "docid": "5067ada7600d40ae276fa1cc9f8c1698", "score": "0.55404675", "text": "_flush(onEnd) {\n const queue = this.queue.reduce(reduceDelays, []);\n this.queue.length = 0; // Track the number of unsettled updates.\n\n let runsLeft = Object.keys(queue).length;\n this.runCount += runsLeft; // Any run can finish last.\n\n const onRunEnd = () => {\n this.runCount--;\n\n if (! --runsLeft && onEnd) {\n onEnd();\n }\n };\n\n Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(queue, (props, delay) => {\n if (delay) {\n setTimeout(() => {\n // Cancelling methods touch the `cancelledAt` property\n if (props.timestamp < this.cancelledAt) return;\n\n this._run(props, onRunEnd);\n }, delay);\n } else {\n this._run(props, onRunEnd);\n }\n });\n }", "title": "" }, { "docid": "2b55ddd8adae1e91e2f92fa4f4aea216", "score": "0.5537898", "text": "runQueue() {\n\t\tif (this.queueRunning || !this.queriesQueue.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.log('info', 'Running queries queue');\n\n\t\tconst nextQuery = this.queriesQueue.shift();\n\t\tthis.queueRunning = true;\n\t\tthis.query(...nextQuery.params).then(\n\t\t\t(data) => {\n\t\t\t\tif (nextQuery.resolve) {\n\t\t\t\t\tnextQuery.resolve(data);\n\t\t\t\t}\n\t\t\t\tthis.resetRetryDelay();\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (shouldQueryBeRetried(err)) {\n\t\t\t\t\tconst retryDelay = this.getNextRetryDelay();\n\t\t\t\t\tthis.queriesQueue.unshift(nextQuery);\n\t\t\t\t\tthis.log('info', `Will retry query in ${retryDelay / 1000} seconds`);\n\t\t\t\t\treturn delay(retryDelay, this.setTimeout);\n\t\t\t\t} else if (nextQuery.reject) {\n\t\t\t\t\tnextQuery.reject(err);\n\t\t\t\t}\n\t\t\t\tthis.resetRetryDelay();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t).then(() => {\n\t\t\t// Will always execute\n\t\t\tthis.queueRunning = false;\n\t\t\tthis.runQueue();\n\t\t});\n\t}", "title": "" }, { "docid": "017000e82a6c8c1f1fb4cf59f3f04077", "score": "0.5537688", "text": "nextOnQueue(connection) {\n // Files to delete\n let item;\n if (this.toDelete.length) {\n // We loop between all the files that we need to delete until they are all done.\n for (item of Array.from(this.toDelete)) {\n if (!item.started) {\n this.deleteItem(connection, item);\n return;\n }\n }\n }\n\n // Files to upload\n if (this.toUpload.length) {\n // We loop between all files that wee need to upload until they are all done\n for (item of Array.from(this.toUpload)) {\n if (!item.started) {\n this.checkBeforeUpload(connection, item);\n return;\n }\n }\n }\n\n\n for (item of Array.from(this.toDelete)) {\n if (!item.completed) { return; }\n }\n\n for (item of Array.from(this.toUpload)) {\n if (!item.completed) { return; }\n }\n\n // Everything is updated, we can finish the process now.\n return this.removeConnections();\n }", "title": "" }, { "docid": "de07c3336e22a64bf2efe4765548c5f6", "score": "0.5536316", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "e935aa09a8df078bf25095f745d82add", "score": "0.55314815", "text": "function cb(e) {\n if (e) return callback(e);\n\n if (sendErrors.length > 0) {\n var responseError = new Error('Collected ' + sendErrors.length + '/' + coll.length + ' failures. See property errors');\n\n responseError.errors = sendErrors;\n\n return callback(responseError);\n }\n\n return callback();\n }", "title": "" }, { "docid": "d8423e1e743bf942dd1b4ca2528f0276", "score": "0.5528209", "text": "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key];\n\n bee.on('failed', this.handleFailure).process(handle);\n });\n }", "title": "" }, { "docid": "b7f54c60d9803f53af07d9beeef44614", "score": "0.55203766", "text": "dequeue () {\n while (!this.deflating && this.queue.length) {\n const params = this.queue.shift();\n\n this.bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "b7f54c60d9803f53af07d9beeef44614", "score": "0.55203766", "text": "dequeue () {\n while (!this.deflating && this.queue.length) {\n const params = this.queue.shift();\n\n this.bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "7d909e1fc6d21f3870e768382985edfc", "score": "0.5518017", "text": "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "7d909e1fc6d21f3870e768382985edfc", "score": "0.5518017", "text": "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "7d909e1fc6d21f3870e768382985edfc", "score": "0.5518017", "text": "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "7d909e1fc6d21f3870e768382985edfc", "score": "0.5518017", "text": "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "7d909e1fc6d21f3870e768382985edfc", "score": "0.5518017", "text": "dequeue () {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n params[0].apply(this, params.slice(1));\n }\n }", "title": "" }, { "docid": "083633c0bb02d524a00cec68005e54cd", "score": "0.55166656", "text": "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key];\n bee.on('failed', this.handleFailure).process(handle);\n });\n }", "title": "" }, { "docid": "470543d1757396699179d2139a774a3f", "score": "0.5514427", "text": "playQueue() {\n // must set delay property to false!!! otherwise the message\n // will be delayed continually...\n this.queue.forEach( m => { \n m.data.delay = false; \n try {\n this.handleMessage( m ) \n }catch( e ) {\n console.error( e )\n }\n })\n this.queue.length = 0\n }", "title": "" }, { "docid": "02eb4b003de1131dca3d4629f9616bff", "score": "0.55134696", "text": "_attemptDelivery () {\n if (this._busy) {\n return;\n }\n\n /**\n * Attempt to deliver one event then asynchronously recurse, reenqueueing the event if delivery fails and the\n * event has not yet reached its retry limit. Sets `this._busy` before doing anything else and clears it once\n * the queue is empty or `this.didOptIn` is cleared.\n */\n const stepDelivery = () => {\n this._busy = true;\n if (!this.didOptIn || !this._networkIsOnline || this._packetQueue.length < 1) {\n this._busy = false;\n return;\n }\n // don't saveQueue() here:\n // - if the app exits or crashes before the network request finishes, we'll lose the packet\n // - if the request finishes, we'll save at that time (see below)\n const packetInfo = this._packetQueue.shift();\n ++packetInfo.attempts;\n const packet = packetInfo.packet;\n nets({\n body: JSON.stringify(packet),\n headers: {'Content-Type': 'application/json'},\n method: 'POST',\n url: this._serverURL\n }, (err, res) => {\n // TODO: check if the failure is because there's no Internet connection and if so refund the attempt\n const packetFailed = err || (res.statusCode !== 200);\n if (packetFailed) {\n if (packetInfo.attempts < this._deliveryAttemptLimit) {\n this._packetQueue.push(packetInfo);\n } else {\n // eslint-disable-next-line no-console\n console.warn('Dropping packet which exceeded retry limit', packet);\n }\n }\n this.saveQueue();\n stepDelivery();\n });\n };\n\n stepDelivery();\n }", "title": "" }, { "docid": "e8aa3996ddc446b6d4a574b162652b69", "score": "0.54960614", "text": "async function tryProcess() {\n const msgs = new Set(msg_buffer);\n msg_buffer.clear();\n\n logger.info(\"processing batch\");\n\n // clean up to allow reaper to accept while we wait for db\n clearTimeout(idle_timer);\n idle_timer = undefined;\n\n const phase_objects = new Set(phase_data);\n phase_data.clear();\n\n try {\n await reap(phase_objects);\n\n logger.info(\"acking batch\", { size: msgs.size });\n await Promise.map(msgs, async (m) => await ch.ack(m));\n } catch (err) {\n // log, move to error queue and NACK\n logger.error(err);\n await Promise.map(msgs, async (m) => {\n await ch.sendToQueue(QUEUE + \"_failed\",\n m.content, { persistent: true });\n await ch.nack(m, false, false);\n });\n }\n }", "title": "" }, { "docid": "a409f7589ff77e1d7bace65f1d42ff27", "score": "0.549335", "text": "function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }", "title": "" }, { "docid": "3d2b6ded4cee9bb39dd94cb86558249f", "score": "0.54767936", "text": "dequeue() {\n if(this.items.length === 0) {\n return;\n } else {\n this.items.shift();\n }\n }", "title": "" }, { "docid": "26d801c14260f74f9af4b0cce044a0f2", "score": "0.5459849", "text": "function sendResponseQueue() {\n\t\tif(callbacks.data) {\n\t\t\twhile(responseQueue.length > 0) {\n\t\t\t\tif(!callbacks.data) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar data = responseQueue.shift();\n\t\t\t\tcallbacks.data(data);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "55b0efbffba6170e6a001b70238a8121", "score": "0.5457531", "text": "function processQueue() {\r\n var skip = scope && scope.$$destroyed;\r\n var queue = !skip ? nextTick.queue : [];\r\n var digest = !skip ? nextTick.digest : null;\r\n\r\n nextTick.queue = [];\r\n nextTick.timeout = null;\r\n nextTick.digest = false;\r\n\r\n queue.forEach(function(callback) {\r\n callback();\r\n });\r\n\r\n if (digest) $rootScope.$digest();\r\n }", "title": "" }, { "docid": "18ab8d82733fe17c0f6b6ea14eae2c16", "score": "0.5432933", "text": "async #drainQueuedAwaits() {\n while (this.#nextQueue.length !== 0) {\n const item = this.#nextQueue[0];\n\n if (!item.await) {\n break;\n }\n\n this.#nextQueue.shift();\n\n const result = await item.value;\n item.complete('resolve', result);\n }\n }", "title": "" }, { "docid": "f5a96a15ff02bd389a2e189341bbf99e", "score": "0.5429239", "text": "dequeue () {\n\t while (!this._deflating && this._queue.length) {\n\t const params = this._queue.shift();\n\n\t this._bufferedBytes -= params[1].length;\n\t params[0].apply(this, params.slice(1));\n\t }\n\t }", "title": "" }, { "docid": "7190a0108cf9200ef06df20095a6319b", "score": "0.54233724", "text": "function done(err) {\n if (err) {\n errored = true;\n return callback(err);\n }\n if (++completed === links.length && !errored) {\n return callback(null, null, true);\n }\n }", "title": "" }, { "docid": "0b3100e05f8ef4489d84821ebe1020b4", "score": "0.54082054", "text": "function process() {\n while (this._queue.length > 0) {\n var e = this.dequeue();\n if ('PRE' in e.hook) {\n for (var i = 0 ; i < e.hook['PRE'].length ; i++) {\n try {\n e.hook['PRE'][i]();\n } catch (e) {\n console.log(\"PREEVENTHOOK EXCEPTION \" + e);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "7d6f0b2916ee58a3b20a59e531d929c5", "score": "0.539911", "text": "function refill() {\n\t\tfor(var i=0; i<args.concurrency && (args.loop==true || iterations<args.loop); i++) {\n\t\t\titerations++;\n\t\t\tqueue.push({ \"hyperpotamus.index\" : iterations } );\n\t\t\tlogger.trace(\"Queued user for processing #\" + iterations);\n\t\t};\n\t\tif(args.loop!=true && args.loop==iterations) {\n\t\t\tqueue.empty = null;\n\t\t}\n\t}", "title": "" }, { "docid": "2f787bf80c0b7ed61ffdb1b0fdd60424", "score": "0.53916514", "text": "_sendQueuedMessages() {\n this._msgQueue.forEach((msgQueueFunc) => {\n msgQueueFunc();\n });\n\n this._msgQueue = [];\n }", "title": "" }, { "docid": "65bcbc9c93699abb4b6b6627a776b22a", "score": "0.5388985", "text": "function flushBatcherQueue () {\n\t runBatcherQueue(queue)\n\t internalQueueDepleted = true\n\t runBatcherQueue(userQueue)\n\t resetBatcherState()\n\t}", "title": "" }, { "docid": "b0e6ae1ac9d03e6ae97822a2fbc57918", "score": "0.5380767", "text": "function ProcessCommunicationsQueue() {\n if (Object.keys($tw.wiki.event_queue).length !== 0) {\n //send the next request if there is one and no request is currently pending\n if ($tw.wiki.event_queue[Object.keys($tw.wiki.event_queue)[0]].data) {\n $tw.wiki.CommunicationsHandler['request_bundle']($tw.wiki.event_queue[Object.keys($tw.wiki.event_queue)[0]].data);\n delete $tw.wiki.event_queue[Object.keys($tw.wiki.event_queue)[0]];\n }\n }\n }", "title": "" }, { "docid": "bcec72e6508e82f51c0d9468613fe25e", "score": "0.5378479", "text": "executeQueuedCallbacks() {\n this.callbacks.forEach((callback) => {\n if (typeof callback !== 'function') {\n return;\n }\n\n callback();\n });\n }", "title": "" }, { "docid": "411b6e8b11ff44ef7bcaa68e1efbbe59", "score": "0.5377062", "text": "async close() {\n this._closed = true\n this._item = []\n\n let e = new error.Closed('Queue is closed')\n if (this._push_defer) {\n this._push_defer.reject(e)\n }\n if (this._pop_defer) {\n this._pop_defer.reject(e)\n }\n }", "title": "" }, { "docid": "1ae45175d1a70eae268c851dfbc4c36d", "score": "0.53752726", "text": "getExceptionQueue() {\n errors.throwNotImplemented(\"getting exception queue (message)\");\n }", "title": "" }, { "docid": "9b6b7383cfcc4d83d636b83c9364e1eb", "score": "0.5372991", "text": "function execute() {\n const start = Date.now();\n const max = Math.min(queues.current.length, queues.index + zaraz.MAX_ITEMS);\n\n debug('queues before', queues.current.length - queues.index, queues.later.length);\n\n while(queues.index < max) {\n queues.current[queues.index++].run();\n if (Date.now() - start > zaraz.ACTIVE) {\n debug('breaking...');\n break;\n }\n }\n\n debug('queues after', queues.current.length - queues.index, queues.later.length);\n\n if (queues.index === queues.current.length) {\n queues.current = queues.later;\n queues.later = [];\n queues.index = 0;\n }\n\n kick();\n}", "title": "" }, { "docid": "c813c89c639936363a17bf3cdae271a4", "score": "0.53666526", "text": "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }", "title": "" }, { "docid": "6909087b4d5c55c055e91c04579b807f", "score": "0.5349769", "text": "function runQueue() {\n var f;\n if(queue.length) {\n f = queue.shift();\n window.setTimeout(function () {\n f();\n runQueue();\n }, 50);\n }\n }", "title": "" }, { "docid": "af86928223e675d1b83ccce58c887cff", "score": "0.53445315", "text": "processQueue() {\n\t\tjobs.forEach(job => {\n\t\t\tconst { bee, handle } = this.queues[job.key]\n\n\t\t\tbee.on('failed', this.handleFailure).process(handle)\n\t\t})\n\t}", "title": "" }, { "docid": "bfba23331fd11ce5077aa623dd673321", "score": "0.5338054", "text": "async _queueFlush() {\n if (this._queue.length == 0) return\n\n await this._queue.map(this._send.bind(this))\n\n this._queue = []\n }", "title": "" }, { "docid": "bf4a2bf22c952c62d9eec230784a6490", "score": "0.5334955", "text": "function finish() {\n var i = 0,\n len = deferreds.length;\n\n for (i = 0; i < len; i += 1) {\n handle(deferreds[i]);\n }\n\n deferreds = null;\n }", "title": "" }, { "docid": "f55c36d393c24ce7d4d8532a125e037e", "score": "0.5334705", "text": "channelCatchUp(){\n this.queued.forEach(ctn => {\n this.dataChannel.send(ctn);\n });\n this.queued = [];\n }", "title": "" }, { "docid": "27dadab951a76a170bba8974d3cc6a27", "score": "0.5323973", "text": "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "title": "" }, { "docid": "27dadab951a76a170bba8974d3cc6a27", "score": "0.5323973", "text": "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "title": "" }, { "docid": "b01406cad2e89aee3c2435b3bde8c51c", "score": "0.5317192", "text": "async _wait_for_slot() {\n if (this._items.length < this._capacity) {\n return\n }\n if (this._push_defer) {\n throw new error.Conflict('There are other caller on pushing')\n }\n\n this._push_defer = new Deferral()\n await this._push_defer.promise\n this._push_defer = null\n }", "title": "" }, { "docid": "e0368c8e5553b5c18f3a0dfb3d9e25bc", "score": "0.52855814", "text": "function processQueue() {\n\t\t\tif (self.isPaused || timeout !== null || self.queue.length === 0) {return;}\n\t\t\tvar item = self.queue.shift(),\n\t\t\tresult;\n\t\t\t/* END: var */\n\t\t\tif (typeof item === 'function') {\n\t\t\t\tresult = item();\n\t\t\t}\n\t\t\t// check to see if we have queued a jQuery Deferred Promise\n\t\t\tif (typeof $ === 'function' && $() instanceof $\n\t\t\t\t\t&& result && typeof result === 'object'\n\t\t\t\t\t&& result.promise && typeof result.promise === 'function') {\n\t\t\t\ttimeout = 0; // placeholder value\n\t\t\t\t$.when(result)\n\t\t\t\t.always(function() {\n\t\t\t\t\ttimeout = setTimeout(function() {\n\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\tprocessQueue();\n\t\t\t\t\t}, self.interval);\n\t\t\t\t});\n\t\t\t} else { // not a Promise\n\t\t\t\ttimeout = setTimeout(function() {\n\t\t\t\t\ttimeout = null;\n\t\t\t\t\tprocessQueue();\n\t\t\t\t}, self.interval);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ce456cd948f49f8ce73db877c0069038", "score": "0.52819055", "text": "function drainQueue() {\n\tvar i = 0;\n\tvar task;\n\tvar innerQueue = mainQueue;\n\tmainQueue = [];\n\t/*jslint boss: true */\n\twhile (task = innerQueue[i++]) {\n\t\ttask();\n\t}\n\n}", "title": "" }, { "docid": "2ccee485a2278ff11cadc55e0df406ac", "score": "0.5262025", "text": "async* [Symbol.asyncIterator]() {\r\n try {\r\n while (true) {\r\n // throw error if no other handler is registered\r\n if (this.error) throw this.error;\r\n\r\n const queuedItem = this.queue.shift();\r\n if (this.queue.length === 0) {\r\n this.backPressureDeferred.resolve();\r\n this.backPressureDeferred = new Deferred();\r\n }\r\n if (queuedItem !== undefined) yield queuedItem;\r\n\r\n if (this.completed) break;\r\n\r\n const deferred = new Deferred();\r\n this.deferreds.push(deferred);\r\n const v = await deferred.promise;\r\n if (!this.completed) yield v;\r\n }\r\n } finally {\r\n // call registered cleanup functions\r\n await this.emit(\"finally\");\r\n }\r\n }", "title": "" }, { "docid": "0aca0d5f0de4b4b2350756d047266e66", "score": "0.52612215", "text": "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }", "title": "" }, { "docid": "cbf41eab5a721c7eca423f2ed99e738e", "score": "0.52604777", "text": "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (true) {\n\t if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n\t window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush');\n\t }\n\t }\n\t resetBatcherState();\n\t }", "title": "" }, { "docid": "fc98134c1fb573e760a83c741d0c82bf", "score": "0.5256222", "text": "cleanup(err) {\n while (this.cleanupTasks && this.cleanupTasks.length) {\n let task = this.cleanupTasks.pop();\n task(err);\n }\n }", "title": "" }, { "docid": "02f09fe18728ee85c9eb4e5b550b6f93", "score": "0.52550304", "text": "_signalAll(reject) {\n for(let job of this._pendingJob) {\n if(!job.isDone()) {\n if(reject) {\n job.reject(new DaxClientError('pool is reset or closed', DaxErrorCode.Connection, true));\n } else {\n // We should give it another connect try instead of fail this \n // request as long as it's within connect timeout which is\n // configurable.\n this._alloc();\n }\n }\n }\n // Don't need to clean pending job list here since frequent array slice\n // is not efficient. If it will be used again, it will be shifted when \n // recycle method try to find a candidate. Otherwise, it will be \n // garbage collected.\n }", "title": "" }, { "docid": "cc325f08b2156531b19f2e067a97c0c1", "score": "0.5251581", "text": "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n }", "title": "" }, { "docid": "18f7bfd752b9676bbb8a1ba55b820619", "score": "0.52500737", "text": "function sendCommandFromQueue() {\n if (q.getLength() >= 1) {\n var qElement = q.dequeue();\n sendCommand(qElement);\n\n if (q.getLength() > 0) {\n setTimeout(function() {\n sendCommandFromQueue();\n }, currentDelay);\n }\n } else {\n console.log(\"error in queue length\", q.getLength());\n }\n}", "title": "" }, { "docid": "adef7d32f28ffb7ec5a8873fcc815cfe", "score": "0.5245667", "text": "_run() {\n this._handler(\n this._queue[0],\n () => { /* callback */\n this._queue.shift();\n\n if (this._queue.length > 0) {\n this._run();\n } \n }\n );\n }", "title": "" }, { "docid": "bc68dd4240c26d6bbe04a79129d8a9bc", "score": "0.5244973", "text": "function moveQueriedToQueued() {\n while (vm.queriedHosts.length > 0) {\n addHost(vm.queriedHosts.shift());\n }\n }", "title": "" }, { "docid": "929d80c554e00d015b55b060d5979187", "score": "0.5238209", "text": "onUploaderFail() {\n this.tries = 3;\n\n this.abort();\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.52363443", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.52363443", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.52363443", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.52363443", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.52363443", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.52363443", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "b0dad8f0c4db1256b2ce6c6d3bed3405", "score": "0.5229993", "text": "function dequeue () {\n var url = tests.shift();\n\tif (url) {\n \tstatus(WAIT_FOR + \"results: \" + url);\n \tnavigate(frame, url);\n \treaper(YETI.next);\n\t} else {\n\t\t//If we get here, something may be wrong\n\t\tcomplete();\n\t}\n }", "title": "" }, { "docid": "5a8c149f78485c905e1f0cd87f3c5407", "score": "0.52247435", "text": "function processQueuePair (qname, qrl, options) {\n const isFifo = qname.endsWith('.fifo')\n const normalizeOptions = Object.assign({}, options, { fifo: isFifo })\n const fqname = qrlCache.normalizeFailQueueName(qname, normalizeOptions)\n const fqrl = qrlCache.normalizeFailQueueName(qrl, normalizeOptions)\n return checkIdle(qname, qrl, options).then(result => {\n debug('result', result)\n if (result.idle) {\n if (options.verbose) console.error(chalk.blue('Queue ') + qname.slice(options.prefix.length) + chalk.blue(' has been ') + 'idle' + chalk.blue(' for the last ') + options['idle-for'] + chalk.blue(' minutes.'))\n // Check fail queue if we get a positive result for normal queue\n return checkIdle(fqname, fqrl, options).then(fresult => {\n debug('fresult', fresult)\n if (fresult.idle) {\n if (options.verbose) console.error(chalk.blue('Queue ') + fqname.slice(options.prefix.length) + chalk.blue(' has been ') + 'idle' + chalk.blue(' for the last ') + options['idle-for'] + chalk.blue(' minutes.'))\n // Trigger a delete if the user wants it\n if (options.delete) {\n // End this branch of the tree\n return Promise.all([\n deleteQueue(qname, qrl, options),\n deleteQueue(fqname, fqrl, options)\n ]).then(deleteResults =>\n deleteResults.reduce((a, b) => Object.assign(a, { apiCalls: {\n SQS: a.apiCalls.SQS + b.apiCalls.SQS,\n CloudWatch: a.apiCalls.CloudWatch + b.apiCalls.CloudWatch\n } }), Object.assign(result, { failq: fresult }, { apiCalls: {\n SQS: result.apiCalls.SQS + fresult.apiCalls.SQS,\n CloudWatch: result.apiCalls.CloudWatch + fresult.apiCalls.CloudWatch\n } }))\n )\n }\n } else {\n if (options.verbose) console.error(chalk.blue('Queue ') + fqname.slice(options.prefix.length) + chalk.blue(' has been ') + 'active' + chalk.blue(' in the last ') + options['idle-for'] + chalk.blue(' minutes.'))\n }\n return Promise.resolve(Object.assign(result, { idle: result.idle && fresult.idle, failq: fresult }, { apiCalls: {\n SQS: result.apiCalls.SQS + fresult.apiCalls.SQS,\n CloudWatch: result.apiCalls.CloudWatch + fresult.apiCalls.CloudWatch\n } }))\n })\n .catch(e => {\n // Handle the case where the fail queue has been deleted or was never created for some reason\n if (e.code === 'AWS.SimpleQueueService.NonExistentQueue') {\n if (options.verbose) console.error(chalk.blue('Queue ') + fqname.slice(options.prefix.length) + chalk.blue(' does not exist.'))\n if (options.delete) {\n return deleteQueue(qname, qrl, options)\n .then(deleteResult => Object.assign(result, {\n deleted: deleteResult.deleted,\n apiCalls: {\n SQS: result.apiCalls.SQS + deleteResult.apiCalls.SQS,\n CloudWatch: result.apiCalls.CloudWatch + deleteResult.apiCalls.CloudWatch\n }\n }))\n } else {\n return result\n }\n } else {\n throw e\n }\n })\n } else {\n if (options.verbose) console.error(chalk.blue('Queue ') + qname.slice(options.prefix.length) + chalk.blue(' has been ') + 'active' + chalk.blue(' in the last ') + options['idle-for'] + chalk.blue(' minutes.'))\n }\n // End this branch of the tree\n return result\n })\n}", "title": "" }, { "docid": "f24ba8e436657e595542b3b62619cecf", "score": "0.5220473", "text": "function processQueue() {\n\t\t\t\t\tvar skip = scope && scope.$$destroyed;\n\t\t\t\t\tvar queue = !skip ? nextTick.queue : [];\n\t\t\t\t\tvar digest = !skip ? nextTick.digest : null;\n\n\t\t\t\t\tnextTick.queue = [];\n\t\t\t\t\tnextTick.timeout = null;\n\t\t\t\t\tnextTick.digest = false;\n\n\t\t\t\t\tqueue.forEach(function (callback) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t});\n\n\t\t\t\t\tif (digest) $rootScope.$digest();\n\t\t\t\t}", "title": "" }, { "docid": "cd4d35234737816313ddfb5f39d96257", "score": "0.5216679", "text": "shiftQueue() {\n this.queue.shift();\n\n if (this.queue.length === 0) {\n if (this.emptyPromiseResolver) {\n this.emptyPromiseResolver();\n }\n \n this.emit('idle', this);\n }\n }", "title": "" }, { "docid": "75d72b1d168cb63533913c61213ff1c5", "score": "0.52142483", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "75d72b1d168cb63533913c61213ff1c5", "score": "0.52142483", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "f0c3cde3dfed41e555dd24e75a041115", "score": "0.52004623", "text": "stepQueue() {\n\n // No-op function if the utteranceQueue is disabled\n if ( !this._enabled ) {\n return;\n }\n\n for ( let i = 0; i < this.queue.length; i++ ) {\n this.queue[ i ].timeInQueue += this._stepInterval;\n }\n\n this.next();\n }", "title": "" }, { "docid": "0929d5e171a185db6a625b63395543fd", "score": "0.5193277", "text": "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n}", "title": "" } ]
7e7daba198d8d8ef95677b7e2a88745e
calculate the password strength
[ { "docid": "f3756d756b5ba6c079acf74ad3d4d646", "score": "0.6813081", "text": "function score_password(pass) {\n var score = 0;\n if (!pass)\n return score;\n\n // award every unique letter until 5 repetitions\n var letters = new Object();\n for (var i=0; i<pass.length; i++) {\n letters[pass[i]] = (letters[pass[i]] || 0) + 1;\n score += 5.0 / letters[pass[i]];\n }\n\n // bonus points for mixing it up\n var variations = {\n digits: /\\d/.test(pass),\n lower: /[a-z]/.test(pass),\n upper: /[A-Z]/.test(pass),\n nonWords: /\\W/.test(pass),\n }\n\n variationCount = 0;\n for (var check in variations) {\n variationCount += (variations[check] == true) ? 1 : 0;\n }\n score += (variationCount - 1) * 10;\n\n return parseInt(score);\n }", "title": "" } ]
[ { "docid": "cdf41c7768072abc72d2d7ba6dad4a2d", "score": "0.8608523", "text": "function passwordStrength() {\n\tlet pass = this.value;\n\n\tlet lengthWeight = pass.length * 4;\n\tlet uppercaseWeight = pass.replace(/[A-Z]/g, '').length * 2;\n\tlet lowercaseWeight = pass.replace(/[a-z]/g, '').length * 2;\n\tlet numbersWeight = pass.replace(/[^0-9]/g, '').length * 4;\n\tlet symbolsWeight = pass.replace(/[A-Za-z0-9]/g, '').length * 6;\n\n\tlet middleNumSymbWeight = pass.replace(/[^0-9]/g, '').length + pass.replace(/[A-Za-z0-9]/g, '').length;\n\tmiddleNumSymbWeight -= ((pass[0] < 'a' || pass[0] > 'z') && (pass[0] < 'A' || pass[0] > 'Z')) ? 1 : 0;\n\tif (pass.length != 1)\n\t\tmiddleNumSymbWeight -= ((pass[pass.length - 1] < 'a' || pass[pass.length - 1] > 'z') && (pass[pass.length - 1] < 'A' || pass[pass.length - 1] > 'Z')) ? 1 : 0;\n\tmiddleNumSymbWeight *= 2;\n\n\tlet requirementsWeight = (pass.length < 8) ? 0 : 1;\n\trequirementsWeight += (pass.length != pass.replace(/[A-Z]/g, '').length) ? 1 : 0;\n\trequirementsWeight += (pass.length != pass.replace(/[a-z]/g, '').length) ? 1 : 0;\n\trequirementsWeight += (numbersWeight != 0) ? 1 : 0;\n\trequirementsWeight += (symbolsWeight != 0) ? 1 : 0;\n\trequirementsWeight *= (pass.length < 8 || requirementsWeight < 4) ? 0 : 2;\n\n\tlet additions = lengthWeight + uppercaseWeight + lowercaseWeight + numbersWeight + symbolsWeight + middleNumSymbWeight + requirementsWeight;\n\n\tlet lettersOnlyWeight = (pass.replace(/[a-zA-Z]/g, '').length == 0) ? pass.length : 0;\n\tlet numbersOnlyWeight = (pass.replace(/[0-9]/g, '').length == 0) ? pass.length : 0;\n\n\tlet repeatChar = 0;\n\tlet repeatCharWeight = 0;\n\tlet consecutiveUpperWeight = 0;\n\tlet consecutiveLowerWeight = 0;\n\tlet consecutiveNumWeight = 0;\n\tlet sequentialLetterWeight = 0;\n\tlet sequentialNumWeight = 0;\n\n\tfor (let i = 0; i < pass.length; i++) {\n\t\tlet repeat = false;\n\t\tfor (let j = 0; j < pass.length; j++) {\n\t\t\tif (pass[i] == pass[j] && i != j) {\n\t\t\t\trepeat = true;\n\t\t\t\trepeatCharWeight += Math.abs(pass.length / (j - i));\n\t\t\t}\n\t\t}\n\t\tif (repeat) {\n\t\t\trepeatChar++;\n\t\t\tlet uniqueChar = pass.length - repeatChar;\n\t\t\trepeatCharWeight = (uniqueChar) ? Math.ceil(repeatCharWeight / uniqueChar) : Math.ceil(repeatCharWeight);\n\t\t}\n\t\tif (i != pass.length - 1) {\n\t\t\tconsecutiveUpperWeight += ((pass[i] >= 'A' && pass[i] <= 'Z') && (pass[i + 1] >= 'A' && pass[i + 1] <= 'Z')) ? 2 : 0;\n\t\t\tconsecutiveLowerWeight += ((pass[i] >= 'a' && pass[i] <= 'z') && (pass[i + 1] >= 'a' && pass[i + 1] <= 'z')) ? 2 : 0;\n\t\t\tconsecutiveNumWeight += ((pass[i] >= '1' && pass[i] <= '9') && (pass[i + 1] >= '1' && pass[i + 1] <= '9')) ? 2 : 0;\n\t\t}\n\t\tif (i < pass.length - 2) {\n\t\t\tsequentialLetterWeight += seqLetter(pass, i) ? 3 : 0;\n\t\t\tsequentialNumWeight += ((pass[i] >= '1' && pass[i] <= '9') && pass.charCodeAt(i + 1) == pass.charCodeAt(i) + 1 && pass.charCodeAt(i + 2) == pass.charCodeAt(i) + 2) ? 3 : 0;\n\t\t}\n\t}\n\n\tlet deductions = lettersOnlyWeight + numbersOnlyWeight + repeatCharWeight + consecutiveUpperWeight + consecutiveLowerWeight + consecutiveNumWeight + sequentialLetterWeight + sequentialNumWeight;\n\n\tlet score = additions - deductions;\n\tscore = score > 100 ? 100 : score;\n\tscore = score < 0 ? 0 : score;\n\n\tthis.parentElement.querySelector('#passScore').innerHTML = score + \"%\";\n}", "title": "" }, { "docid": "01d96a879156288db5e47ff599d9a8e3", "score": "0.8262943", "text": "function indvPassStrength(password) {\r\n let strengthLevel = 0;\r\n const upper = new RegExp(\"[A-Z]+\"); // contains 1 or more uppercase letters?\r\n const lower = new RegExp(\"[a-z]+\"); // contains 1 or more lowercase letters?\r\n const num = new RegExp(\"[0-9]+\"); // contains 1 or more numbers?\r\n const special = new RegExp(\"[!@#$%^&*]+\"); // contains 1 or more special characters?\r\n if (upper.test(password) && lower.test(password)) {\r\n strengthLevel++;\r\n }\r\n if (num.test(password)) {\r\n strengthLevel++;\r\n }\r\n if (special.test(password)) {\r\n strengthLevel++;\r\n }\r\n if (password.length >= 8) {\r\n strengthLevel++;\r\n }\r\n return strengthLevel;\r\n }", "title": "" }, { "docid": "40aa752b64bfe054f6174f530ac766d7", "score": "0.8152785", "text": "function PasswordStrength(e) {\n\n\tvar pass = form.pass1.value;\n\n\t// we could have written a for loop which went through every \n\t// character and detected what they are, but this method \n\t// with regex is slightly faster\n\n\t// count uppercase: match no of uppercase chars\n\t// this command returns an array containing all the uppercase letters\n\tvar uc = pass.match(/[A-Z]/g); // g:global match\n\tuc = (uc && uc.length || 0);\n\t// if we have an array we get its length or we return zero if there is empty array\n\n\t// count numbers\n\tvar nm = pass.match(/\\d/g);\n\tnm = (nm && nm.length || 0);\n\n\t// count symbols\n\tvar nw = pass.match(/\\W/g); // W: not a number, digit or underscore\n\tnw = (nw && nw.length || 0);\n\n\t// determine strength based on its length awarding bonus points \n\t// such as upper case letters, numbers and symbols\n\tvar s = pass.length + uc + (nm * 2) + (nw * 3);\n\ts = Math.min(Math.floor(s / 10), 2);\n\t// anything under 10 is weak, 10-20 average and 20+ strong\n\t// we convert the result into 0-2 range by dividing 10\n\t// since we might have more than 2, we take minimum\n\t// we then use the result as an index for our strength node, with text and color arrays\n\tform.strength.textContent = strtext[s]; // writes text for span node\n\tform.strength.style.color = strcolor[s];\n\n}", "title": "" }, { "docid": "1127ad281a9aff5940c292b36e04f272", "score": "0.8102946", "text": "function passwordStrength()\n{\n\n}", "title": "" }, { "docid": "a9a2d1afeca6c07aa9618946a79b99f7", "score": "0.8075315", "text": "function calculatePasswordStrength(password_value){\n let value = password_value;\n var strength = 0;\n var lengthCheck = false; // password has a minimum length of 8 characters\n var capitalLetterCheck = false; // password contain at least 1 capital letter\n var smallCaseLetterCheck = false; // password has a at least 1 small case letter\n var numberCheck = false; // password contain at least 1 number\n var specialCharacterCheck = false; // passwrod contain as least 1 special character\n\n // check whether password length is at least 8 characters\n if (value.length >= 8)\n lengthCheck = true;\n\n // iterate through password string character by character\n for (var i=0; i<password_value.length; i++){\n // password contains capital letter(s)\n if (password_value.charCodeAt(i) < 91 && password_value.charCodeAt(i) > 64)\n capitalLetterCheck = true;\n // password contains small case letter(s)\n else if (password_value.charCodeAt(i) < 123 && password_value.charCodeAt(i) > 96)\n smallCaseLetterCheck = true;\n // password contains number(s)\n else if (password_value.charCodeAt(i) < 58 && password_value.charCodeAt(i) > 47)\n numberCheck = true;\n // password contains special characters(s)\n else if ((password_value.charCodeAt(i) < 32 && password_value.charCodeAt(i) > 47) || (password_value.charCodeAt(i) < 65 && password_value.charCodeAt(i) > 57) ||\n (password_value.charCodeAt(i) < 97 && password_value.charCodeAt(i) > 90) || (password_value.charCodeAt(i) < 127 && password_value.charCodeAt(i) > 122))\n specialCharacterCheck = true;\n }\n\n // calculate strength points.\n // To calculate strength points, we add the booleans checks to an array\n // and iterate through that array\n // each \"true\" check counts as 1 point\n let checkArr = [lengthCheck, capitalLetterCheck, smallCaseLetterCheck, numberCheck, specialCharacterCheck];\n for (var i=0; i<checkArr.length; i++){\n if (checkArr[i] === true)\n strength++;\n }\n\n return strength\n }", "title": "" }, { "docid": "3215d3563fed9c0ff09589c9bd652c55", "score": "0.7983515", "text": "function passwordStrength(password1) {\n\t\n\tvar shortPass = 1, badPass = 2, goodPass = 3, strongPass = 4, mismatch = 5, symbolSize = 0, natLog, score = 0;\n\tvar pass_strength = Array();\n\t//password < 4\n\tif ( password1.length < 4 ){\n\t\tscore = 9;\n\t\tpass_strength = [shortPass, parseInt(score)];\n\t\treturn pass_strength;\n\t}\n\n\tvar strength = 0;\n\t\n\tif (password1.length > 7) strength += 1.5;\n\t\t\t\n\t//If password contains both lower and uppercase characters, increase strength value.\n\tif (password1.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1.5;\t\n\t\n\t//If it has numbers and characters, increase strength value.\n\tif (password1.match(/([a-zA-Z])/) && password1.match(/([0-9])/)) strength += 1.5;\t\n\t\n\t//If it has one special character, increase strength value.\n\tif (password1.match(/([!,%,&,@,#,$,^,*,?,_,~])/) && password1.match(/([a-zA-Z])/)) strength += 1.5;\n\t\n\t//if it has two special characters, increase strength value.\n\tif (password1.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/) && password1.match(/([a-zA-Z])/)) strength += 1.5;\n\t\n\t//If value is less than 2\n\tif( strength < 2 ){\n\t\tpass_strength = [badPass, parseInt((strength/5)*100)];\t\n\t\treturn pass_strength;\t\n\t}\n\t\n\tif (strength == 2 ){\n\t\tpass_strength = [goodPass, parseInt((strength/5)*100)];\t\n\t\treturn pass_strength;\t\n\t}else{\n\t\tpass_strength = [strongPass, parseInt((strength/5)*100)];\n\t\treturn pass_strength;\t\n\t}\n}", "title": "" }, { "docid": "d0c0cf4363d98020561d616d644d5109", "score": "0.79735214", "text": "function getPasswordStrength(password) {\n let toReturn;\n\n // If the password length is less than or equal to 6\n if(password.length<=6) {\n toReturn = 0;\n }\n\n // If the password length is greater than 6 and contain any lowercase alphabet or any number or any special character\n if(password.length>6 && (password.match(/[a-z]/) || password.match(/\\d+/) || password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))) {\n toReturn = 1;\n }\n\n // If the password length is greater than 6 and contain alphabet,number,special character respectively\n if(password.length>6 && ((password.match(/[a-z]/) && password.match(/\\d+/)) || (password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) || (password.match(/[a-z]/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)))) {\n toReturn = 2;\n }\n\n // If the password length is greater than 6 and must contain alphabets,numbers and special characters\n if(password.length>6 && password.match(/[a-z]/) && password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) {\n toReturn = 3;\n }\n\n return toReturn;\n}", "title": "" }, { "docid": "e5edc837603d09bf9165fb0d3ad4caa9", "score": "0.79734045", "text": "function calc_strength(password, pass_check){\n\tvar k = 1;\n\n\tpass_check.number = look_for_number(password);\n\tpass_check.uppercase = look_for_uppercase(password);\n\tpass_check.specialchars = look_for_specialchars(password);\n\tpass_check.len = (password.length >= 8 && password.length <= 16);\n\n\tfor(var key in pass_check)\n\t\tif(pass_check[key])\n\t\t\tk++;\n\t\t\t\n\n\tif(k == 1)\n\t\treturn 1;\n\telse{\n\t\tk--;\n\t}\n\t\n\tif((k == 3 || k == 4) && (!pass_check.len || !hasLowercase(password)))\n\t\tk--;\n\n\treturn k;\n}", "title": "" }, { "docid": "494ab0f1416f9ec1aacd1cbbd0ecb72c", "score": "0.7813366", "text": "function check_passwd_strength(passwd){\n if(passwd.trim() == \"\"){\n return(0);\n }\n var strength = 0;\n if(passwd.length > 6){\n strength = strength + 1;\n }\n var charlist = [];\n for(var i=0;i < passwd.length; i++){\n charlist[i] = passwd.substring(i, 1);\n }\n var contains_digits = 0;\n var contains_special_char = 0;\n var contains_lowercase = 0;\n var contains_uppercase = 0;\n var spchars = \"~`!#$%^&*+=-[]\\\\\\';,/{}|\\\":<>?\";\n for(var i=0;i < charlist.length; i++){\n if(parseInt(charlist[i])){\n strength += 1;\n continue;\n }\n if(!parseInt(charlist[i]) && charlist[i] == charlist[i].toUpperCase()){ // contains lowercase character\n strength += 1;\n continue;\n }\n if(!parseInt(charlist[i]) && charlist[i] == charlist[i].toLowerCase()){ // contains uppercase character\n strength += 1;\n continue;\n }\n if(spchars.indexOf(charlist[i])){ // contains special character\n strength += 1;\n continue;\n }\n }\n return strength; \n}", "title": "" }, { "docid": "a438b8e87a7c6388e24dd27bbef46af6", "score": "0.7697301", "text": "function passwordStrength(pw) {\n const containsNumber = /[0-9]/g\n const containsUpperLower = /((?<=[a-z])\\S*[A-Z])|((?<=[A-Z])\\S*[a-z])/g\n const containsSpecialChar = /[^a-zA-Z0-9\\s]/\n\n if (pw.match(/[\\s]/g)) return STRENGTHS[0]\n\n if (pw.length === 0) return STRENGTHS[1];\n\n if (pw.length < 8 || !pw.match(containsUpperLower)) return STRENGTHS[2];\n\n if (pw.match(containsUpperLower) && (!pw.match(containsNumber))) return STRENGTHS[3] \n if(!pw.match(containsSpecialChar)) return STRENGTHS[3];\n\n if ((pw.match(containsNumber).length + pw.match(containsSpecialChar).length < 3)) return STRENGTHS[4];\n\n return STRENGTHS[4]\n}", "title": "" }, { "docid": "bed89d19fcec1cde2e583a890a0b548b", "score": "0.7557171", "text": "function checkPasswordStrength(pw) {\r\n // input: a string, the password\r\n // output: a string from 'strong', 'medium', or 'weak'\r\n // hints: see question definition in HTML\r\n // also see W3Schools JS 'string methods' and 'regular expressions'\r\n\r\n // if pw contains at least one number, or at least one piece of punctuation,\r\n // then the password strength is 'medium'\r\n\r\n // if pw contains both of the above, password strength is 'strong'\r\n\r\n // otherwise, password strength is 'weak'\r\n // todo: finish the function\r\n return 'weak';\r\n}", "title": "" }, { "docid": "1abf0b7ba253ccc5f29fbc7c48ff643f", "score": "0.75487137", "text": "function checkStrength(password)\n {\n //initial strength\n var strength = 0\n\n //if the password length is less than 6, return message.\n if (password.length < 4) {\n return '<span class=\"glyphicon glyphicon-remove text-danger\"> Too short</span>'\n }\n\n //length is ok, lets continue.\n\n //if length is 8 characters or more, increase strength value\n if (password.length > 7) strength += 1\n\n //if password contains both lower and uppercase characters, increase strength value\n if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1\n\n //if it has numbers and characters, increase strength value\n if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1\n\n //if it has one special character, increase strength value\n if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1\n\n //if it has two special characters, increase strength value\n if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1\n\n //now we have calculated strength value, we can return messages\n\n //if value is less than 2\n if (strength < 2 )\n {\n return '<span class=\"glyphicon glyphicon-exclamation-sign text-warning\"> Weak</span>'\n }\n else if (strength == 2 )\n {\n return '<span class=\"glyphicon glyphicon-ok text-success\"> Good</span>'\n }\n else\n {\n return '<span class=\"glyphicon glyphicon-thumbs-up text-success\"> Strong</span>'\n }\n }", "title": "" }, { "docid": "6105c428a8fa453a9a19e8493f7b47ea", "score": "0.75473833", "text": "function checkStrength(e) {\n\n // Initial\n var strength = 0\n\n // Get password value\n var p = e.val();\n var m = e.next('.password-strength');\n\n // Remove classes from message\n m.removeClass('good weak strong');\n\n //if the password length is less than 6, return message.\n if (p.length < 6) {\n m.addClass('short');\n m.text('Too short');\n return;\n }\n\n // If length is 8 characters or more, increase strength value\n if (p.length > 7) strength += 1;\n\n // If password contains both lower and uppercase characters, increase strength value\n if (p.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1;\n\n // If it has numbers and characters, increase strength value\n if (p.match(/([a-zA-Z])/) && p.match(/([0-9])/)) strength += 1;\n\n // If it has one special character, increase strength value\n if (p.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1;\n\n // If it has two special characters, increase strength value\n if (p.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1;\n\n // If value is less than 2\n if (strength < 2 ) {\n m.addClass('weak')\n m.text('Weak');\n } else if (strength == 2 ) {\n m.addClass('good');\n m.text('Good');\n } else {\n m.addClass('strong');\n m.text('Strong');\n }\n }", "title": "" }, { "docid": "19d7578ca6b5b904206f1d2c4c3704e3", "score": "0.7499145", "text": "function checkStrength(password) {\n var strength = 0\n if (password.length < 6) {\n $('#strengthMessage').removeClass()\n $('#strengthMessage').addClass('Short')\n $('#submit').attr(\"disabled\", true);\n $('button').css('background', '#282828');\n\n return 'Too short'\n }\n if (password.length > 7) strength += 1\n // If password contains both lower and uppercase characters, increase strength value.\n if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1\n // If it has numbers and characters, increase strength value.\n if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1\n // If it has one special character, increase strength value.\n if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1\n // If it has two special characters, increase strength value.\n if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1\n // Calculated strength value, we can return messages\n // If value is less than 2\n if (strength < 2) {\n $('#strengthMessage').removeClass()\n $('#strengthMessage').addClass('Weak')\n $('#submit').attr(\"disabled\", true);\n $('button').css('background', '#282828');\n return 'Weak'\n } else if (strength == 2) {\n $('#strengthMessage').removeClass()\n $('#strengthMessage').addClass('Good')\n passwordMatch()\n return 'Good'\n } else {\n $('#strengthMessage').removeClass()\n $('#strengthMessage').addClass('Strong')\n passwordMatch()\n return 'Strong'\n }\n }", "title": "" }, { "docid": "d222420b9dd5314c11ac3a3fa6854a56", "score": "0.7496032", "text": "function chkPasswordStrength(pass)\n{\n var desc = new Array();\n desc[1] = \"Password Muy Debil\";//Very Weak\n desc[2] = \"Password Debil\";//Weak\n desc[3] = \"Password Seguridad Media\";//Medium\n desc[4] = \"Password Segura\";//Strong\n desc[5] = \"Password Muy segura\";//Very strong\n\n var score = 1;\n\n //if pass has both lower and uppercase characters give 1 point\n if ( ( pass.match(/[a-z]/) ) && ( pass.match(/[A-Z]/) ) ) score++;\n\n //if pass has at least one number give 1 point\n if (pass.match(/\\d+/)) score++;\n\n //if pass has at least one special caracther give 1 point\n if ( pass.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;\n\n //if pass bigger than 12 characters give another 1 point\n if (pass.length > 12) score++;\n\n document.getElementById('textPassword').innerHTML = desc[score];\n document.getElementById('textPassword').style.color=\"green\";\n}", "title": "" }, { "docid": "17a605462b13f60de1a1b63397841d6c", "score": "0.7414737", "text": "function passwordStrength(password) {\r\n let passStrong = true;\r\n const strongRegex = new RegExp(\r\n \"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})\"\r\n );\r\n if (!strongRegex.test(password)) {\r\n passStrong = false;\r\n }\r\n return passStrong;\r\n }", "title": "" }, { "docid": "4ac9a1032c1b252b0ba129d6f5840f96", "score": "0.71341294", "text": "function calculatePasswordStrength(password) {\n const weaknesses = [];\n weaknesses.push(lengthWeakness(password));\n weaknesses.push(lowerCaseWeakness(password));\n weaknesses.push(upperCaseWeakness(password));\n weaknesses.push(numberWeakness(password));\n weaknesses.push(specialCharacterWeakness(password));\n weaknesses.push(repeatCharacterWeakness(password));\n return weaknesses;\n}", "title": "" }, { "docid": "671ab5afb9088725989e21d1e92098bd", "score": "0.71022546", "text": "function passwordStrength() {\n\tlet password = document.getElementById(\"recruitScreenPasswordField\");\n\tlet content = document.getElementById(\"strengthMeterContent\");\n\tlet strength = 0;\n\t// checks if the password contains any letters\n\tif (password.value.match(/[a-z][a-z]+/)) {\n\t\tstrength += 1\n\t}\n\t// checks if the password contains any uppercase letters\n\tif (password.value.match(/[A-Z][A-Z]+/)) {\n\t\tstrength += 1\n\t}\n\t// checks if the password contains any numbers\n\tif (password.value.match(/[0-9][0-9]+/)) {\n\t\tstrength += 1\n\t}\n\t// checks if the password contains any special characters\n\tif (password.value.match(/[!\"#$%&'()*+,./:;<=>?@^_`|~]/)) {\n\t\tstrength += 1\n\t}\n\t// checks if the password is at least 6 characters long\n\tif (password.value.length > 5) {\n\t\tstrength += 1\n\t}\n\t// checks if the password is at least 8 characters long\n\tif (password.value.length > 7) {\n\t\tstrength += 1\n\t}\n\tswitch(strength) {\n\t\t// very weak password\n\t\tcase 0:\n\t\t\tpassword.style.color = \"#EF2E2E\";\n\t\t\tshape.className = \"veryWeak\";\n\t\t\tcontent.style.lineHeight = \"30px\";\n\t\t\tcontent.innerHTML = \"VERY \\ WEAK\";\n\t\t\tbreak;\n\t\t// weak password\n\t\tcase 2:\n\t\t\tpassword.style.color = \"#EF7E2E\";\n\t\t\tshape.className = \"weak\";\n\t\t\tcontent.style.lineHeight = \"60px\";\n\t\t\tcontent.innerHTML = \"WEAK\";\n\t\t\tbreak;\n\t\t// strong password\n\t\tcase 4:\n\t\t\tpassword.style.color = \"#EED82E\";\n\t\t\tshape.className = \"strong\";\n\t\t\tcontent.style.lineHeight = \"60px\";\n\t\t\tcontent.innerHTML = \"STRONG\";\n\t\t\tbreak;\n\t\t// very strong password\n\t\tcase 6:\n\t\t\tpassword.style.color = \"#24B936\";\n\t\t\tshape.className = \"veryStrong\";\n\t\t\tcontent.style.lineHeight = \"30px\";\n\t\t\tcontent.innerHTML = \"VERY \\ STRONG\";\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "63715353d67dad49bbaba29b361c352e", "score": "0.70148295", "text": "function scorePassword (password) {\n\tpassword = password || \"\";\n\n\tif (!password.length) {\n\t\treturn 0;\n\t}\n\n\tvar classes = [\n\t\t[ /[a-z]/, 26 ],\n\t\t[ /[A-Z]/, 26 ],\n\t\t[ /\\d/, 10], \n\t\t[ /[^\\da-zA-Z]/, 33], // non-alphanumeric (33) on en-US keyboards\n\t];\n\n\tvar n = 0;\n\tfor (var i = 0; i < classes.length; i++) {\n\t\tvar re = classes[i][0];\n\t\tvar val = classes[i][1];\n\n\t\tif (password.match(re)) {\n\t\t\tn += val;\n\t\t}\n\t}\n\n\treturn password.length * Math.log(n);\n}", "title": "" }, { "docid": "6bb5750c792af0f9f929af76cf532a73", "score": "0.7005743", "text": "function checkPasswordStrength() {\n let str = passField1.value;\n if (str.includes(\"£\") || str.includes(\"!\") || str.includes(\"?\") || str.includes(\"$\") ||\n str.includes(\"#\") || str.includes(\"_\") || str.includes(\"-\") || str.includes(\"+\") ||\n str.includes(\"=\") || str.includes(\"~\")) {\n if (str.match(\".*?([0-9]).*?\").length != null && str.length > 8) {\n passField1.className = \"border-suc\";\n passField1.setAttribute(\"data-valid\", \"true\");\n }\n }\n else {\n passField1.className = \"border-fail\";\n passField1.setAttribute(\"data-valid\", \"false\");\n }\n\n enableButton();\n}", "title": "" }, { "docid": "30f82ee3a9ec286d78e2fe6b766a6ea5", "score": "0.69751155", "text": "function passwordStrength(password)\n{\n // create a new array and call it str\n\t\tvar str = new Array(); \n\t\t\n\t\t// assign values to array\n str[0] = \"Password is very Weak\";\n str[1] = \"Password is weak\";\n str[2] = \"Password is better\";\n str[3] = \"Password is medium\";\n str[4] = \"Password is strong\";\n str[5] = \"Password is very strong\";\n\t\t\n\t\t// local varible that also holds the strength of the password\n\t\tvar score = 0; \n\n\n // if password bigger than 6 give 1 point\n if (password.length > 6) score++;\n // if password has both lower and uppercase characters give 1 point \n if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;\n // if password has at least one number give 1 point\n if (password.match(/\\d+/)) score++;\n // if password has at least one special caracther give 1 point\n if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;\n // if password bigger than 8 give another 1 point\n if (password.length > 8) score++;\n\t\t// assign phrase\n document.getElementById(\"passwordDescription\").innerHTML = str[score];\n\t\t // assign bar colour and size\n document.getElementById(\"passwordStrength\").className = \"strength\" + score;\n\t\t \n\t\t // assign value to global variable\n\t\t theScore = score;\n}", "title": "" }, { "docid": "58f56f5e5811862fea12b9af5f1eb47d", "score": "0.6956093", "text": "function getPasswordLength () {\n var pwLength = getNewInteger(); // get an integer from the user\n while (pwLength < 8 || pwLength > 128) { // verify the integer is between 8 and 128\n pwLength = getNewInteger(); // prompt user for a new integer until it is valid (between 8 and 128)\n }\n return pwLength; // return a valid password length\n}", "title": "" }, { "docid": "c0274cd16133f3806970a23ccd75e0a9", "score": "0.69406223", "text": "function pwdStr(){\n let password = document.getElementById(\"pwd\").value;\n let unacceptablePwdFormat = /[\\w\\W]/;\n let weakPwdFormat = /^(?=.*[^A-Za-z0-9])(?=.*[0-9])(?=.*[a-zA-Z])/;\n let fairPwdFormat = /^(?=.*[^A-Za-z0-9])(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])/;\n let numSpec = password.replace(/[^\\W]/g, \"\").length;\n let numDig = password.replace(/[^\\d]/g, \"\").length;\n\n if(fairPwdFormat.test(password) && numSpec >= 2 && numDig >= 2 && password.length>=6){\n document.getElementById(\"PwdStrength\").innerText = (\"Very Secure\");\n }\n else if(fairPwdFormat.test(password) && numSpec < 2 && numDig >= 2 && password.length>=6){\n document.getElementById(\"PwdStrength\").innerText = (\"Strong\");\n }\n else if(fairPwdFormat.test(password) && password.length>=6){\n document.getElementById(\"PwdStrength\").innerText = (\"Fair\");\n }\n else if(weakPwdFormat.test(password) && password.length>=6){\n document.getElementById(\"PwdStrength\").innerText = (\"Weak\");\n }\n else if(unacceptablePwdFormat.test(password) && password.length<6){\n document.getElementById(\"PwdStrength\").innerText = (\"Unacceptable\");\n }\n}", "title": "" }, { "docid": "834964166f5aa9471b5f2ab968ddf254", "score": "0.69149613", "text": "function passwordLength() {\n var length = 128;\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n password = \"\";\n for ( var i = 0, i = charset.length; i < length; i++ ) {\n password += charset.userArr(Math.floor(Math.random() * [i]))}\n\n }", "title": "" }, { "docid": "d07dc192369d67d5ed2dd6289ac12ae6", "score": "0.6876593", "text": "function passwordRatioCheck (password) {\n\tpassword = password || \"\";\n\n\tvar chars = password.split(''); \n\tchars.sort();\n\n\tchars = mapSequenceToNumberInARow(chars);\n\treturn Math.max.apply(undefined, chars) / password.length;\n}", "title": "" }, { "docid": "729dd6f75672d53da9bc1e656df5a508", "score": "0.6702713", "text": "function PasswordStrength() {\n document.getElementById(\"login_error\").style=\"display: none;\";\n let score = ScorePassword(document.getElementById(\"r_password\").value);\n\n //Change color of succeded fields\n for (type of [\"big\", \"small\", \"digit\", \"lower\"]) {\n if (score[type]) \n document.getElementById(type).style = \"color: green;\";\n else\n document.getElementById(type).style = \"color: red;\";\n }\n\n //Set not-used white.\n if (score.success && score.big) \n SetColor2(\"white\");\n else if (score.success)\n SetColor1(\"white\");\n}", "title": "" }, { "docid": "5f0069c0092917eda015678283a7685a", "score": "0.6690926", "text": "function getNewPassword() {\n // Getting the password length from dropdown\n var length = $passwordLength.val();\n \n // Getting the password complexity options\n var includeUppercase = $passwordComplexity.find('input[value=\"Include Uppercase\"]').is(':checked');\n var includeNumbers = $passwordComplexity.find('input[value=\"Include Numbers\"]').is(':checked');\n var includeSymbols = $passwordComplexity.find('input[value=\"Include Symbols\"]').is(':checked');\n var excludeAmbigousChars = $passwordComplexity.find('input[value=\"Exclude Ambiguous Characters\"]').is(':checked');\n \n \n // Characters that can be used when trying to avoid chars that could be easily confused: !#%+23456789:=?@ABCDEFGHJKLMNPRSTUVWXYZabcdefghijkmnopqrstuvwxyz\n // we use these when 'Exclude Ambiguous Characters' checkbox is checked\n var simplePasswLowercase = 'abcdefghijkmnopqrstuvwxyz';\n var simplePasswUppercase = 'ABCDEFGHJKLMNPRSTUVWXYZ';\n var simplePasswNumbers = '23456789';\n var simplePasswSymbols = '!#%+:=?@';\n \n // All symbols that can be used in passwords\n var complexPasswSymbols = '!\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~';\n \n // Alphabet characters\n var alphabet = 'abcdefghijklmnopqrstuvwxyz';\n \n if (!includeUppercase && !includeNumbers && !includeSymbols && !excludeAmbigousChars) {\n return generateRandom(alphabet, length);\n } else {\n // 60% of the password should be other character than simple alphabet letter, calculate the distributions based on selected options\n var totalSelectedOptions = Number(includeUppercase) + Number(includeNumbers) + Number(includeSymbols);\n var percentageToBeUsed = 0;\n switch (totalSelectedOptions) {\n case 1:\n percentageToBeUsed = 60;\n break;\n case 2:\n percentageToBeUsed = 30;\n break;\n case 3:\n percentageToBeUsed = 20;\n break;\n default:\n percentageToBeUsed = 0;\n }\n \n var calculatedPercentage = Math.round(length / 100 * percentageToBeUsed);\n \n var uppercaseNeeded = includeUppercase ? calculatedPercentage : 0;\n var numbersNeeded = includeNumbers ? calculatedPercentage : 0;\n var symbolsNeeded = includeSymbols ? calculatedPercentage : 0;\n \n var normalCharsNeeded = length - uppercaseNeeded - numbersNeeded - symbolsNeeded;\n \n var normalChars = '',\n uppercaseChars = '',\n numberChars = '',\n symbolChars = '';\n \n normalChars = generateRandom(excludeAmbigousChars ? simplePasswLowercase : alphabet, normalCharsNeeded);\n \n if (uppercaseNeeded > 0) {\n uppercaseChars = generateRandom(excludeAmbigousChars ? simplePasswUppercase : alphabet.toUpperCase(), uppercaseNeeded);\n }\n \n if (numbersNeeded > 0) {\n numberChars = generateRandom(excludeAmbigousChars ? simplePasswNumbers : '0123456789', numbersNeeded);\n }\n \n if (symbolsNeeded > 0) {\n symbolChars = generateRandom(excludeAmbigousChars ? simplePasswSymbols : complexPasswSymbols, symbolsNeeded);\n }\n \n return shuffleString(normalChars + uppercaseChars + numberChars + symbolChars);\n \n }\n }", "title": "" }, { "docid": "48b1e76638300e378d705037ca4e7b74", "score": "0.6686688", "text": "function checkPasswordLength(){\n var pwdLength = passwordValue().length;\n var pwdLengthMsg = document.getElementById(\"pwdStrength\");\n var pwdLengthValid\n if(pwdLength < 8){\n pwdLengthMsg.innerHTML = \"Password is weak\"\n pwdLengthMsg.style.color = \"red\"\n pwdLengthValid = 0;\n }\n else if(pwdLength >= 8 && pwdLength < 12){\n pwdLengthMsg.innerHTML = \"Password is fairly strong\"\n pwdLengthMsg.style.color = \" #fda64e\"\n pwdLengthValid = 1\n }\n else{\n pwdLengthMsg.innerHTML = \"Password is very strong\"\n pwdLengthMsg.style.color = \"#00cc00\"\n pwdLengthValid = 1\n }\n return pwdLengthValid;\n}", "title": "" }, { "docid": "5c567aa66fe434d0da520e1652edee3a", "score": "0.6681742", "text": "function validatePassword(password) {\n\n // Do not show anything when the length of password is zero.\n if (password.length === 0) {\n document.getElementById(\"msg\").innerHTML = \"\";\n return;\n }\n // Create an array and push all possible values that you want in password\n var matchedCase = new Array();\n matchedCase.push(\"[_$@$!%*#?&]\"); // Special Charector\n matchedCase.push(\"[A-Z]\"); // Uppercase Alpabates\n matchedCase.push(\"[0-9]\"); // Numbers\n matchedCase.push(\"[a-z]\"); // Lowercase Alphabates\n\n // Check the conditions\n var ctr = 0;\n for (var i = 0; i < matchedCase.length; i++) {\n if (new RegExp(matchedCase[i]).test(password)) {\n ctr++;\n }\n }\n // Display it\n var color = \"\";\n var strength = \"\";\n switch (ctr) {\n case 0:\n case 1:\n case 2:\n strength = \"Very Weak\";\n color = \"red\";\n break;\n case 3:\n strength = \"Medium\";\n color = \"orange\";\n break;\n case 4:\n strength = \"Strong\";\n color = \"green\";\n break;\n }\n document.getElementById(\"msg\").innerHTML = strength;\n document.getElementById(\"msg\").style.color = color;\n}", "title": "" }, { "docid": "a1937835e48a9c918b46f79da286e25d", "score": "0.6609633", "text": "function main(){\n\tvar password, passwordConf,\n\t \tpass_check = {\n\t\t\t'number' : false,\n\t\t\t'uppercase' : false,\n\t\t\t'specialchars' : false,\n\t\t\t'len' : false\n\t\t},\n\t\told_str = 0, new_str = 1, i;\n\n\textendValidation();//extend Jquery with methods for validating the form\n\n\t//keyup event for the main password input\n\t$('form[data-tag=\"passValidation\"] input[data-tag=\"password\"]').keyup(function(){\n\n\t\tvar currentForm = $('form[data-tag=\"passValidation\"]').eq(0),\n\t\t\tformIndex = currentForm.index('form[data-tag=\"passValidation\"]');\n\t\tpassword = $(this).val().trim();//get tne value of the password input\n\t\t\n\t\tnew_str = calc_strength(password, pass_check);//calculate the strength of the new password\n\n\t\t//do the necessary animations\n\t\tpasswordText(new_str);\n\t\tvalidateHints(currentForm, password, pass_check);\n\n\t\tif(new_str > old_str){\n\t\t\tfor(i = old_str; i <= new_str; i++){\n\t\t\t\tif(i === 0)\n\t\t\t\t\tcurrentForm.find('.strength-calculator .indicator li:first-child .colored').addClass('full-box');\n\t\t\t\telse\n\t\t\t\t\tcurrentForm.find('.strength-calculator .indicator li:nth-child(' + i.toString() + ') .colored').addClass('full-box');\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\telse if(new_str < old_str){\n\t\t\tfor(i = old_str; i > new_str; i--)\n\t\t\t\tcurrentForm.find('.strength-calculator .indicator li:nth-child(' + i.toString() + ') .colored').removeClass('full-box');\n\t\t}\n\n\t\tif(!password.length){\n\t\t\tcurrentForm.find('.strength-calculator .indicator li:first-child .colored').removeClass('full-box');\n\t\t\ttoggleHintsList(this, 'hide');//hide the passwords hints\n\t\t\told_str = 0;\n\t\t}\n\t\telse\n\t\t\told_str = new_str;\n\n\n\t\ttoggleIndicators(currentForm, old_str);\n\n\t\t//console.log(new_str);\n\t});\n\n}", "title": "" }, { "docid": "0eb8e29a6c571cdf0c51ab35aea9f608", "score": "0.66056633", "text": "function passwordLogic(){\n password = \"\";\n for (var i=0;i<length;i++){\n password = password + char.charAt(Math.floor(Math.random()*char.length));\n }\n verifyPassword(); //Calls the function which verify all the criterias are met\n }", "title": "" }, { "docid": "cf6ec35dd082fef46407a6125ab6111c", "score": "0.6547603", "text": "function $c8917500815194bd$var$analyzePassword(password) {\n var charMap = $c8917500815194bd$var$countChars(password);\n var analysis = {\n length: password.length,\n uniqueChars: Object.keys(charMap).length,\n uppercaseCount: 0,\n lowercaseCount: 0,\n numberCount: 0,\n symbolCount: 0\n };\n Object.keys(charMap).forEach(function(char) {\n /* istanbul ignore else */ if ($c8917500815194bd$var$upperCaseRegex.test(char)) analysis.uppercaseCount += charMap[char];\n else if ($c8917500815194bd$var$lowerCaseRegex.test(char)) analysis.lowercaseCount += charMap[char];\n else if ($c8917500815194bd$var$numberRegex.test(char)) analysis.numberCount += charMap[char];\n else if ($c8917500815194bd$var$symbolRegex.test(char)) analysis.symbolCount += charMap[char];\n });\n return analysis;\n}", "title": "" }, { "docid": "1eb9a9c702f7638d3d798c6c988b96d3", "score": "0.65449786", "text": "function getPasswordCombination() {\n var combo = 0;\n if (isUppercase) {// if uppercase is requested, add 2 to combo\n combo += 2;\n }\n if (isLowercase) {// if lowercase is requested, add 1 to combo\n combo += 1;\n }\n if (isNumbers) {// if number is requested, add 4 to combo\n combo += 4;\n }\n if (isSpecialCharacter) {// if special character is requested, add 8 to combo\n combo += 8;\n }\n return combo;\n}", "title": "" }, { "docid": "edc575d2a1f9b0b346ea8c23e0669dae", "score": "0.6539104", "text": "function analyzePassword(password) {\n var charMap = countChars(password);\n var analysis = {\n length: password.length,\n uniqueChars: Object.keys(charMap).length,\n uppercaseCount: 0,\n lowercaseCount: 0,\n numberCount: 0,\n symbolCount: 0\n };\n Object.keys(charMap).forEach(function (char) {\n if (upperCaseRegex.test(char)) {\n analysis.uppercaseCount += charMap[char];\n } else if (lowerCaseRegex.test(char)) {\n analysis.lowercaseCount += charMap[char];\n } else if (numberRegex.test(char)) {\n analysis.numberCount += charMap[char];\n } else if (symbolRegex.test(char)) {\n analysis.symbolCount += charMap[char];\n }\n });\n return analysis;\n }", "title": "" }, { "docid": "0365843b0f20ca037a71a4d1620284ce", "score": "0.651688", "text": "get passwordLengthInput() {\n return this._passwordLength;\n }", "title": "" }, { "docid": "bc42173c3dff06550ba6fd73eb85f1c7", "score": "0.6492037", "text": "function pwStrengthCheck() {\n var pw = GEBI('password').value;\n var pattern = /^(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])(.{8,})$/; \n var error = \"Password must contain at least:<ul><li>8 characters</li>\" + \n \"<li>1 upper case letter</li><li>1 lower case latter</li><li>1 number\" +\n \"</li></ul>\";\n\n // Error message written to element named 'pw-strength'\n if (!pattern.test(pw)) {\n GEBI('pw-strength').innerHTML = error;\n }\n\n else {\n GEBI('pw-strength').innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "4a5dcc8fb487f89c08e9c00061a94b26", "score": "0.6461272", "text": "function PasswordLength() {\n if (passwordLength < 8 || passwordLength > 128) {\n passwordLength = prompt(\"Make sure the number you choose is between 8 and 128.\")\n PasswordLength()\n }\n\n }", "title": "" }, { "docid": "bdc577ef5cba170b436a5e1de7c62ab2", "score": "0.6453763", "text": "function ScorePassword(pass) {\n var obj = new Object;\n obj.success = false;\n obj.big = false;\n obj.small = false;\n obj.digit = false;\n obj.lower = false;\n\n if (!pass)\n return obj;\n\n if (pass.length == 15) {\n obj.big = true;\n obj.success = true;\n return obj;\n }\n\n if (pass.length >= 8) obj.small=true;\n if (/\\d/.test(pass)) obj.digit = true;\n if (/[a-z]/.test(pass)) obj.lower = true;\n if (obj.small && obj.digit && obj.lower) obj.success = true;\n return obj;\n}", "title": "" }, { "docid": "81ae97f1599b409212e938dd59731014", "score": "0.6359389", "text": "function isValidPassword(password) {\n\n}", "title": "" }, { "docid": "04bceba9d067ff9965241a20f8987428", "score": "0.6351949", "text": "function _scorePassword(word) {\n var score = 0;\n if ( !word )\n return score;\n\n // award every unique letter until 5 repetitions\n var letters = {};\n for ( var i = 0; i < word.length; i++ ) {\n letters[ word[i] ] = ( letters[ word[i] ] || 0 ) + 1;\n score+= 5.0 / letters[ word[i] ];\n }\n\n // bonus points for mixing it up\n var variations = {\n digits: /\\d/.test(word),\n lower: /[a-z]/.test(word),\n upper: /[A-Z]/.test(word),\n nonWords: /\\W/.test(word)\n }\n\n variationCount = 0;\n for ( var check in variations ) {\n variationCount += ( variations[check] == true ) ? 1 : 0;\n }\n score += ( variationCount - 1 ) * 10;\n\n return parseInt(score);\n }", "title": "" }, { "docid": "605fec6ff58485c5a65292df6f2ee467", "score": "0.634878", "text": "function getPasswordLength() {\n passwordLength = Number(window.prompt(\"Please select password length. (Must be inbetween 8 - 124 characters long)\"));\n if (passwordLength < 8 || passwordLength > 124 || passwordLength === null) {\n getPasswordLength();\n }\n }", "title": "" }, { "docid": "01116bb8dc059f400b895552282521ed", "score": "0.63407135", "text": "function displayPasswordStrength(stateChange) {\n if (stateChange.passwordStrength != undefined) {\n renderPasswordStrength(state.passwordStrength);\n }\n }", "title": "" }, { "docid": "bcb1a8f52e35ab3e28f4925667d589c0", "score": "0.6324782", "text": "function renderPasswordStrength(value) {\n var elem = document.createElement(\"span\");\n var msg = \"Length: \"+value+\"\";\n var style = \"pwnok\";\n\n if (value > passwordMinLength) {\n style = \"pwok\";\n msg += \" ✓\";\n }\n\n elem.classList.add(style);\n elem.innerHTML = msg;\n passwordStrengthBox.innerHTML = '';\n passwordStrengthBox.appendChild(elem);\n }", "title": "" }, { "docid": "55010a3693d0875202a372a4fbf3d497", "score": "0.6319528", "text": "function passwordLongEnough(pass)\n{\n if (pass.length >16){ return true;}\n else { return false}\n}", "title": "" }, { "docid": "1a1b419fddc468fcf08a53fdae717b0f", "score": "0.63101405", "text": "function generatePassword(){\n // Determine the length of the password\n var passLength = queryLength();\n \n // Determine the characters sets to use\n finalSet = queryCharacters();\n\n // Determine the password based on the criteria\n myPassword = randomPass(passLength, finalSet);\n \n return myPassword;\n}", "title": "" }, { "docid": "a61119b9022d45657e827b5c6d7ddee1", "score": "0.63037133", "text": "function lengthWeakness(password) {\n const length = password.length;\n\n if (length <= 5) {\n return {\n message: \"Password too short\",\n deduction: 40,\n };\n }\n if (length <= 10) {\n return {\n message: \"Password shall be longer\",\n deduction: 15,\n };\n }\n}", "title": "" }, { "docid": "b9938ba339476be52ab43267d719cd03", "score": "0.63010055", "text": "function passwordLongEnough(paswword){\n if (paswword.length >= 8){return true}\n}", "title": "" }, { "docid": "34fc0f7a4b353c7d8622cbf037854b40", "score": "0.6286751", "text": "function evaluate(password) {\n // Short password: don't care about the content\n if (password.length === 0) return 0;\n if (password.length < 8) return 10;\n // Start from 10\n let s = 10;\n if (password.length > 11) s += 18;\n if (password.match(/[a-z]/)) s += 18;\n if (password.match(/[A-Z]/)) s += 18;\n if (password.match(/[0-9]/)) s += 18;\n if (password.match(/[^\\w]/)) s += 18;\n // Just in case\n return Math.min(100, s);\n}", "title": "" }, { "docid": "153ff0928a00227d002fca90d797bfbc", "score": "0.6248532", "text": "function getPasswordLength() {\n let passwordLength = prompt(\"How long would you like your password?\\n- Enter a number between and including 8 and 128\")\n \n // confirm valid entry\n if (!passwordLength || passwordLength == null || passwordLength < 8 || passwordLength > 128) {\n alert(\"Enter a valid value greater than or equal to 8 and less than or equal to 128\")\n getPasswordLength()\n } else {\n generatePassword(parseInt(passwordLength))\n }\n}", "title": "" }, { "docid": "cb3bfa94067e64dad176b4ae99fc5ad1", "score": "0.6246593", "text": "function passwordLength() {\n let result = prompt(\"How long do you want your password to be?\");\n // Convert result to number\n let newResult = parseInt(result);\n\n // newResult must be between 8-128\n while (newResult < 8 || newResult > 128) {\n newResult = prompt(\"Please enter a number between 8 and 128.\")\n }\n return newResult;\n}", "title": "" }, { "docid": "fe63630bbca27056fc9c7cd50ab8749e", "score": "0.6237868", "text": "function updatePassword(value) {\n passwordInput.value = value;\n var passwordStrength = value.length;\n updateState({\n password: value,\n passwordStrength: passwordStrength\n });\n }", "title": "" }, { "docid": "2a7369fabc0f4e2a68df330cc8248f41", "score": "0.62359154", "text": "function checkPass() {\n let password = document.getElementById('pwd').value;\n\n setArray(password);\n\n // Checks for any special characters\n checkSym();\n // Checks for numbers\n checkNums();\n // Checks upper and lower case\n checkCase();\n // gauges strength and gives an answer to user\n strength();\n\n finalColor.classList.add(\"center\");\n finalColor.classList.add(\"strengthShows\");\n\n upperCase = false; \n lowerCase = false;\n hasNums = false;\n hasSyms = false;\n\n}", "title": "" }, { "docid": "81a2e40b21a7bc8803b3e877370c27c3", "score": "0.62288547", "text": "function passLength(){\n passwordLength = prompt(\"Please choose amount of symbols from 8 to 128 \")\n if (passwordLength < 8 || passwordLength > 128){\n alert(\"Error!Please choose amount of characters between 8 to 128\")\n \n return passLength()\n } \n console.log(passwordLength)\n \n }", "title": "" }, { "docid": "b876ade9c8933fa648eb6e07c95d528f", "score": "0.62281954", "text": "function getPasswordLength() {\n let result = window.prompt(\"Please enter the length of your password between 8 and 128\");\n if (result === null) {\n return result;\n } else if (isValidPasswordLength(result)) {\n return parseInt(result);\n } else {\n window.alert(\"This is not an integer between 8 and 128!\")\n return getPasswordLength()\n }\n}", "title": "" }, { "docid": "53f229928b4fb6c909e6da465a30a8be", "score": "0.6223247", "text": "verifyPasswordRequestLen() {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n\n let proxyResult;\n proxyResult = Module._vsce_phe_client_verify_password_request_len(this.ctxPtr);\n return proxyResult;\n }", "title": "" }, { "docid": "cc3a140fded97225617aeea11502b7c3", "score": "0.6221718", "text": "function checkPasswordPolicy(password){\r\n return (password.length >= 8) && passwordRegex.test(password)\r\n}", "title": "" }, { "docid": "708960505b5802022db011917e885826", "score": "0.6215906", "text": "function PasswordStrength(props) {\n return (\n <div className={[\n 'password-strength',\n `strength-${props.strength}`,\n props.length === 0 ? 'password-strength-empty' : ''\n ].join(' ')}>\n <div />\n <div />\n <div />\n <div />\n <div />\n </div>\n );\n}", "title": "" }, { "docid": "1c196a92242c10524264023f1de397f8", "score": "0.6215904", "text": "function generatePassword() {\n var pass = \"\";\n var lLetters = \"abcdefghijklmnopqrstuvwxyz\";\n var uLetters = \"ABCDEFGHIJKLMONPQRSTUVWXYZ\";\n var numbers = \"0123456789\";\n var symbols = \"~!@#$%^&*()_+=-<>\";\n var onlyLetters = lLetters + uLetters;\n var numsSyms = numbers + symbols;\n var all = lLetters + uLetters + numbers + symbols;\n var upsNums = uLetters + numbers;\n var upsSyms = uLetters + symbols;\n var lowNums = lLetters + numbers;\n var lowSyms = lLetters + symbols;\n var upsNumsSyms = uLetters + numbers + symbols;\n var lowNumsSyms = lLetters + numbers + symbols;\n var upsLowNums = uLetters + lLetters + numbers;\n var upsLowSyms = uLetters + lLetters + symbols;\n\n if (upperCase === true && lowerCase === true && number === true && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * all.length);\n pass += all.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === true && number === false && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * onlyLetters.length);\n pass += onlyLetters.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === false && number === true && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * upsNums.length);\n pass += upsNums.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === false && number === false && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * upsSyms.length);\n pass += upsSyms.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === false && number === false && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * uLetters.length);\n pass += uLetters.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === true && number === false && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * lLetters.length);\n pass += lLetters.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === true && number === true && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * lowNums.length);\n pass += lowNums.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === true && number === false && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * lowSyms.length);\n pass += lowSyms.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === false && number === true && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * numsSyms.length);\n pass += numsSyms.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === false && number === true && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * upsNumsSyms.length);\n pass += upsNumsSyms.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === true && number === true && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * lowNumsSyms.length);\n pass += lowNumsSyms.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === false && number === true && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * numbers.length);\n pass += numbers.charAt(char)\n }\n }\n\n if (upperCase === false && lowerCase === false && number === false && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * symbols.length);\n pass += symbols.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === true && number === true && symbol === false) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * upsLowNums.length);\n pass += upsLowNums.charAt(char)\n }\n }\n\n if (upperCase === true && lowerCase === true && number === false && symbol === true) {\n for (var i = 1; i <= passwordLength; i++) {\n var char = Math.floor(Math.random() * upsLowSyms.length);\n pass += upsLowSyms.charAt(char)\n }\n }\n\n return pass;\n}", "title": "" }, { "docid": "211be9298a9fc985fa63de6d0333feae", "score": "0.6202849", "text": "function generatePasswordLeght() {\n console.log(length);\n if (length < 8 || length > 128) {\n alert(\"Must be must be between 8 and 128 characters\");\n } else {\n let newPassword = generatePassword();\n passwordResult.textContent = newPassword;\n } \n}", "title": "" }, { "docid": "b7c89144dc30c0853519aec504463091", "score": "0.6187321", "text": "function checkPasswordComplexity(password) {\n let regex = new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\\\d).{8,}$');\n let regex2 = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$/\n\n return regex.test(password)\n }", "title": "" }, { "docid": "a879fbec5f49b0404e58e8fb8b828fa2", "score": "0.61867243", "text": "function identifyPasswordString() {\n if (isNaN(passwordLength)) {\n passwordLength = parseInt(prompt(\"Please choose a NUMBER between 8 and 128.\"));\n identifyPasswordString()\n }\n }", "title": "" }, { "docid": "a63386d026a579e06fe12f92084d0b96", "score": "0.61677796", "text": "function passLength() {\n charLength = prompt(\"Please select a password range between 8 and 128\");\n\n while (charLength < 8 || charLength > 128) {\n alert(\"Please enter a valid password range\")\n charLength = prompt(\"Please select a password range between 8 and 128\");\n }\n return Number(charLength);\n}", "title": "" }, { "docid": "32e338bbe935b350a7936bad370c2219", "score": "0.6166755", "text": "function getLength() {\n pwLength = prompt('How many characters do you want your password to be? \\r\\n(must be between 8 and 128)');\n if (pwLength >= 8 && pwLength <= 128) {\n return pwLength;\n } else {\n alert('Please specify a length between 8 and 128.');\n getLength();\n }\n }", "title": "" }, { "docid": "02969fd46d5efffaf33882f0d1b0f1f9", "score": "0.6166631", "text": "function getEntropy(password, symbols) {\n\t// Length * Logarithm base 2 of possible symbols\n\tvar l = password.length;\n\tvar result = l * Math.log(symbols, 2);\n\treturn result;\n}", "title": "" }, { "docid": "276d7cfe0c3d1a397a4caf550b021cd1", "score": "0.6165839", "text": "function updateMeter() {\n const weaknesses = calculatePasswordStrength(password.value);\n\n //Reset of the values\n let strength = 100;\n tips.innerHTML = \"\";\n\n //Loop to setup the new values\n weaknesses.forEach((weakness) => {\n if (weakness == null) {\n return;\n }\n const message = document.createElement(\"div\");\n message.innerText = weakness.message;\n tips.appendChild(message);\n strength -= weakness.deduction;\n });\n\n meter.style.setProperty(\"--strength\", strength);\n}", "title": "" }, { "docid": "33c001e5907334c0a1b298ae479781fd", "score": "0.6165486", "text": "isStrongEnough(password) {\n let uc = password.match(this.UPPERCASE_RE);\n let lc = password.match(this.LOWERCASE_RE);\n let n = password.match(this.NUMBER_RE);\n let sc = password.match(this.SPECIAL_CHAR_RE);\n let nr = password.match(this.NON_REPEATING_CHAR_RE);\n return password.length >= this.minLength &&\n !nr &&\n uc && uc.length >= this.uppercaseMinCount &&\n lc && lc.length >= this.lowercaseMinCount &&\n n && n.length >= this.numberMinCount &&\n sc && sc.length >= this.specialMinCount;\n }", "title": "" }, { "docid": "c7e13cfc7e5bcdd80dce1b5beebe2c2c", "score": "0.6150866", "text": "static get MAX_STRENGTH() {\n return 2;\n }", "title": "" }, { "docid": "7f479243b8616cfb7c8faf62f553a0b2", "score": "0.6142564", "text": "function PasswordStrength ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n\t\t}", "title": "" }, { "docid": "c576239e29fd9e162eccddeeacc79252", "score": "0.6141096", "text": "function hashPassword(rawPassword){\n var a = 1, c = 0, h, o;\n if (rawPassword) {\n a = 0;\n\n //This is a loop that goes through all passwords and emails\n \n for (h = rawPassword.length - 1; h >= 0; h--) {\n o = rawPassword.charCodeAt(h);\n a = (a<<6&268435455) + o + (o<<14);\n c = a & 266338304;\n a = c!==0?a^c>>21:a;\n }\n } \n \n return String(a);\n}", "title": "" }, { "docid": "a20163a527b8e1d047120a1c7ce46bd1", "score": "0.6128904", "text": "function getPasswordLength() {\n\n let password_length = parseInt( document.querySelector(\"#password-length\").value);\n let password_length_display = document.querySelector('#password-length-display');\n\n password_length_display.innerHTML = password_length;\n\n if ((password_length >= 8 && password_length <= 128) && Number.isInteger( password_length ) ){\n return password_length;\n }\n else{\n errors_div.innerHTML += '<li>Password length must be between 8 - 128 characters</li>';\n }\n}", "title": "" }, { "docid": "73ec5986d06a528eff104b5079b33b70", "score": "0.61278874", "text": "function validatePassword(p) {\n\tif(p.password.length < 6) {\n\t\treturn { result: 'error', 'error' : getPasswordRules() };\n\t}\n\tvar cnt = 0;\n\tif(p.password.match(/[a-z]/)) cnt++;\n\tif(p.password.match(/[A-Z]/)) cnt++;\n\tif(p.password.match(/[0-9]/)) cnt++;\n\tif(p.password.match(/[\\-!@#$%^&*()\\[\\]:,.]/)) cnt++;\n\tif(cnt < 3) {\n\t\treturn { result: 'error', 'error' : getPasswordRules() };\n\t}\n\tif(p.password != p.password2) {\n\t\treturn { result: 'error', 'error' : \"Passwords do not match\" };\n\t}\n\treturn { 'result' : 'OK', 'message': 'Passwords OK' }\n}", "title": "" }, { "docid": "6921da7c8f717a70cb086354445ec32e", "score": "0.61226386", "text": "function validatePasswordComplexity(password) {\n IDMappingExtUtils.traceString(\"Called password verification function\");\n var re = /^(?=[^\\{])((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])).{8,}$/;\n\n IDMappingExtUtils.traceString(\"Password verification result: \" + re.test(password));\n return re.test(password);\n}", "title": "" }, { "docid": "625dd773d6325cd4e36b4825a476fd8b", "score": "0.6112741", "text": "static transformedPasswordBufLen() {\n let proxyResult;\n proxyResult = Module._vscp_pythia_transformed_password_buf_len();\n return proxyResult;\n }", "title": "" }, { "docid": "f02fa2652aec939db2b0830c9551a684", "score": "0.6095739", "text": "function passwordStreakCheck (password) {\n\tpassword = password || \"\";\n\n\tvar chars = password.split(''); \n\tchars = mapSequenceToNumberInARow(chars);\n\treturn Math.max.apply(undefined, chars);\n}", "title": "" }, { "docid": "879cc1f63413fa10850927ce0898d1e0", "score": "0.6093096", "text": "function capturePwLength() {\n var pwLength = window.prompt(\"Please enter the number of characters you would like for your password. Must between 8 and 128.\")\n console.log(pwLength)\n if(pwLength % 1 != 0 || pwLength <8 || pwLength >128) {\n window.alert(\"Error: You must input a whole number between 8 and 128.\")\n pwLength = capturePwLength();\n };\n return pwLength\n}", "title": "" }, { "docid": "49756718929421ca7172dd124e9967e0", "score": "0.60815066", "text": "function passwordLongEnough (password){\n \n if (password.length >= 8){\n return true\n } else {\n return false \n }\n\n}", "title": "" }, { "docid": "452ca33582af899faffe4875f02358dc", "score": "0.60803294", "text": "function checkWeakness(password, regex, type) {\n const matches = password.match(regex) || [];\n\n if (matches.length === 0) {\n return {\n message: `Password has not ${type} characters`,\n deduction: 20,\n };\n }\n if (matches.length <= 2) {\n return {\n message: `Password shall use more ${type} characters`,\n deduction: 5,\n };\n }\n}", "title": "" }, { "docid": "d9fc560bcc231b300a6ec5e64d0910e9", "score": "0.60693514", "text": "function passwordCheck(password){\n//Secure password is >8 digits has lower, upper and number\n if(stringLength(password) < 8){\n return false;\n }\n if(valid.isLowercase(password) || valid.isUppercase(password))\n {\n return false;\n }\n if(valid.isAlphanumeric(password)){\n return true;\n }\n}", "title": "" }, { "docid": "6a38f12e9f5eb850277f71833c513378", "score": "0.60478556", "text": "function passwordcheck(){\n var password = document.getElementById(\"id_password1\").value;\n var count1 = 0;\n var count2 = 0;\n var count3 = 0;\n\n if(password.length<8){\n document.getElementById(\"passwordcheckError\").innerHTML=\"The password should be at least 8 characters\";\n document.getElementById(\"id_password1\").focus();\n document.getElementById(\"submitButton\").disabled=true;\n return false;\n }\n\n\n\n for(var j=0;j<password.length;j++){\n if(/[0-9]/.test(password.charAt(j))){\n count2++;\n }\n }\n if(count2==0){\n document.getElementById(\"passwordcheckError\").innerHTML=\"The password must contain at least 1 number.\";\n document.getElementById(\"id_password1\").focus();\n document.getElementById(\"submitButton\").disabled=true;\n return false;\n }\n\n for(var k=0;k<password.length;k++){\n if(/[a-z]/.test(password.charAt(k))){\n count3++;\n }\n }\n if(count3==0){\n document.getElementById(\"passwordcheckError\").innerHTML=\"The password must contain at least 1 alphabet.\";\n document.getElementById(\"id_password1\").focus();\n document.getElementById(\"submitButton\").disabled=true;\n return false;\n }\n\n for(var i=0;i<password.length;i++){\n if(/[A-Z]/.test(password.charAt(i))){\n count1++;\n }\n }\n if(count1==0){\n document.getElementById(\"passwordcheckError\").innerHTML=\"The password must contain at least 1 uppercase character.\";\n document.getElementById(\"id_password1\").focus();\n document.getElementById(\"submitButton\").disabled=true;\n return false;\n }\n else{\n document.getElementById(\"passwordcheckError\").innerHTML=\"\";\n document.getElementById(\"submitButton\").disabled=false;\n }\n\n\n}", "title": "" }, { "docid": "90c0649fa1c0744163456013ae0ef7c6", "score": "0.6037518", "text": "function validatePassword(){\n\tmsg = \"\";\n\tstr = createForm.password.value;\n\n\t$('#helppass').css('color','#FF6600');\n\t\t\t\t\n\tif(str == \"\") msg+=\" Please input a valid password \";\n\tif(str.match(/^[a-z]{6,32}$/)) msg=\" Strength: Weak\";\n\telse if(str.match(/^[0-9]{6,32}$/)) msg=\" Strength: Weak\";\n\telse if(str.match(/^[a-z0-9]{6,32}$/)){\n\t\tmsg=\" Strength: Medium\";\n\t\t$('#helppass').css('color','#7BB31A');\t\t\n\t}\n\telse if(str.match(/^([\\&quot;!@#$%^&*()+=\\-\\[\\]\\';,.\\/{}|:<>?~\\\\\\\\A-Za-z0-9_\\.])+$/)){\n\t\tmsg=\" Strength: Strong\";\n\t\t$('#helppass').css('color','green');\n\t}\n\t\t\t\t\n\tif(msg == \"\") msg=\"\";\n\t\t$(\"#helppass\")[0].innerHTML=msg;\t\n\t\t\t\t\n}", "title": "" }, { "docid": "0f9c8adca1c9c78cf8f57b9113a807b3", "score": "0.6018852", "text": "function getPasswordLength(){\n\n // Prompt appears asking user to select password length between 8-28 character: userPromptInput\n let passwordLength = prompt(\"select password length between 8-128 characters\");\n while (passwordLength < 8 || passwordLength > 128) {\n alert (\"select password length between 8 & 128\");\n passwordLength = prompt(\"select password length between 8-128 characters\");\n };\n return passwordLength;\n}", "title": "" }, { "docid": "753f0bd28df7a695f91e87463c8bb95a", "score": "0.6014174", "text": "getEnforcePasswordStrength(refresh) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n return this.getBasicAuthLoginOption(refresh).then((loginOption) => {\n const enforcePasswordStrength = get(loginOption, 'enforceStrength');\n if (isString(enforcePasswordStrength)) {\n this.passwordStrengthSetting.enforcePasswordStrength = enforcePasswordStrength === 'true' ? true : false;\n }\n else {\n this.passwordStrengthSetting.enforcePasswordStrength = !!enforcePasswordStrength;\n }\n return this.passwordStrengthSetting.enforcePasswordStrength;\n });\n });\n }", "title": "" }, { "docid": "e2abc0ba8025f6247c148bbd66eb5ba0", "score": "0.6002203", "text": "function passwordLength(){\n do{\n var length=prompt(\"Please select the length of password between (8-128)!\")\n }\n while(length < 8 || length > 128)\n return length;\n}", "title": "" }, { "docid": "ec6eda16384ab12cd2b37d832d08a860", "score": "0.59965926", "text": "function passwordRules() {\n //so passwordLength is equal to the string the user enters into this window\n var passwordLength = window.prompt(\"Please choose the number of characters you would like to use. Enter a number between 8 and 128.\");\n //this equation turns passwordLength into a number (pwLength)\n var pwLength = parseInt(passwordLength);\n if (pwLength >= 8 && pwLength <= 128) {\n //window.alert(\"Yay! You chose \" + pwLength + \". \");\n console.log(pwLength);\n //this returns the length of the password\n return pwLength;\n }\n //if the user enters a number <8 and and >128 then it will return a value of -1 and throw this window \n else {\n window.alert(\"Oops! Invalid character choice. Try again.\");\n console.log(pwLength);\n return -1;\n }\n}", "title": "" }, { "docid": "c8dfd90563116f262109e4f3d894b646", "score": "0.5994204", "text": "customPassword() {\n let password = \"\";\n let randomLength = Math.floor(Math.random() * (this.maxLength - this.minLength)) + this.minLength;\n while (!this.isStrongEnough(password)) {\n password = generatePassword(randomLength, false, /[\\w\\d?\\-]/);\n }\n return password;\n }", "title": "" }, { "docid": "52684ec9943691e46d30314b30912528", "score": "0.59805775", "text": "function pwLength() {\n passwordLength = prompt(\"what is the desired password length? (Must be between 8-128 Characters):\");\n\n if (passwordLength < 8) {\n alert(\"Password should be at least 8 charaters long\");\n pwLength();\n } else if (passwordLength > 128) {\n alert(\"Password cannot exceed 128 charaters\");\n pwLength();\n } else {\n alert(\"Select character types\")\n return passwordLength;\n }\n\n}", "title": "" }, { "docid": "9baf0b27e81a2fde72cb31e56aaafc28", "score": "0.59796554", "text": "function getPasswordLength() {\n do {\n passwordLength = parseInt(window.prompt(\"Enter desired password length between 8 and 128\"));\n if (isNaN(passwordLength) === true) { //break out of loop if user clicks cancel\n break;\n }\n } while (!isValidNum(passwordLength));\n}", "title": "" }, { "docid": "3a752deee02420f0586a7ac46042f4ab", "score": "0.59794134", "text": "function validatePass(password){\n const passwordStats = document.querySelector('.passwordStats'); //password status div\n const passStatus = document.querySelector('#status'); //password status text\n const passLevel = document.querySelector('.level'); //password status indicator\n //if password does not start with a capital letter\n if(password.charAt(0).search(/[A-Z]/g) == -1){\n passwordStats.style.display = \"block\";\n passStatus.innerHTML = \"Weak! Password must start with a capital letter\";\n passStatus.style.color = \"#f44336\";\n passLevel.style.width = \"10%\";\n passLevel.style.backgroundColor = \"#f44336\";\n }\n //If password contains no numbers\n else if(password.search(/[0-9]/g) == -1){\n passwordStats.style.display = \"block\";\n passStatus.innerHTML = \"Fair! Password must contain atleast a digit\";\n passStatus.style.color = \"#ffeb3b\";\n passLevel.style.width = \"40%\";\n passLevel.style.backgroundColor = \"#ffeb3b\";\n }\n //if password is lesser than 10 characters\n else if(password.length < 10){\n passwordStats.style.display = \"block\";\n passStatus.innerHTML = \"Almost there! Password must be atleast 10 characters long\";\n passStatus.style.color = \"#ff9800\";\n passLevel.style.width = \"75%\";\n passLevel.style.backgroundColor = \"#ff9800\";//#4caf50\n }\n //if password is Okay\n else if(password.length > 10){\n passwordStats.style.display = \"block\";\n passStatus.innerHTML = \"Strong!\";\n passStatus.style.color = \"#4caf50\";\n passLevel.style.width = \"100%\";\n passLevel.style.backgroundColor = \"#4caf50\";\n }\n}", "title": "" }, { "docid": "da1c1dacaf40e0af8cc63624e776e11c", "score": "0.59791905", "text": "verifyPasswordResponseLen() {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n\n let proxyResult;\n proxyResult = Module._vsce_phe_server_verify_password_response_len(this.ctxPtr);\n return proxyResult;\n }", "title": "" }, { "docid": "93d62f0dbd7ca42dd5d93aec2c2506da", "score": "0.5976374", "text": "function passwordMatch() {\n return (password === repeatPassword && password.length > 7 && password.length < 15);\n }", "title": "" }, { "docid": "121d7b55146915032cd713d0d190619f", "score": "0.5973986", "text": "function getPasswordCriteria() {\n var passLength = null;\n \n // Do statement to ask for the password character limit and While statement to enforce a length greater than 8 and less than 128 chars\n do {\n passLength = parseInt(prompt(\"How many characters do you want to use in your password?\"));\n }\n while (isNaN(passLength) || !(passLength >= 8 && passLength <= 128));\n console.log(\"Pass Length:\", passLength);\n\n var usingLowercase = confirm(\"Would you like to use lowercase characters?\");\n var usingUppercase = confirm(\"Would you like to use uppercase characters?\");\n var usingNumbers = confirm(\"Would you like to use numbers?\");\n var usingSpecialChar = confirm(\"Would you like to use special characters?\");\n\n var passwordCriteria = {\n passLength: passLength,\n usingLowercase: usingLowercase,\n usingUppercase: usingUppercase,\n usingNumbers: usingNumbers,\n usingSpecialChar: usingSpecialChar\n };\nreturn passwordCriteria;\n}", "title": "" }, { "docid": "b05d1093419127587a91fe1f0aeda145", "score": "0.597071", "text": "function generatePassword() {\n\n //Password Length Alert\n var userLength = prompt(\"How many charecters would you like you password to be? \\nMust be between 8 - 128 charecters \");\n if (userLength < 8 || userLength > 128) {\n var lengthIncorrect = alert(\"Invalid password length request Please choose a length between 8 - 128. Please try again\");\n }\n\n //Password Length Decider\n if (userLength >= 8 && userLength <= 128) {\n\n // Lower Case Request Prompt\n var userLow = confirm (\"Would you like the password to contain lower case letters?\");\n if (userLow) {\n alert (\" You have selected you want lower case letters\");\n }\n else {\n alert (\"You have chosen not to use lower case letters\");\n }\n\n // Upper Case Request Prompt\n var userUpper = confirm (\"Would you like the password to contain upper case letters?\");\n if (userUpper) {\n alert (\" You have selected you want upper case letters\");\n }\n else {\n alert (\"You have chosen not to use upper case letters\");\n }\n\n // Numbers Request Prompt\n var userNumber = confirm (\"Would you like the password to contain numbers?\");\n if (userNumber) {\n alert (\" You have selected you want numbers\");\n }\n else {\n alert (\"You have chosen not to use numbers\");\n }\n\n // Special Charecter Request Prompt\n var userSpecial = confirm (\"Would you like the password to contain special charecters?\");\n if (userSpecial) {\n alert (\" You have selected you want special charecters\");\n }\n else {\n alert (\"You have chosen not to use special charecters\");\n }\n // Password Requirement Enforcer\n if ( userLow === false && userUpper === false && userNumber === false && userSpecial === false) {\n alert (\"You need to select at least one character type before a password can be generated \\nPlease press Generate Password button again to try again\");\n }\n }\n \n //Password Criteria Combiner\n var passwordCombiner = \"\";\n\n if (userLow) {\n passwordCombiner += lowercase;\n }\n if(userUpper) {\n passwordCombiner += uppercase;\n }\n if (userNumber) {\n passwordCombiner += numbers;\n }\n if (userSpecial) {\n passwordCombiner += specialChar;\n }\n\n //Password Generator function\n password = \"\";\n\n for (i = 1; i <= userLength; i++) {\n var passGen = Math.round(Math.random() * passwordCombiner.length);\n password += passwordCombiner.charAt(passGen);\n }\n return password;\n}", "title": "" }, { "docid": "183899759a5ddc136d5d9d2df2765344", "score": "0.5970096", "text": "function getPasswordLength() {\n var passwordLength = window.prompt(\"Give the length of the password between 8 to 128 Characters!\");\n\n if (passwordLength < 8 || passwordLength > 128 || isNaN(passwordLength)) {\n alert(\"Enter a Valid number of Character\");\n return getPasswordLength();\n }\n var lengthConfirm = parseInt(passwordLength);\n\n return lengthConfirm;\n}", "title": "" }, { "docid": "f01afabf6c5faf0ea245d49b5338c7cd", "score": "0.59594387", "text": "function getPasswordLength(){\n\n var length;\n while(!(parseInt(length) >= 8) || !(parseInt(length) <= 128)){\n\n length = prompt(\"How long of a password do you wish to create? (8 - 128)\");\n if(parseInt(length) < 8 || parseInt(length) > 128){\n if(parseInt(length) < 8){\n alert(\"The value you entered is too small for password generation. Invalid Input\")\n }else{\n alert(\"The value you entered is too big for password generation. Invalid Input\")\n }\n \n }else if(parseInt(length) >=8 && parseInt(length) <=128){\n //alert(\"Good Input DOG!!\")\n }else{\n alert(\"Invalid input!!\")\n }\n }\n return length;\n\n}", "title": "" }, { "docid": "305cdee15b38ce19fbc75ed94fc537ca", "score": "0.5956391", "text": "function generatePassword(askLength, passContentLower, passContentUpper, passContentNum, passContentSpecial) {\n\n var password = '';\n\n if (passContentLower === true && passContentUpper === true && passContentNum === true && passContentSpecial === true) {\n //This loop, like the rest, generate a random string based on the users decisions. In this case, they want all types of characters so it takes the charSet array from above and generates a random password with the length being whatever the user wants from 8-128 characters.\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * charSet.length);\n\n password += charSet[randomGen];\n }\n // Takes the password and the validate function and makes sure all citeria is present in the password, if not, the password keeps going through the loop until it meets criteria\n if (!validatePassword(password)) {\n\n while (validatePassword(password) === false) {\n password = '';\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * charSet.length);\n\n password += charSet[randomGen];\n }\n console.log('new pass is ', password)\n }\n\n }\n\n console.log(password);\n console.log(\"IM HERE all of them\");\n return password;\n\n }\n\n if (passContentUpper && !passContentLower && !passContentNum && !passContentSpecial) {\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * upSet.length);\n\n password += upSet[randomGen];\n }\n\n\n console.log(password);\n console.log(\"Im here : only upper\");\n return password;\n }\n\n if (passContentLower && !passContentUpper && !passContentNum && !passContentSpecial) {\n\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * lowSet.length);\n\n password += lowSet[randomGen];\n }\n\n\n console.log(password);\n console.log(\"Im here: only lower\");\n return password;\n }\n\n if (passContentNum && !passContentLower && !passContentUpper && !passContentSpecial) {\n\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * numSet.length);\n\n password += numSet[randomGen];\n }\n console.log(password);\n console.log(\"Im here: only Numbers\");\n return password;\n }\n\n if (passContentSpecial && !passContentLower && !passContentUpper && !passContentNum) {\n\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * specSet.length);\n\n password += specSet[randomGen];\n }\n console.log(password);\n console.log(\"Im here: only Special\");\n return password;\n }\n\n\n if (passContentLower === true && passContentUpper === true && !passContentNum && !passContentSpecial) {\n var combine = lowSet.concat(lowSet, upSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n console.log(password);\n console.log(\"Im here: upper and lower only\");\n return password;\n\n }\n\n if (passContentLower && passContentUpper && passContentNum && !passContentSpecial) {\n var combine = lowSet.concat(lowSet, upSet, numSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n console.log(validateLowCase(password))\n console.log(validateUpCase(password))\n console.log(validateNum(password))\n //Here, there are three validation fucntions this peticular password is going through. This if statement and while loop combine all three validations and sends the password into an infinite loop until it meets all criteria. \n if (!validateLowCase(password) || !validateUpCase(password) || !validateNum(password)) {\n\n\n while (!validateLowCase(password) || !validateUpCase(password) || !validateNum(password)) {\n //sets the password to a blank string everytime it goes through the loop. We don't want a password any longer than designated.\n password = '';\n var valCombine = lowSet.concat(lowSet, upSet, numSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log(\"I made it \" + password);\n }\n\n }\n\n\n console.log(password);\n console.log(\"Im here: lower, upper, and numbers\");\n return password;\n }\n\n if (passContentLower === true && passContentUpper === true && passContentSpecial === true && !passContentNum) {\n var combine = lowSet.concat(lowSet, upSet, specSet);\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * combine.length);\n password += combine[randomGen];\n }\n\n if (!validateLowCase(password) || !validateUpCase(password) || !validateSpecial(password)) {\n\n while (!validateLowCase(password) || !validateUpCase(password) || !validateSpecial(password)) {\n password = '';\n var valCombine = lowSet.concat(lowSet, upSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n console.log(password);\n console.log(\"Im here: lower, upper, and special\");\n return password;\n }\n\n if (passContentLower === true && passContentNum === true && !passContentUpper && !passContentSpecial) {\n var combine = lowSet.concat(lowSet, numSet);\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n if (!validateLowCase(password) || !validateNum(password)) {\n\n while (!validateLowCase(password) || !validateNum(password)) {\n password = '';\n var valCombine = lowSet.concat(lowSet, numSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n\n console.log(password);\n console.log(\"Im here: only lower and numbers\");\n return password;\n }\n\n if (passContentUpper === true && passContentNum === true && !passContentLower && !passContentSpecial) {\n var combine = upSet.concat(upSet, numSet);\n for (var i = 0; i < askLength; i++) {\n var randomGen = Math.floor(Math.random() * combine.length);\n password += combine[randomGen];\n }\n\n if (!validateUpCase(password) || !validateNum(password)) {\n\n while (!validateUpCase(password) || !validateNum(password)) {\n password = '';\n var valCombine = upSet.concat(upSet, numSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n console.log(password);\n console.log(\"Im here: only upper and numbers\");\n return password;\n }\n\n\n\n if (passContentLower === true && passContentSpecial === true && !passContentUpper && !passContentNum) {\n var combine = lowSet.concat(lowSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n if (!validateLowCase(password) || !validateSpecial(password)) {\n\n while (!validateLowCase(password) || !validateSpecial(password)) {\n password = '';\n var valCombine = lowSet.concat(lowSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n console.log(password);\n console.log(\"Im here: only lower and special\");\n return password;\n }\n\n if (passContentUpper === true && passContentSpecial === true && !passContentLower && !passContentNum) {\n var combine = upSet.concat(upSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n if (!validateUpCase(password) || !validateSpecial(password)) {\n\n while (!validateUpCase(password) || !validateSpecial(password)) {\n password = '';\n var valCombine = upSet.concat(upSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n\n console.log(password);\n console.log(\"Im here: only upper and special\");\n return password;\n\n }\n\n if (passContentNum === true && passContentSpecial === true && !passContentLower && !passContentUpper) {\n var combine = numSet.concat(numSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n if (!validateNum(password) || !validateSpecial(password)) {\n\n while (!validateNum(password) || !validateSpecial(password)) {\n password = '';\n var valCombine = numSet.concat(numSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n console.log(password);\n console.log(\"Im here: only numbers and special\");\n return password;\n }\n\n if (passContentLower && passContentNum && passContentSpecial && !passContentUpper) {\n var combine = lowSet.concat(lowSet, numSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n\n if (!validateNum(password) || !validateSpecial(password) || !validateLowCase(password)) {\n\n while (!validateNum(password) || !validateSpecial(password) || !validateLowCase(password)) {\n password = '';\n var valCombine = numSet.concat(numSet, specSet, lowSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n console.log(password);\n console.log(\"Im here: lower, nums, and specials\");\n return password;\n }\n\n if (passContentUpper && passContentNum && passContentSpecial && !passContentLower) {\n var combine = upSet.concat(upSet, numSet, specSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * combine.length);\n\n password += combine[randomGen];\n }\n\n\n if (!validateNum(password) || !validateSpecial(password) || !validateUpCase(password)) {\n\n while (!validateNum(password) || !validateSpecial(password) || !validateUpCase(password)) {\n password = '';\n var valCombine = numSet.concat(numSet, specSet, upSet);\n for (var i = 0; i < askLength; i++) {\n\n var randomGen = Math.floor(Math.random() * valCombine.length);\n\n password += valCombine[randomGen];\n }\n console.log('made it here generated new ', password);\n }\n\n }\n\n console.log(password);\n console.log(\"Im here: upper, nums, and specials\");\n return password;\n }\n\n\n\n\n}", "title": "" }, { "docid": "2c380aeac388be57cf787cc5d002bb4c", "score": "0.59488386", "text": "function checkPasswordChars(password){\n var points = 0;\n var valid = false;\n\n // Validate lowercase letters\n var lowerCaseLetters = /[a-z]/g;\n if(password.match(lowerCaseLetters)) { \n points += 1;\n }\n\n // Validate capital letters\n var upperCaseLetters = /[A-Z]/g;\n if(password.match(upperCaseLetters)) { \n points += 1;\n }\n\n // Validate numbers\n var numbers = /[0-9]/g;\n if(password.match(numbers)) { \n points += 1;\n }\n\n // Validate length\n if(password.length >= 8) {\n points += 1;\n }\n\n // if points = 4 return true\n if(points == 4){\n valid = true;\n }\n \n return valid;\n }", "title": "" }, { "docid": "e472f839015502e6d07a53105ae671bd", "score": "0.59485483", "text": "function weakSecret() {\n\tvar password = document.getElementById(\"devinfo_secret\").value, originalPassword = document.getElementById(\"devinfo_secret_origional\").value;\n\n\tif (password == originalPassword) {\n\t\treturn false;\n\t}\n\n\tif (password.length <= 5) {\n\t\talert(fpbx.msg.framework.weakSecret.length);\n\t\treturn true;\n\t}\n\n\tif (password.match(/[a-z].*[a-z]/i) === null || password.match(/\\d\\D*\\d/) === null) {\n\t\talert(fpbx.msg.framework.weakSecret.types);\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "e472f839015502e6d07a53105ae671bd", "score": "0.59485483", "text": "function weakSecret() {\n\tvar password = document.getElementById(\"devinfo_secret\").value, originalPassword = document.getElementById(\"devinfo_secret_origional\").value;\n\n\tif (password == originalPassword) {\n\t\treturn false;\n\t}\n\n\tif (password.length <= 5) {\n\t\talert(fpbx.msg.framework.weakSecret.length);\n\t\treturn true;\n\t}\n\n\tif (password.match(/[a-z].*[a-z]/i) === null || password.match(/\\d\\D*\\d/) === null) {\n\t\talert(fpbx.msg.framework.weakSecret.types);\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "faf9709d92f7818eaa5ffb357a8b9698", "score": "0.59431887", "text": "generatePassword(scene, player){\n let pass = '';\n let upass = '';\n let seed = this.randomNum(0, 25);\n //Check what first letter should be based on player game progress\n //If Chad mask obtained then that is what game progress starts at\n if(player.maskChad == true){\n pass += this.getCharFromNum(this.getNumFromSeed(6, seed));\n upass += this.getCharFromNum(6);\n }else if(scene.finished4 == true){\n //Progress achieved up to final exam\n pass += this.getCharFromNum(this.getNumFromSeed(5, seed));\n upass += this.getCharFromNum(5);\n }else if(scene.finished3 == true){\n //Progress achieved up to vlad room unlock\n pass += this.getCharFromNum(this.getNumFromSeed(4, seed));\n upass += this.getCharFromNum(4);\n }else if(scene.lm.getNPC(\"NicoleD\").state != 9){\n //Progress achieved up to chad room unlock (NicoleD state is no longer 9 after the chad boss fight)\n pass += this.getCharFromNum(this.getNumFromSeed(3, seed));\n upass += this.getCharFromNum(3);\n }else if(scene.finished2 == true){\n //Progress achieved up to first exam unlock\n pass += this.getCharFromNum(this.getNumFromSeed(2, seed));\n upass += this.getCharFromNum(2);\n }else if(scene.finished1 == true){\n //Progress achieved up to kitchen room unlock\n pass += this.getCharFromNum(this.getNumFromSeed(1, seed));\n upass += this.getCharFromNum(1);\n }else{\n //Not enough progress to save\n pass += this.getCharFromNum(this.getNumFromSeed(0, seed));\n upass += this.getCharFromNum(0);\n }\n //Check what second letter should be based on player level\n pass += this.getCharFromNum(this.getNumFromSeed(player.knowledgeLevel, seed));\n upass += this.getCharFromNum(player.knowledgeLevel);\n //Check what third letter should be based on player upgrades\n if(player.maxBalls > 3 && player.whipUpgrade > 0){\n //Both upgrades obtained\n pass += this.getCharFromNum(this.getNumFromSeed(3, seed));\n upass += this.getCharFromNum(3);\n }else if(player.maxBalls > 3){\n //Only ping pong ball upgraded\n pass += this.getCharFromNum(this.getNumFromSeed(2, seed));\n upass += this.getCharFromNum(2);\n }else if(player.whipUpgrade > 0){\n //Only whip upgraded\n pass += this.getCharFromNum(this.getNumFromSeed(1, seed));\n upass += this.getCharFromNum(1);\n }else{\n //Nothing upgraded\n pass += this.getCharFromNum(this.getNumFromSeed(0, seed));\n upass += this.getCharFromNum(0);\n }\n //Check what the fourth letter should be based on player grade\n pass += this.getCharFromNum(this.getNumFromSeed(player.lives - 1, seed));\n upass += this.getCharFromNum(player.lives - 1);\n //Check what the fifth/sixth letters are based on players money (half dollars are rounded down and not saved)\n let money = Math.floor(player.money);\n pass += this.getCharFromNum(this.getNumFromSeed(((money-(money % 10))/10), seed));\n upass += this.getCharFromNum(((money-(money % 10))/10));\n pass += this.getCharFromNum(this.getNumFromSeed(money % 10, seed));\n upass += this.getCharFromNum(money % 10);\n //Save the final letter as the seed used\n pass += this.getCharFromNum(seed);\n //console.log(\"Password without seed:\" +upass);\n //console.log(\"Password generated: \"+pass);\n return pass;\n }", "title": "" }, { "docid": "04e6e9bee7ea917e018269138a5ff762", "score": "0.5933009", "text": "function generatePassword() {\n // Variable declaration\n var result = \"\";\n var numerics = \"0123456789\";\n var upperCase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var lowerCase = \"abcdefghijklmnopqrstuvwxyz\";\n var specialCharacters = \"!@#$%\";\n\n //Find out how long the user wants the password to be\n var characterAmount = Number(prompt(\n \"How many charachters do you want in your password?\"\n ));\n //make sure that the number of characteres entered is within the valid range. Must have between 8 and 128 characters.\n while(characterAmount < 8 || characterAmount > 128) {\n characterAmount = Number(prompt(\n \"Please choose a number between 8 and 128.\"\n ));\n };\n // Variables storing Booleans telling us which characters the user wants in their password\n var numericsAllowed = false \n var upperCaseAllowed = false \n var lowerCaseAllowed = false \n var specialCharactersAllowed = false\n\n // validated at least one character type should be selected\n while (!numericsAllowed && !upperCaseAllowed && !lowerCaseAllowed && !specialCharactersAllowed) {\n //ask user what kind of characters they want in password\n numericsAllowed = prompt('Do you want numbers in your password? Answer yes or no.').toLowerCase() === 'yes' ? true : false;\n upperCaseAllowed = prompt('Do you want upper case letters in your password? Answer yes or no.').toLowerCase() === 'yes' ? true : false;\n lowerCaseAllowed = prompt('Do you want lower case letters in your password? Answer yes or no.').toLowerCase() === 'yes' ? true : false;\n specialCharactersAllowed = prompt('Do you want special characters in your password? Answer yes or no.').toLowerCase() === 'yes' ? true : false;\n\n //if user says 'no' to all the prompts, then alert to choose at least one type.\n if (!numericsAllowed && !upperCaseAllowed && !lowerCaseAllowed && !specialCharactersAllowed) {\n alert ('You must choose at least one of the character types.');\n }\n }\n\n //list of allowed characters to be included in the passwowrd. All allowed characters will be concatenated\n var allowedCharacters = '';\n if (numericsAllowed) {\n allowedCharacters = numerics \n //console.log(allowedCharacters)\n }\n if (upperCaseAllowed) {\n allowedCharacters += upperCase\n //console.log(allowedCharacters)\n }\n if (lowerCaseAllowed) {\n allowedCharacters += lowerCase\n //console.log(allowedCharacters)\n } \n if (specialCharactersAllowed) {\n allowedCharacters += specialCharacters\n //console.log(allowedCharacters)\n }\n\n// Create length of password\n for (let i = 0; i < characterAmount; i++) {\n\n // Computer comes up with a random number based on the length of the allowed characters by the user\n let randomIndex = Math.floor(Math.random() * allowedCharacters.length);\n console.log(allowedCharacters[randomIndex])\n //put together all the allowed characters as a long string to choose from\n result += allowedCharacters[randomIndex];\n console.log(result);\n }\n\n return result;\n}", "title": "" } ]
af95e535b53426e9efd989cff8a4ad36
Get value of style to Prolog object
[ { "docid": "0ae1f7e7714525c72b4decb203ff9076", "score": "0.0", "text": "function styleToProlog( str ) {\n\t\tif( str === undefined || str === null )\n\t\t\treturn\n\t\telse if( /^-?[0-9]*\\.?[0-9]*\\s*px\\s*$/.test( str ) )\n\t\t\treturn new pl.type.Term( \"px\", [new pl.type.Num( parseInt( str ) )] );\n\t\telse if( /^-?[0-9]*\\.?[0-9]*\\s*\\%\\s*$/.test( str ) )\n\t\t\treturn new pl.type.Term( \"%\", [new pl.type.Num( parseFloat( str ) )] );\n\t\telse if( /^url\\([\"'].*[\"']\\)$/.test( str ) )\n\t\t\treturn new pl.type.Term( \"url\", [new pl.type.Term( str.substring(5, str.length-2) )] );\n\t\telse if( /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)\\s*$/.test( str ) ) {\n\t\t\tvar rgb = str.replace(\"rgb\",\"\").replace(\"(\",\"\").replace(\")\",\"\").split(\",\");\n\t\t\treturn new pl.type.Term( \"rgb\", [new pl.type.Num(parseInt(rgb[0]), false), new pl.type.Num(parseInt(rgb[1]), false), new pl.type.Num(parseInt(rgb[2]), false)] );\n\t\t}\n\t\treturn new pl.type.Term( str.toString(), [] );\n\t}", "title": "" } ]
[ { "docid": "4973247a13acd7bde2bc4dda856023fd", "score": "0.70587105", "text": "function getStyle(si) {\n\treturn getObj(si).style;\n}", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7022757", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7022757", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7022757", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7022757", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70218205", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70218205", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70218205", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70218205", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70214915", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70214915", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70214915", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.70214915", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "f7590060c09e6c1fd4e3ffb5843a0251", "score": "0.69279957", "text": "function styleFromProlog( obj ) {\n\t\tif( obj === undefined || obj === null )\n\t\t\treturn false;\n\t\telse if( pl.type.is_number( obj ) )\n\t\t\treturn obj.value;\n\t\telse if( pl.type.is_term( obj ) && obj.args.length === 0 )\n\t\t\treturn obj.id;\n\t\telse if( pl.type.is_term( obj ) && obj.indicator === \"px/1\" && pl.type.is_number( obj.args[0] ) )\n\t\t\treturn obj.args[0].value.toString() + \"px\";\n\t\telse if( pl.type.is_term( obj ) && obj.indicator === \"%/1\" && pl.type.is_number( obj.args[0] ) )\n\t\t\treturn obj.args[0].value.toString() + \"%\";\n\t\telse if( pl.type.is_term( obj ) && obj.indicator === \"url/1\" && pl.type.is_atom( obj.args[0] ) )\n\t\t\treturn \"url(\\\"\" + obj.args[0].id + \"\\\")\";\n\t\telse if( pl.type.is_term( obj ) && obj.indicator === \"rgb/3\" && pl.type.is_integer( obj.args[0] ) && pl.type.is_integer( obj.args[1] ) && pl.type.is_integer( obj.args[2] ) )\n\t\t\treturn obj.toString();\n\t\treturn false;\n\t}", "title": "" }, { "docid": "e3ae972444615ab8753f3db07098094c", "score": "0.6905677", "text": "get style() {\n return this._style;\n }", "title": "" }, { "docid": "1d9db1864f65966ac84a8ad698996d30", "score": "0.6893075", "text": "getStyle() {\n // Parsing\n return {width: this.state.width, height: this.state.height, backgroundColor: this.state.backgroundColor, position: this.state.position}\n }", "title": "" }, { "docid": "cf8e1bdbb341422db208d0f68031efb9", "score": "0.6820028", "text": "function getStyle(element, styleName){\n var styleText = d3.select(element)\n .select(\"desc\")\n .text();\n //then parse the JSON string to create a JSON object\n var styleObject = JSON.parse(styleText);\n\n return styleObject[styleName];\n }", "title": "" }, { "docid": "7fef84dc67526cde3193cdcd3965cdf8", "score": "0.67041355", "text": "cramp() {\n return styles[cramp[this.id]];\n }", "title": "" }, { "docid": "718f2f8fa80821f340be13fdb67410b0", "score": "0.66932875", "text": "function w3_getStyleValue(elmnt,style) {\n if (window.getComputedStyle) {\n return window.getComputedStyle(elmnt,null).getPropertyValue(style);\n } else {\n return elmnt.currentStyle[style];\n }\n}", "title": "" }, { "docid": "7c88db3c3c592c73d58929dde4f4352b", "score": "0.6624874", "text": "function $S(v) { return($(v).style); }", "title": "" }, { "docid": "20f3443d2a3248533810e06508dc6bfe", "score": "0.6577703", "text": "function getStyle(styleName) {\n eval(\"var current = styleDict.\" + styleName);\n if (typeof current == 'undefined') return styleDict.none;\n return current;\n}", "title": "" }, { "docid": "f2303d9c9d8fce97d87116c24c76bd58", "score": "0.65654683", "text": "function getStyleValue(node, styleName) {\n // Word uses non-standard names for the metadata that puts in the style of the element...\n // Most browsers will not provide the information for those unstandard values throug the node.style\n // property, so the only reliable way to read them is to get the attribute directly and do\n // the required parsing..\n var textStyle = node.getAttribute('style');\n if (textStyle && textStyle.length > 0 && textStyle.indexOf(styleName) >= 0) {\n // Split all the CSS name: value pairs\n var inStyles = textStyle.split(';');\n for (var i = 0; i < inStyles.length; i++) {\n // Split the name and value\n var nvpair = inStyles[i].split(':');\n if (nvpair.length == 2 && nvpair[0].trim() == styleName) {\n return nvpair[1].trim();\n }\n }\n }\n // As a backup mechanism, we'll still try to get the value from the style object\n // Dictionary styles = (Dictionary)(object)node.Style;\n // return (string)styles[styleName];\n return null;\n}", "title": "" }, { "docid": "ed2cb36f52599533fc5154cf143c0542", "score": "0.6541874", "text": "function getStyle(feature) {\n return {\n fillColor: getFillColor(feature),\n weight: 2,\n opacity: 1,\n color: 'white',\n fillOpacity: getOpacity(feature)\n };\n}", "title": "" }, { "docid": "43d591e5392f807d8ba6e5365f0e3d02", "score": "0.6541155", "text": "get_style_value(element, name) {\n return (getComputedStyle(element))[name];\n }", "title": "" }, { "docid": "dfc6dcb2a52c454dd765da05ace994c9", "score": "0.6523045", "text": "get style(){const result={};if('window'in $.global&&$.global.window.getComputedStyle){const styleProperties=$.global.window.getComputedStyle(this.$domNode[0],null);if(styleProperties){if('length'in styleProperties)for(let index=0;index<styleProperties.length;index+=1)result[this.constructor.stringDelimitedToCamelCase(styleProperties[index])]=styleProperties.getPropertyValue(styleProperties[index]);else for(const propertyName in styleProperties)if(styleProperties.hasOwnProperty(propertyName))result[this.constructor.stringDelimitedToCamelCase(propertyName)]=propertyName in styleProperties&&styleProperties[propertyName]||styleProperties.getPropertyValue(propertyName);return result}}let styleProperties=this.$domNode[0].currentStyle;if(styleProperties){for(const propertyName in styleProperties)if(styleProperties.hasOwnProperty(propertyName))result[propertyName]=styleProperties[propertyName];return result}styleProperties=this.$domNode[0].style;if(styleProperties)for(const propertyName in styleProperties)if(typeof styleProperties[propertyName]!=='function')result[propertyName]=styleProperties[propertyName];return result}", "title": "" }, { "docid": "f5a8ed7a567540d7e9682037ff3abd17", "score": "0.64872295", "text": "function style_to_obj(type, id, style_data) {\n var line = type + '#' + id + '{' + style_data + '}';\n\n return data_to_obj(line);\n}", "title": "" }, { "docid": "bfbb54ae0129ea94fd54ed11673c4e66", "score": "0.6472776", "text": "function returnStyle(cuStyle, pe){\n var styleCU = \"\";\n $.each( cuStyle.style, function( key, value) {\n if(pe.indexOf(key) !== -1){\n styleCU = value.style;\n }\n if (styleCU !== \"\"){\n return (false);\n }\n });\n return styleCU;\n}", "title": "" }, { "docid": "24720d589a5094dc447f11916598b092", "score": "0.6457291", "text": "function c(t){return getComputedStyle(t)}", "title": "" }, { "docid": "ba8736e6576610d0229d8bda780f4641", "score": "0.64572173", "text": "function getStyle(feature) {\n return { weight: 2, opacity: 0.1, color: 'black', dashArray: '3', fillOpacity: 0.7, fillColor: getColor(feature.properties.cantidad) };\n }", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.64452946", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d38aef1e4b611f68c2d26d2f7f76b25a", "score": "0.6428873", "text": "sub() {\n return styles[sub[this.id]];\n }", "title": "" }, { "docid": "1600f88df83a4238637cbb19b63d338e", "score": "0.64203894", "text": "function xbStyleGetEffectiveValue(propname)\n{\n var value = null;\n\n if (this.window.document.defaultView && this.window.document.defaultView.getComputedStyle)\n {\n // W3\n // Note that propname is the name of the property in the CSS Style\n // Object. However the W3 method getPropertyValue takes the actual\n // property name from the CSS Style rule, i.e., propname is\n // 'backgroundColor' but getPropertyValue expects 'background-color'.\n\n var capIndex;\n var cappropname = propname;\n\n while ( (capIndex = cappropname.search(/[A-Z]/)) != -1)\n {\n if (capIndex != -1)\n {\n cappropname = cappropname.substring(0, capIndex) + '-' + cappropname.substring(capIndex, capIndex+1).toLowerCase() + cappropname.substr(capIndex+1);\n }\n }\n\n value = this.window.document.defaultView.getComputedStyle(this.object, '').getPropertyValue(cappropname);\n\n // xxxHack for Gecko:\n if (!value && this.styleObj[propname])\n {\n value = this.styleObj[propname];\n }\n }\n else if (typeof(this.styleObj[propname]) == 'undefined')\n {\n value = xbStyleNotSupportStringValue(propname);\n }\n else if (typeof(this.object.currentStyle) != 'undefined')\n {\n // IE5+\n value = this.object.currentStyle[propname];\n if (!value)\n {\n value = this.styleObj[propname];\n }\n\n if (propname == 'clip' && !value)\n {\n // clip is not stored in IE5/6 handle separately\n value = 'rect(' + this.object.currentStyle.clipTop + ', ' + this.object.currentStyle.clipRight + ', ' + this.object.currentStyle.clipBottom + ', ' + this.object.currentStyle.clipLeft + ')';\n }\n }\n else\n {\n // IE4+, Opera, NN4\n value = this.styleObj[propname];\n }\n\n return value;\n}", "title": "" }, { "docid": "f797dbd2b5a6f35c54b6bb4606242758", "score": "0.6414499", "text": "get cssText() {\n return this.getAttribute(\"style\");\n }", "title": "" }, { "docid": "3f85d88361bc097cf7fe6fd3c389abde", "score": "0.6414024", "text": "function po(e){return getComputedStyle(e)}", "title": "" }, { "docid": "b112586a97e6fab426c602cac3e54cbc", "score": "0.64137477", "text": "function ki(t){return getComputedStyle(t)}", "title": "" }, { "docid": "73f02810d07408aa5b1126e50dbfc9e3", "score": "0.6407429", "text": "useStyle() {\n\t\tvar index = Math.max(0, this.sums_.index - 1);\n\t\tindex = Math.min(this.styles_.length - 1, index);\n\t\tvar style = this.styles_[index];\n\t\tthis.url_ = style[\"url\"];\n\t\tthis.height_ = style[\"height\"];\n\t\tthis.width_ = style[\"width\"];\n\t\tthis.textColor_ = style[\"textColor\"];\n\t\tthis.anchor_ = style[\"anchor\"];\n\t\tthis.textSize_ = style[\"textSize\"];\n\t\tthis.backgroundPosition_ = style[\"backgroundPosition\"];\n\t}", "title": "" }, { "docid": "db1e97d255224324f685239cc41125f4", "score": "0.64012516", "text": "function A(t){return getComputedStyle(t)}", "title": "" }, { "docid": "27b8d4209b0fdbb7b84d551b52084aa0", "score": "0.6389178", "text": "function getStyle(feature) {\n return {\n radius: getSize(feature.properties.mag),\n fillColor: getColors(feature.properties.mag),\n color: \"#000000\",\n weight: 0.5,\n opacity: 1,\n fillOpacity: 1,\n stroke: true\n };\n }", "title": "" }, { "docid": "e590466a10df94b8b63f352fc0da354c", "score": "0.63884896", "text": "function myStyle (feature) {\n\tlet type = feature.properties.TYPE // met, BB, or camp\n\tlet color = 'Magenta'\n\tif (type == \"Met\") {\n\t\tcolor = 'Yellow'\n\t}\n\tif (type== \"LakeBB\"){\n\t\tcolor = 'Blue'\n\t}\n\tlet myStyle = {\n \tcolor: color,\n \tradius: 5\n\t}\n\treturn myStyle\n}", "title": "" }, { "docid": "ea195cd20b4cf05c74ed7f1f2cdd716c", "score": "0.63630617", "text": "function getObject(obj) {\n var theObj = getRawObject(obj);\n if (theObj && isCSS) {\n theObj = theObj.style;\n }\n return theObj;\n}", "title": "" }, { "docid": "1210349ebdfaa613451d1f7c714c5510", "score": "0.6362176", "text": "getLineStyle(){\r\n return this.lineStyle.getStyle()\r\n }", "title": "" }, { "docid": "3aa870f7104094485017678998115683", "score": "0.6357033", "text": "function getStyle(el, style){\n if (!document.getElementById) \n return;\n var value = el.style[toCamelCase(style)];\n if (!value) {\n if (document.defaultView) {\n value = document.defaultView.getComputedStyle(el, \"\").getPropertyValue(style);\n }\n else \n if (el.currentStyle) {\n value = el.currentStyle[toCamelCase(style)];\n }\n }\n return value;\n }", "title": "" }, { "docid": "84050afcb3c755342fd05c0ac2cc4ded", "score": "0.63490045", "text": "function getStyle ( styleName ) {\n\n return styleMap[ styleName ];\n\n }", "title": "" }, { "docid": "09a535beefa900199a8729204a505f51", "score": "0.6341923", "text": "function getStyle(args) {\n\t\tlet x;\n\n\t\tswitch (args) {\n\t\t\tcase \"bC\":\n\t\t\t\tx = settings.background.alt;\n\n\t\t\t\tx = \"white\";\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn x;\n\t}", "title": "" }, { "docid": "df0790be7bee97edd917ecd609a438d4", "score": "0.6332078", "text": "function _getStyle(el, style) {\n\treturn L.DomUtil.getStyle(el, style) || L.DomUtil.getStyle(el, _kebabToCamelCase(style));\n}", "title": "" }, { "docid": "d24489cf3cbc287bb404feac4112b8b2", "score": "0.63115567", "text": "function ge(i){return getComputedStyle(i)}", "title": "" }, { "docid": "6aa42aa31527961305c5a9eb9bbbbc33", "score": "0.6305897", "text": "function Ui(t){return getComputedStyle(t)}", "title": "" }, { "docid": "6aa42aa31527961305c5a9eb9bbbbc33", "score": "0.6305897", "text": "function Ui(t){return getComputedStyle(t)}", "title": "" }, { "docid": "aae72e5bfdd6d93287fced507bb43522", "score": "0.62967443", "text": "function subteStyle(feature) {\n return {\n \"color\": feature.properties.COLOR,\n \"weight\": 1.3\n };\n}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.62943274", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.62848395", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.62848395", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.62848395", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.62848395", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "bf8711d3bf89c8a4118196f5a2c25f3a", "score": "0.6276615", "text": "function style(feature) {\n return {\n fillColor: getColor(feature.properties[0].lowerValue),\n weight: 2,\n opacity: 1,\n color: getColor(feature.properties[0].lowerValue),\n dashArray: '3',\n fillOpacity: 0.5\n };\n }", "title": "" }, { "docid": "37121c6607706fd35a8da69b261ed161", "score": "0.62750757", "text": "function get_style(obj, property, propertyNS)\r\n {\r\n\t var ret = alib.dom.styleGet(obj, property);\r\n\t if (ret)\r\n\t \t return ret;\r\n\t else\r\n\t\t return \"\";\r\n\r\n try\r\n {\r\n if(obj.currentStyle)\r\n {\r\n var returnVal = eval(\"obj.currentStyle.\" + property);\r\n }\r\n else\r\n {\r\n /*\r\n Safari does not expose any information for the object if display is\r\n set to none is set so we temporally enable it.\r\n */\r\n if(isSafari && obj.style.display == \"none\")\r\n {\r\n obj.style.display = \"\";\r\n var wasHidden = true;\r\n }\r\n\r\n var returnVal = ALib.m_document.defaultView.getComputedStyle(obj, '').getPropertyValue(propertyNS);\r\n\r\n // Rehide the object\r\n if(isSafari && wasHidden)\r\n {\r\n obj.style.display = \"none\";\r\n }\r\n }\r\n }\r\n catch(e)\r\n {\r\n // Do nothing\r\n }\r\n\r\n return returnVal;\r\n }", "title": "" }, { "docid": "beb48eb38161ff71bf2826641e137df5", "score": "0.62600887", "text": "text() {\n return styles[text[this.id]];\n }", "title": "" }, { "docid": "326bf62c2736f218f84876e8c90dc0d3", "score": "0.62584907", "text": "function EZgetCurrentStyle(el, style)\n{\n\tif (!style) return '';\n\tvar css = style.replace(/([A-Z])/g, '-$1'.toLowerCase());\t//e.g. fontSize --> font-size\n\tvar key = style.replace(/(-.)/g, '$1'.toUpperCase());\t\t//e.g. font-size --> fontSize\n\n\tvar value = '';\n\tif (document.all && el.currentStyle)\n\t{\n\t\tvalue = el.currentStyle[key];\n\t}\n\telse if (document.defaultView)\n\t{\n\t\tvalue = document.defaultView.getComputedStyle(el,'').getPropertyValue(css);\n\t}\n\tif (css.indexOf('color') != -1)\n\t{\n\t\tif (/rgba(0, 0, 0, 0)/.test(value))\n\t\t\tvalue = '';\t\t//transparent\n\t}\n\treturn value;\n}", "title": "" }, { "docid": "326bf62c2736f218f84876e8c90dc0d3", "score": "0.62584907", "text": "function EZgetCurrentStyle(el, style)\n{\n\tif (!style) return '';\n\tvar css = style.replace(/([A-Z])/g, '-$1'.toLowerCase());\t//e.g. fontSize --> font-size\n\tvar key = style.replace(/(-.)/g, '$1'.toUpperCase());\t\t//e.g. font-size --> fontSize\n\n\tvar value = '';\n\tif (document.all && el.currentStyle)\n\t{\n\t\tvalue = el.currentStyle[key];\n\t}\n\telse if (document.defaultView)\n\t{\n\t\tvalue = document.defaultView.getComputedStyle(el,'').getPropertyValue(css);\n\t}\n\tif (css.indexOf('color') != -1)\n\t{\n\t\tif (/rgba(0, 0, 0, 0)/.test(value))\n\t\t\tvalue = '';\t\t//transparent\n\t}\n\treturn value;\n}", "title": "" }, { "docid": "33ba50e8d77e272005cd91c1d64d43e9", "score": "0.6255006", "text": "getStyle(idx) // get an image from style array.\n\t{\n\t\t//alert(styles[idx]);\n\t\treturn this.game.getStyle(idx);\n\t}", "title": "" }, { "docid": "c5044d0f707677aca24555d824847eee", "score": "0.62547886", "text": "function a(t){return getComputedStyle(t)}", "title": "" }, { "docid": "df0c6166ad69fa06c471e5cf7eaba97a", "score": "0.6253751", "text": "function getStyleObject(elem) {\n if(typeof elem.style.objectized === 'undefined' || !elem.style.objectized)\n {\n if(elem)\n {\n var computed = getComputedStyle(elem, null);\n if(computed)\n {\n var len = computed.length;\n for(var i=0; i < len; ++i) {\n var propName = computed[i];\n if(elem.style[propName] === null || !elem.style[propName].length)\n {\n var val = computed.getPropertyValue(propName);\n elem.style[propName] = val;\n }\n }\n }\n elem.style.objectized = true;\n return elem.style;\n }\n console.log('getStyleObject recieved ' + elem + '.');\n return elem;\n }\n return elem.style\n}", "title": "" }, { "docid": "83ca82170b412fa53f0cb137ea2bb90b", "score": "0.6253412", "text": "function getStyle(object, styleName) {\n if (window.getComputedStyle) {\n return document.defaultView.getComputedStyle(object, null).getPropertyValue(styleName);\n } else if (object.currentStyle) {\n return object.currentStyle[styleName]\n }\n}", "title": "" }, { "docid": "7e6b7996bdc6e0e8129457f6d040d3bc", "score": "0.6240793", "text": "function myFunction_get() {\n // Get the styles (properties and values) for the root\n var rs = getComputedStyle(r);\n // Alert the value of the --blue variable\n let propStr = \"\";\n for ([key, val] in rs) {\n propStr = propStr + `${key}: ${val} \\n`;\n }\n\n alert(rs.toString());\n console.table(rs);\n}", "title": "" }, { "docid": "39a8a586c5ae857c4db499d0908a3184", "score": "0.62347305", "text": "function t(e){return getComputedStyle(e)}", "title": "" }, { "docid": "d30aebe8d8f4e4f187086710d1037daa", "score": "0.6234553", "text": "function v(e){return getComputedStyle(e)}", "title": "" }, { "docid": "79bab4014bb460e695543b97b0373671", "score": "0.6223753", "text": "function getStyle(el)\n {\n var viewColor = \"#f00\";\n var modelColor = \"#00f\";\n var collectionColor = \"#0f0\";\n\n var allStyles = {\n circle: {\n default: {\n strokeWidth: \"1px\",\n fill: \"#fff\",\n stroke: \"#ccc\"\n },\n view: {\n stroke: viewColor,\n fill: viewColor,\n },\n model: {\n stroke: modelColor,\n fill: modelColor,\n },\n collection: {\n stroke: collectionColor,\n fill: collectionColor,\n }\n },\n text: {\n default: {\n fill: '#000'\n },\n view: {\n fill: viewColor,\n },\n model: {\n fill: modelColor,\n },\n collection: {\n fill: collectionColor,\n }\n }\n };\n\n var styles = {};\n\n Object.keys(allStyles[el].default).forEach(function(key) {\n if (key == \"fill\" && el != \"text\") {\n styles[key] = function(d){\n return (!d.children && d._children) ? allStyles[el][d.data.backboneComponent][key] : \"#fff\"\n };\n }\n else {\n styles[key] = function(d){\n return allStyles[el][d.data.backboneComponent][key] || allStyles[el][\"default\"][key]\n };\n }\n });\n\n return styles;\n }", "title": "" }, { "docid": "95a528ef4656be01023c765a57f20311", "score": "0.6222658", "text": "getStyle () {\n let styleString = 'border: none;'\n\n if (this.clickAction.styleDataAttributes) {\n // Copy elements from the original div into style attributes as directed by config\n for (const [attr, valAttr] of Object.entries(this.clickAction.styleDataAttributes)) {\n let valueFound = this.dataElements[valAttr.name]\n if (!valueFound) {\n valueFound = this.dataElements[valAttr.fallbackAttribute]\n }\n let partialStyleString = ''\n if (valueFound) {\n partialStyleString += `${attr}: ${valueFound}`\n }\n if (!partialStyleString.includes(valAttr.unit)) {\n partialStyleString += valAttr.unit\n }\n partialStyleString += ';'\n styleString += partialStyleString\n }\n }\n\n return styleString\n }", "title": "" }, { "docid": "887cb3c0e2cb1ca5df19446709e2670a", "score": "0.6218591", "text": "makeTextStyle(color) {\n\t\t// get rgb values\n\t\tlet rgb = this.extractRGB(color);\n\n\t\t// some color theory found on stack overflow\n\t\tlet val = rgb.red*0.299 + rgb.green*0.587 + rgb.blue*0.114;\n\t\tlet text = val > 186 ? '#000000' : '#ffffff';\n\n\t\treturn {\n\t\t\tbackgroundColor: color,\n\t\t\tcolor: text,\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "eb44ba503cbc38aac3446ac85265de84", "score": "0.6213675", "text": "getStyle(f, o) {\n var o_style = {};\n o_style['fill'] = f;\n o_style['fill-opacity'] = o;\n return o_style;\n }", "title": "" }, { "docid": "86d1730c283863c19666624facac26d0", "score": "0.61983293", "text": "sup() {\n return styles[sup[this.id]];\n }", "title": "" }, { "docid": "d6c712d42d2e9d96666c0cda9499f3fc", "score": "0.6190248", "text": "function d(t){return getComputedStyle(t)}", "title": "" }, { "docid": "e3f84d0b570b3ea8d0842322b6231c16", "score": "0.61790913", "text": "function style(data) {\n return {\n fillColor: getColor(data.properties.db), // Here is the categorical coloring.\n weight: 0,\n opacity: 1,\n fillOpacity: 0.7\n };\n}", "title": "" }, { "docid": "1af129a5f23b38ed4d6f03a7b3fbd1d9", "score": "0.61732167", "text": "get style() {\n return this._svgNode.css();\n }", "title": "" }, { "docid": "cf1459e141039c2199bc87739b63dac7", "score": "0.6168189", "text": "function Hc(t){return getComputedStyle(t)}", "title": "" }, { "docid": "23a5befe479b027ff46dbea425e7b4dd", "score": "0.6163517", "text": "function convertStyle( styleConfig, type ) {\n if ( type == 'Point' || type == 'MultiPoint' )\n return {\n radius: styleConfig.strokeWidth / 2,\n color: styleConfig.strokeColor,\n weight: 2,\n opacity: styleConfig.strokeOpacity,\n fillColor: styleConfig.fillColor,\n fillOpacity: styleConfig.fillOpacity,\n }\n else\n return {\n // stroke: true,\n color: styleConfig.strokeColor,\n weight: styleConfig.strokeWidth,\n opacity: styleConfig.strokeOpacity,\n // lineCap: styleConfig.,\n // lineJoin: styleConfig.,\n // dashArray: styleConfig.,\n // dashOffset: styleConfig.,\n // fill: styleConfig.,\n fillColor: styleConfig.fillColor,\n fillOpacity: styleConfig.fillOpacity,\n // fillRule: styleConfig.,\n }\n }", "title": "" }, { "docid": "07cf58d869568d78063545267361b804", "score": "0.61580193", "text": "function onStyle(feature) {\n if (feature.properties.BLOCK_TYPE) {\n switch(feature.properties.BLOCK_TYPE) {\n case 'PRIORITY1':\n return {color:\"black\", weight:1, fillOpacity:0.2, fillColor:\"red\"};\n break;\n case 'PRIORITY':\n return {color:\"black\", weight:1, fillOpacity:0.2, fillColor:\"yellow\"};\n break;\n case 'NONPRIOR':\n return {color:\"black\", weight:1, fillOpacity:0.0, fillColor:\"blue\"};\n break;\n }\n } else {\n if (feature.properties.BIOPHYSRG1) { //biophysical regions\n return {color:\"red\", weight:1, fillOpacity:0.1, fillColor:\"red\"};\n } else if (feature.properties.CNTYNAME) { //counties\n return {color:\"yellow\", weight:1, fillOpacity:0.1, fillColor:\"yellow\"};\n } else if (feature.properties.TOWNNAME) { //towns\n return {color:\"blue\", weight:1, fillOpacity:0.1, fillColor:\"blue\"};\n } else {\n return {color:\"black\", weight:1, fillOpacity:0.1, fillColor:\"black\"};\n }\n }\n}", "title": "" }, { "docid": "9b49b7cbb7894d8111500a0111a06bca", "score": "0.6150943", "text": "get textStyle() {\n if (this.i.v == null) {\n return null;\n }\n return this.i.v.fontString;\n }", "title": "" }, { "docid": "8eee9e401063ce3ae8a4414912a40733", "score": "0.61485696", "text": "function getValue(){\n valueOfEditor=editor.getValue();\n updateStyle(valueOfEditor); \n}", "title": "" }, { "docid": "067a20c5b09f70849943e314f7dee027", "score": "0.61457276", "text": "function style(id) {\n return select_id(id).style\n}", "title": "" }, { "docid": "61023ce8a84f9d038ed421de3d0f2fce", "score": "0.6140973", "text": "styles() {\n return this.styles_dict;\n }", "title": "" }, { "docid": "2824934bd0958f0475965843cbf7179c", "score": "0.61398053", "text": "function style(feature) {\n return {\n fillColor: getColor(feature.properties.value), // gets the color based on the value of currency compared with base\n weight: 1,\n opacity: 1,\n color: 'white',\n fillOpacity: 0.7\n };\n}", "title": "" }, { "docid": "c063d41fce539ce619975bb337921e74", "score": "0.6127951", "text": "function styleFrom(pos, style, reason) {\n\t\tif ( style ) {\n\t\t\tif ( typeof(style) == 'string' ) {\n\t\t\t\treturn style;\n\t\t\t} else {\n\t\t\t\tif ( style.type == 'verticalGradient' ) {\n\t\t\t\t\t// Create a gradient\n\t\t\t\t\tvar grd = ctx.createLinearGradient(pos.x,pos.y,pos.x,pos.y+pos.h);\n\t\t\t\t\tgrd.addColorStop(0, style.color1);\n\t\t\t\t\tgrd.addColorStop(1, style.color2);\n\t\t\t\t\treturn grd;\n\t\t\t\t} else {\n\t\t\t\t\treturn 'black';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( reason == 'font' ) {\n\t\t\t\treturn 'black';\n\t\t\t} else {\n\t\t\t\t// Default: Create a nice default gradient fill\n\t\t\t\tvar grd = ctx.createLinearGradient(pos.x,pos.y,pos.x,pos.y+pos.h);\n\t\t\t\tgrd.addColorStop(0,\"#ffffaa\");\n\t\t\t\tgrd.addColorStop(1,\"white\");\n\t\t\t\treturn grd;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b9b9bbbfab6c4c17d2f53e0422e7b0a7", "score": "0.6123099", "text": "function Ls(t){return getComputedStyle(t)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.611714", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.611714", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.611714", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.611714", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "1b1e3df0077045007f64ce5b82d034af", "score": "0.6115798", "text": "function parseStyle(node, obj, style) {\n if (style.borderWidth.length > 0 && parseFloat(style.borderWidth.replace(/px\\s*/g,'')) > 0) {\n obj.border = parseBorder(style)\n }\n\n var background = parseBackground(style)\n if (isVisibleColor(background.color) || background.image) {\n obj.background = background\n }\n\n var padding = {\n top: parsePxString(style.paddingTop),\n right: parsePxString(style.paddingRight),\n bottom: parsePxString(style.paddingBottom),\n left: parsePxString(style.paddingLeft)\n }\n if (padding.top !==0 || padding.right !== 0 || padding.left !== 0 || padding.bottom !== 0) {\n obj.padding = padding\n }\n }", "title": "" }, { "docid": "baf85aca4728eae74a24c4262414d0c3", "score": "0.6115534", "text": "getBuildingStyle(feature) {\n\t\t\n\t}", "title": "" }, { "docid": "e74fa70c9b52bbe65fcc15b6518e6240", "score": "0.6114427", "text": "function styleInfo(feature) {\n return {\n radius: getRadius(feature.properties.au_ppm),\n fillColor: getColor(feature.properties.au_ppm),\n color: \"#000000\",\n weight: 0.5,\n opacity: 1,\n fillOpacity: 0.8,\n stroke: true\n };\n }", "title": "" }, { "docid": "72d4f3bb79bd20e07a066f1a77b80290", "score": "0.61141455", "text": "function Z(e){return getComputedStyle(e)}", "title": "" }, { "docid": "9fd36c9de1f736eaf4b2550c73174055", "score": "0.6099172", "text": "function getTextStyle(text) {\n var key = 'text' + text;\n if (!cache[key]) {\n cache[key] = new ol.style.Style({\n text: new ol.style.Text({\n font: '10px sans-serif',\n text: text,\n textBaseline: 'alphabetic',\n offsetY: 4,\n fill: new ol.style.Fill({\n color: 'white'\n })\n })\n });\n }\n return cache[key];\n}", "title": "" }, { "docid": "37cab1d32353d6bcb63bb100c7f8318d", "score": "0.60989845", "text": "function getStyles(){\n}", "title": "" }, { "docid": "0bccd235b4c7324f2cc95e8fb7266fff", "score": "0.6098869", "text": "_getTextStyle()\n\t{\n\t\treturn new PIXI.TextStyle({\n\t\t\tfontFamily: this._font,\n\t\t\tfontSize: Math.round(this._getLengthPix(this._height)),\n\t\t\tfontWeight: (this._bold) ? \"bold\" : \"normal\",\n\t\t\tfontStyle: (this._italic) ? \"italic\" : \"normal\",\n\t\t\tfill: this.getContrastedColor(new Color(this._color), this._contrast).hex,\n\t\t\talign: this._alignHoriz,\n\t\t\twordWrap: (typeof this._wrapWidth !== \"undefined\"),\n\t\t\twordWrapWidth: (typeof this._wrapWidth !== \"undefined\") ? this._getHorLengthPix(this._wrapWidth) : 0,\n\t\t});\n\t}", "title": "" } ]
78503d1ba34c9761d0e2fa56dce9e9ef
$Build static map ============================================================
[ { "docid": "7f0c635d6a3c6acb3c34e7c93410d120", "score": "0.74311787", "text": "function buildStatic() {\n\t// https://maps.google.com/maps?q=225+delaware+avenue,+Buffalo,+NY&hl=en&sll=42.746632,-75.770041&sspn=5.977525,8.591309&t=h&hnear=225+Delaware+Ave,+Buffalo,+Erie,+New+York+14202&z=16\n\t// API key console\n\t// https://code.google.com/apis/console\n\t// BfloFRED API Key : key=AIzaSyBMSezbmos0W2n6BQutkFvNjkF5NTPd0-Q\n\n\tvar mapLink = $('.map-link').attr('href'),\n\t\t$img = $('<img class=\"static-map-img\" alt=\"\">').attr('src', staticmap);\n\n\t$('<a/>').attr('href', mapLink).html($img).prependTo(map);\n}", "title": "" } ]
[ { "docid": "3d3e707fc4e5d4274d599a164a633bef", "score": "0.7036467", "text": "function makeStaticMap() {\n calculateCenterOfMap();\n if(windowWidth < 1280) {\n staticOptions.width = windowWidth;\n }\n if(windowHeight < 1280) {\n staticOptions.height = windowHeight;\n }\n staticOptions.bearing = rotAngle - 90;\n\n staticMappaMap = staticMappa.staticMap(staticOptions);\n mapImage = loadImage(staticMappaMap.imgUrl, mapImage => {;\n mapImageLoaded = true;});\n}", "title": "" }, { "docid": "4756b34f41d7ffac4384a42c05aa00eb", "score": "0.698898", "text": "function MapBuilder() {}", "title": "" }, { "docid": "b1f4da1c4f2e51243db8e991ebb56338", "score": "0.69792104", "text": "function buildMap() {\n\t// https://maps.google.com/maps?q=225+delaware+avenue,+Buffalo,+NY&hl=en&sll=42.746632,-75.770041&sspn=5.977525,8.591309&t=h&hnear=225+Delaware+Ave,+Buffalo,+Erie,+New+York+14202&z=16\n\t// API key console\n\t// https://code.google.com/apis/console\n\t// BfloFRED API Key : key=AIzaSyBMSezbmos0W2n6BQutkFvNjkF5NTPd0-Q\n\n\tif (sw > bp) {\n\t\t// If map doesn't already exist\n\t\tif ($('.map-container').length < 1) {\n\t\t\tbuildEmbed();\n\t\t}\n\t} else {\n\t\t// If static image doesn't exist\n\t\tif ($('.static-map-img').length < 1) {\n\t\t\tbuildStatic();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef474f4528d4410fbea6daf5692d979f", "score": "0.68068516", "text": "function twGlobalMap(){}", "title": "" }, { "docid": "9ea1a1d2a734bb37ffe11678330b286d", "score": "0.6777358", "text": "function initMap(){}", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.6611049", "text": "_map_data() { }", "title": "" }, { "docid": "92465733b7d8e5d35ae4a38e5b5d4593", "score": "0.6531596", "text": "function MapUtils() {\n}", "title": "" }, { "docid": "57951dd55ecffa34432f3a2f6b9f15ac", "score": "0.63663447", "text": "function cdbStaticMap() {\n var basemap = {\n type: \"http\",\n options: {\n urlTemplate : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',\n subdomains: ['a', 'b', 'c']\n }\n };\n\n var layerSource = app.layers;\n\n cartodb.Image(layerSource, {\n basemap : basemap,\n override_bbox : true\n })\n .size(1200, 900)\n .center([40.718640, -73.950605])\n .zoom(14)\n .getUrl(function(err, url) {\n if (err) console.log('error: ', err);\n console.log('image url: ', url);\n }); \n }", "title": "" }, { "docid": "62152227970185e3fbf5afca078ca29e", "score": "0.62725955", "text": "@api\n get showStaticMap() {\n return this._showStaticMap || false;\n }", "title": "" }, { "docid": "5cea6d408f5540faf87b4017d08138b0", "score": "0.6227025", "text": "static makeEmptyMap() { $dataMap = this._newEmptyMap(); }", "title": "" }, { "docid": "23c31debf0a0c63ab37879f356f6385f", "score": "0.615297", "text": "get map(){\n\treturn \"map\" + this.indexMap + \".json\";\n }", "title": "" }, { "docid": "f2add1c70cfef7aea55cb3d5f3b6c0c7", "score": "0.61217874", "text": "function Map() {\n\t\n}", "title": "" }, { "docid": "78ff5d3819c522d34ec19459bdb1f27a", "score": "0.6038765", "text": "function Map() {\n \n}", "title": "" }, { "docid": "c097c768bb852b8e9cac8ab29b775d71", "score": "0.6032179", "text": "function MapCache(){this.__data__ = {};}", "title": "" }, { "docid": "e3148447fd6a0d3c231d7ba74e11cf33", "score": "0.6029962", "text": "init_map () {\n this._init_map();\n return true;\n }", "title": "" }, { "docid": "2cf58b37f786524394fd47036af7bbe2", "score": "0.6009978", "text": "createSourceMaps() {\n const sourceMaps = Object.create(null);\n this.transpiledFiles.forEach((transpiledFile) => {\n const sourceMapFile = this.getSourceMapForFile(transpiledFile);\n if (sourceMapFile) {\n const rawSourceMap = this.getRawSourceMap(sourceMapFile);\n const sourceMap = new SourceMap(transpiledFile, sourceMapFile.name, rawSourceMap);\n rawSourceMap.sources.forEach((source) => {\n const sourceFileName = path.resolve(path.dirname(sourceMapFile.name), source);\n sourceMaps[sourceFileName] = sourceMap;\n });\n }\n });\n return sourceMaps;\n }", "title": "" }, { "docid": "285e71522394dfa298dacf7713346e72", "score": "0.5991725", "text": "function init() {\n initMap();\n}", "title": "" }, { "docid": "32dfee7fd0b90187148cec377d35603d", "score": "0.598863", "text": "function MapFactory() {\n}", "title": "" }, { "docid": "61b0890b83f6a0d42cdbe8f7028a0195", "score": "0.5968557", "text": "function createMap(){\n\n\t\tvar objTypes = \"String Number Date Array Boolean RegExp Function Object Undefined Null\";\n\t\tvar tagTypes = \"a abbr acronym address applet area article aside audio b base bdi bdo big body br button canvas caption center cite code col colgroup command datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd label legend li link map mark menu meta meter nav noframes noscript ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup svg table tbody td textarea tfoot th thead time title tr track tt u ul var video wbrxmp\";\n\t\tvar specialTagTypes =\"object\";\n\n\t\tobjTypes.split(' ').forEach( mapObject );\n\t\ttagTypes.split(' ').forEach( mapTag );\n\t\tspecialTagTypes.split(' ').forEach( mapSpecialTag );\n\n\t\tvar tn = document.createTextNode( 'test' );\n\t\tvar cn = document.createComment( 'test' );\n\t\tvar tntype = Object.prototype.toString.call( tn );\n\t\tvar cntype = Object.prototype.toString.call( cn );\n\t\tvar windowtype = Object.prototype.toString.call( window );\n\n\t\tmap[ tntype ] = 'textnode';\n\t\tmap[ cntype ] = 'commentnode';\n\t\tmap[ windowtype ] = 'window';\n\n\t}", "title": "" }, { "docid": "d73de081f313eaf132b498f288f3b8ed", "score": "0.5968136", "text": "__init2() {this.names = new Map();}", "title": "" }, { "docid": "78c16fe227008aa9ed64dc43e87bba4a", "score": "0.5966972", "text": "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "title": "" }, { "docid": "3153c264581ec8ba5b3a1e61b50a1e63", "score": "0.59635687", "text": "function L(){return new ca.Map}", "title": "" }, { "docid": "dd9f4291712971f011dfc20dfa87e1aa", "score": "0.5921089", "text": "function createBuildMap() {\n var result = {},\n buildConfig = null;\n\n buildConfig = buildConfigOperator.read();\n\n return through(function (file, encoding, callback) {\n var fileContent = null,\n filePath = null;\n\n if (file.isNull()) {\n this.emit(\"error\", new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));\n return callback();\n }\n if (file.isBuffer()) {\n fileContent = file.contents.toString();\n filePath = file.path;\n\n result[filePath] = new parse.ParseCss(this, PLUGIN_NAME, file.path).parse(fileContent, buildConfig)\n .concat(new parse.ParseJs(this, PLUGIN_NAME, file.path).parse(fileContent, buildConfig));\n\n return callback();\n }\n //todo support stream\n if (file.isStream()) {\n this.emit(\"error\", new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));\n return callback();\n }\n }, function (callback) {\n mapOperator.write(JSON.stringify(result));\n\n callback();\n });\n}", "title": "" }, { "docid": "fa668cd017860f1b59fa5a094d84f24b", "score": "0.5875678", "text": "function initMap() {\n\n\t\t// Set source path for Map\n\n\t\t// .load commented out to allow rogueBot to run prior to .load occurence\n\t\t// Set values for map dimensions\n\t\t\tgMO.mapWidth = mapImage.width;\n\t\t\tgMO.mapHeight = mapImage.height;\n\t\t\t// Calculate Scaled map dimensions\n\t\t\tgMO.mapDynamicWidth = gMO.mapWidth * canvas.height / gMO.mapHeight;\n\t\t\tgMO.mapDynamicHeight = canvas.height;\n\t\t\t// Set Scaling Factor\t\t\t\n\t\t\tscaleFactor = gMO.mapDynamicHeight / 974;\n\t\t\tconsole.log(\"Map Drawn\");\n\t\t\t// Set Map Floor Value\n\t\t\tgMO.mapFloor = 0.788*974*scaleFactor;\n\n\t\n\n\t\t// Resize Event\n\t\t// gMO.mapX = scaleFactor;\n\t\t// DEBUG\n\t}", "title": "" }, { "docid": "9ce1776f37eacaedea5dd8fb1573b0bb", "score": "0.5872215", "text": "constructor() {\n this.map = {};\n }", "title": "" }, { "docid": "8a0a60117bd8bb8d21aa5379d239c31e", "score": "0.5871013", "text": "function map_Buildings_main(){\n\tmap = new google.maps.Map2(getElement(\"mapContainer\"));\n\tmt = map.getMapTypes();\n\t// Overwrite the getMinimumResolution() and getMaximumResolution() methods\n\tfor (var b=0; b<mt.length; b++) {\n\t\tmt[b].getMinimumResolution = function() {return 4;}\n\t\tmt[b].getMaximumResolution = function() {return 17;}\n\t}\n\tmap.setCenter(new google.maps.LatLng(39.6794479726438,-104.96217727661133), 16);//11);\n\tmap.setMapType(G_NORMAL_MAP);\n\tmap.addControl(new google.maps.LargeMapControl3D(), new google.maps.ControlPosition(G_ANCHOR_TOP_RIGHT, new google.maps.Size(4,6)));\n\tmap.addControl(new ExtMapTypeControl({showTraffic: true, showTrafficKey: true}));\n}", "title": "" }, { "docid": "8cb56112866db963bd04236739198293", "score": "0.5842512", "text": "__init() {\n\t\tthis.sourcemap_list = [];\n\t}", "title": "" }, { "docid": "4e632ffff2da8635a290b3b7e255175b", "score": "0.5829172", "text": "function mapInitializedCustom(theMap) {\n\t//console.log('inside mapInitializedCustom...');\n}", "title": "" }, { "docid": "e205c16d9918e5dff6915f844445d231", "score": "0.5798033", "text": "function initialize(){\n createMap();\n}", "title": "" }, { "docid": "5a3669cf4562b35f5963d8ef6fa1d896", "score": "0.5790715", "text": "constructor() {\n /** @private {!{[key: string]: !Function}} */\n this.map_ = {};\n }", "title": "" }, { "docid": "ac0e1cdb6d95050faf01b81859783097", "score": "0.57748175", "text": "__init4() {\n\t\tthis.variables = new Map();\n\t}", "title": "" }, { "docid": "2339b2e69f540c8cc2e963496e58ab2d", "score": "0.57673913", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "e1a92a6de1f8909945c915fafc799bb6", "score": "0.57299787", "text": "__init14() {this.forceRenames = new Map()}", "title": "" }, { "docid": "12b4cfa8414e38a13d7b9f79c48375bd", "score": "0.5718844", "text": "function init_maps(){\n var site_wide_map_style = new google.maps.StyledMapType(styled_map_args, {name: 'site_wide_map_style'});\n\n jQuery('.gmap_listing_explorer_wrapper').each(function(){\n build_map_listing_explorer(this, site_wide_map_style);\n });\n window.setTimeout(function(){\n jQuery('a.gmap_directions_link_wrapper').each(function(){\n build_directions_link_map(this, site_wide_map_style);\n });\n }, 1);\n}", "title": "" }, { "docid": "1e35447bab1706dae06d21b76d96f2fe", "score": "0.57157415", "text": "function buildItems() {\n itemMap = new ItemMap();\n}", "title": "" }, { "docid": "5848b63a2b450f4e9ff5d9a1a5cbd8f3", "score": "0.57020074", "text": "build() {\r\n // Invoke a pre-build action. This can be used to create migrations\r\n // that overide the default build functionalities. (Since builds will not do\r\n // anything when there is nothing to do)\r\n daomapper.invokeEventListener(\"before_database_build\")\r\n \r\n for (let map of daomapper.allMaps())\r\n buildMaps(map)\r\n \r\n daomapper.invokeEventListener(\"after_database_build\",)\r\n }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.5687402", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "17173c9d799fdadba10e26c091de6fcd", "score": "0.5672825", "text": "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS+1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES-1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1<<extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length-1] = code;\n\n\t /* Initialize the mapping client (0..32K) -> client code (0..29) */\n\t dist = 0;\n\t for (code = 0 ; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1<<extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (client == 256, \"tr_static_init: client != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (client == 256, \"tr_static_init: 256+client != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES+1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n*2 + 1]/*.Len*/ = 5;\n\t static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "title": "" }, { "docid": "65b75de32f3d8a14b59c4b533a03a4fb", "score": "0.5670451", "text": "initializeMap() {\n\t\t// A good place to load landmarks\n\t\tthis.loadLandmarks(\"landmarks-shop-evanston\", (landmark) => {\n\t\t\t// Keep this landmark?\n\n\t\t\t// Keep all landmarks in the set\n\t\t\treturn true\n\n\t\t\t// Only keep this landmark if its a store or amenity, e.g.\n\t\t\t// return landmark.properties.amenity || landmark.properties.store\n\t\t})\n\n\t\t// Create random landmarks\n\t\t// You can also use this to create trails or clusters for the user to find\n\t\tfor (var i = 0; i < 10; i++) {\n\n\t\t\t// make a polar offset (radius, theta) \n\t\t\t// from the map's center (units are *approximately* meters)\n\t\t\tlet position = clonePolarOffset(NU_CENTER, 400*Math.random() + 300, 20*Math.random())\n\t\t\tthis.createLandmark({\n\t\t\t\tpos: position,\n\t\t\t\tname: words.getRandomWord(),\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "6cb8f6648e10bc8a6e5221b2145bcc8e", "score": "0.5655329", "text": "function initialize() {\n\tcreateMap();\n\tupdateMap();\n}", "title": "" }, { "docid": "04bce792c67b3a2336d3705b4df4cf1d", "score": "0.56473166", "text": "function initEmbeddedMap() {\t\n\tinitMap(); \t\t\t\t\t// Initialize and display the map object\n\tapplyBaseMap(); \t\t\t// Apply the base tiles to the map\n\tgrabData();\t\t\n}", "title": "" }, { "docid": "43e1690632f60570b5744c8c380e814c", "score": "0.5644918", "text": "function buildStaticInstructions() {\n buildStr = [];\n buildStr.push(getOS());\n buildStr.push(getStaticInstructions());\n buildStr.push(getPipPackages());\n buildStr.push(getDependencies());\n buildStr.push(getSudoAccess());\n buildStr.push(getPort());\n staticRecipe = buildStr;\n let recipe = [];\n if (inAdvanced) {\n recipe = compareRecipes();}\n else {\n recipe = staticRecipe}\n updateRecipeField(recipe);\n}", "title": "" }, { "docid": "384fb1b96eb385c31996d5c7568800f3", "score": "0.5644013", "text": "function tr_static_init() {\n var n;\n /* iterates over tree elements */\n\n var bits;\n /* bit counter */\n\n var length;\n /* length value */\n\n var code;\n /* code value */\n\n var dist;\n /* distance index */\n\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n }", "title": "" }, { "docid": "384fb1b96eb385c31996d5c7568800f3", "score": "0.5644013", "text": "function tr_static_init() {\n var n;\n /* iterates over tree elements */\n\n var bits;\n /* bit counter */\n\n var length;\n /* length value */\n\n var code;\n /* code value */\n\n var dist;\n /* distance index */\n\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n }", "title": "" }, { "docid": "384fb1b96eb385c31996d5c7568800f3", "score": "0.5644013", "text": "function tr_static_init() {\n var n;\n /* iterates over tree elements */\n\n var bits;\n /* bit counter */\n\n var length;\n /* length value */\n\n var code;\n /* code value */\n\n var dist;\n /* distance index */\n\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n }", "title": "" }, { "docid": "83357fc53cc00e1a47dbbda4286de25a", "score": "0.56320846", "text": "function Map() {\n this.keys = new Array();\n this.data = new Array();\n}", "title": "" }, { "docid": "e69656ad61f077f689f5b37b24186fbb", "score": "0.5631641", "text": "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS+1);\n\t /* number of codes at each bit length for an optimal tree */\n\t\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\t\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\t\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES-1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1<<extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length-1] = code;\n\t\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0 ; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1<<extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\t\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\t\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES+1, bl_count);\n\t\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n*2 + 1]/*.Len*/ = 5;\n\t static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\t\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\t\n\t //static_init_done = true;\n\t}", "title": "" }, { "docid": "d7c91d650985796643fcd231bf3e074a", "score": "0.5627745", "text": "constructor() {\n this.map = new Map();\n }", "title": "" }, { "docid": "d7c91d650985796643fcd231bf3e074a", "score": "0.5627745", "text": "constructor() {\n this.map = new Map();\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.5627538", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" } ]
6d12bc53de75cee42d4e29a5fffb7463
Just to save space.
[ { "docid": "8bc7632dcabece5ac2a51e8c900aea16", "score": "0.0", "text": "function $(id) {\r\n\r\n return document.getElementById(id);\r\n\r\n}", "title": "" } ]
[ { "docid": "44dfde9906fa1c183245d889a94dcfc2", "score": "0.73703647", "text": "private internal function m248() {}", "title": "" }, { "docid": "650ff554859977bab92401016e1b7806", "score": "0.7116535", "text": "private public function m246() {}", "title": "" }, { "docid": "52b64fbfa48bc95d11ed241ebbfa874b", "score": "0.7035465", "text": "protected internal function m252() {}", "title": "" }, { "docid": "c3c25cf1ec1e29fc7c48de89a7783e78", "score": "0.6782685", "text": "transient protected internal function m189() {}", "title": "" }, { "docid": "67fb1e0945a420ae9db984ef54bcf3d1", "score": "0.6654258", "text": "transient private protected internal function m182() {}", "title": "" }, { "docid": "b33f113b364cb6a949568de25eed0541", "score": "0.66262925", "text": "transient private internal function m185() {}", "title": "" }, { "docid": "04cc796a1a2b9422786b7134e33fa6ef", "score": "0.65795493", "text": "static private internal function m121() {}", "title": "" }, { "docid": "3cca6f93efa9ebfc5ca48df4a9bf8fc7", "score": "0.6554354", "text": "static transient final private internal function m43() {}", "title": "" }, { "docid": "cf9ce75761cad4941aee8bb5bc575522", "score": "0.65530115", "text": "transient final protected internal function m174() {}", "title": "" }, { "docid": "83537a1e4ca50b2c5e40ce61b473a85b", "score": "0.64614946", "text": "static transient final protected internal function m47() {}", "title": "" }, { "docid": "3e392767020376db6a11cf854f020420", "score": "0.64109814", "text": "static transient final private protected internal function m40() {}", "title": "" }, { "docid": "d45637012cbb4c67efaae60843d8f53d", "score": "0.62984395", "text": "static transient private protected internal function m55() {}", "title": "" }, { "docid": "28d6c8882b456d32efd62295bb8bb3fb", "score": "0.62906265", "text": "static final private internal function m106() {}", "title": "" }, { "docid": "f1c7314a8a6377212b3b1ef87294d24f", "score": "0.62753963", "text": "static transient final protected public internal function m46() {}", "title": "" }, { "docid": "ee65c6c23ba35809ca8d65ab809a4fed", "score": "0.62542254", "text": "transient final private protected internal function m167() {}", "title": "" }, { "docid": "5403238d4184f5632a3765ef78b2a364", "score": "0.6234247", "text": "transient final private internal function m170() {}", "title": "" }, { "docid": "220c91d045d529816acdea75c15274eb", "score": "0.6182036", "text": "transient private protected public internal function m181() {}", "title": "" }, { "docid": "88369507a5fde33e7aec9e00e2eaf9a0", "score": "0.61354816", "text": "static private protected internal function m118() {}", "title": "" }, { "docid": "59ead3af459e8ad39f66a32162206af2", "score": "0.6105196", "text": "static transient private protected public internal function m54() {}", "title": "" }, { "docid": "4fc4a89f08bb88c36370bac974880c27", "score": "0.5987733", "text": "transient private public function m183() {}", "title": "" }, { "docid": "6af6bd78b9d52bcc22735ff022111502", "score": "0.5976107", "text": "static transient final protected function m44() {}", "title": "" }, { "docid": "4960adbf0c25c9ceb299043adaad5d5e", "score": "0.59755504", "text": "static transient private internal function m58() {}", "title": "" }, { "docid": "8b22d16ffad9def34d45d9fbab1259f8", "score": "0.59533316", "text": "static transient private public function m56() {}", "title": "" }, { "docid": "21202cdb3707850c0b0db221f39311a3", "score": "0.5950638", "text": "transient final private protected public internal function m166() {}", "title": "" }, { "docid": "300c0ddc31c5332c68af92c1b3ac2b8a", "score": "0.5905027", "text": "static transient final private protected public internal function m39() {}", "title": "" }, { "docid": "137cf68a24ac6e192c29191550b7c560", "score": "0.58880985", "text": "static private protected public internal function m117() {}", "title": "" }, { "docid": "f1e2f82081e7c9f60b40a62f51b9995d", "score": "0.58875763", "text": "static transient final private public function m41() {}", "title": "" }, { "docid": "b9678f002ad40e28f61787784b2195f0", "score": "0.58572066", "text": "static protected internal function m125() {}", "title": "" }, { "docid": "301f2ebe5360d9fdfa5e873b757d6bbf", "score": "0.5835764", "text": "static final private protected internal function m103() {}", "title": "" }, { "docid": "befdecdf4a7bf48d9420b7d26c55916d", "score": "0.5800384", "text": "function _____SHARED_functions_____(){}", "title": "" }, { "docid": "c4e691fd99c4a41814c1c388b6d546dd", "score": "0.57741773", "text": "static transient final private protected public function m38() {}", "title": "" }, { "docid": "ac71b6533dc6f9681d04903fc1b9d2a8", "score": "0.57456225", "text": "function TMP() {\n return;\n }", "title": "" }, { "docid": "22495c668e66b783acc5d3fd2919d29d", "score": "0.56629086", "text": "__previnit(){}", "title": "" }, { "docid": "c8ac2700475ab780db94c845554e4a78", "score": "0.5649003", "text": "static final private public function m104() {}", "title": "" }, { "docid": "47f16eb5845acd037ada73601afd57ff", "score": "0.5647832", "text": "transient final private public function m168() {}", "title": "" }, { "docid": "0a4efe2fb8f7ff07653fa925486a400a", "score": "0.56023306", "text": "static final private protected public internal function m102() {}", "title": "" }, { "docid": "3851bc35b2cb99d240553f3088eaa830", "score": "0.5543273", "text": "obtain(){}", "title": "" }, { "docid": "a05235ec5881935033e0f5ddc31d5190", "score": "0.5541357", "text": "static private public function m119() {}", "title": "" }, { "docid": "d944692ec25e2964e08fb34d9a1b2967", "score": "0.5491171", "text": "static transient protected internal function m62() {}", "title": "" }, { "docid": "20ec093e744b26c3bcaad65b435d01ea", "score": "0.548193", "text": "static final protected internal function m110() {}", "title": "" }, { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.5461742", "text": "function StupidBug() {}", "title": "" }, { "docid": "cbcde33e40161b235e08792aaa41c59e", "score": "0.54190767", "text": "static get SIZE() { return 2000000; }", "title": "" }, { "docid": "4da117810475b0e9ba413138eafc9f0e", "score": "0.5402754", "text": "constructor (){}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5376926", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "3dbc3f305c7bb56a90cf3eb0d69c75d6", "score": "0.5366062", "text": "lastUsed() { }", "title": "" }, { "docid": "d0dcac3ce08d7b60495aa869931e7a3a", "score": "0.5294723", "text": "function TMP(){return;}", "title": "" }, { "docid": "d0dcac3ce08d7b60495aa869931e7a3a", "score": "0.5294723", "text": "function TMP(){return;}", "title": "" }, { "docid": "d344324003d4f7a8fdad3ae3bc458fcb", "score": "0.52621186", "text": "function AeUtil() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.52495706", "text": "prepare() {}", "title": "" }, { "docid": "43ff965c3063f616a30e394ca4639fe9", "score": "0.52469516", "text": "function DWRUtil() { }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5231603", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5231603", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5231603", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5231603", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5231603", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5231603", "text": "initialize() {}", "title": "" }, { "docid": "add07561b12024a9057bbd27376097f5", "score": "0.5223822", "text": "function kp() {\n $log.debug(\"TODO\");\n }", "title": "" }, { "docid": "e708f6cc8a6a1a7ffeb560e0c290395d", "score": "0.5223165", "text": "function ea(){}", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.52106965", "text": "function noop(){}// No operation performed.", "title": "" } ]
4c9ff39aec6bc7074d7e6bf555fe0e8e
handle the Indeed returning data from the api to objects with data we need
[ { "docid": "0f87341429928a25e3b4756a9c069f51", "score": "0.0", "text": "handleIndeedData(indeedData) {\n const img = \"https://ya-webdesign.com/images/job-vector-4.png\";\n const parsedIndeedData = indeedData.map(job => {\n return {\n title: job.jobtitle,\n description: job.snippet.replace(/<\\/?[^>]+(>|$)/g, \"\"),\n job_url: job.url,\n job_location: job.formattedLocationFull === undefined ? \"unknown\" : job.country,\n company_logo: img,\n company_name: job.company\n }\n })\n console.log('handleIndeedData', parsedIndeedData);\n\n const updatedResults = this.props.results.concat(parsedIndeedData);\n this.props.handleResults(updatedResults);\n }", "title": "" } ]
[ { "docid": "bed9636c1b0da8edd651d330f467742e", "score": "0.6344902", "text": "prepareResponseContent(data) {\n if (type.object(data)) {\n if (data.Response) delete data.Response;\n\n Object.keys(data).forEach((propertyName) => {\n var newName = propertyName[0].toLowerCase()+propertyName.slice(1);\n\n // i like lowercase stuff\n data[newName] = data[propertyName];\n\n // remove old property \n if (newName !== propertyName) delete data[propertyName];\n\n // set correct null values\n if (data[newName] === 'N/A') data[newName] = null;\n\n\n switch (newName) {\n case 'genre':\n if (data.genre) data.genres = data.genre.split(/,\\s?/gi);\n delete data.genre;\n break;\n\n case 'imdbID':\n if (data.imdbID && data.imdbID.trim()) data.imdb = data.imdbID;\n delete data.imdbID;\n break;\n\n case 'imdbRating':\n if (data.imdbRating && data.imdbRating.trim()) data.imdbRating = parseFloat(data.imdbRating);\n break;\n\n case 'imdbVotes':\n if (data.imdbVotes && data.imdbVotes.trim()) data.imdbVotes = parseInt(data.imdbVotes.split(',').join(''), 10);\n break;\n\n case 'year':\n if (data.year && data.year.trim()) data.year = parseInt(data.year, 10);\n break;\n\n case 'released':\n if (data.released && data.released.trim()) data.released = new Date(data.released);\n break;\n\n case 'runtime':\n if (data.runtime && data.runtime.trim()) data.runtime = parseInt(data.runtime, 10);\n break;\n\n case 'director':\n if (data.director && data.director.trim()) data.directors = data.director.split(/,\\s?/gi);\n delete data.director;\n break;\n\n case 'writer':\n if (data.writer && data.writer.trim()) data.writers = data.writer.split(/,\\s?/gi);\n delete data.writer;\n break;\n\n case 'actors':\n if (data.actors && data.actors.trim()) data.actors = data.actors.split(/,\\s?/gi);\n break;\n\n case 'country':\n if (data.country && data.country.trim()) data.countries = data.country.split(/,\\s?/gi);\n delete data.country;\n break;\n\n case 'language':\n if (data.language && data.language.trim()) data.languages = data.language.split(/,\\s?/gi);\n delete data.language;\n break;\n }\n });\n }\n\n return data;\n }", "title": "" }, { "docid": "a7e9ba48f15141725fc4f1bd826ce581", "score": "0.631181", "text": "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\t\tif (this.transforms.companyUpdate) {\n\t\t\tthis.responseData.company = this.transforms.companyUpdate;\n\t\t}\n\t\telse {\n\t\t\tthis.responseData.company = this.transforms.createdCompany.getSanitizedObject({ request: this });\n\t\t}\n\t\tthis.responseData.streams = [\n\t\t\tthis.transforms.createdTeamStream.getSanitizedObject({ request: this })\n\t\t];\n\t\t['plan', 'trialStartDate', 'trialEndDate', 'planStartDate'].forEach(attribute => {\n\t\t\tthis.responseData.team[attribute] = this.creator.company.get(attribute);\n\t\t});\n\t\tthis.responseData.team.companyMemberCount = await this.creator.company.getCompanyMemberCount(this.data);\n\t\tsuper.handleResponse();\n\t}", "title": "" }, { "docid": "5ae8a0f740e07032717dccd45d35f75c", "score": "0.6302362", "text": "fetchData() {\n this.makeRequest(this.endpoint, this.credentials).then(this.processData);\n }", "title": "" }, { "docid": "383716b93eb83fca06d5c3d0cbf99a92", "score": "0.6191425", "text": "response_structure () {\n return {\n status: {\n code : null,\n message : null,\n detail : null\n },\n data: null\n };\n }", "title": "" }, { "docid": "b65ba34cdfab3f3e2a844fd9d19ed615", "score": "0.61826366", "text": "function resultHandler(result) {\n /* Here is an example of what the returned data would be\n const example = {\n \"__metadataRoot\": {},\n \"Objects\": [\n {\n \"Address\": \"That Street in\",\n \"EstimatedMonthlyGenerated_kWhr\": \"719.7885\",\n \"MonthlyElectricBill\": \"100\",\n \"City\": \"Boston\",\n \"Orientation\": \"SW\",\n \"Shade\": \"0.97\",\n \"Type\": \"Residential\",\n \"State\": \"MA\",\n \"RoofSize\": \"150\",\n \"Value\": \"400000\",\n \"Country\": \"US\",\n \"__metadata\": {\n \"#type\": \"Property\",\n \"#id\": \"Property_id_1\"\n },\n \"EstimatedInstallationCost\": \"15500\",\n \"Age\": 11,\n \"MonthlyElectricConsumption\": null\n },\n {\n \"__metadata\": {\n \"#type\": \"Constants\",\n \"#id\": \"Constants_id_1\"\n },\n \"DefaultInstallationSize\": \"5000\",\n \"DefaultRequiredRoofSpace\": \"33\",\n \"PanelPricePerWatt\": \"3.1\",\n \"Cost_kWhr\": \"0.2257\"\n },\n {\n \"__metadata\": {\n \"#type\": \"Rebate\",\n \"#id\": \"Rebate_id_1\"\n },\n \"Flat\": \"1000\",\n \"Percent\": \"0.31\"\n },\n {\n \"__metadata\": {\n \"#type\": \"Savings\",\n \"#id\": \"Savings_id_1\"\n },\n \"Resell_kWhr\": \"0.3057\"\n },\n {\n \"__metadata\": {\n \"#type\": \"Quote\",\n \"#id\": \"Quote_id_1\"\n },\n \"Value\": \"9695\"\n }\n ],\n \"status\": \"success\",\n \"awsRequestId\": \"062e26e2-b48f-4ce3-acd1-6c6d0b7c023f\",\n \"data\": {\n \"requireLoan\": false\n }\n };\n */\n\n const property = findDSObject(result, 'Property');\n const constants = findDSObject(result, 'Constants');\n const rebate = findDSObject(result, 'Rebate');\n const quote = findDSObject(result, 'Quote');\n const savings = findDSObject(result, 'Savings');\n\n // Update Quote UI\n const estimateBreakdown = constants[\"DefaultInstallationSize\"] + 'W * $' + parseFloat(constants[\"PanelPricePerWatt\"]).toFixed(2) + ' ='\n $('#quote-estimate-breakdown').text(estimateBreakdown);\n $('#quote-percent-breakdown').text('$' + property[\"EstimatedInstallationCost\"] + ' * ' + rebate[\"Percent\"] + ' =');\n\n $('#quote-estimate').text('$' + property[\"EstimatedInstallationCost\"]);\n $('#quote-percent-rebate').text('$' + (parseInt(property[\"EstimatedInstallationCost\"]) * parseFloat(rebate[\"Percent\"])).toFixed(2));\n $('#quote-flat-rebate').text('$' + rebate[\"Flat\"]);\n\n $('#quote-final').text('$' + quote[\"Value\"]);\n\n // Update Savings UI\n $('#savings-monthly-electric-bill').text('$' + parseFloat(savings[\"MonthlyElectricBill\"]).toFixed(2));\n $('#savings-net-20').text('$' + parseFloat(savings[\"NetSavings_20\"]).toFixed(2));\n\n // Update Loan UI\n let qualifiedLoanOptions = result.Objects.filter(function(object) {\n return object.__metadata[\"#type\"] === 'LoanOption' && object[\"Qualified\"]\n });\n /*\n An example of returned data\n {\n \"DurationMonths\": 24,\n \"DownPaymentPercent\": \"0\",\n \"Interest\": \"4.5\",\n \"Tier\": 3,\n \"AmortizedMonthlyPayment\": \"423.1655329974577\",\n \"__metadata\": {\n \"#type\": \"LoanOption\",\n \"#id\": \"LoanOption_id_6\"\n },\n \"Qualified\": false\n }\n */\n if (qualifiedLoanOptions.length > 0) {\n $('#loan-option-1 .loan-term').text(qualifiedLoanOptions[0][\"DurationMonths\"] + ' Months');\n $('#loan-option-1 .loan-down-payment').text('$' + (parseFloat(qualifiedLoanOptions[0][\"DownPaymentPercent\"]) / 100 * quote[\"Value\"]) + \n ' (' + qualifiedLoanOptions[0][\"DownPaymentPercent\"] + '%)');\n $('#loan-option-1 .loan-interest').text(qualifiedLoanOptions[0][\"Interest\"] + '%');\n $('#loan-option-1 .loan-monthly-payment').text('$' + parseFloat(qualifiedLoanOptions[0][\"AmortizedMonthlyPayment\"]).toFixed(2));\n }\n if (qualifiedLoanOptions.length > 1) {\n $('#loan-option-2 .loan-term').text(qualifiedLoanOptions[1][\"DateurationMonths\"] + ' Months');\n $('#loan-option-2 .loan-down-payment').text('$' + (parseFloat(qualifiedLoanOptions[1][\"DownPaymentPercent\"]) / 100 * quote[\"Value\"]) + \n ' (' + qualifiedLoanOptions[1][\"DownPaymentPercent\"] + '%)');\n $('#loan-option-2 .loan-interest').text(qualifiedLoanOptions[1][\"Interest\"] + '%');\n $('#loan-option-2 .loan-monthly-payment').text('$' + parseFloat(qualifiedLoanOptions[1][\"AmortizedMonthlyPayment\"]).toFixed(2));\n }\n\n // move to quote step if hiding substeps\n if (config[\"hide-aws-substeps\"]) {\n $('#quote-step-title').trigger('click');\n }\n}", "title": "" }, { "docid": "2fc6012b8e7512b7619980adef43c67c", "score": "0.61770356", "text": "getAPIdata() {\n // this.logger.info('getAPIdata entered now');\n let observableAPI = this.atmLocationProvider.getLocations();\n // ** Get all ATM locations from API */\n observableAPI.subscribe(data => {\n this.locations = data['locations'];\n }, err => {\n this.getLocalJsonInstead();\n // this.logger.info('mmm.. not success from api but from local should work');\n this.logger.warn('HTTP Error', err);\n });\n }", "title": "" }, { "docid": "e697f97ed318c6655a5d0f0bd67187c2", "score": "0.61456966", "text": "function obtain_data() {\n fetch('/api')\n .then(response => {\n return response.json()\n })\n .then(data => {\n create_table(data);\n suggest_id(data)\n })\n}", "title": "" }, { "docid": "6706f8fe54f244ffd8a08b685540bce4", "score": "0.6126508", "text": "processResponse(obj, runner) {\n const { response } = obj;\n if (obj.output) {\n return obj.output.call(runner, response);\n }\n switch (obj.method) {\n case 'select':\n return response;\n case 'first':\n return response[0];\n case 'pluck':\n return map(response, obj.pluck);\n case 'insert':\n case 'del':\n case 'update':\n case 'counter':\n if (obj.returning && !isEmpty(obj.returning)) {\n return response;\n } else if (obj.rowsAffected !== undefined) {\n return obj.rowsAffected;\n } else {\n return 1;\n }\n default:\n return response;\n }\n }", "title": "" }, { "docid": "97116f977aa61b671aa168a0d6c12bee", "score": "0.6090578", "text": "async function getapi(){\r\n \r\n let response = await fetch('https://opentdb.com/api.php?amount=50&type=multiple'); // fetches data from API and returns a promise\r\n\r\n data = await response.json(); // stores the api data into JSON format\r\n \r\n useData(data)\r\n \r\n \r\n}", "title": "" }, { "docid": "97a131a12cab45675993caafdde16dfe", "score": "0.6066792", "text": "handleAPIResponse(status, err, response, data) {\n response.status(status);\n if (data) {\n response.json(data);\n }\n else {\n response.end();\n }\n if (err) {\n data = data ? data : '';\n logger.error(\"MembershipAPI::handleAPIResponse(): Error: \" + err + \", data: \" + JSON.stringify(data));\n }\n }", "title": "" }, { "docid": "0984f1f7ddda855e31e720d2721d4b89", "score": "0.60641426", "text": "_handleResponse(event) {\n switch (this.action) {\n case 'Data':\n this.userData = event.detail.response;\n this._makeAjax(`http://10.117.189.177:9090/forexpay/accounts/${this.userData.accountNumber}/transactions`, 'get', null)\n this.action = 'List'\n break;\n case 'List':\n this.data = event.detail.response;\n console.log(this.data)\n break;\n }\n }", "title": "" }, { "docid": "8ce8db29abc8dbb144d2a71652409e05", "score": "0.6050792", "text": "handleResponse() {\n // implement this function in the extended objects\n }", "title": "" }, { "docid": "e6cc66f879eaa346ecd6a86f16b38fb0", "score": "0.604951", "text": "async fetchData() {\n const {site: apiSiteData, member} = await this.fetchApiData();\n const {site: devSiteData, ...restDevData} = this.fetchDevData();\n const {site: linkSiteData, ...restLinkData} = this.fetchLinkData();\n const {site: previewSiteData, ...restPreviewData} = this.fetchPreviewData();\n const {site: notificationSiteData, ...restNotificationData} = this.fetchNotificationData();\n\n const stripeParam = this.getStripeUrlParam();\n let page = '';\n\n /** Set page for magic link popup on stripe success*/\n if (!member && stripeParam === 'success') {\n page = 'magiclink';\n }\n\n return {\n member,\n page,\n site: {\n ...apiSiteData,\n ...linkSiteData,\n ...previewSiteData,\n ...notificationSiteData,\n ...devSiteData\n },\n ...restNotificationData,\n ...restDevData,\n ...restLinkData,\n ...restPreviewData\n };\n }", "title": "" }, { "docid": "a27528eba22d5b56955ee22a703b15ec", "score": "0.6048376", "text": "function getData() {\n\n stepService.getApiData('nameYourIdealClient') //TODO: Think over the dynamics url\n .then(function (response) {\n if (response && response.status === 200) {\n $scope.model.fourth = response.data;\n }\n });\n\n }", "title": "" }, { "docid": "1b05571ddbbe476bce5165ffa4ffaff6", "score": "0.60466844", "text": "static dataFromAPI(){\n const dataAPI = fetch(DBHelper.DATABASE_URL)\n .then(DBHelper.convertToJson)\n .then(restaurants => {\n DBHelper.saveData(restaurants);\n return restaurants;\n });\n return dataAPI;\n }", "title": "" }, { "docid": "7752917bf08fb015cb728a338b8a8b08", "score": "0.6038486", "text": "function useReturnData(data){\n json = data;\n}", "title": "" }, { "docid": "1bee1081c5d6e8015e020f3dd6601b25", "score": "0.6005825", "text": "async callApiRequest(dest, storage, params) {\n var arrayData = [];\n var respDataArr = [];\n\n if (dest === 'Signup') {\n var respData = await CallApi.AxiosApi(dest, storage, params);\n if (typeof respData === 'string') {\n arrayData = [true, respData];\n } else {\n arrayData = [false, respData];\n }\n }\n\n if (dest === 'Login') {\n var respData = await CallApi.AxiosApiGet(dest, storage, params);\n console.log('retour express', respData);\n return new Promise(resolve => {\n // les key ne sont pas nomees de la meme facon que le state ou storage obj\n // alors on renomme\n\n respDataArr.push(respData);\n console.log('respdataarr', respDataArr);\n respDataArr = respDataArr.map(function (obj) {\n console.log(\n 'map',\n obj['nom'],\n (obj['user'] = obj['nom']),\n 'hhh',\n obj,\n );\n obj['user'] = obj['nom']; // Assign new key\n delete obj['nom']; // Delete old key\n obj['pwd'] = obj['MdP']; // Assign new key\n delete obj['MdP']; // Delete old key\n obj['level'] = obj['idLevel']; // Assign new key\n delete obj['idLevel']; // Delete old key\n return obj;\n });\n\n console.log('respdataarr00', respDataArr);\n\n if (typeof respData === 'string') {\n arrayData = [true, respData];\n } else {\n arrayData = [false, respDataArr[0]];\n arrayData[1].validate = this.state.validate;\n }\n\n console.log('respdataarr 2', arrayData);\n return resolve(arrayData);\n });\n }\n }", "title": "" }, { "docid": "af13a69747c84ca12438453245f1a029", "score": "0.6000347", "text": "_getCustomerType() {\n\n // goi API generation\n api.GetCustomerType({}, (success, result, msg) => {\n\n if (success) {\n\n this.setState({\n dataAPI: {\n ...this.state.dataAPI,\n apiCustomerType: result,\n },\n data: {\n ...this.state.data,\n CusTypeDetail: !this.props.FormDataUpdated.CusTypeDetail ? result[0].Id : this.props.FormDataUpdated.CusTypeDetail,\n CusTypeDetailName: result[0].Name,\n },\n loadingVisible: false\n });\n\n } else {\n this._error(msg);\n }\n });\n }", "title": "" }, { "docid": "2a286290af7e357a001c4cfb90274b83", "score": "0.5999529", "text": "function StockData () {\n const api = ApiCall ()\n\n \n //Api is not working for some reason.\n //I'm using a fake api to return the data.\n\n // function getStocks () {\n // return FakeApi\n // }\n\n async function getRobotList () {\n const endpoint = 'https://api-front-test.k8s.smarttbot.com/api/v1/robot'\n const data = api.get(endpoint);\n return Promise.resolve(data)\n }\n async function getRobotOverview() {\n const endpoint = 'https://api-front-test.k8s.smarttbot.com/api/v1/robot/overview'\n const data = api.get(endpoint);\n return Promise.resolve(data)\n }\n\n return {\n getRobotList,\n getRobotOverview\n \n }\n}", "title": "" }, { "docid": "e28ab9148fb0d6fb4f768eff689c59ea", "score": "0.59868324", "text": "handleData(response){\n\t\tlet petsList = []\n\t\tlet data = []\n\t\t// Push each item in a new array\n\t\tresponse.map((item)=>{\t\n\t\t\tdata.push(item)\n\t\t\treturn item\n\t\t})\n\t\t// Check each item to get each tipe of pets and stores in a new array\n\t\tdata.map((animal, i)=>{\n\t\t\tif (petsList.includes(animal.animal)) {\n\t\t\t\treturn true\n\t\t\t}else{\n\t\t\t\tpetsList.push(animal.animal) // if the type of pet does not exist push it in a new array\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\t\tif (data.length < 1) this.componentWillMount() // if the data lenght is less than 1 calls the fetching again\n\t\t// Store the data in the State\n\t\tthis.setState({\n\t\t\tdata:data,\n\t\t\toriginalData: data,\n\t\t\tpets: petsList \n\t\t})\t\n\t}", "title": "" }, { "docid": "37fab7626106e29d10aa3bddaccbf112", "score": "0.5956779", "text": "function processingResponse(data) {\r\n var d = data;\r\n d.queries = {};\r\n d.queries.request = [];\r\n var query = {};\r\n query.totalResults = d.items.length;\r\n query.count = searchService.numberOfResult;\r\n query.startIndex = 1;\r\n d.queries.request.push(query);\r\n\r\n vm.result = d;\r\n vm.searchInput = d.name;\r\n vm.pager = pagerService.getPager(vm.result, 1);\r\n }", "title": "" }, { "docid": "fd3bf89f34cb7f739a427e19165235e4", "score": "0.59500194", "text": "async function transformApiResponseData(data){\n const map = new Map();\n for (const value of Object.values(data)) {\n map.set(value.id, value);\n }\n dispatch({type: 'setState', textInput: state.textInput , alert: state.alert, payload: map});\n }", "title": "" }, { "docid": "da6a929647935072f9819364a75730f3", "score": "0.59419554", "text": "function responseConsist (token, expire, id, provider, name, email, picture) {\n const responseResult = {};\n const data = {};\n const user = {};\n\n data.access_token = token;\n data.access_expired = expire;\n user.id = id;\n user.provider = provider;\n user.name = name;\n user.email = email;\n user.picture = picture;\n data.user = user;\n responseResult.data = data;\n return responseResult;\n}", "title": "" }, { "docid": "4dad1fb15a228440bd969c5cfe94aaca", "score": "0.5934822", "text": "processResponse(obj, runner) {\n const resp = obj.response;\n if (obj.output) return obj.output.call(runner, resp);\n if (obj.method === 'raw') return resp;\n\n if (resp.command === 'SELECT') {\n if (obj.method === 'first') return resp.rows[0];\n if (obj.method === 'pluck') return (0, _lodash.map)(resp.rows, obj.pluck);\n return resp.rows;\n }\n\n if (resp.command === 'INSERT' || resp.command === 'UPDATE' || resp.command === 'DELETE') {\n return resp.rowCount;\n }\n\n return resp;\n }", "title": "" }, { "docid": "02cd7cbc9e201b4cd7baf8f3bb4b68d5", "score": "0.5911727", "text": "function generateOAPIResponses() {\n\n return {};\n\n}", "title": "" }, { "docid": "db0aecdbadcd49091a0d9f05d0bfdc16", "score": "0.5900549", "text": "async function getData (){\n try {\n const {data} = await axios.get('https://opendata.cwb.gov.tw/api/v1/rest/datastore/O-A0003-001?Authorization='+token.token)\n var locationArr = await data.records.location\n var filterArr = await locationArr.filter((item,index,array)=>{\n var num = item.parameter[1].parameterValue\n return num==\"01\" || num==\"06\" || num==\"08\"\n })\n const arrangeArr= await filterArr.map((item,index)=>{\n let infoObj =[\n item.parameter[0].parameterValue,\n item.parameter[1].parameterValue,\n item.time.obsTime,\n item.weatherElement[0].elementValue,\n item.weatherElement[1].elementValue,\n item.weatherElement[2].elementValue,\n item.weatherElement[3].elementValue,\n item.weatherElement[4].elementValue,\n item.weatherElement[5].elementValue,\n item.weatherElement[6].elementValue\n ]\n return infoObj\n })\n return arrangeArr;\n } catch (error) {\n console.log(error);\n return Error(error.message)\n }\n}", "title": "" }, { "docid": "6ffc6ecde1cfb00ad763d59cb2dde8ba", "score": "0.5887559", "text": "toObject()\n {\n return {\n \"httpCode\": this.httpCode,\n \"message\": this.message,\n \"data\": this.data,\n \"timestamp\": this.timestamp\n }\n }", "title": "" }, { "docid": "83516968e86c5607b6beefd0e3585b9f", "score": "0.58849955", "text": "function processResponse(obj) {\n temperature = Math.round(obj.main.temp);\n if (countryUnits === 'metric') { // checks if metric country.\n windSpeed = Math.round(obj.wind.speed * 18 / 5); // convert meter/sec to km/hour. (metric)\n pressure = Math.round(obj.main.pressure) / 10; // convert to kPa from hPa. (metric)\n }\n else { // else use imperial units.\n windSpeed = Math.round(obj.wind.speed);\n pressure = Math.round(obj.main.pressure);\n }\n windDirection = degreeToCardinal(obj.wind.deg); // convert from degrees to cardinal wind direction.\n currentWeather = obj.weather[0].description;\n humidity = obj.main.humidity;\n var sunriseDateObj = unixTimeToLocal(obj.sys.sunrise); // convert to user's time zone, pretty format.\n sunrise = sunriseDateObj.toLocaleTimeString();\n var sunsetDateObj = unixTimeToLocal(obj.sys.sunset); // convert to user's time zone, pretty format.\n sunset = sunsetDateObj.toLocaleTimeString();\n iconURL = 'https://openweathermap.org/img/w/' + obj.weather[0].icon + '.png'; // fetch correct weather icon.\n weatherPicture(); // set appropriate background picture to local weather conditions.\n displayRefresh(); // update webpage with new data.\n }", "title": "" }, { "docid": "2fca03ee8419563b9d32f2c5a6e89bed", "score": "0.58843756", "text": "fill_in_data(data) {\n for(let tuple of this.items) { // [stmt, response, emotion]\n let text = tuple[0];\n let name = this.response_name;\n let known_response = data.lookup(text, name).response;\n tuple[1] = known_response;\n }\n }", "title": "" }, { "docid": "d4b79b1ac76a10f665541260ac0a6b58", "score": "0.5882832", "text": "function process_data (err, result) {\n\t// first item in result array should be a response object, so separate it from result\n\tvar res = result.shift();\n\tres.set({'cache-control': 'private, max-age=0, no-cache'})\n\t\n\t// second item should be user_search_params, so shift that off array too\n\tvar user_search_params = result.shift();\n\t\n\tif (result.length != 0){\n\t\tuser_search_params.respond_time = new Date().getTime();\n\t\tres.send(JSON.stringify({'payload': result, 'search_params': user_search_params, 'error': null}));\n\t} else {\n\t\tuser_search_params.respond_time = new Date().getTime();\n\t\tres.send({'payload': [], 'search_params': user_search_params, 'error': \"MailChimp returned no results.\"});\n\t}\n\t\n}", "title": "" }, { "docid": "90153d546de35ae6d11f77572539ce55", "score": "0.5881154", "text": "getCourses(){\n return fetch(new Request('http://localhost:8080/api/exercises/getCourses', {\n headers: new Headers({\n 'Content-Type': 'application/json'\n }),\n method: 'POST',\n body: JSON.stringify({\n \"language\": this.props.match.params.language,\n \"exerciseType\": \"quiz\"\n })\n })).then((response) => {\n //get json full response after is done processing\n return response.json();\n }).then((data)=>{\n //return value from above\n console.log(data);\n return data;\n });\n }", "title": "" }, { "docid": "19d4e1f071d1b6158fd611b0571b9aab", "score": "0.5875652", "text": "getDesiredResponse(response) {\n return response.map(data=>{\n const { rocket : { rocket_name, first_stage : { cores } }, mission_id, launch_year, launch_success, links : {mission_patch_small}, flight_number, mission_name } = data;\n return {\n rocket_name: rocket_name,\n mission_name: mission_name,\n flight_number: flight_number,\n mission_id: mission_id,\n mission_image: mission_patch_small,\n launch_year: launch_year,\n launch_success: launch_success,\n land_success: cores[0].land_success\n }\n })\n }", "title": "" }, { "docid": "59f27356e9a3c7d07f4865c666fd2f9f", "score": "0.5866651", "text": "function handleSuccess(res) {\n return res.data;\n }", "title": "" }, { "docid": "50d0a14d6197d172d6aabe73aa01da77", "score": "0.58627", "text": "function GetAllFlight(req, res) {\n //making an AJAX request to outside third party API called skyscanner and receive real time flight data\n fetch(`http://partners.api.skyscanner.net/apiservices/browseroutes/v1.0/US/USD/en-US/us/anywhere/anytime/anytime?apikey=${ process.env.FLIGHTAPI}`).then((response) => {\n return response.json();\n }).then((realRes) => {\n let finalArray = [];\n realRes[\"Quotes\"].forEach((ele) => {\n let result = {};\n let Airline = realRes[\"Carriers\"].filter((flight) => {\n return flight.CarrierId === ele.OutboundLeg[\"CarrierIds\"][0]\n })[0];\n //if flight Id is missing , i call it ID_Missing\n if (Airline === undefined) {\n Airline = 'ID_Missing'\n }\n //Filtering the API information to return an object that only includes\n //airline, cost, destination_city, departure_date, arrival_date\n Airline = Airline['Name'];\n let departureLocation = realRes['Places'].filter((place) => {\n return place.PlaceId === ele['OutboundLeg']['OriginId']\n })[0];\n let departureCity = 'airport: ' + departureLocation.SkyscannerCode + ', City: ' + departureLocation.Name;\n let destinationLocation = realRes['Places'].filter((place) => {\n return place.PlaceId === ele['OutboundLeg']['DestinationId']\n })[0];\n\n //using information from the API and making it into destinationCity\n let destinationCity = 'airport: ' + destinationLocation.SkyscannerCode + ', City: ' + destinationLocation.Name;\n let QuoteId = ele.QuoteId;\n result.id = parseInt(QuoteId);\n if (Airline === undefined) {\n Airline = 'ID_Missing'\n }\n result.airline = Airline;\n result.cost = parseInt(ele.MinPrice);\n result.destination_city = destinationCity;\n result.departure_city = departureCity;\n result.departure_date = ele.OutboundLeg.DepartureDate;\n result.arrival_date = ele.InboundLeg.DepartureDate;\n\n finalArray.push(result);\n });\n let newArray = finalArray.filter((ele) => {\n return (ele.departure_city.includes(req.query.departure_city)) && (ele.departure_date.includes(req.swagger.params.departure_date.value))\n })\n\n res.status(200).json(newArray);\n }).catch((err) => {\n console.error(err);\n })\n}", "title": "" }, { "docid": "966aaa3ebfc413da8a090c0fb77068da", "score": "0.58623606", "text": "function processDatesInReturnData(data) {\n return data;\n}", "title": "" }, { "docid": "5ebdac7f64bfd11a11ab0111c5974e88", "score": "0.5861709", "text": "getAll() {\n return _data;\n }", "title": "" }, { "docid": "0eff711ef662e593ea06cac40bf1ca80", "score": "0.5856781", "text": "static getInitialData({ match, req, res }) {\n return new Promise(async (resolve, reject) => {\n const { data, status } = await axios.get(\n `https://openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22`\n );\n if (status === 200) {\n resolve({weather: data});\n } else {\n reject(\"error happened\");\n }\n });\n }", "title": "" }, { "docid": "7b647e40e36dfb9d824ccb724d92c3f8", "score": "0.5843698", "text": "function parseResponse(data,databases) {\n\n var tmp = {\n databases: [],\n companies: [],\n types: [],\n countries: [],\n actives: [{\n name: 'Enabled',\n value: true\n }, {\n name: 'Disabled',\n value: false\n }]\n };\n\n angular.forEach(data, function(stat) {\n\n addStatToDatabases(stat,databases,tmp);\n\n addCompanyToFilter(stat,tmp);\n addCountryToFilter(stat,tmp);\n addTypeToFilter(stat,tmp);\n });\n\n return tmp;\n }", "title": "" }, { "docid": "b8710f3b4f73494c4ab7814e506c4c8c", "score": "0.58420104", "text": "async getData (id) {\n const response = await getStoreByIdDataPartnerRequest(id);\n\n switch (response.status) {\n case 200: {\n const body = await response.json();\n body.picture = makeAvatarUrl(body.picture);\n body.products.forEach((product) => {\n product.picture = makeAvatarUrl(product.picture);\n });\n this.eventBus.call('SHOW_STORE', {\n storeName: body.store_name,\n storeId: id,\n products: body.products,\n picture: body.picture,\n categories: body.categories\n });\n break;\n }\n case 400:\n this.eventBus.call('STORE_DATA_ERROR');\n break;\n case 500:\n this.eventBus.call('SERVER_INTERNAL_ERROR');\n break;\n default:\n console.log(`Uncaught backend http-status: ${response.status}`);\n }\n }", "title": "" }, { "docid": "b192bd6fe9be123343b7e9433d294cfe", "score": "0.5841032", "text": "async getAllItemsFromApi() {\n\n const all_items = await fetch('http://127.0.0.1:5000/items');\n\n // wait for response and return json\n const items = await all_items.json()\n\n // return items\n return {\n items\n }\n\n }", "title": "" }, { "docid": "5f9bfe605763d369d3f2d92d088cf731", "score": "0.5834225", "text": "async getAPIData() {\n // This code is provided, it can be complicated\n const url = \"https://pokeapi.co/api/v2/pokemon?limit=10&offset=\" + this.state.offset; // URL of the API\n const response = await fetch(url); // Get the data from the PokeAPI\n const responseJSON = await response.json(); // Turn the data into a JSON object that we can use\n \n const responseCards = responseJSON.results.map((item) => <PokeCard key={item.name} name={item.name} url={item.url} sendData={this.getDetailView} />);\n \n this.setState(\n {\n pokemon: this.state.pokemon.concat(responseCards),\n offset: this.state.offset + 10\n }\n );\n }", "title": "" }, { "docid": "fc9e8886668d204f73d6daa3fc5dd9c9", "score": "0.58284706", "text": "accessData( url , data ) {\n \n var options = {\n method: 'GET' ,\n uri: url ,\n json: true ,\n }\n\n var response = await rp(options)\n .then( function(parseBody){\n console.log(parseBody);\n return parseBody ;\n }).catch( function(err){\n console.log(err);\n });\n\n return response ;\n }", "title": "" }, { "docid": "10392daae33b15d9cd10183ad02bafcb", "score": "0.5812104", "text": "async data() {\n\n\n // get the data from provide url/file\n const apiResponse = await fetch('product.json');\n return apiResponse\n\n }", "title": "" }, { "docid": "8eeb615230fac3a49451c1e817c0bdce", "score": "0.58110535", "text": "async getData() {\n\t\tlet data = { dep: null, arr: null };\n\n\t\tconst departures = await fetch(this.getUrl(\"departure\"), { headers: { accept: \"application/json\" } }).then((response) => {\n\t\t\tif (response.ok) return response.json();\n\t\t\telse {\n\t\t\t\tLog.error(\"Error retrieving departures. Please check your module configuration.\", response.status, response.statusText);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t\tdata.dep = departures.departures.all;\n\n\t\t// Also fetch arrivals data if enabled\n\t\tif (this.config.getLiveArrivals) {\n\t\t\tconst arrivals = await fetch(this.getUrl(\"arrival\"), { headers: { accept: \"application/json\" } }).then((response) => {\n\t\t\t\tif (response.ok) return response.json();\n\t\t\t\telse {\n\t\t\t\t\tLog.error(\"Error retrieving arrivals. Please check your module configuration.\", response.status, response.statusText);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdata.arr = arrivals.arrivals.all;\n\t\t}\n\n\t\treturn {\n\t\t\tdepartures: data.dep ? data.dep : null,\n\t\t\tarrivals: data.arr ? data.arr : null\n\t\t};\n\t}", "title": "" }, { "docid": "fa3e70f9caf5983fc64262eac78c8538", "score": "0.5809419", "text": "async function fetchObjects() {\n const url = `${BASE_URL}/object?${KEY}`; //brings data in from API\n try {\n const response = await fetch(url); //fetches the data\n const data = await response.json(); //waits for data\n console.log(data);\n return data; //returns data\n } catch (error) {\n console.error(error); //console log error\n }\n}", "title": "" }, { "docid": "97306fe52ea420aca4cd48eb0c57e671", "score": "0.5808168", "text": "invocarPeliculas(title,okBusqueda,failBusqueda)\n {\n const endpoint = `${url}${apiKey}&s=${title}`;\n console.log(\"Buscando todas las peliculas\")\n fetch(endpoint\n ).then ((response) => {\n \n return response.json();\n }).then (responseData => {\n try {console.log(\"response peliculas\",responseData);\n console.log(responseData.Response);\n if(responseData.Response == 'True'){\n \n console.log('entre al if');\n var i,newArray = [];\n for (i = 0; i < responseData.Search.length; i++) \n {\n \n \n newArray.push(this.createData(responseData.Search[i],i));\n \n \n }\n okBusqueda(newArray) \n }\n \n } catch (error) { console.log(error);\n \n }\n console.log('Antes de invocar okBusqueda :', newArray)\n\n \n \n });\n }", "title": "" }, { "docid": "fea20c5c7ee007549652835587990a03", "score": "0.58074534", "text": "getDataFromApi()\n {\n if ( !this.props.isDealershipAdmin ) {\n this.getDepartmentsFromApi();\n } else {\n this.getDealershipDepartmentsFromApi();\n }\n }", "title": "" }, { "docid": "0a7b29b1da487b7b6d06358abf79be30", "score": "0.5799012", "text": "async liveSearchingFromApi(param) {\n const all_items = await fetch(`http://127.0.0.1:5000/item/search/${param}`);\n\n // wait for response and return json\n const items = await all_items.json();\n\n return {\n items\n }\n\n }", "title": "" }, { "docid": "f544606a8c3a2e23321b5479725ed4ea", "score": "0.57963574", "text": "processResults(data, page) {\n let results = data.map((obj) => {\n return { id: obj.id, text: obj.label[0] };\n })\n return { results: results };\n }", "title": "" }, { "docid": "438b1c9a72282089d9ccfefd6caf9d4d", "score": "0.57878953", "text": "returnData()\n {\n return appData;\n }", "title": "" }, { "docid": "ac57beedc9a45079d8eacdae95628842", "score": "0.5787576", "text": "async getWeather(){\n\t \tconst response = await fetch(this.url);\n\t \tconst resData = await response.json();\n\t \t//console.log(\"Sample Data:\");\n\t \t//const resData = new Sampledata();\n\t \treturn resData;\n\t }", "title": "" }, { "docid": "70e1274d4b87d21a21fb4f83914b84c1", "score": "0.5785381", "text": "function fetchData(){\n let data = FooBar.getData(true);\n let obj = JSON.parse(data);\n return obj;\n}", "title": "" }, { "docid": "de461cc8949c766088c0428e8c5db0ac", "score": "0.5784965", "text": "getData() {\n\n // get the id of the subwaystop from the url as a string\n const id = this.props.match.params.id;\n\n // make call to appropriate subway stop\n axios.get(`api/v1/subway_stops/${id}`)\n\t\t.then(response => {\n // set subway stop\n this.setState({ subway_stop: response.data })\n\t\t})\n .catch(error => {\n console.log(error)\n this.redirect();\n })\n \n // make call to posts\n axios.get(\"api/v1/posts\")\n .then(response => {\n // get a new array that only gets the posts from subway stop\n // then sorts them with sort posts function\n let posts = this.sortPosts(response.data.filter(post => post.subway_stop_id === Number(id)))\n // set the state\n this.setState({ posts: posts })\n })\n .catch(error => console.log(error))\n }", "title": "" }, { "docid": "f6169f72018fa4bf9b0d49d5bc047a82", "score": "0.5784893", "text": "function getWeatherData(res,latit, logit) {\n try{\n let weatherQuery = {\n lat: latit ,\n lon: logit ,\n key: process.env.WEATHER_API_KEY\n }\n let weatherUrl = 'https://api.weatherbit.io/v2.0/forecast/daily';\n // let weatherData = require(\"./data/weather.json\");\n superagent.get(weatherUrl).query(weatherQuery).then(data =>{\n let castArray = [];\n let casting = data.body.data;\n // console.log(casting);\n \n casting.map(weatherValue => {\n let newDateTime = new Date(weatherValue.valid_date).toString();\n let stringDate = newDateTime.split(\" \").splice(0,4).join(\" \");\n \n let obj = new DataWeather(weatherValue.weather.description, stringDate);\n castArray.push(obj);\n })\n res.status(200).send(castArray);\n }).catch(error=>{\n res.status(500).send(error);\n })\n } catch(error){\n res.status(500).send(\"There was an error getting from API... \" + error);\n }\n\n}", "title": "" }, { "docid": "21a60dfce7726a1267a8e47fd54ecbee", "score": "0.5781606", "text": "getParsedData(){\t\t\n\t\tconst {data, search} = this.state;\n\t\tif (!search) {\n\t\t return data\n\t\t}\n\t\tconsole.log(data);\n\t\tlet temp_value = data.filter(item => {\n\t\t\tconsole.log(typeof item['id']);\n\t\t\treturn (\n\t\t\t\titem[\"id\"].toString().includes(search.toString()) ||\n\t\t\t\titem[\"firstName\"].toLowerCase().includes(search.toLowerCase()) ||\n\t\t\t\titem[\"lastName\"].toLowerCase().includes(search.toLowerCase()) ||\n\t\t\t\titem[\"email\"].toLowerCase().includes(search.toLowerCase()) ||\n\t\t\t\titem[\"phone\"].toString().includes(search.toString())\n\t\t\t);\n\t\t});\n\t\t\t\t\n\t\t// let temp_value = data.map(item => {\n\t\t\t// // let ch_item = item;\n\t\t\t\n\t\t\t// if (\n\t\t\t\t// item[\"id\"].toString().includes(search.toString()) ||\n\t\t\t\t// item[\"firstName\"].toLowerCase().includes(search.toLowerCase()) ||\n\t\t\t\t// item[\"lastName\"].toLowerCase().includes(search.toLowerCase()) ||\n\t\t\t\t// item[\"email\"].toLowerCase().includes(search.toLowerCase()) ||\n\t\t\t\t// item[\"phone\"].toString().includes(search.toString())\n\t\t\t// ){\n\t\t\t\t// let pattern = '(' + search.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\") + ')';\n\t\t\t\t// console.log(pattern);\n\t\t\t\t// let ch_name = item[\"firstName\"].replace(new RegExp(pattern, 'gi'), '<strong>$1<\\/strong>');\n\t\t\t\t// item[\"firstName\"] = ch_name;\n\t\t\t\t// console.log(ch_name);\n\t\t\t\t// return item;\n\t\t\t// }\n\t\t// });\n\t\t\n\t\t// temp_value = temp_value.filter(item => {\n\t\t\t\n\t\t\t// return (\n\t\t\t\t// typeof item !== \"undefined\"\t\t\t\t\n\t\t\t// );\n\t\t// });\n\t\t// console.log(temp_value);\n\t\treturn temp_value\n\t}", "title": "" }, { "docid": "5b5948c42adf459c087d9086b5eefa6c", "score": "0.57811934", "text": "async function getuserdetails(req,res){\n let result={\n userdetails:{},\n created_chambers:[],\n joined_chambers:[],\n }\n try{\n const token=await req.get('Authorization').replace(\"Bearer \",\"\")\n const payload=jwt.verify(await token,process.env.jwt_secret)\n const userdata =await user.findOne({\"_id\":await payload.DJID,\"user_email\":await payload.DJ_email,\"status\":\"activated\"},{\n \"status\":0,\n \"user_password\":0,\n \"activation_key\":0,\n \"password_reset_key\":0,\n \"password_reset_token\":0,\n \"activation_time\":0,\n \"password_reset_key_expiry\":0});\n if(userdata){\n result.userdetails=userdata;\n const create = await detail.get_created_details({userid:payload.DJID,page_number:req.body.created_details_pageno,items_per_page:req.body.created_details_items_per_page});\n if(await create.success){result.created_chambers=create.success};\n const join= await detail.get_joined_details({userid:payload.DJID,page_number:req.body.joined_details_pageno,items_per_page:req.body.joined_details_items_per_page});\n if(await join.success){result.joined_chambers=join.success}\n return res.send({\"success\":result})\n \n }\n else{return res.send({\"error\":\"No such user\"})} \n }catch(err){return res.send({\"error\":\"invalid token\"})}\n}", "title": "" }, { "docid": "4717e59061da32d2d7f9486698027355", "score": "0.57796806", "text": "function makeApiCall() {\r\n console.log(\"MAKING API CALL!!!!!!!!!!!!!!!!\")\r\n return {\r\n request: { url: `https://jsonplaceholder.typicode.com/posts/2` },\r\n successMsg: (response) => {\r\n console.log(response)\r\n return {\r\n type: MSGS.API_MODULE_MESSAGE,\r\n action: MSGS.MAKE_API_CALL_SUCCESS,\r\n payload: response,\r\n }\r\n },\r\n errorMsg: (response) => {\r\n return {\r\n type: MSGS.API_MODULE_MESSAGE,\r\n action: MSGS.MAKE_API_CALL_ERROR,\r\n payload: response,\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c9dda9500d08e1e434ba8c23d49e2ad1", "score": "0.57729244", "text": "@wire(getSobjectHistory, { paramWrapper: '$paramWrapper' })\n getHistory(result) {\n this._wiredData = result;\n if (result.error) {\n this.showErrorMessage(result.error);\n this.showSpinner = false;\n }\n if (result.data) {\n this.historyTrackedRecordId = result.data.historyTrackedRecordId;\n if (result.data.displayMessage) {\n this.displayMessage = result.data.displayMessage;\n }\n\n this._listOfValues = JSON.parse(JSON.stringify(result.data.lstSectionWrapper)); //deep cloning the response from apex \n this._listOfValues.forEach(sectionItem => {\n if (sectionItem.lstSubSections) {\n sectionItem.lstSubSections.forEach(subSectionItem => {\n subSectionItem.showRelativeDateTime = false;\n //checking if the template contains RELATIVE_DATETIME for replacing the text with Relative date time value \n if (subSectionItem && subSectionItem.subSectionTitle && subSectionItem.subSectionTitle.includes('(RELATIVE_DATETIME)')) {\n subSectionItem.relativeDateTime = new Date(subSectionItem.actualDateTime); //create JS Date object for relative date time \n subSectionItem.subSectionTitle = subSectionItem.subSectionTitle.replace('(RELATIVE_DATETIME)', '');\n subSectionItem.showRelativeDateTime = true\n }\n subSectionItem.recordSize = subSectionItem.lstContentString.length;\n })\n }\n sectionItem.recordSize = sectionItem.lstSubSections.length;\n if (sectionItem.isDateTime) {\n sectionItem.relativeSectionTitle = new Date(sectionItem.sectionTitle);\n }\n });\n\n this.showDateFilter = result.data.showDateFilter;\n\n if (this.calendarFilter.length == 0 && result.data.showDateFilter) {\n this.selectedDateFilterValue = result.data.selectedDateFilter;\n result.data.lstDateFilters.forEach(dateFilterJS => {\n const dateFilterObj = {\n id: dateFilterJS.keyValue, label: dateFilterJS.optionLabel, value: dateFilterJS.optionValue\n }\n\n this._mapDateFilters[dateFilterJS.optionValue] = dateFilterJS.optionLabel;\n\n dateFilterObj.checked = dateFilterJS.optionValue == this.selectedDateFilterValue ? true : false;\n if (dateFilterJS.optionValue == this.selectedDateFilterValue) {\n this.selectedDateFilterLabel = dateFilterJS.optionLabel;\n }\n this.calendarFilter.push(dateFilterObj);\n });\n }\n\n this.listOfValues = this._listOfValues;\n this.showTableFormatButton = result.data.showTableFormatButton;\n this.showRecordLink = result.data.showRecordLink;\n this.timelineHeight = result.data.timelineHeight;\n this.showSpinner = false;\n }\n }", "title": "" }, { "docid": "ff1e9a9986debfb46310e521fa2ba4ba", "score": "0.5772164", "text": "getjsondata(req,res){\n return unempcount.findAll()\n .then(unemp => res.status(200).send(JSON.stringify(unemp)))\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "8297c5ec77801b2ca74223c60b96dd79", "score": "0.57684815", "text": "PendingRequestData(e) {\n this.allData = this.search_name.value;\n this.startDate = this.range.value.start_date;\n this.endDate = this.range.value.end_date;\n this.service.AllPendingRequest(this.allData, this.startDate, this.endDate, this.userId)\n .subscribe(res => {\n if (res['status'] == '1') {\n console.log(\"api response\", res);\n this.list_Obj = res['data'];\n this.userData = [...res['data']];\n // console.log(\"listttttttt\", this.list_Obj);\n this.filteredUser = this.list_Obj;\n }\n });\n }", "title": "" }, { "docid": "2572d0a698a9283ed21195a9e8d01ad7", "score": "0.5767373", "text": "async _getData() {\n let { isSuccess, data } = await getRequest(this._makeUrl())\n if (!isSuccess) return ''\n return this._paginationFormat(data)\n }", "title": "" }, { "docid": "75469d09302702e0890f67d6564081e8", "score": "0.57665104", "text": "function initPageData() {\n const requestOptions = {\n 'content-type': 'application/json',\n method: 'GET',\n redirect: 'follow'\n };\n\n return fetch(GetUserUrl, requestOptions)\n .then(response => response.json())\n .then((responseData) => {\n // console.log(responseData);\n return responseData;\n })\n .catch(error => console.warn(error));\n}", "title": "" }, { "docid": "309be82dda0f345a00969152084fc406", "score": "0.5766199", "text": "static parse(data) {\r\n const parsedData = super.parse(data)\r\n\r\n parsedData.client = ClientRepository.findByKey(data.client_uuid)\r\n parsedData.date = data.date && moment(typeof data.date === 'object' ? data.date.date : data.date)\r\n parsedData.dueDate = data.due_date && moment(typeof data.due_date === 'object' ? data.due_date.date : data.due_date)\r\n parsedData.quoteNumber = data.quote_number\r\n parsedData.poNumber = data.po_number\r\n\r\n const currency = CurrencyRepository.findByKey(data.currency_code)\r\n\r\n parsedData.currency = currency\r\n parsedData.partial = Money.create({\r\n amount: data.partial,\r\n currency\r\n })\r\n\r\n parsedData.discount = Discount.create({\r\n type: data.discount_type,\r\n value: data.discount_value,\r\n currency\r\n })\r\n\r\n parsedData.noteToClient = data.note_to_client\r\n parsedData.terms = data.terms\r\n parsedData.footer = data.footer\r\n\r\n parsedData.status = data.status\r\n\r\n parsedData.amount = Money.create({\r\n amount: data.amount,\r\n currency\r\n })\r\n\r\n return parsedData\r\n }", "title": "" }, { "docid": "d527e2b106679c0ef6d6b9a85fbdc5b7", "score": "0.57661873", "text": "static getInitialData({ match, req, res }) {\n const params = {\n filter: {\n where: { sidebar: true },\n order: ['posicionSidebar ASC', 'fecha DESC'],\n limit: 6,\n fields: {\n cuerpo: false\n }\n } \n }\n const detailParams = {\n filter: {\n where: {\n id: match.params.articuloId\n }\n }\n }\n return new Promise((resolve, reject) => {\n axios.get('http://placernautas.com:3005/api/articulos/' + match.params.articuloId)\n .then((articulo) => {\n axios.get('http://placernautas.com:3005/api/articulos', {params})\n .then(notas => {\n const params = {\n filter: {\n order: 'visitas DESC',\n limit: 5,\n fields: {\n cuerpo: false\n }\n }\n }\n axios.get(API + 'articulos', {params})\n .then(leidas => {\n cargarNotaAutor()\n .then(autores => {\n resolve({\n articulo: articulo.data,\n sidebar: notas.data,\n leidas: leidas.data,\n autores: autores.data\n })\n })\n })\n .catch(error => {\n console.log(error)\n reject(error)\n })\n })\n })\n .catch((error) => {\n reject({\n error: error\n })\n })\n });\n }", "title": "" }, { "docid": "835e613d5f6bc7b697be86371baa70dd", "score": "0.5761185", "text": "function retrieveDataFromNewsApi() {\n\t$.when($.getJSON(newsApiSendData.url.endpoint, newsApiSendData.query, storeRetrievedData).fail(renderWarningMessageToUser)).done(executeAfterApiDataRetrieval);\n}", "title": "" }, { "docid": "326f5138fef8501f74c4b704fa5d3171", "score": "0.5759027", "text": "getProducts(page) {\n const url = `${apiPath}/api/${this.user.uuid}/admin/ec/products?page=${page}`;\n //預設帶入 token\n axios.defaults.headers.common.Authorization = `Bearer ${this.user.token}`;\n //這行超級重要,因為是驗證透過此來做驗證\n \n axios.get(url).then((response) => { //使用箭頭函式是因為可以取代外面的this\n console.log(response.data)\n console.log(response.data.data);\n console.log(this.realData);\n \n this.pageInform.nowPage=page;\n this.pageInform.totalPage=response.data.meta.pagination.total_pages;\n this.pageInform.nowItem=response.data.meta.pagination.count;\n this.pageInform.totalItem=response.data.meta.pagination.total;\n this.realData = response.data.data; // Get all product data\n this.pagination = response.data.meta.pagination; // Get分頁\n });\n }", "title": "" }, { "docid": "9eb30e724b603171f7ddbed90e6c8078", "score": "0.57560855", "text": "getData(source, name) {\n if(source===\"\") {this.mapData([], name);}\n fetch(source)\n .then(response => response.json())\n .then(function(json) {\n var arr = [];\n json.forEach(item => {\n arr.push(item);\n });\n this.mapData(arr, name);\n }.bind(this))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "ed513dc2bb6c9b2c37a92596519f4055", "score": "0.5753652", "text": "static getObjectFromData(type, rawData) {\n if (type === QUESTION) {\n return Question.fromArray(rawData.response);\n } else if (type === QUESTIONS) {\n return rawData.response.map(Question.fromArray);\n } else if (type === ANSWER) {\n return Answer.fromArray(rawData.response);\n } else if (type === RESULT) {\n return Result.fromArray(rawData.response);\n } else if (type === QUIZZES) {\n return rawData.response.map(Quiz.fromArray);\n } else if (type === QUIZ) {\n return Quiz.fromArray(rawData.response);\n } else if (type === USER) {\n return User.fromArray(rawData.response);\n } else if (type === ERRORMSG) {\n return rawData.response;\n } else if (type === STATUS) {\n return rawData.response;\n }\n return null;\n }", "title": "" }, { "docid": "295827076068a6f64e995f6f87a71831", "score": "0.5753081", "text": "handleResponse() {}", "title": "" }, { "docid": "904ced19b936a8501cedc7f3748ec867", "score": "0.5751208", "text": "function obtainData () {\n\trequest({\n\t\n\t\t\turl: String(\"http://ratings.food.gov.uk/enhanced-search/^/^/Type/7844/^/\"+ String(pageIndex) +\"/5000/json\"),\n\t\t\tmethod: \"GET\", \n\t\t\theaders: {\"x-api-version\": 2 }\n\t\t\t\n\t\t\t}, function(error, response, body) {\n\t\t\tvar res = {};\n\t\t\tif (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsingleEntry = JSON.parse(body); \n\t\t\t\twriteToJSON (singleEntry, main);\t\n\t\t\t};\n\t\t}\n\t);\n}", "title": "" }, { "docid": "67b0eaecebb6161ce027016250fa7c4d", "score": "0.57512033", "text": "apiRequest(data)\n {\n\n }", "title": "" }, { "docid": "3feea71ec727b5232cc206a2508edcec", "score": "0.5750114", "text": "function HandleResults(result) { //check the length of the return\n\n if (result.Results.length >= 1) { //add it to the array\n \ttotalResults.push.apply(totalResults, result.Results);\n\t\tprogress && progress(totalResults.length, result.TotalItems) //progress\n if (totalResults.length < result.TotalItems) { //length of array is less than expected number\n currentPage++; //guess we should get the next\n goGet(HandleResults,currentPage);\n } else {\n if (hq.EntityTypeId != 1) { //thats a region, or state, not unit\n \t$.each(totalResults,function(k,v){\n \t\tv.Callsign = '('+v.CreatedAt.Code+') '+v.Callsign\n \t})\n }\n let response = {}\n response.responseJSON = {}\n response.responseJSON.Results = totalResults\n cb(response); //we are done\n }\n } else { //last entry amazingly 0, or something is broken. lets stop\n \tlet response = {}\n \tresponse.responseJSON = {}\n \tresponse.responseJSON.Results = []\n cb(response); //we are done\n }\n}", "title": "" }, { "docid": "b3b5df7a27bab058c8df1c82f710f213", "score": "0.57481533", "text": "parseData(data) {\n return data;\n }", "title": "" }, { "docid": "85c5c83fed8c3dc3fb40ae147fe3dc68", "score": "0.5739475", "text": "function handleResponse(response) {\n return handleData(JSON.parse(response).data)\n}", "title": "" }, { "docid": "88cb1be72eeb57a97f1aadb16ebb4b3d", "score": "0.5735372", "text": "static getAllOrders(req, res) {\n const query = 'SELECT * FROM orders';\n /**\n * Async Dm method here\n */\n db.query(query).then((resp) => {\n if (resp.rows.length === 0) {\n const message = 'No order found for this user ';\n return sendResponse.sendResponse40x(res, 200, message, false);\n }\n const dataArr = resp.rows;\n const response = dataArr.map((product, i) => {\n const parsedRes = JSON.parse(product.mealitem);\n product.mealitem = parsedRes;\n return product;\n });\n const message = 'Food order retrieved succesfully';\n return sendResponse.sendResponse2xx(res, 200, true, message, resp.rowCount, response);\n });\n return null;\n }", "title": "" }, { "docid": "cdc4fac742cbfbf93fa54f1ecede08a4", "score": "0.57345587", "text": "async loadApi() {\n return axios.get(url + this.route)\n .then(response => {\n this.data = response.data.data\n return response.data.data \n })\n .catch(err => {\n return 'Api está fechada / ' + err\n })\n }", "title": "" }, { "docid": "43031093b2b59693f4f7716f73c91fe3", "score": "0.5725828", "text": "createJson() {\n const { bookingHome } = this.props;\n const { bookingView } = this.props;\n let url = '';\n const dateLabelS = this.createDate(bookingHome.state.datePickUp);\n const dateLabelE = this.createDate(bookingHome.state.dateReturn);\n let { id } = this.props;\n // if id changed\n if (newId == true) {\n id = idNew;\n }\n // you need the start date, return date and location id\n url = 'http://52.18.171.117/api/website/location/capacity/' +\n dateLabelS + '/' +\n dateLabelE + '/' + id;\n const temp = this;\n newId = false;\n // if you change\n if (this.state.pressed.length !== 0) {\n // change the other trailer to unpicked\n this.handleClose();\n }\n // get the data ... by success take the data and load the trailer / by error nothing\n GetDataFromJson(url).then(function (successResponse) {\n temp.state.json = successResponse;\n if (bookingView.state.trailerLoading !== null) {\n // stops the loading\n bookingView.setTrailerLoading();\n }\n temp.createTrailer();\n }, function () {\n // some Error Message\n });\n }", "title": "" }, { "docid": "0ff92165ca319fde7c663fb4102e46af", "score": "0.5724535", "text": "function formatApiReturn(body, endpoint) {\n var responseObject = {};\n //modify the data field to match spec\n responseObject.data = responseFormatter(body.data, endpoint);\n responseObject.meta = body.meta;\n if (body.pagination) {\n responseObject.pagination = body.pagination;\n if (!responseObject.pagination.offset) {\n responseObject.pagination.offset = null;\n }\n }\n return responseObject;\n}", "title": "" }, { "docid": "1f024984715c103df4c53482dfb827f7", "score": "0.5723573", "text": "async function sendAPIRequest()\r\n{\r\n let response = await fetch('https://opentdb.com/api.php?amount=1&category=17&type=multiple');\r\n console.log(response)\r\n let data = await response.json()//waiting for promise\r\n console.log(data)\r\n useApiData(data)\r\n}", "title": "" }, { "docid": "d502a30f3ba7134ef0a3593c4bc213f6", "score": "0.5718831", "text": "function get() {\n return data;\n}", "title": "" }, { "docid": "445e203c48985bdd1b0c11b4f919847e", "score": "0.57172674", "text": "function getData() {\n fetch(mergedAPI)\n .then(resp => resp.json())\n .then(resp => {\n fetchData(resp);\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "a0fcca459ccdad7da4ff878f4e215657", "score": "0.5715762", "text": "function showData() {\n\n const options = {\n method: 'get'\n }\n\n const response = {\n res: {},\n body: {}\n }\n\n fetch('/api', options)\n .then(function (res){\n response.res = res\n return res.json()\n })\n .then(function (data) {\n response.body = data;\n homeworksData = data \n viewHomeworks(response)\n }).catch(function (err) {\n console.log(err)\n })\n}", "title": "" }, { "docid": "6c1511dfd4b41a7f8d5dedf192bae478", "score": "0.57155085", "text": "function getData() {\n let params = {\n key: APIKEY,\n postal_code: tripData.postCode,\n units: 'I'\n }\n let queryString = formatQuery(params)\n let url = (`${BASE_URL}?${queryString}`);\n\n fetch(url)\n .then(response => {\n if (response.status == 204) {\n throw new Error(response.statusText);\n } else if (response.ok) {\n return response.json();\n } else {\n throw new Error(response.statusText);\n }\n })\n .then(responseJson => checkDates(responseJson))\n .catch(error => {\n $('.js-error-msg').text(`Something went wrong: ${error.message} for postal code. Please try again later.`)\n $('.js-error-msg').removeClass('hidden')\n })\n}", "title": "" }, { "docid": "70b49235ab8e761e1f070225ca6b3665", "score": "0.57140654", "text": "function getAllData() {\n ob = {};\n return ob;\n}", "title": "" }, { "docid": "2be478bb98a9c54e49fb38a4def2c80d", "score": "0.5711117", "text": "async next() {\n const payload = await this.nextRaw();\n const result = payload.map(dbo => Post.fromDbObject(dbo));\n //console.log(result[0].transaction + ' - ' + result[0].title);\n //console.log(JSON.stringify(queryObject));\n return result;\n }", "title": "" }, { "docid": "da4089f12a1e2d84eef046bc558f18bb", "score": "0.5708832", "text": "function getInverterRealtimeData(id) {\n request.get(requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=CommonInverterData', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n try {\n const data = JSON.parse(body);\n if (\"Body\" in data) {\n\n createInverterObjects(id);\n\n const resp = data.Body.Data;\n adapter.setState(\"inverter.\" + id + \".DAY_ENERGY\", {val: resp.DAY_ENERGY.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".TOTAL_ENERGY\", {val: resp.TOTAL_ENERGY.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".YEAR_ENERGY\", {val: resp.YEAR_ENERGY.Value, ack: true});\n\n if (\"PAC\" in resp) {\n adapter.setState(\"inverter.\" + id + \".FAC\", {val: resp.FAC.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".IAC\", {val: resp.IAC.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".IDC\", {val: resp.IDC.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".PAC\", {val: resp.PAC.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".UAC\", {val: resp.UAC.Value, ack: true});\n adapter.setState(\"inverter.\" + id + \".UDC\", {val: resp.UDC.Value, ack: true});\n } else {\n adapter.setState(\"inverter.\" + id + \".FAC\", {val: 0, ack: true});\n adapter.setState(\"inverter.\" + id + \".IAC\", {val: 0, ack: true});\n adapter.setState(\"inverter.\" + id + \".IDC\", {val: 0, ack: true});\n adapter.setState(\"inverter.\" + id + \".PAC\", {val: 0, ack: true});\n adapter.setState(\"inverter.\" + id + \".UAC\", {val: 0, ack: true});\n adapter.setState(\"inverter.\" + id + \".UDC\", {val: 0, ack: true});\n }\n\n const status = resp.DeviceStatus;\n let statusCode = parseInt(status.StatusCode);\n adapter.setState(\"inverter.\" + id + \".StatusCode\", {val: statusCode, ack: true});\n\n let statusCodeString = \"Startup\";\n if (statusCode === 7) {\n statusCodeString = \"Running\";\n } else if (statusCode === 8) {\n statusCodeString = \"Standby\";\n } else if (statusCode === 9) {\n statusCodeString = \"Bootloading\";\n } else if (statusCode === 10) {\n statusCodeString = \"Error\";\n }\n adapter.setState(\"inverter.\" + id + \".StatusCodeString\", {val: statusCodeString, ack: true});\n\n statusCode = parseInt(status.ErrorCode);\n adapter.setState(\"inverter.\" + id + \".ErrorCode\", {val: statusCode, ack: true});\n\n if (statusCode >= 700) {\n statusCodeString = getStringErrorCode700(statusCode);\n } else if (statusCode >= 600) {\n statusCodeString = getStringErrorCode600(statusCode);\n } else if (statusCode >= 500) {\n statusCodeString = getStringErrorCode500(statusCode);\n } else if (statusCode >= 400) {\n statusCodeString = getStringErrorCode400(statusCode);\n } else if (statusCode >= 300) {\n statusCodeString = getStringErrorCode300(statusCode);\n } else {\n statusCodeString = getStringErrorCode100(statusCode);\n }\n adapter.setState(\"inverter.\" + id + \".ErrorCodeString\", {val: statusCodeString, ack: true});\n\n } else {\n adapter.log.warn(data.Head.Status.Reason + \" inverter: \" + id);\n }\n } catch (e) {\n adapter.log.warn(e);\n }\n }\n });\n}", "title": "" }, { "docid": "e9ba2b94cfd49c3215ad7bf48cffe860", "score": "0.57055914", "text": "getHospitalsData() {\n return this.httpClient.get(`${this.Rest_API}/hospitals`);\n }", "title": "" }, { "docid": "e9ba2b94cfd49c3215ad7bf48cffe860", "score": "0.57055914", "text": "getHospitalsData() {\n return this.httpClient.get(`${this.Rest_API}/hospitals`);\n }", "title": "" }, { "docid": "8da661e2e4406e5bc82aa522697436ff", "score": "0.5703665", "text": "function getPromisedData() {\n OrgService.getSourceContexts().then(function (contexts) {\n var status = contexts.server_response.status;\n if (status >= 200 && status <= 210) {\n contexts.sort(Common.a2zComparator());\n if ($scope.preSearch && $scope.preSearch.source_contextfilter) {\n $scope.sourceContexts = _.filter(contexts, function (item, index) {\n return _.contains($scope.preSearch.source_contextfilter, item.code);\n });\n } else {\n $scope.sourceContexts = contexts;\n }\n }\n });\n\n $scope.getSourceStatusArr();\n\n OrgService.getServiceRequests().then(function (requests) {\n var status = requests.server_response.status;\n\n if (status >= 200 && status <= 210) {\n $scope.serviceRequests = requests;\n }\n\n delete requests.server_response;\n });\n\n //get countries\n GeoLocationService.getCountryList().then(function (countries) {\n var status = countries.server_response.status;\n\n if (status >= 200 && status <= 210) {\n $scope.countries = countries;\n }\n });\n }", "title": "" }, { "docid": "87f4d3eeb6a627a77441b0281b4da50f", "score": "0.570322", "text": "async function hentData() {\n const respons = await fetch(url, options);\n retter = await respons.json();\n visRetter();\n}", "title": "" }, { "docid": "6e9bb3c939ab606cab34e004aba9f858", "score": "0.5700504", "text": "resolveRequest (response, data) {\n // Always 200?\n response.writeHead(200, this.headers);\n // Needs JSONAPI Serializer here!\n response.end(rows);\n }", "title": "" }, { "docid": "e2e57fe8ad1a886a577ae45b76e0af57", "score": "0.56986827", "text": "if(token) {\n this.headers = {\n authorization: token,\n 'Content-Type': 'application/json',\n };\n const dataToBeSend = {};\n dataToBeSend.search = '';\n apiCall('get', null, CITY, this.headers).then(res => {\n // toast(`${res.message}`, {});\n });\n apiCall('get', null, INDUSTRY, this.headers).then(res => {\n // toast(`${res.message}`, {});\n });\n apiCall('get', null, FUNCTIONAL_AREA, this.headers).then(res => {\n // toast(`${res.message}`, {});\n });\n }", "title": "" }, { "docid": "1800d6eb471a7d33fdf11fe5387d131b", "score": "0.5698367", "text": "function parseResponse(data){\n return data.results.map(function (post) {\n return {\n link: post.url,\n imageUrl: (((post.media[0])[\"media-metadata\"])[2]).url,\n imageWidth: (((post.media[0])[\"media-metadata\"])[2]).width,\n description: post.abstract,\n title: post.title,\n date: post.published_date\n }\n })\n }", "title": "" }, { "docid": "870e9d2c6cfc1b3b29d46623cb82bb49", "score": "0.5697098", "text": "function getData() {\n document.querySelector(\".loading\").style.display = \"block\";\n fetch(\"https://www.boredapi.com/api/activity\")\n .then((res) => res.json())\n .then((act) => {\n const activity = {\n Activity: act.activity,\n Type: act.type,\n Participants: act.participants,\n };\n\n document.querySelector(\".loading\").style.display = \"none\";\n // a response was retrived after PostAct() completed its fetch.\n // this was done to have an ID specific to an activity\n postAct(activity)\n .then((res) => res.json())\n .then((theAct) => addToList(theAct, \"activities\"));\n });\n}", "title": "" }, { "docid": "4cbc6cf33a4e29091c27dd9722cbbc1d", "score": "0.5696462", "text": "function getAPIdata() {\n\n var url = \"https://api.openweathermap.org/data/2.5/weather\";\n var apiKey =\"910e837151d5d789f03c6c3cc16cddfb\";\n var city = \"florida\";\n\n // construct request\n var request = url + \"?\" + \"appid=\" + apiKey + \"&\" + \"q=\" + city;\n \n // get current weather\n fetch(request)\n \n // parse to JSON format\n .then(function(response) {\n return response.json();\n })\n \n // render weather per day\n .then(function(response) {\n // render weatherCondition\n onAPISucces(response); \n })\n \n // catch error\n .catch(function (error) {\n onAPIError(error);\n });\n}", "title": "" }, { "docid": "ee1d3f207e3d7324d1454529087fac3f", "score": "0.56951827", "text": "static async _onGetData(r) {\n\t\tconst data = {};\n\t\tconst profiles = await Route53._getProfiles();\n\t\tfor (let p of profiles) {\n\t\t\tdata[p] = await Route53._getZones(p);\n\t\t}\n\n\t\tconst config = getConfiguration();\n\t\tconfig.plugin('route53', data);\n\t\tawait config.save();\n\t\treturn r.res.writeJson(data);\n\t}", "title": "" }, { "docid": "0802f3c8f6d65c8824e2a73b1b189f45", "score": "0.5694473", "text": "async getBeers(){\n if(this.state.advSearchMode){\n return\n } else {\n const {per_page, page, fetchedBeers} = this.state;\n const url = `https://api.punkapi.com/v2/beers?page=${page}&per_page=${per_page}`;\n try{\n let response = await fetch(url);\n let data = await response.json();\n\n this.setState({\n fetchedBeers:[...fetchedBeers, ...data],\n scrolling: false,\n totalPages: 10,\n loading:false\n })\n return this.state.fetchedBeers;\n }\n catch(err){\n this.setState({\n loading:false,\n error:true\n })\n }\n }\n }", "title": "" }, { "docid": "9a85a12c7e1ba28d61dd9e55b986d895", "score": "0.5693677", "text": "bindgetuserinfo(res) {\n console.log(res);\n var _this = this;\n let rawData = JSON.parse(res.detail.rawData);\n wx.login({\n success: ress => {\n // console.log(ress.code);\n wx.request({\n url: `${app.globalData.apiPrefix}/apps/mp/phRuserLesson/getMiniProInfo/${ress.code}`,\n success(r) {\n console.log(r)\n // console.log(r.data.data);\n _this.setData({\n openId: r.data.data.openid\n })\n wx.setStorageSync('session_key', r.data.data.session_key);\n let dat = {\n username: rawData.nickName,\n type: 5,\n mini_openid: r.data.data.openid,\n head_img: rawData.avatarUrl\n };\n _this.setData({\n dat: JSON.stringify(dat)\n })\n console.log(dat);\n _this.login()\n }\n })\n }\n })\n }", "title": "" }, { "docid": "25bbae01c83dfb1c6eabc7464126f2f7", "score": "0.5684864", "text": "async function getQuotes(){\r\n \r\n loading();\r\n // const proxyUrl = 'https://cors-anywhere.herokuapp.com/'\r\n const apiUrl ='https://type.fit/api/quotes';\r\n try{\r\n const response = await fetch(apiUrl); \r\n // const data = await response.json();\r\n apiQuotes = await response.json();\r\n newQuote();\r\n goBack();\r\n \r\n console.log(quote);\r\n }catch(error){\r\n // getQuotes();\r\n \r\n }\r\n \r\n \r\n \r\n}", "title": "" }, { "docid": "d7fa110dad25bb11bb7d3a6a261d2016", "score": "0.56842446", "text": "function APIcallback(err, APIresHead, APIresBody) {\n // gets three objects as input\n if ((err) || (APIresHead.statusCode != 200)) {\n // API is not working\n console.log(\"Got API error\");\n console.log(body);\n } else {\n if (APIresHead.error) {\n // API worked but is not giving you data\n console.log(APIresHead.error);\n } else {\n res.json( {\"English\" : qObj.english, \"Chinese\": APIresBody.data.translations[0].translatedText} );\n }\n }\n }", "title": "" }, { "docid": "cc1ee96f92130f61f9b3037ff0776263", "score": "0.56832916", "text": "result(data) {\n let recordsTotal = 0;\n let tableData = [];\n\n if (data.length > 0 ) {\n recordsTotal = data[0].count;\n tableData = data[0].data;\n }\n let result = {\n draw: this.request.draw,\n recordsTotal: recordsTotal,\n recordsFiltered: recordsTotal,\n data: tableData\n };\n return result;\n }", "title": "" } ]
b4c35f81f166c97f347720f15dee1dec
Copyright (C) 19912018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see or any other header that includes because the implicit include comes before any feature test macros that may be defined in a source file before it first explicitly includes a system header. GCC knows the name of this header in order to preinclude it. / glibc's intent is to support the IEC 559 math functionality, real and complex. If the GCC (4.9 and later) predefined macros specifying compiler intent are available, use them to determine whether the overall intent is to support these features; otherwise, presume an older compiler has intent to support these features and define these macros by default. / wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is synchronized with ISO/IEC 10646:2017, fifth edition, plus the following additions from Amendment 1 to the fifth edition: 56 emoji characters 285 hentaigana 3 additional Zanabazar Square characters / We do not support C11 . / simple set with reasonably fast iteration though an array, which may contain nulls elements must be objects that have a unique _key property collections are expected to be homogeneous when iterating over a set with an iterator, the following operations are safe: adding an element to the set (the existing iterator will iterate over the new elements) removing the last returned element through the iterator behaviour for deleting elements is unpredictable and unsafe
[ { "docid": "db5f414c15d065e60b5a2470ed11acc5", "score": "0.0", "text": "function h$Set(s) {\n this._vals = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" } ]
[ { "docid": "01ae7617b120cfc247579c6fd3d1def3", "score": "0.6270356", "text": "function polyfillSet() {\n mix(Set.prototype, SetStd.prototype);\n}", "title": "" }, { "docid": "fd5646c462542d58532dcfb9179f23be", "score": "0.54811925", "text": "function polyfill() {\n if (navigator.userAgent.match(/MSIE/) ||\n navigator.userAgent.match(/Trident/) ||\n navigator.userAgent.match(/Edge/)) {\n // Internet Explorer's native IndexedDB does not support compound keys\n compoundKeyPolyfill();\n }\n }", "title": "" }, { "docid": "df2f60bba8f54cce9094f27f494d0212", "score": "0.5398206", "text": "function addPolyfills () {\n\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n if (!Array.prototype.find) {\n Array.prototype.find = function (predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n };\n }\n\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n if (!String.prototype.includes) {\n String.prototype.includes = function (search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > this.length) {\n return false;\n }\n else {\n return this.indexOf(search, start) !== -1;\n }\n };\n }\n}", "title": "" }, { "docid": "293f00903cb82c7892495b4125c13a7d", "score": "0.53270966", "text": "function tryGetNativeSet() {\n // Internet Explorer's Set doesn't support iteration, so don't use it.\n // eslint-disable-next-line no-in-operator\n return typeof Set !== \"undefined\" && \"entries\" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;\n }", "title": "" }, { "docid": "e6a6754d22e32a7bca421d8a21a974b1", "score": "0.5128542", "text": "function SetPolyfill(){\nthis._cache=[];}", "title": "" }, { "docid": "7809259cef789f4315e4c1635bdd6c88", "score": "0.51119435", "text": "function Zu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "c2107a744787e82915a23cda246664a4", "score": "0.50037515", "text": "function compatibility_hackery() {\n if(!Array.prototype.some) {\n Array.prototype.some = function(f) {\n for(var i=0; i!=this.length; ++i) {\n if(f(this[i])) return true;\n }\n return false;\n }\n }\n \n if(!Array.prototype.map) {\n Array.prototype.map = function(f) {\n var a = new Array();\n for(var i=0; i!=this.length; ++i) {\n a.push(f(this[i]));\n }\n return a;\n }\n }\n}", "title": "" }, { "docid": "ed3ee1e055a723be302719e009832a16", "score": "0.49677676", "text": "function ngxChartsPolyfills() {\n // IE11 fix\n // Ref: https://github.com/swimlane/ngx-charts/issues/386\n if (typeof (SVGElement) !== 'undefined' && typeof SVGElement.prototype.contains === 'undefined') {\n SVGElement.prototype.contains = HTMLDivElement.prototype.contains;\n }\n}", "title": "" }, { "docid": "ed3ee1e055a723be302719e009832a16", "score": "0.49677676", "text": "function ngxChartsPolyfills() {\n // IE11 fix\n // Ref: https://github.com/swimlane/ngx-charts/issues/386\n if (typeof (SVGElement) !== 'undefined' && typeof SVGElement.prototype.contains === 'undefined') {\n SVGElement.prototype.contains = HTMLDivElement.prototype.contains;\n }\n}", "title": "" }, { "docid": "504b4192bc91f7a0940ba374010c049c", "score": "0.49554378", "text": "function ngxChartsPolyfills() {\r\n // IE11 fix\r\n // Ref: https://github.com/swimlane/ngx-charts/issues/386\r\n if (typeof (SVGElement) !== 'undefined' && typeof SVGElement.prototype.contains === 'undefined') {\r\n SVGElement.prototype.contains = HTMLDivElement.prototype.contains;\r\n }\r\n}", "title": "" }, { "docid": "e63ab0eb1b74031e872096bce6a1fb5b", "score": "0.49529627", "text": "function ngxChartsPolyfills() {\n // IE11 fix\n // Ref: https://github.com/swimlane/ngx-charts/issues/386\n if (typeof SVGElement !== 'undefined' && typeof SVGElement.prototype.contains === 'undefined') {\n SVGElement.prototype.contains = HTMLDivElement.prototype.contains;\n }\n}", "title": "" }, { "docid": "95be3a4521cb9f77d278c21436663708", "score": "0.49375162", "text": "function loadPolyfills() {\n \n /*Object assign polyfill (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)*/\n if (typeof Object.assign != 'function') {\n Object.assign = function(target, varArgs) { // .length of function is 2\n 'use strict';\n if (target == null) { // TypeError if undefined or null\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var to = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var nextSource = arguments[index];\n\n if (nextSource != null) { // Skip over if undefined or null\n for (var nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n };\n };\n\n /*Mini polyfill for Array.from without optional arguments (mapFunction [second argument], thisArg [third argument]) (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from)*/\n if(typeof Array.from !== \"function\") {\n Array.from = function(arrLikeObj) {\n return Array.prototype.slice.call(arrLikeObj, 0);\n }\n };\n \n }", "title": "" }, { "docid": "c89002088328269aadf44ef87479c415", "score": "0.49031448", "text": "function n768062() { return 'cti'; }", "title": "" }, { "docid": "d41c5d88b846ef4461851cf70bd12867", "score": "0.48483723", "text": "function n1184638() { return '; t'; }", "title": "" }, { "docid": "418fdd5914ec35922a013a28c5d64146", "score": "0.48371708", "text": "function has(name){if(has[name]!==undef){// Return cached feature test result.\nreturn has[name];}var isSupported;if(name==\"bug-string-char-index\"){// IE <= 7 doesn't support accessing string characters using square\n// bracket notation. IE 8 only supports this for primitives.\nisSupported=\"a\"[0]!=\"a\";}else if(name==\"json\"){// Indicates whether both `JSON.stringify` and `JSON.parse` are\n// supported.\nisSupported=has(\"json-stringify\")&&has(\"json-parse\");}else{var value,serialized=\"{\\\"a\\\":[1,true,false,null,\\\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\\\"]}\";// Test `JSON.stringify`.\nif(name==\"json-stringify\"){var stringify=exports.stringify,stringifySupported=typeof stringify==\"function\"&&isExtended;if(stringifySupported){// A test function object with a custom `toJSON` method.\n(value=function value(){return 1;}).toJSON=value;try{stringifySupported=// Firefox 3.1b1 and b2 serialize string, number, and boolean\n// primitives as object literals.\nstringify(0)===\"0\"&&// FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n// literals.\nstringify(new Number())===\"0\"&&stringify(new String())=='\"\"'&&// FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n// does not define a canonical JSON representation (this applies to\n// objects with `toJSON` properties as well, *unless* they are nested\n// within an object or array).\nstringify(getClass)===undef&&// IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n// FF 3.1b3 pass this test.\nstringify(undef)===undef&&// Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n// respectively, if the value is omitted entirely.\nstringify()===undef&&// FF 3.1b1, 2 throw an error if the given value is not a number,\n// string, array, object, Boolean, or `null` literal. This applies to\n// objects with custom `toJSON` methods as well, unless they are nested\n// inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n// methods entirely.\nstringify(value)===\"1\"&&stringify([value])==\"[1]\"&&// Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n// `\"[null]\"`.\nstringify([undef])==\"[null]\"&&// YUI 3.0.0b1 fails to serialize `null` literals.\nstringify(null)==\"null\"&&// FF 3.1b1, 2 halts serialization if an array contains a function:\n// `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n// elides non-JSON values from objects and arrays, unless they\n// define custom `toJSON` methods.\nstringify([undef,getClass,null])==\"[null,null,null]\"&&// Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n// where character escape codes are expected (e.g., `\\b` => `\\u0008`).\nstringify({\"a\":[value,true,false,null,\"\\x00\\b\\n\\f\\r\\t\"]})==serialized&&// FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\nstringify(null,value)===\"1\"&&stringify([1,2],null,1)==\"[\\n 1,\\n 2\\n]\"&&// JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n// serialize extended years.\nstringify(new Date(-8.64e15))=='\"-271821-04-20T00:00:00.000Z\"'&&// The milliseconds are optional in ES 5, but required in 5.1.\nstringify(new Date(8.64e15))=='\"+275760-09-13T00:00:00.000Z\"'&&// Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n// four-digit years instead of six-digit years. Credits: @Yaffle.\nstringify(new Date(-621987552e5))=='\"-000001-01-01T00:00:00.000Z\"'&&// Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n// values less than 1000. Credits: @Yaffle.\nstringify(new Date(-1))=='\"1969-12-31T23:59:59.999Z\"';}catch(exception){stringifySupported=false;}}isSupported=stringifySupported;}// Test `JSON.parse`.\nif(name==\"json-parse\"){var parse=exports.parse;if(typeof parse==\"function\"){try{// FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n// Conforming implementations should also coerce the initial argument to\n// a string prior to parsing.\nif(parse(\"0\")===0&&!parse(false)){// Simple parsing test.\nvalue=parse(serialized);var parseSupported=value[\"a\"].length==5&&value[\"a\"][0]===1;if(parseSupported){try{// Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\nparseSupported=!parse('\"\\t\"');}catch(exception){}if(parseSupported){try{// FF 4.0 and 4.0.1 allow leading `+` signs and leading\n// decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n// certain octal literals.\nparseSupported=parse(\"01\")!==1;}catch(exception){}}if(parseSupported){try{// FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n// points. These environments, along with FF 3.1b1 and 2,\n// also allow trailing commas in JSON objects and arrays.\nparseSupported=parse(\"1.\")!==1;}catch(exception){}}}}}catch(exception){parseSupported=false;}}isSupported=parseSupported;}}return has[name]=!!isSupported;}", "title": "" }, { "docid": "79441cd6aaf99d58cb8286910562a8e9", "score": "0.4820156", "text": "testSymbolPolyfill_usesNativeImplementation() {\n assertEquals(Symbol, window['jscomp_Symbol']);\n }", "title": "" }, { "docid": "87344a75738eceee22f32c9b9875ef17", "score": "0.48015076", "text": "function Yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "3b343837de6efd93a078dbbcc772abd7", "score": "0.48001292", "text": "function Kh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "17ed9ca030103f9fa473c7e0a74dca8e", "score": "0.4793854", "text": "function polyfill() {\n // NOTE(lmr): I'm temporarily disabling this code. Need to re-address later.\n // const node = global.document.documentElement;\n // const node = document.getElementById('root');\n // flexibility(node);\n // const data = flexibility.readAll(node);\n // flexibility.writeAll(data);\n // let queue = [];\n // queue.push(...data);\n // while (queue.length) {\n // let node = queue.pop();\n // node.element = null;\n // queue.push(...node.children);\n // }\n //\n // console.log(JSON.stringify(data, null, ' '));\n}", "title": "" }, { "docid": "60e85241e3c66a57ea697924bd32d131", "score": "0.47530982", "text": "function Zc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "0cc11c4429f5921d8a18bdb32d572ad7", "score": "0.4742827", "text": "function has(name) {\r\n\t if (has[name] !== undef) {\r\n\t // Return cached feature test result.\r\n\t return has[name];\r\n\t }\r\n\t\r\n\t var isSupported;\r\n\t if (name == \"bug-string-char-index\") {\r\n\t // IE <= 7 doesn't support accessing string characters using square\r\n\t // bracket notation. IE 8 only supports this for primitives.\r\n\t isSupported = \"a\"[0] != \"a\";\r\n\t } else if (name == \"json\") {\r\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\r\n\t // supported.\r\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\r\n\t } else {\r\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\r\n\t // Test `JSON.stringify`.\r\n\t if (name == \"json-stringify\") {\r\n\t var stringify = JSON3.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\r\n\t if (stringifySupported) {\r\n\t // A test function object with a custom `toJSON` method.\r\n\t (value = function () {\r\n\t return 1;\r\n\t }).toJSON = value;\r\n\t try {\r\n\t stringifySupported =\r\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\r\n\t // primitives as object literals.\r\n\t stringify(0) === \"0\" &&\r\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\r\n\t // literals.\r\n\t stringify(new Number()) === \"0\" &&\r\n\t stringify(new String()) == '\"\"' &&\r\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\r\n\t // does not define a canonical JSON representation (this applies to\r\n\t // objects with `toJSON` properties as well, *unless* they are nested\r\n\t // within an object or array).\r\n\t stringify(getClass) === undef &&\r\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\r\n\t // FF 3.1b3 pass this test.\r\n\t stringify(undef) === undef &&\r\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\r\n\t // respectively, if the value is omitted entirely.\r\n\t stringify() === undef &&\r\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\r\n\t // string, array, object, Boolean, or `null` literal. This applies to\r\n\t // objects with custom `toJSON` methods as well, unless they are nested\r\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\r\n\t // methods entirely.\r\n\t stringify(value) === \"1\" &&\r\n\t stringify([value]) == \"[1]\" &&\r\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\r\n\t // `\"[null]\"`.\r\n\t stringify([undef]) == \"[null]\" &&\r\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\r\n\t stringify(null) == \"null\" &&\r\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\r\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\r\n\t // elides non-JSON values from objects and arrays, unless they\r\n\t // define custom `toJSON` methods.\r\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\r\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\r\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\r\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\r\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\r\n\t stringify(null, value) === \"1\" &&\r\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\r\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\r\n\t // serialize extended years.\r\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\r\n\t // The milliseconds are optional in ES 5, but required in 5.1.\r\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\r\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\r\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\r\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\r\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\r\n\t // values less than 1000. Credits: @Yaffle.\r\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\r\n\t } catch (exception) {\r\n\t stringifySupported = false;\r\n\t }\r\n\t }\r\n\t isSupported = stringifySupported;\r\n\t }\r\n\t // Test `JSON.parse`.\r\n\t if (name == \"json-parse\") {\r\n\t var parse = JSON3.parse;\r\n\t if (typeof parse == \"function\") {\r\n\t try {\r\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\r\n\t // Conforming implementations should also coerce the initial argument to\r\n\t // a string prior to parsing.\r\n\t if (parse(\"0\") === 0 && !parse(false)) {\r\n\t // Simple parsing test.\r\n\t value = parse(serialized);\r\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\r\n\t if (parseSupported) {\r\n\t try {\r\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\r\n\t parseSupported = !parse('\"\\t\"');\r\n\t } catch (exception) {}\r\n\t if (parseSupported) {\r\n\t try {\r\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\r\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\r\n\t // certain octal literals.\r\n\t parseSupported = parse(\"01\") !== 1;\r\n\t } catch (exception) {}\r\n\t }\r\n\t if (parseSupported) {\r\n\t try {\r\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\r\n\t // points. These environments, along with FF 3.1b1 and 2,\r\n\t // also allow trailing commas in JSON objects and arrays.\r\n\t parseSupported = parse(\"1.\") !== 1;\r\n\t } catch (exception) {}\r\n\t }\r\n\t }\r\n\t }\r\n\t } catch (exception) {\r\n\t parseSupported = false;\r\n\t }\r\n\t }\r\n\t isSupported = parseSupported;\r\n\t }\r\n\t }\r\n\t return has[name] = !!isSupported;\r\n\t }", "title": "" }, { "docid": "5f364c6c4daa86d28dd027dd592b1204", "score": "0.47388", "text": "function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{'default':obj};}/*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode", "title": "" }, { "docid": "076f753119f4710e8d32dee369af462d", "score": "0.47337413", "text": "function Xs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "076f753119f4710e8d32dee369af462d", "score": "0.47337413", "text": "function Xs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "436e736715337ce13060f217c9268841", "score": "0.47319296", "text": "function loadPolyfills() {\n // https://vanillajstoolkit.com/polyfills/stringstartswith/\n if (!String.prototype.startsWith) {\n\tString.prototype.startsWith = function(searchString, position){\n\t\treturn this.substr(position || 0, searchString.length) === searchString;\n\t};\n }\n\n}", "title": "" }, { "docid": "4b4436e93565b44b3a5c93a8a8849a40", "score": "0.47233003", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = JSON3.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = JSON3.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "4b4436e93565b44b3a5c93a8a8849a40", "score": "0.47233003", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = JSON3.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = JSON3.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "a33f618e6c08642fd5d3515f1da3a9c6", "score": "0.471035", "text": "function fr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "e8b4359dedf600809f1e7491410f2280", "score": "0.47075525", "text": "function gL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,i)}return n}", "title": "" }, { "docid": "8f9cf8cd0b9ed586404584a796139d2f", "score": "0.47074625", "text": "function Qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "41d109a9b719d62a8447422b646e5a61", "score": "0.4693081", "text": "function Qc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "c4096793409b04080a6d61a076b526c9", "score": "0.46862277", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = exports.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "3e7c4942080001398fb268e00caaf8d1", "score": "0.46821693", "text": "function browserIsUnicodeCompliant() {\n\treturn document.getElementById('unicodeContainer').offsetWidth ===\n document.getElementById('unprintableContainer').offsetWidth;\n}", "title": "" }, { "docid": "1a0ede4492837d85e329a388d2b6b7d7", "score": "0.46808752", "text": "function Kc(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols==\"function\")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}", "title": "" }, { "docid": "95f4b3ff355c6652fbb0f8e637028f42", "score": "0.46708912", "text": "function emulatedSet(keys) {\n var hash = {};\n\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n\n return {\n contains: function (key) {\n return hash[key];\n },\n push: function (key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n} // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't", "title": "" }, { "docid": "0b90776feb494b8c8aa53cfa7269fecc", "score": "0.4655367", "text": "function tameIntl() {\n // todo: somehow fix these. These almost certainly don't enable the reading\n // of side-channels, but we want things to be deterministic across\n // runtimes. Best bet is to just disallow calling these functions without\n // an explicit locale name.\n\n // the whitelist may have deleted Intl entirely, so tolerate that\n if (typeof Intl !== 'undefined') {\n Intl.DateTimeFormat = () => {\n throw Error('disabled');\n };\n Intl.NumberFormat = () => {\n throw Error('disabled');\n };\n Intl.getCanonicalLocales = () => {\n throw Error('disabled');\n };\n }\n // eslint-disable-next-line no-extend-native\n Object.prototype.toLocaleString = () => {\n throw new Error('toLocaleString suppressed');\n };\n }", "title": "" }, { "docid": "c701e7e5af4a5105bf20fbc410226c39", "score": "0.4643771", "text": "function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "9c475535582a587954a315e14ca48de8", "score": "0.46273783", "text": "function lib_globals() {\n\n var XML_ENTITIES = {'amp': 38, 'apos': 27, 'gt': 62, 'lt': 60, 'nbsp': 160, 'quot': 34};\n var HTML_ENTITIES = {'aacute': 225, 'acirc': 226, 'acute': 180, 'aelig': 230, 'agrave': 224,\n 'alefsym': 8501, 'alpha': 945, 'amp': 38, 'and': 8743, 'ang': 8736, 'apos': 27, 'aring': 229,\n 'asymp': 8776, 'atilde': 227, 'auml': 228, 'bdquo': 8222, 'beta': 946, 'brvbar': 166,\n 'bull': 8226, 'cap': 8745, 'ccedil': 231, 'cedil': 184, 'cent': 162, 'chi': 967, 'circ': 710,\n 'clubs': 9827, 'cong': 8773, 'copy': 169, 'crarr': 8629, 'cup': 8746, 'curren': 164,\n 'dagger': 8225, 'darr': 8659, 'deg': 176, 'delta': 948, 'diams': 9830, 'divide': 247,\n 'eacute': 233, 'ecirc': 234, 'egrave': 232, 'empty': 8709, 'emsp': 8195, 'ensp': 8194,\n 'epsilon': 949, 'equiv': 8801, 'eta': 951, 'eth': 240, 'euml': 235, 'euro': 8364, 'exist': 8707,\n 'fnof': 402, 'forall': 8704, 'frac12': 189, 'frac14': 188, 'frac34': 190, 'frasl': 8260,\n 'gamma': 947, 'ge': 8805, 'gt': 62, 'harr': 8660, 'hearts': 9829, 'hellip': 8230, 'iacute': 237,\n 'icirc': 238, 'iexcl': 161, 'igrave': 236, 'image': 8465, 'infin': 8734, 'int': 8747, 'iota': 953,\n 'iquest': 191, 'isin': 8712, 'iuml': 239, 'kappa': 954, 'lambda': 955, 'lang': 9001, 'laquo': 171,\n 'larr': 8656, 'lceil': 8968, 'ldquo': 8220, 'le': 8804, 'lfloor': 8970, 'lowast': 8727,\n 'loz': 9674, 'lrm': 8206, 'lsaquo': 8249, 'lsquo': 8216, 'lt': 60, 'macr': 175, 'mdash': 8212,\n 'micro': 181, 'middot': 183, 'minus': 8722, 'mu': 956, 'nabla': 8711, 'nbsp': 160, 'ndash': 8211,\n 'ne': 8800, 'ni': 8715, 'not': 172, 'notin': 8713, 'nsub': 8836, 'ntilde': 241, 'nu': 957,\n 'oacute': 243, 'ocirc': 244, 'oelig': 339, 'ograve': 242, 'oline': 8254, 'omega': 969,\n 'omicron': 959, 'oplus': 8853, 'or': 8744, 'ordf': 170, 'ordm': 186, 'oslash': 248, 'otilde': 245,\n 'otimes': 8855, 'ouml': 246, 'para': 182, 'part': 8706, 'permil': 8240, 'perp': 8869, 'phi': 966,\n 'pi': 960, 'piv': 982, 'plusmn': 177, 'pound': 163, 'prime': 8243, 'prod': 8719, 'prop': 8733,\n 'psi': 968, 'quot': 34, 'radic': 8730, 'rang': 9002, 'raquo': 187, 'rarr': 8658, 'rceil': 8969,\n 'rdquo': 8221, 'real': 8476, 'reg': 174, 'rfloor': 8971, 'rho': 961, 'rlm': 8207, 'rsaquo': 8250,\n 'rsquo': 8217, 'sbquo': 8218, 'scaron': 353, 'sdot': 8901, 'sect': 167, 'shy': 173, 'sigma': 963,\n 'sigmaf': 962, 'sim': 8764, 'spades': 9824, 'sub': 8834, 'sube': 8838, 'sum': 8721, 'sup': 8835,\n 'sup1': 185, 'sup2': 178, 'sup3': 179, 'supe': 8839, 'szlig': 223, 'tau': 964, 'there4': 8756,\n 'theta': 952, 'thetasym': 977, 'thinsp': 8201, 'thorn': 254, 'tilde': 732, 'times': 215,\n 'trade': 8482, 'uacute': 250, 'uarr': 8657, 'ucirc': 251, 'ugrave': 249, 'uml': 168, 'upsih': 978,\n 'upsilon': 965, 'uuml': 252, 'weierp': 8472, 'xi': 958, 'yacute': 253, 'yen': 165, 'yuml': 376,\n 'zeta': 950, 'zwj': 8205, 'zwnj': 8204};\n\n function getGlobal() {\n return this;\n }\n\n //Append properties from one or more objects into the first (overwriting)\n Object.append = function() {\n var ret, args = Array.toArray(arguments);\n for (var i=0; i<args.length; i++) {\n if (args[i] instanceof Object) {\n if (ret) {\n Object.each(args[i], function(n, val) {\n ret[n] = val;\n });\n } else {\n ret = args[i];\n }\n }\n }\n return ret;\n };\n //Recursively append objects such that sub-objects are cloned\n Object.combine = function() {\n var ret, args = Array.toArray(arguments);\n for (var i=0; i<args.length; i++) {\n if (args[i] instanceof Object) {\n if (ret) {\n Object.each(args[i],function(n, val) {\n if (Object.isPrimitive(val)) {\n ret[n] = val;\n } else\n if (Object.vartype(val, 'object')) {\n //TODO: valueOf\n if (Object.exists(ret, n)) {\n ret[n] = Object.combine(ret[n],val)\n } else {\n ret[n] = Object.combine({},val)\n }\n } else {\n //TODO: clone\n ret[n] = val;\n }\n });\n } else {\n ret = args[i];\n }\n }\n }\n return ret;\n };\n //Create a new object that \"inherits\" from another\n Object.create = function(obj) {\n function F() {}\n F.prototype = obj;\n return new F();\n };\n //Extend an object so it \"inherits\" from parent but contains the given properties as its own\n Object.extend = function(parent, ext) {\n var obj = Object.create(parent);\n if (ext instanceof Function) {\n Object.append(obj, ext.call(parent, parent));\n } else\n if (ext instanceof Object) {\n //Object.append(obj, {_super: parent})\n Object.append(obj, ext)\n }\n return obj;\n };\n Object.each = function(o, f) {\n var i = 0;\n for (var n in o) if (Object.exists(o, n)) if (f.call(o, n, o[n],(i++)) === false) break;\n return o;\n };\n Object.exists = function(o, n) {\n return Object.prototype.hasOwnProperty.call(o, n);\n };\n Object.isPrimitive = function(obj) {\n return Object.vartype(obj, 'boolean null number string undefined');\n };\n Object.isSet = function(obj) {\n return !(obj === null || typeof obj == 'undefined');\n };\n Object.keys = function(o) {\n var a = [];\n Object.each(o, function(n) {\n a.push(n);\n });\n return a;\n };\n Object.remove = function(o, a) {\n var type = Object.vartype(a);\n if (type == 'array') {\n for (var i=0; i<a.length; i++) Object.remove(o, a[i]);\n } else\n if (type == 'string' && Object.exists(o, a)) {\n delete o[a];\n }\n return o;\n };\n Object.values = function(o) {\n var a = [];\n Object.each(o, function(n, val) {\n a.push(val);\n });\n return a;\n };\n Object.vartype = function(obj, /**String|Array=*/ list) {\n if (list) {\n list = (list instanceof Array) ? list : String(list).w();\n return list.exists(Object.vartype(obj));\n }\n var type = (obj === null) ? 'null' : typeof obj;\n if (obj instanceof Object) {\n return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();\n }\n return (type == 'object') ? 'unknown' : type;\n };\n\n Array.prototype.each = function(fn) {\n var arr = this, len = arr.length;\n for (var i = 0; i < len; i++) {\n if (fn.call(arr, i, arr[i]) === false) break;\n }\n return arr;\n };\n if (!Array.prototype.forEach)\n Array.prototype.forEach = function (fn, context) {\n var arr = this, len;\n context = context || arr;\n len = context.length;\n for (var i = 0; i < len; i++) {\n if (i in arr) fn.call(context, arr[i], i, arr);\n }\n };\n if (!Array.prototype.indexOf)\n Array.prototype.indexOf = function(el, i) {\n var arr = this, len = arr.length;\n i = i || 0;\n if (i < 0) i = len + i;\n for (; i < len; i++) {\n if (arr[i] === el) return i;\n }\n return -1\n };\n Array.prototype.exists = function(el) {\n return (Array.prototype.indexOf.call(this, el) >= 0);\n };\n if (!Array.prototype.filter)\n Array.prototype.filter = function(fn) {\n var arr = [];\n Array.prototype.each.call(this, function(i, el) {\n if (fn(el, i)) arr.push(el);\n });\n return arr;\n };\n if (!Array.prototype.map)\n Array.prototype.map = function(fn) {\n var arr = [];\n Array.prototype.each.call(this, function(i, el) {\n arr.push(fn(el, i));\n });\n return arr;\n };\n if (!Array.prototype.reduce)\n Array.prototype.reduce = function(fn, init) {\n var arr = this, len = arr.length, out, i = 0;\n if (arguments.length >= 2) {\n out = init;\n } else {\n out = arr[i++];\n }\n while (i < len) {\n out = fn.call(arr, out, arr[i], i++, arr);\n }\n return out;\n };\n Array.toArray = function(obj) {\n var len = obj.length, arr = new Array(len);\n for (var i = 0; i < len; i++) {\n arr[i] = obj[i];\n }\n return arr;\n };\n\n Function.prototype.bind = function(obj) {\n var fn = this;\n return function() {\n return fn.apply(obj, arguments);\n };\n };\n Function.noop = function() {};\n \n Number.parse = function(s, /**Number=0*/ d) {\n var i = parseFloat(s);\n d = (arguments.length > 1) ? d : 0;\n return isFinite(i) ? i : d;\n };\n Number.parseInt = function(s, /**Number=0*/ d) {\n var i = parseInt(s, 10);\n d = (arguments.lengt > 1) ? d : 0;\n return isFinite(i) ? i : d;\n };\n Number.random = function(lower, upper) {\n return Math.floor(Math.random() * (upper - lower + 1)) + lower;\n };\n \n var _split = String.prototype.split;\n String.prototype.split = function(s, limit) {\n if (Object.vartype(s) !== 'regexp') {\n return _split.apply(this, arguments);\n }\n var str = String(this), out = [], lastLastIndex = 0, match, lastLength;\n if (arguments.length < 2 || +limit < 0) {\n limit = Infinity;\n } else {\n limit = Math.floor(+limit);\n if (!limit) {\n return [];\n }\n }\n s = RegExp.copyAsGlobal(s);\n while (match = s.exec(str)) {\n if (s.lastIndex > lastLastIndex) {\n out.push(str.slice(lastLastIndex, match.index));\n if (match.length > 1 && match.index < str.length) {\n Array.prototype.push.apply(out, match.slice(1));\n }\n lastLength = match[0].length;\n lastLastIndex = s.lastIndex;\n if (out.length >= limit)\n break;\n }\n if (s.lastIndex === match.index)\n s.lastIndex++;\n }\n if (lastLastIndex === str.length) {\n if (!RegExp.prototype.test.call(s, '') || lastLength)\n out.push('');\n } else {\n out.push(str.slice(lastLastIndex));\n }\n return (out.length > limit) ? out.slice(0, limit) : out;\n };\n \n String.prototype.replaceAll = function(a, b) {\n if (arguments.length == 1) {\n var self = this;\n Object.each(a, function() {\n String.prototype.replaceAll.apply(self, arguments);\n });\n return self;\n }\n return String.prototype.replace.call(this, new RegExp(RegExp.escape(a), 'ig'), b);\n };\n String.prototype.trimLeft = function() {\n return String.prototype.replace.call(this, /^\\s*/, '');\n };\n String.prototype.trimRight = function() {\n return String.prototype.replace.call(this, /\\s*$/, '');\n };\n String.prototype.trim = function() {\n return String.prototype.replace.call(this, /^\\s+|\\s+$/g, '');\n };\n String.prototype.padLeft = function(n, s) {\n var r = String(this), len = r.length;\n return (len < n) ? new Array(n - len + 1).join(s) + r : r;\n };\n String.prototype.padRight = function(n, s) {\n var r = String(this), len = r.length;\n return (len < n) ? r + new Array(n - len + 1).join(s) : r;\n };\n String.prototype.startsWith = function(s) {\n var self = this, re = new RegExp('^' + RegExp.escape(s), 'i');\n return !!String(self).match(re);\n };\n String.prototype.endsWith = function(s) {\n var self = this, re = new RegExp(RegExp.escape(s) + '$', 'i');\n return !!String(self).match(re);\n };\n String.prototype.replaceHead = function(s1, s2) {\n var self = this, re = new RegExp('^' + RegExp.escape(s1), 'i');\n return String(self).replace(re, s2);\n };\n String.prototype.replaceTail = function(s1, s2) {\n var self = this, re = new RegExp(RegExp.escape(s1) + '$', 'i');\n return String(self).replace(re, s2);\n };\n String.prototype.w = function() {\n return String.prototype.split.call(this, /[,\\s]+/);\n };\n\n String.parse = function(s, /**String=''*/ d) {\n d = (arguments.length > 1) ? d : '';\n return Object.isSet(s) ? String(s) : d;\n };\n String.repeat = function(s, n) {\n var a = new Array(n + 1);\n return a.join(s);\n };\n\n var re_urlEnc = /[^0-9a-f!$'()*,-.\\/:;@[\\\\\\]^_{|}~]+/ig;\n String.urlEnc = function(s) {\n return String(s).replace(re_urlEnc, function(s) {\n return encodeURIComponent(s);\n });\n };\n String.urlDec = function(s) {\n s = String(s).replace(/\\+/g, ' ');\n try {\n return decodeURIComponent(s);\n } catch(e) {\n return unescape(s);\n }\n };\n \n String.htmlEnc = function(s, /**Boolean=true*/ attr) {\n s = String(s).replaceAll({'&': '&amp;', '>': '&gt;', '<': '&lt;', '\\u00a0': '&nbsp;'});\n if (attr !== false) {\n s = s.replaceAll('\"', '&quot;');\n }\n return s;\n };\n String.htmlDec = function(s) {\n s = String.parse(s);\n s = s.replace(/&([a-z]+);/ig, function(ent, n) {\n var i = HTML_ENTITIES[n.toLowerCase()];\n return (i) ? String.fromCharCode(i) : ent;\n });\n s = s.replace(/&#(\\d+);/g, function(ent, n) {\n var i = parseInt(n, 10);\n return (i) ? String.fromCharCode(i) : ent;\n });\n return s;\n };\n \n Date.prototype.toGMTString = function() {\n var a = Date.prototype.toUTCString.call(this).split(' ');\n if (a[1].length == 1) a[1] = '0' + a[1];\n return a.join(' ').replace(/UTC$/i, 'GMT');\n };\n Date.prototype.add = function(parts) {\n var date = this;\n if (parts.years) {\n date.setYear(date.getFullYear() + Number.parseInt(parts.years));\n }\n if (parts.months) {\n date.setMonth(date.getMonth() + Number.parseInt(parts.months));\n }\n if (parts.days) {\n date.setDate(date.getDate() + Number.parseInt(parts.days));\n }\n if (parts.hours) {\n date.setHours(date.getHours() + Number.parseInt(parts.hours));\n }\n if (parts.minutes) {\n date.setMinutes(date.getMinutes() + Number.parseInt(parts.minutes));\n }\n if (parts.seconds) {\n date.setSeconds(date.getSeconds() + Number.parseInt(parts.seconds));\n }\n return date;\n };\n Date.today = function() {\n var date = new Date();\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n };\n Date.now = function() {\n return new Date();\n };\n\n var REG_DATE_1 = /^(\\d{4})-(\\d{2})-(\\d{2})\\s*T?([\\d:]+)(\\.\\d+)?($|[Z\\s+-].*)$/i;\n var REG_DATE_2 = /\\b(\\d{4})-(\\d{1,2})-(\\d{1,2})\\b/;\n Date.fromString = function(str, /**String=*/ def) {\n if (str instanceof Date) {\n return new Date(str);\n }\n str = String(str);\n //ISO 8601 / JSON-style date: \"2008-12-13T16:08:32Z\"\n str = str.replace(REG_DATE_1, '$1/$2/$3 $4$6');\n //YYYY-MM-DD\n str = str.replace(REG_DATE_2, '$1/$2/$3');\n var i = Date.parse(str);\n if (isFinite(i)) {\n return new Date(i);\n }\n if (arguments.length > 1) {\n return def;\n }\n };\n Date.fromUTCString = function(str, /**String=*/ def) {\n var d = Date.fromString(str, def);\n if (d) {\n return new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(),\n d.getMinutes(), d.getSeconds(), d.valueOf() % 1000));\n }\n };\n Date.getParts = function(d, /**Boolean=false*/ utc) {\n var part = {\n yyyy: (utc) ? d.getUTCFullYear() : d.getFullYear(),\n moy: (utc) ? d.getUTCMonth() : d.getMonth(),\n d: (utc) ? d.getUTCDate() : d.getDate(),\n dow: (utc) ? d.getUTCDay() : d.getDay(),\n H: (utc) ? d.getUTCHours() : d.getHours(),\n n: (utc) ? d.getUTCMinutes() : d.getMinutes(),\n s: (utc) ? d.getUTCSeconds() : d.getSeconds()\n };\n part.yy = String(part.yyyy).substr(2);\n part.m = part.moy + 1;\n part.cc = 'January February March April May June July August September October November December'\n .w()[part.moy];\n part.c = part.cc ? part.cc.substr(0, 3) : '';\n part.ww = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.w()[part.dow];\n part.w = part.ww ? part.ww.substr(0, 3) : '';\n part.h = (part.H > 12 || part.H == 0) ? Math.abs(part.H - 12) : part.H;\n part.p = (part.H > 11) ? 'pm' : 'am';\n part.P = (part.H > 11) ? 'PM' : 'AM';\n 'm d H h n s'.w().each(function(i, n) {\n part[n + n] = String(100 + part[n]).substring(1);\n });\n return function(n) {\n return String.parse(part[n]);\n };\n };\n Date.format = function(d, fmt, /**Boolean=false*/ utc) {\n var r, type = Object.vartype(d);\n if (type == 'date' || type == 'number') {\n d = new Date(d);\n } else {\n d = Date.fromString(d);\n }\n if (!d) return '';\n r = (fmt) ? String(fmt) : '{yyyy}/{mm}/{dd}';\n var part = Date.getParts(d, utc);\n r = r.replace(/\\{(\\w+)\\}/g, function(str, n) {\n return part(n) || str;\n });\n return r;\n };\n RegExp.escape = function(s) {\n return String(s).replace(/([.?*+^$[\\]\\\\(){}-])/g,'\\\\$1');\n };\n RegExp.copyAsGlobal = function (o) {\n var m = 'g' + ((o.ignoreCase) ? 'i' : '') + ((o.multiline) ? 'm' : '');\n return new RegExp(o.source,m);\n };\n\n //Shorthand Copies\n vartype = Object.vartype;\n isPrimitive = Object.isPrimitive;\n isSet = Object.isSet;\n toArray = Array.toArray;\n urlEnc = String.urlEnc;\n urlDec = String.urlDec;\n htmlEnc = String.htmlEnc;\n htmlDec = String.htmlDec;\n\n return getGlobal();\n}", "title": "" }, { "docid": "736916ed4db44a606b35c548dbf333fa", "score": "0.46242103", "text": "function es4Keys(o) {\n\n var a = [], i;\n \n for (i in o)\n if (HOP.call(o, i))\n a.push(i);\n \n if (ENUM_BUG) \n for (i = 0; i < ENUM_BUG_KEYS.length; ++i)\n if (HOP.call(o, ENUM_BUG_KEYS[i]))\n a.push(ENUM_BUG_KEYS[i]);\n \n return a;\n}", "title": "" }, { "docid": "5bc764c5cbbcbf0e377f15b56e70a7a8", "score": "0.46236515", "text": "function o17() {\n var o18 = [\n \"Object\", \"Function\", \"Array\", \"String\", \"Boolean\", \"Number\", \"Math\", \"Date\", \"RegExp\", \"Error\",\n \"Object.prototype\", \"Function.prototype\", \"Array.prototype\", \"String.prototype\", \"Boolean.prototype\",\n \"Number.prototype\", \"Date.prototype\", \"RegExp.prototype\", \"Error.prototype\",\n \"o\", \"f\", \"foo\", \"foo.prototype\", \"a\", \"s\", \"b\", \"n\", \"d\", \"r\", \"e\"\n ]\n \n var o19 = [\n \"abs\", \"acos\", \"anchor\", \"apply\", \"Array\", \"asin\", \"atan\", \"atan2\", \"big\", \"bind\",\n \"blink\", \"bold\", \"Boolean\", \"call\", \"ceil\", \"charAt\", \"charCodeAt\", \"concat\", \"constructor\", \"cos\",\n \"Date\", \"decodeURI\", \"decodeURIComponent\", \"description\", \"E\", \"encodeURI\", \"encodeURIComponent\", \"escape\", \"Error\", \"eval\", \"EvalError\",\n \"every\", \"exec\", \"exp\", \"flags\", \"filter\", \"fixed\", \"floor\", \"fontcolor\", \"fontsize\", \"forEach\",\n \"fromCharCode\", \"Function\", \"getDate\", \"getDay\", \"getFullYear\", \"getHours\", \"getMilliseconds\", \"getMinutes\", \"getMonth\", \"getSeconds\",\n \"getTime\", \"getTimezoneOffset\", \"getUTCDate\", \"getUTCDay\", \"getUTCFullYear\", \"getUTCHours\", \"getUTCMilliseconds\", \"getUTCMinutes\", \"getUTCMonth\",\n \"getUTCSeconds\", \"getYear\", \"hasOwnProperty\", \"indexOf\", \"Infinity\", \"isFinite\", \"isNaN\", \"isPrototypeOf\", \"italics\", \"join\", \"lastIndexOf\",\n \"length\", \"link\", \"LN10\", \"LN2\", \"localeCompare\", \"log\", \"LOG10E\", \"LOG2E\", \"map\", \"Math\",\n \"max\", \"MAX_VALUE\", \"match\", \"message\", \"min\", \"MIN_VALUE\", \"NaN\", \"name\", \"Now\", \"Number\",\n \"number\", \"NEGATIVE_INFINITY\", \"Object\", \"parse\", \"parseFloat\", \"parseInt\", \"PI\", \"pop\", \"POSITIVE_INFINITY\", \"pow\",\n \"propertyIsEnumerable\", \"prototype\", \"push\", \"random\", \"RangeError\", \"reduce\", \"reduceRight\", \"ReferenceError\", \"replace\", \"reverse\",\n \"round\", \"RegExp\", \"search\", \"setDate\", \"setFullYear\", \"setHours\", \"setMilliseconds\", \"setMinutes\", \"setMonth\", \"setSeconds\",\n \"setTime\", \"setUTCDate\", \"setUTCFullYear\", \"setUTCHours\", \"setUTCMilliseconds\", \"setUTCMinutes\", \"setUTCMonth\", \"setUTCSeconds\", \"setYear\", \"shift\",\n \"sin\", \"slice\", \"some\", \"sort\", \"source\", \"splice\", \"split\", \"sqrt\", \"SQRT1_2\", \"SQRT2\",\n \"strike\", \"String\", \"sub\", \"substring\", \"substr\", \"sup\", \"SyntaxError\", \"tan\", \"test\", \"toDateString\",\n \"toExponential\", \"toFixed\", \"toISOString\", \"toJSON\", \"toLocaleDateString\", \"toLocaleLowerCase\", \"toLocaleString\", \"toLocaleTimeString\",\n \"toLocaleUpperCase\", \"toLowerCase\", \"toPrecision\", \"toString\", \"toTimeString\", \"toUpperCase\", \"toUTCString\", \"trim\", \"TypeError\", \"undefined\",\n \"unescape\", \"unshift\", \"URIError\", \"UTC\", \"valueOf\", \"enumerable\", \"configurable\", \"writable\", \"value\", \"get\", \"set\", \"defineProperty\",\n \"defineProperties\", \"toGMTString\", \"compile\", \"global\", \"lastIndex\", \"multiline\", \"ignoreCase\", \"index\", \"input\",\n \"lastMatch\", \"lastParen\", \"leftContext\", \"rightContext\",\n \"x\", \"y\"\n ];\n \n try {\nfor (var o20=0; o20<o18.length; o20++)\n {\n try {\nfor (var o21=0; o21< o19.length; o21++)\n {\n try {\no15(o18[o20] + \".propertyIsEnumerable(\\\"\" + o19[o21] + \"\\\")\");\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "title": "" }, { "docid": "302927c8f4fce8c114171e82544890d5", "score": "0.4619744", "text": "function Gs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}", "title": "" }, { "docid": "dc8d53b711f6165b1dd9a866a8416736", "score": "0.4612395", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = JSON3.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" &&\n\t stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" &&\n\t stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" &&\n\t stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = JSON3.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "2e320d54565fe937f58416bde201ef25", "score": "0.4606402", "text": "function _(e,t){return void 0===t&&(t={}),b(e)?e.map(function(e){return _(e,t)}):\"Object\"!==y(n=e)||n.constructor!==Object||Object.getPrototypeOf(n)!==Object.prototype?e:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)).reduce(function(n,i){return b(t.props)&&!t.props.includes(i)?n:(function(e,t,n,i,r){var o={}.propertyIsEnumerable.call(i,t)?\"enumerable\":\"nonenumerable\";\"enumerable\"===o&&(e[t]=n),r&&\"nonenumerable\"===o&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}(n,i,_(e[i],t),e,t.nonenumerable),n)},{});var n}", "title": "" }, { "docid": "573f40eea3c57f41424d4fdf6dc7a632", "score": "0.4597362", "text": "function Ql(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}", "title": "" }, { "docid": "6583fdeef92518cbd6f5f8dc5534af6b", "score": "0.45928422", "text": "function K(){!function(e){$[q++]^=255&e,$[q++]^=e>>8&255,$[q++]^=e>>16&255,$[q++]^=e>>24&255,q>=256&&(q-=256)}((new Date).getTime())}", "title": "" }, { "docid": "9491e06f3c3a92ef6e0cd14d51460203", "score": "0.458532", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n\n var isSupported;\n\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value,\n serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}'; // Test `JSON.stringify`.\n\n if (name == \"json-stringify\") {\n var stringify = exports.stringify,\n stringifySupported = typeof stringify == \"function\" && isExtended;\n\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n\n try {\n stringifySupported = // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" && // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" && stringify(new String()) == '\"\"' && // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef && // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef && // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef && // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" && stringify([value]) == \"[1]\" && // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" && // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" && // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" && // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({\n \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"]\n }) == serialized && // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" && stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" && // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' && // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' && // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' && // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n\n isSupported = stringifySupported;\n } // Test `JSON.parse`.\n\n\n if (name == \"json-parse\") {\n var parse = exports.parse;\n\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n\n isSupported = parseSupported;\n }\n }\n\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a827a0da05a35dfaae327768f76a65cf", "score": "0.45796353", "text": "function Js(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "f7743f81df6992c61c71faec96784042", "score": "0.45763054", "text": "function ft(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}", "title": "" }, { "docid": "727621bce3eba2a480bedd452669daf3", "score": "0.45690072", "text": "function Ys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "5fe352e412dd412be71eb91e6e398186", "score": "0.45666093", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both JSON.stringify and JSON.parse are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test JSON.stringify.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom toJSON method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is null, undefined, or\n // does not define a canonical JSON representation (this applies to\n // objects with toJSON properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes undefined as \"undefined\". Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw Errors and TypeErrors,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or null literal. This applies to\n // objects with custom toJSON methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom toJSON\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes [undefined] as \"[]\" instead of\n // \"[null]\".\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize null literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // [1, true, getClass, 1] serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom toJSON methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., \\b => \\u0008).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the filter and width arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test JSON.parse.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading + signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "b24ad545b4138790bf9d71db4c07bede", "score": "0.4561599", "text": "function Ql(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "b24ad545b4138790bf9d71db4c07bede", "score": "0.4561599", "text": "function Ql(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "07c05abd1e505fa08215bc8ea5c283ee", "score": "0.4554021", "text": "function n924278() { return 'ec'; }", "title": "" }, { "docid": "e0d9b93ef2541b25ee6ed85eb7dc78a4", "score": "0.45527682", "text": "function __strict(x) {return x}", "title": "" }, { "docid": "e0d9b93ef2541b25ee6ed85eb7dc78a4", "score": "0.45527682", "text": "function __strict(x) {return x}", "title": "" }, { "docid": "e0d9b93ef2541b25ee6ed85eb7dc78a4", "score": "0.45527682", "text": "function __strict(x) {return x}", "title": "" }, { "docid": "e0d9b93ef2541b25ee6ed85eb7dc78a4", "score": "0.45527682", "text": "function __strict(x) {return x}", "title": "" }, { "docid": "70521f8ab188d0dda3ee8dfe7ab627cf", "score": "0.4546932", "text": "function has(name) {\n\t if (has[name] !== undef) {\n\t // Return cached feature test result.\n\t return has[name];\n\t }\n\n\t var isSupported;\n\t if (name == \"bug-string-char-index\") {\n\t // IE <= 7 doesn't support accessing string characters using square\n\t // bracket notation. IE 8 only supports this for primitives.\n\t isSupported = \"a\"[0] != \"a\";\n\t } else if (name == \"json\") {\n\t // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t // supported.\n\t isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t } else {\n\t var value,\n\t serialized = \"{\\\"a\\\":[1,true,false,null,\\\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\\\"]}\";\n\t // Test `JSON.stringify`.\n\t if (name == \"json-stringify\") {\n\t var stringify = JSON3.stringify,\n\t stringifySupported = typeof stringify == \"function\" && isExtended;\n\t if (stringifySupported) {\n\t // A test function object with a custom `toJSON` method.\n\t (value = function () {\n\t return 1;\n\t }).toJSON = value;\n\t try {\n\t stringifySupported =\n\t // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t // primitives as object literals.\n\t stringify(0) === \"0\" &&\n\t // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t // literals.\n\t stringify(new Number()) === \"0\" && stringify(new String()) == '\"\"' &&\n\t // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t // does not define a canonical JSON representation (this applies to\n\t // objects with `toJSON` properties as well, *unless* they are nested\n\t // within an object or array).\n\t stringify(getClass) === undef &&\n\t // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t // FF 3.1b3 pass this test.\n\t stringify(undef) === undef &&\n\t // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t // respectively, if the value is omitted entirely.\n\t stringify() === undef &&\n\t // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t // string, array, object, Boolean, or `null` literal. This applies to\n\t // objects with custom `toJSON` methods as well, unless they are nested\n\t // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t // methods entirely.\n\t stringify(value) === \"1\" && stringify([value]) == \"[1]\" &&\n\t // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t // `\"[null]\"`.\n\t stringify([undef]) == \"[null]\" &&\n\t // YUI 3.0.0b1 fails to serialize `null` literals.\n\t stringify(null) == \"null\" &&\n\t // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t // elides non-JSON values from objects and arrays, unless they\n\t // define custom `toJSON` methods.\n\t stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t stringify(null, value) === \"1\" && stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t // serialize extended years.\n\t stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t // The milliseconds are optional in ES 5, but required in 5.1.\n\t stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t // values less than 1000. Credits: @Yaffle.\n\t stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t } catch (exception) {\n\t stringifySupported = false;\n\t }\n\t }\n\t isSupported = stringifySupported;\n\t }\n\t // Test `JSON.parse`.\n\t if (name == \"json-parse\") {\n\t var parse = JSON3.parse;\n\t if (typeof parse == \"function\") {\n\t try {\n\t // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t // Conforming implementations should also coerce the initial argument to\n\t // a string prior to parsing.\n\t if (parse(\"0\") === 0 && !parse(false)) {\n\t // Simple parsing test.\n\t value = parse(serialized);\n\t var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t if (parseSupported) {\n\t try {\n\t // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t parseSupported = !parse('\"\\t\"');\n\t } catch (exception) {}\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t // certain octal literals.\n\t parseSupported = parse(\"01\") !== 1;\n\t } catch (exception) {}\n\t }\n\t if (parseSupported) {\n\t try {\n\t // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t // points. These environments, along with FF 3.1b1 and 2,\n\t // also allow trailing commas in JSON objects and arrays.\n\t parseSupported = parse(\"1.\") !== 1;\n\t } catch (exception) {}\n\t }\n\t }\n\t }\n\t } catch (exception) {\n\t parseSupported = false;\n\t }\n\t }\n\t isSupported = parseSupported;\n\t }\n\t }\n\t return has[name] = !!isSupported;\n\t }", "title": "" }, { "docid": "00ec5032f2c0b91beff8b3b3729128dd", "score": "0.45455277", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value,\n serialized = \"{\\\"a\\\":[1,true,false,null,\\\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\\\"]}\";\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify,\n stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function value() {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" && stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" && stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" && stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "72c0d144a4132a9de42ebd931f147747", "score": "0.45407528", "text": "function ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "7a1b69c81e02e39ee803f724ce54ce86", "score": "0.45357156", "text": "function Ko(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" }, { "docid": "a4a97f263ee4439063dbe3e4cbe3a631", "score": "0.45357013", "text": "function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }", "title": "" } ]
2037bff52f4deabd1b1bb78d98bce0d4
It generates shape data with random size and xposition
[ { "docid": "f2f3de34463fedcd81db8c847f813c48", "score": "0.6214518", "text": "_generateShapes(containerSize, amount) {\n const ms = new Date().getTime();\n for (let i = 0; i < amount; i++) {\n const width = random(SHAPE_SIZE_LIMIT.WIDTH.MIN, SHAPE_SIZE_LIMIT.WIDTH.MAX);\n this.onAddShape({\n id: ms + i,\n x: random(0, containerSize.width - width),\n y: 0,\n width,\n height: random(SHAPE_SIZE_LIMIT.HEIGHT.MIN, SHAPE_SIZE_LIMIT.HEIGHT.MAX)\n });\n }\n }", "title": "" } ]
[ { "docid": "a1f339f5ac0fe96588e00602de50b8b7", "score": "0.71093976", "text": "generateShapes() {\n const x = Math.floor(Math.random() * APP_WIDTH);\n const y = this.appHeight - 450;\n this.createRandomShape(x, y);\n }", "title": "" }, { "docid": "a4ff61300b1a290c063bd07ac7dab387", "score": "0.6780054", "text": "generateShapes(x, y) {\n p.push()\n for (let i = 0; i < this.allShapes; i++) {\n\n let shape = new Shape(x, y, this.speed)\n this.shapes.push(shape)\n p.allShapes.push(shape)\n this.gap.push(y)\n y -= p.round(p.random(200,500))\n }\n p.pop()\n }", "title": "" }, { "docid": "e2bfbea021948a43ec3f88b58843ea9c", "score": "0.67536455", "text": "constructor(sizeXYZ){\n this.size = sizeXYZ;\n \n this.R = random(60, 70);\n this.G = random(110, 140);\n this.B = random(150, 200);\n }", "title": "" }, { "docid": "0e601e2441e53180183593ca8b0ad017", "score": "0.6729971", "text": "function generatePointsCoordinates(){\n\tfor (var i = 0; i < POINTS_QUANTITY; i++){\n\t\tvar pointX = Math.random()*canvas.width;\n\t\tvar pointY = Math.random()*canvas.height;\n\t\tvar point = {\n\t\t\tx: pointX,\n\t\t\ty: pointY,\n\t\t\t//size of point\n\t\t\tsizePoint: Math.floor((Math.random() * 3) + 1),\n\t\t\t//determining the direction\n\t\t\tmoveToPoint: Math.floor((Math.random() * POINTS_QUANTITY) + 0),\n\t\t\t//time to change of position \n\t\t\tmoveTime: i,\n\t\t\t//text tag for point\n\t\t\ttag: ((typeof tags !== 'undefined' && tags != null) ? tags[i] : null)\n\t\t};\n\t\tpoints.push(point);\n\t}\n}", "title": "" }, { "docid": "90a6f0f81022273d9c748671e27fb3e8", "score": "0.6633054", "text": "getRandomShape() {\n // this.shapeType = this.getRanShapeType();\n this.shapeType = 'I';\n switch (this.shapeType) {\n case 'O':\n this.createO();\n break;\n case 'I':\n this.createI();\n break;\n case 'T':\n this.createT();\n break;\n case 'L':\n this.createL();\n break;\n case 'J':\n this.createJ();\n break;\n case 'S':\n this.createS();\n break;\n case 'Z':\n this.createZ();\n break;\n }\n }", "title": "" }, { "docid": "a78afe3340a1fffcea94726019b9d2e5", "score": "0.66113484", "text": "getRandomData( width, height, size ) {\n var len = width * height * 3;\n var data = new Float32Array( len );\n while( len-- )data[len] = ( Math.random() -.5 ) * size ;\n return data;\n }", "title": "" }, { "docid": "8579d5bee34ec8c073f0cf5b76b809fd", "score": "0.659125", "text": "function customShape(){\r\n x = random(500)\r\n y = random(500)\r\n fill(random(255), 40, random(255), random(255));\r\n rect(x, y, size, size);\r\n stroke(10, 200, 220);\r\n rect (x, y, size - 40, size - 40);\r\n stroke(100, 100, 150);\r\n fill(200, 255, 255);\r\n rect (x, y, size - 80, size - 80);\r\n }", "title": "" }, { "docid": "cfee4004b380da386c08bc7841e49428", "score": "0.65644556", "text": "function createShapeObj() {\n var shapeObj = {};\n shapeObj[\"width\"] = randNumForShape(shapeMinSise, shapeMaxSise);;\n shapeObj[\"height\"] = randNumForShape(shapeMinSise, shapeMaxSise);;\n var lenWidth = canvasWidth - shapeObj[\"width\"];\n shapeObj[\"left\"] = randNum(lenWidth);;\n var lenHeight = canvasHeight - shapeObj[\"height\"];\n shapeObj[\"top\"] = randNum(lenHeight);;\n shapeObj[\"backgroundColor\"] = randomColor();\n shapeObj[\"shapeType\"] = shapeType;\n return shapeObj;\n }", "title": "" }, { "docid": "bdbb32005ba026ac6a896954e93fe9b1", "score": "0.65576583", "text": "function customShape(){\n x = random(700)\n y = random(700)\n fill(random(255), 40, random(255), random(255));\n rect(x, y, size, size);\n stroke(10, 200, 220);\n rect (x, y, size - 40, size - 40);\n stroke(100, 100, 150);\n fill(200, 255, 255);\n rect (x, y, size - 80, size - 80);\n }", "title": "" }, { "docid": "2525fb1e30e2da7f067f2377d410d784", "score": "0.6489779", "text": "_createPoints() {\n var ratio = this.options.pointsRatio;\n for (var x = 0; x < this.options.width; x = x + this.options.width / ratio) {\n for (var y = 0; y < this.options.height; y = y + this.options.height / ratio) {\n var px = x + Math.random() * this.options.width / ratio;\n var py = y + Math.random() * this.options.height / ratio;\n var p = { x: px, originX: px, y: py, originY: py };\n this.points.push(p);\n }\n }\n }", "title": "" }, { "docid": "bcb884fe0e3260a47a587ec5007ac490", "score": "0.64863724", "text": "reset() {\n this.x = random(width);\n this.y = random(height);\n }", "title": "" }, { "docid": "2c9b4c369b6577d288b3da4353b26714", "score": "0.6479794", "text": "constructor(x = random(width), y = random(height)) {\r\n this.x = x;\r\n this.y = y;\r\n }", "title": "" }, { "docid": "7ee6c64cc16e449939df1ecdf97b197d", "score": "0.63979053", "text": "function generateShapeData() {\n const data = [];\n const colors = [\"red\", \"green\", \"blue\"];\n const shapes = [\"square\", \"triangle\", \"circle\"];\n const repeats = [1, 2, 3];\n\n for (var i = 0; i < colors.length; i++) {\n for (var j = 0; j < shapes.length; j++) {\n for (var k = 0; k < repeats.length; k++) {\n // This condition limits the number of objects created by skipping the combo of \"blue circle 3\"\n if (\n i !== colors.length - 1 ||\n j !== shapes.length - 1 ||\n k !== repeats.length - 1\n ) {\n const newObj = {\n color: colors[i],\n shape: shapes[j],\n repeat: repeats[k],\n };\n data.push(newObj);\n }\n }\n }\n }\n\n return data;\n }", "title": "" }, { "docid": "87a4a59ff8b0ca0feca6e74e5c721f9d", "score": "0.63832027", "text": "function newShape() {\n var id = Math.floor( Math.random() * shapes.length );\n var shape = shapes[ id ]; // maintain id for color filling\n\n var niveau = getUrlVars()['niveau'];\n if (niveau > 5) {\n var shape = [];\n var multiply = 1;\n switch (niveau) {\n case '6': multiply = 1.5; break;\n case '8': multiply = 3; break;\n case '1000': multiply = 10; break;\n }\n for (var i = 0; i < 16; i++) {\n shape.push(Math.floor(Math.random() * multiply))\n }\n }\n\n current = [];\n for ( var y = 0; y < 4; ++y ) {\n current[ y ] = [];\n for ( var x = 0; x < 4; ++x ) {\n var i = 4 * y + x;\n if ( typeof shape[ i ] != 'undefined' && shape[ i ] ) {\n current[ y ][ x ] = id + 1;\n }\n else {\n current[ y ][ x ] = 0;\n }\n }\n }\n // position where the shape will evolve\n currentX = 5;\n currentY = 0;\n}", "title": "" }, { "docid": "372a93753bb30879ef9f54cf4c18e324", "score": "0.6360244", "text": "generateShape() {\n let NUM_SHAPES = 5;\n let shape = Math.floor((Math.random() * NUM_SHAPES) + 1)\n //let shape = 4;\n let middle = Math.floor(this.COLUMNS / 2);\n if (this.NEXT_NUM != 0)\n shape = this.NEXT_NUM;\n switch(shape) {\n case 1:\n this.GRID[0][middle] = shape;\n this.GRID[1][middle] = shape;\n this.GRID[0][middle - 1] = shape;\n this.GRID[1][middle - 1] = shape;\n break;\n case 2:\n this.GRID[0][middle] = shape;\n this.GRID[1][middle] = shape;\n this.GRID[2][middle] = shape;\n this.GRID[3][middle] = shape;\n break;\n case 3:\n this.GRID[0][middle] = shape;\n this.GRID[1][middle] = shape;\n this.GRID[1][middle - 1] = shape;\n this.GRID[1][middle - 2] = shape; \n break;\n case 4:\n this.GRID[0][middle] = shape;\n this.GRID[0][middle - 1] = shape;\n this.GRID[1][middle - 1] = shape;\n this.GRID[1][middle - 2] = shape;\n break;\n case 5:\n this.GRID[0][middle - 1] = shape;\n this.GRID[1][middle] = shape;\n this.GRID[1][middle - 1] = shape;\n this.GRID[1][middle - 2] = shape;\n break;\n }\n \n shape = Math.floor((Math.random() * NUM_SHAPES) + 1);\n switch (shape) {\n //2x2 block\n case 1:\n this.clearNext();\n this.NEXT[2][2] = shape;\n this.NEXT[2][3] = shape;\n this.NEXT[3][2] = shape;\n this.NEXT[3][3] = shape;\n this.NEXT_NUM = 1;\n \n break;\n //1x4 block\n case 2:\n this.clearNext();\n this.NEXT[1][3] = shape;\n this.NEXT[2][3] = shape;\n this.NEXT[3][3] = shape;\n this.NEXT[4][3] = shape;\n this.NEXT_NUM = 2;\n\n break;\n\n //l-shape\n case 3:\n this.clearNext();\n this.NEXT[2][4] = shape;\n this.NEXT[3][4] = shape;\n this.NEXT[3][3] = shape;\n this.NEXT[3][2] = shape;\n this.NEXT_NUM = 3;\n\n break;\n //s-block\n case 4:\n this.clearNext();\n this.NEXT[2][4] = shape;\n this.NEXT[2][3] = shape;\n this.NEXT[3][3] = shape;\n this.NEXT[3][2] = shape;\n this.NEXT_NUM = 4;\n\n \n break;\n //t-block\n case 5:\n this.clearNext();\n this.NEXT[3][2] = shape;\n this.NEXT[3][3] = shape;\n this.NEXT[3][4] = shape;\n this.NEXT[2][3] = shape;\n this.NEXT_NUM = 5;\n\n break;\n\n }\n \n }", "title": "" }, { "docid": "153b8b119b950ad0143db61d4a737146", "score": "0.6307149", "text": "function setVariables() {\n num_x = random(3, 24);\n num_y = random(3, 24);\n size = random(50, 100);\n}", "title": "" }, { "docid": "e0730c5f4d831bd19eecf827881aeb19", "score": "0.6306493", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "title": "" }, { "docid": "77ecce625c01ef86722b08cbe393d7d8", "score": "0.6304005", "text": "function rand() {\n return {\n x: randomService.randDim(dim[0]),\n y: randomService.randDim(dim[1])\n };\n }", "title": "" }, { "docid": "b5aa00b88d4b90e14bab458f0efe9c64", "score": "0.62965304", "text": "function getRandomData() {\r\n if (data.length > 0) data = data.slice(1);\r\n // do a random walk\r\n while (data.length < totalPoints) {\r\n var prev = data.length > 0 ? data[data.length - 1] : 50;\r\n var y = prev + Math.random() * 10 - 5;\r\n if (y < 0) y = 0;\r\n if (y > 100) y = 100;\r\n data.push(y);\r\n }\r\n // zip the generated y values with the x values\r\n var res = [];\r\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\r\n return res;\r\n }", "title": "" }, { "docid": "0089859166699f3afda12c379fae1797", "score": "0.62925583", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "title": "" }, { "docid": "0089859166699f3afda12c379fae1797", "score": "0.62925583", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "title": "" }, { "docid": "4fc9aa3dddc2bd0010106f75c39d0de6", "score": "0.6290836", "text": "randomize(){\n let x =random(width);\n let y = random(-100,-10);\n this.pos=createVector(x,y);\n this.vel=createVector(0,0);\n this.acc=createVector();\n this.r= getRandomSize();\n }", "title": "" }, { "docid": "c5fcd9569033bc91e82ce2d294f979ce", "score": "0.62855095", "text": "generate() {\n for (let x=0; x<this.width; x++) {\n for (let y=0; y<this.height; y++) {\n this[x][y] = this.create(x, y);\n }\n }\n }", "title": "" }, { "docid": "6665e48fabbdd244b166dec27515f4e1", "score": "0.62772655", "text": "function randomPoints() {\n let x = {\n x: Math.floor(Math.random() * 17 + 1) * cw,\n y: Math.floor(Math.random() * 15 + 3) * cw\n };\n return x;\n }", "title": "" }, { "docid": "77c427303f929ff62f02a4b11dd52da9", "score": "0.6275936", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]]);\n return res;\n }", "title": "" }, { "docid": "f74202e3b303d23a61c739edca785058", "score": "0.6266313", "text": "function getRandomData() {\r\n if (data.length > 0) data = data.slice(1);\r\n // do a random walk\r\n while (data.length < totalPoints) {\r\n var prev = data.length > 0 ? data[data.length - 1] : 50;\r\n var y = prev + Math.random() * 10 - 5;\r\n if (y < 0) y = 0;\r\n if (y > 100) y = 100;\r\n data.push(y);\r\n }\r\n // zip the generated y values with the x values\r\n var res = [];\r\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\r\n return res;\r\n }", "title": "" }, { "docid": "f74202e3b303d23a61c739edca785058", "score": "0.6266313", "text": "function getRandomData() {\r\n if (data.length > 0) data = data.slice(1);\r\n // do a random walk\r\n while (data.length < totalPoints) {\r\n var prev = data.length > 0 ? data[data.length - 1] : 50;\r\n var y = prev + Math.random() * 10 - 5;\r\n if (y < 0) y = 0;\r\n if (y > 100) y = 100;\r\n data.push(y);\r\n }\r\n // zip the generated y values with the x values\r\n var res = [];\r\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\r\n return res;\r\n }", "title": "" }, { "docid": "b3c8fbeb4582b650882cb13eff030fbd", "score": "0.62621284", "text": "function generateCoordinates() {\n let xCoordinate = (Math.floor(Math.random() * (max - min) + min)) * scale;\n let yCoordinate = (Math.floor(Math.random() * (max - min) + min)) * scale;\n return {xCoordinate, yCoordinate};\n}", "title": "" }, { "docid": "77e8fbec8d0eb05395ee3664045ca3f5", "score": "0.6250315", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "title": "" }, { "docid": "77e8fbec8d0eb05395ee3664045ca3f5", "score": "0.6250315", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "title": "" }, { "docid": "77e8fbec8d0eb05395ee3664045ca3f5", "score": "0.6250315", "text": "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "title": "" }, { "docid": "508a90505526caff961764b785c87942", "score": "0.62412477", "text": "function randomGenerator(shape) {\n if (shape == \"notCrystal\") {\n return Math.floor(Math.random() * (120 - 19) + 19) + 1;\n } else if (shape == \"crystal\") {\n return Math.floor(Math.random() * (12 - 1) + 1) + 1;\n }\n}", "title": "" }, { "docid": "e2785378b21a71205fd493e3b4fb099d", "score": "0.6231738", "text": "function spawnShape(){\n\n //shapeArray = generateSprite();\n console.log('called spawn shape')\n shapeArray = getNextSprite();\n\n shapeWidth = shapeArray[0].length;\n shapeCol = Math.floor(Math.random() * (TILE_COLS-3));\n shapeRow = 0;\n shapeHeight = shapeArray.length;\n shapeDirection = 0;\n waitForMovement = false;\n waitForRespawn = false;\n\n}", "title": "" }, { "docid": "4e285a879fe9eca3a8328150ad1d559f", "score": "0.6191855", "text": "place() {\n if (this.position === null) this.position = {};\n let xDiv = Math.floor(this.dims.x) - 1;\n let yDiv = Math.floor(this.dims.y) - 1;\n this.position.x = this.randBetween(this.padding, xDiv - this.padding);\n this.position.y = this.randBetween(this.padding, yDiv - this.padding);\n }", "title": "" }, { "docid": "5fc63efdd5bb055bea5966c26ed6b865", "score": "0.6183407", "text": "function createPoints(amount) {\n let array = [];\n for(let i = 0; i < amount; i++) {\n let x = random(windowWidth);\n let y = random(windowHeight);\n let r = random(255);\n let g = random(255);\n let b = random(255);\n let o = random(200,255);\n let d = random(360);\n\n array.push({ x: x, y: y, r: r, g: g, b: b, o: o, d: d, s: 0});\n }\n return array;\n}", "title": "" }, { "docid": "934b1ab6ec284ca26a26031057d58dd0", "score": "0.6172122", "text": "function coordinateGenerator()\n\t{\n\t\tvar x, y, smallest = 1000000, smallest_index;\n\n\t\tfor(var i = hashTableForX.length; i >= 0 ; i--)\n\t\t{\n\t\t\tif(hashTableForX[i] < smallest)\n\t\t\t{\n\t\t\t\tsmallest_index = i;\n\t\t\t\tsmallest = hashTableForX[i];\n\t\t\t}\n\t\t}\n\t\tx = Math.ceil((Math.random() + smallest_index) * Math.ceil(canvas.width / hashTableForX_Size));\n\t\thashTableForX[smallest_index] += 1;\n\t\ty = Math.ceil(Math.random() * canvas.height);\n\t\treturn {\n\t\t\t\"x\" : x,\n\t\t\t\"y\" : y\n\t\t};\n\t}", "title": "" }, { "docid": "6669004c9791ba100f5aef504d54e9c0", "score": "0.6170247", "text": "function getRandomLocation() {\n return { x_pos: Math.floor(Math.random()*context.canvas.width),\n y_pos: Math.floor(Math.random()*context.canvas.height) };\n}", "title": "" }, { "docid": "ec356a58f48a58015d2826eff51629b6", "score": "0.6165545", "text": "reset() {\n // Random position\n this.x = random(0, width);\n this.y = random(0, height);\n }", "title": "" }, { "docid": "b310169d86f36d1399c0fb8690fa08d8", "score": "0.61294204", "text": "function newShape() {\n id = Math.floor(Math.random() * shapes.length);\n currentId = id;\n var shape = shapes[id][0]; // maintain id for color filling\n\n current = shapeToCurrent(shape);\n\n // new shape starts to move\n freezed = false;\n // position where the shape will evolve\n currentX = Math.floor(Math.random() * 6);\n currentY = 0;\n currentZ = 0;\n}", "title": "" }, { "docid": "76fdc077885351a4df144e9749f01f65", "score": "0.61261594", "text": "function generateSeedLocation(){\n return [Math.floor(Math.random() * canvasWidth), Math.floor(Math.random() * canvasHeight)];\n}//end generateSeedLocation()", "title": "" }, { "docid": "96aebe94c1e5d36151db556887469bed", "score": "0.6123788", "text": "makeRoofCoordinates() {\n this.LRhorizontal =\n MIN_BUILDING_HORIZONTAL +\n Math.random() * MAX_BUILDING_HORIZONTAL;\n this.LRvertical =\n this.y < HEIGHT_FLAT\n ? 0\n : Math.min(\n MIN_BUILDING_VERTICAL +\n Math.random() * MAX_BUILDING_VERTICAL,\n this.LRhorizontal\n );\n this.TDhorizontal =\n MIN_BUILDING_HORIZONTAL +\n Math.random() * MAX_BUILDING_HORIZONTAL;\n this.TDvertical =\n this.y < HEIGHT_FLAT\n ? 0\n : Math.min(\n MIN_BUILDING_VERTICAL +\n Math.random() * MAX_BUILDING_VERTICAL,\n this.TDhorizontal\n );\n this.side = this.LRhorizontal > this.TDhorizontal ? 1 : -1;\n this.outerX =\n this.side === 1 ? this.LRhorizontal : this.TDhorizontal;\n this.outerY =\n this.side === 1 ? this.LRvertical : this.TDvertical;\n this.midX =\n this.side *\n (this.side === 1 ? this.TDhorizontal : this.LRhorizontal);\n this.midY = this.side === 1 ? this.TDvertical : this.LRvertical;\n }", "title": "" }, { "docid": "2e41edff94426fa8ba626f0140eaa4f8", "score": "0.6105114", "text": "function createPlaceholderShip(n){\r\n var rx, ry;\r\n if (verticalRandom()){\r\n rx = Math.floor(Math.random() * 9 + 1);\r\n ry = Math.floor(Math.random() * (11 - n) + 1);\r\n return {start: [rx - 1, ry - 1], end: [rx + 1, ry + n]};\r\n } else {\r\n rx = Math.floor(Math.random() * (11 - n) + 1);\r\n ry = Math.floor(Math.random() * 9 + 1);\r\n return {start: [rx - 1, ry - 1], end: [rx + n, ry + 1]};\r\n }\r\n}", "title": "" }, { "docid": "5b7f3b21114674c2de76654d8a78b9da", "score": "0.61006784", "text": "setRandomPosition(shape) {\n\t\tlet x = this.stage.x + (100 + (Math.random() * (this.stage.width-200)));\n\t\tlet y = 100 + (Math.random() * ((this.stage.height/2)-200));\n\t\tshape.setPosition(x, y);\n\t}", "title": "" }, { "docid": "eb1a3e682c8033cd110980bd628c2f09", "score": "0.60988563", "text": "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.size = 3;\n this.baseX = this.x;\n this.baseY = this.y;\n this.weight = (Math.random() * 6) + 1;\n }", "title": "" }, { "docid": "9687e4eed9fdc0c8dc9109fcf97c406e", "score": "0.6094897", "text": "randomizeShip(height, width) {\n var yStart = Math.floor((Math.random() * height));\n var xStart = Math.floor((Math.random() * width));\n\n var block1 = {x:xStart, y:yStart};\n var block2 = {x:xStart, y:yStart + 1};\n var block3 = {x:xStart, y:yStart + 2};\n var block4 = {x:xStart + 1, y:yStart + 2};\n\n this.area.push(block1);\n this.area.push(block2);\n this.area.push(block3);\n this.area.push(block4);\n }", "title": "" }, { "docid": "839a06a6a65fe7b582c07e664d3bd20e", "score": "0.60753477", "text": "function createRandomMesh() {\n //How many random triangles to create per width\n var num_hori_intervals = Math.round(image.width / 20);\n var interval_width = Math.round(image.width / num_hori_intervals);\n var random_locations = create2DArray(image.height / interval_width);\n\n changeMeshMode(true);\n //drawTestGrid(num_hori_intervals); \n random_locations = setRandomPoints(num_hori_intervals, random_locations);\n console.log(JSON.stringify(random_locations));\n connectPoints(random_locations);\n drawEntireMesh();\n}", "title": "" }, { "docid": "a9f5775d6df21a488586c5b878cb6349", "score": "0.60532916", "text": "function getRandomCoordinates() {\n return {\n x: Math.floor(Math.floor(Math.random() * GAME_WIDTH) / SNAKE_WIDTH) * SNAKE_WIDTH,\n y: Math.floor(Math.floor(Math.random() * GAME_WIDTH) / SNAKE_WIDTH) * SNAKE_WIDTH\n };\n}", "title": "" }, { "docid": "0651b4df6678bb852d0126555d15a3eb", "score": "0.60399264", "text": "constructor(graphic, width, height) {\n this.graphic = graphic\n this.x = random(width)\n this.y = random(height)\n\n // this.x = width / 2\n // this.y = height / 2\n }", "title": "" }, { "docid": "1836e45d5a1459d51525876d7c3e277e", "score": "0.60341316", "text": "constructor(){\n this.x = random (0, width);\n this.y = random (0, height);\n this.xspeed = 10;\n this.yspeed = 10;\n }", "title": "" }, { "docid": "60c789ecdc05a2a71b1f4efef47758c3", "score": "0.6027686", "text": "constructor(x, y) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\tthis.size = random(20, 70);\n\t\tthis.alpha = random(80, 160)\n\t}", "title": "" }, { "docid": "7d9422f63a7fef8ae14179072d0a47bd", "score": "0.6027067", "text": "reproduce() {\n this.offspring++;\n var d = Math.random()*Math.PI*2;\n var dst = Math.random()*this.size*1.5\n cells.push(newCell(this.size * Math.sqrt(this.fraction), this.x+Math.cos(d)*dst, this.y+Math.sin(d)*dst, this.color, this.fraction, this.args, this.defComm, this.age));\n this.size *= Math.sqrt(1 - this.fraction);\n }", "title": "" }, { "docid": "2f9fe5ce68db0c26e49dc0b071651032", "score": "0.6020216", "text": "function randCoords() {\n let randX = randomFloat(50, c.width - 50);\n let randY = randomFloat(50, c.height - 50);\n return {\n x: randX,\n y: randY,\n };\n }", "title": "" }, { "docid": "9d80dff2649a4c89ede90c76b7436999", "score": "0.6019004", "text": "constructor() {\r\n this.x = random(width);\r\n this.y = random(height);\r\n this.diameterx = random(width/width, width/100);\r\n this.diametery = random(height/height, height/100);\r\n this.speedx = random(5,15);\r\n this.speedy = random(5,15);\r\n this.colorR = random(255);\r\n this.colorG = random(255);\r\n this.colorB = random(255);\r\n this.starAlpha = random(0,10);\r\n }", "title": "" }, { "docid": "8e6881b6f17c97eccc8056d9a289f077", "score": "0.60127896", "text": "function generator(times, xmin, xmax, ymin, ymax)\n {\n var points = new Array();\n xmin = xmin * 10;\n xmax = xmax * 10;\n\n //let's hard written this part temporarily.\n ymin = ymin * 10;\n ymax = ymax * 10;\n\n var i = 0;\n for (i = 0; i < times; i++)\n {\n var x = randomIntFromInterval(xmin, xmax);\n x = x / parseFloat(10);\n\n var y = randomIntFromInterval(ymin, ymax);\n y = y / parseFloat(10);\n\n points[i] = new coordinate(i,x,y);\n }\n return points;\n }", "title": "" }, { "docid": "af5881fb8bbdb62825141431f659b225", "score": "0.60116494", "text": "function shapeCreate() {\n for (var i = 0; i < arrayRandomized.length; i++) {\n var div = document.createElement(\"div\");\n div.className = arrayRandomized[i];\n\n //call random number for color of the shape\n var colorType = randNum(11);\n switch (colorType) {\n case (1):\n div.className += \" gray1\";\n break;\n case (2):\n div.className += \" gray2\";\n break;\n case (3):\n div.className += \" green1\";\n break;\n case (4):\n div.className += \" green2\";\n break;\n case (5):\n div.className += \" red1\";\n break;\n case (6):\n div.className += \" blue1\";\n break;\n case (7):\n div.className += \" blue2\";\n break;\n case (8):\n div.className += \" blue3\";\n break;\n case (9):\n div.className += \" purple\";\n break;\n case (10):\n div.className += \" yellow\";\n break;\n case (11):\n div.className += \" orange\";\n break;\n }\n\n var board = document.getElementById('container');\n board.appendChild(div);\n }\n }", "title": "" }, { "docid": "43d3b446fadbf8a08a6e16d5c445863d", "score": "0.60039455", "text": "function getXValue(t, o) {\r\n if(t==1) { //I shape\r\n if(o==0) return 1 + Math.floor((Math.random()*6));\r\n else if(o==1) return 0 + Math.floor((Math.random()*8));\r\n else if(o==2) return 1 + Math.floor((Math.random()*6));\r\n else if(o==3) return 0 + Math.floor((Math.random()*9));\r\n else return 1 + Math.floor((Math.random()*6));\r\n } else if (t==2 || t==3 || t==5|| t==6 || t==7) { //J, L, S, T, or Z shape\r\n if(o==0) return 1 + Math.floor((Math.random()*6));\r\n else if(o==1) return 0 + Math.floor((Math.random()*8));\r\n else if(o==2) return 1 + Math.floor((Math.random()*6));\r\n else if(o==3) return 1 + Math.floor((Math.random()*7));\r\n else return 1 + Math.floor((Math.random()*6));\r\n } else if(t==4) { //O shape\r\n return 0 + Math.floor((Math.random()*8));\r\n } else return 0 + Math.floor((Math.random()*5)); //Random return value that will work with any shape and orientation\r\n}", "title": "" }, { "docid": "0551a8809ff8bf4696ba2d4e9e272df1", "score": "0.5993653", "text": "function randomX () {\n return Math.floor(Math.random() * CANVAS_WIDTH)\n }", "title": "" }, { "docid": "1c0c776a09242dc7ad1d5ed9abfb05e5", "score": "0.59918916", "text": "function randomPosition()\n{\n return project.view.size * Point.random();\n}", "title": "" }, { "docid": "e302f10dc9734b5e0e2feca31d31192a", "score": "0.5983862", "text": "buildShapes() {\n const\n w = 1 / this.nCols,\n h = 1 / this.nRows;\n for (let y = 0; y < this.nRows; y++) {\n for (let x = 0; x < this.nCols; x++) {\n this.shapeData[y * this.nCols + x] = new Rectangle(new Point(x * w, y * h), new Dimension(w, h));\n }\n }\n this.initiated = true;\n }", "title": "" }, { "docid": "d76a46548fe20b0f4b18187f64f93fe5", "score": "0.59796274", "text": "function generateFood() {\n let x = floor(width / SCALE);\n let y = floor(height / SCALE);\n\n let food_pos_x = floor(random(x))*SCALE;\n let food_pos_y = floor(random(y))*SCALE;\n\n return createVector(food_pos_x, food_pos_y);\n}", "title": "" }, { "docid": "4e480447c6aedd0bdface4a7a1636f2d", "score": "0.5978836", "text": "function randomlyGenerateApple() {\n apple.x = getRandomInt(0, 15) * grid;\n apple.y = getRandomInt(0, 15) * grid;\n}", "title": "" }, { "docid": "3b037444070784f4e89d5421ad642138", "score": "0.5973262", "text": "function populate_blobs(){\n r = random(10,60)\n blobs.push(new Dot(random(0,width),random(0,height),r,random(1,10),0,0,0,random(20,250)+r))\n}", "title": "" }, { "docid": "53c17cced39eb13fbaf8fd2ecbac34db", "score": "0.5954881", "text": "function create_food(){\n\t\tfood = {\n\t\t\tx:Math.round(Math.random()*(w-cw)/cw),\n\t\t\ty:Math.round(Math.random()*(h-cw)/cw),\n\t\t};\n\t\t//this will create a cell with x/y between 0-44\n\t}", "title": "" }, { "docid": "88874e807dec0cf9446002a751f10ac4", "score": "0.59282506", "text": "function generateStars() {\n let vertices = [];\n\n for (var i = 0; i < 10000; i++) {\n\n let x = THREE.MathUtils.randFloatSpread(2000);\n let y = THREE.MathUtils.randFloatSpread(2000);\n let z = THREE.MathUtils.randFloatSpread(2000);\n\n vertices.push(x, y, z);\n\n }\n\n const geometry = new THREE.BufferGeometry();\n geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));\n\n const material = new THREE.PointsMaterial({\n color: 0x888888\n });\n\n const points = new THREE.Points(geometry, material);\n\n props.scene.add(points);\n}", "title": "" }, { "docid": "77f62723cdbdb09045d3bd6a410b181a", "score": "0.58942354", "text": "function bubbleLocations() \n{\n for (var i = 0; i < 100; i++) \n {\n fillBubbleXPos[i] = random(0, width);\n fillBubbleYPos[i] = random(0, height);\n }\n}", "title": "" }, { "docid": "4c110862a26f3273f977fcd4443bad18", "score": "0.5893117", "text": "function getRandomCoordinates() {\n var row = Math.floor(Math.random() * totalRows) + 1;\n var col = Math.floor(Math.random() * totalCols) + 1;\n return [row, col];\n}", "title": "" }, { "docid": "175063fe94cf32bf5dc4e4db7d88b268", "score": "0.5887078", "text": "function createFood() {\n food = {\n x: Math.floor(Math.random() * maxCanvasPosition) * segment,\n y: Math.floor(Math.random() * maxCanvasPosition) * segment\n };\n}", "title": "" }, { "docid": "058b9905c8f1eec4dbbaf5d12c9a5a1b", "score": "0.588682", "text": "newStarRandomPosition() {\n\t\tthis.x = this.getRandomPosition('x');\n\t\tthis.y = this.getRandomPosition('y');\n\t}", "title": "" }, { "docid": "26edc5deb5049a02800f2ff59d3f98e5", "score": "0.5870555", "text": "randomize() {\n // Instantiate snow above the screen\n let x = random(width);\n let y = random(-100, -10);\n\n this.pos = createVector(x, y);\n this.vel = createVector(0, 0);\n this.acc = createVector();\n this.size = getRandomSize3();\n }", "title": "" }, { "docid": "ad7fcbfda94e572000cbdd1dce4380df", "score": "0.5865438", "text": "function getRandomPosition() {\n const x = random(0, numberOfBoxes - 1) * boxSize;\n const y = random(0, numberOfBoxes - 1) * boxSize;\n return { x, y };\n}", "title": "" }, { "docid": "8f686226eedb7ef12d3036b9d33d6d6f", "score": "0.58622366", "text": "function generatePoints() {\nlet points = [];\nlet angleSteps = 360/drawingParams.pointCount;\nlet num = 0\n for (angle = 0; angle < 360; angle += angleSteps) {\n let posX = cos(angle) * drawingParams.radius/2;\n let posY = sin(angle) * drawingParams.radius/2;\n points.push({posX, posY, num});\n num++;\n }\n return points;\n}", "title": "" }, { "docid": "9feb2b8c00c485e62a57f8e59cf60750", "score": "0.58562523", "text": "function reDo() {\n background(bgcolorPickR.value(), bgcolorPickG.value(), bgcolorPickB.value());\n\n for (let i = 0; i < random(6, 12); i++) {\n shape[i] = new Shape(random(width), random(height), random(40, (radiusSlider.value())));\n // shape.splice(0, 1);\n }\n for (let i = 0; i < random(1, 6); i++) {\n shapeC[i] = new secondShape(random(width), random(height), random(40, (radiusColoredSlider.value())));\n // shapeC.splice(0, 1);\n }\n shape.splice(0, 1);\n shapeC.splice(0, 1);\n}", "title": "" }, { "docid": "b2d0a70095d011e78eae95b8cc1be917", "score": "0.5841039", "text": "function setup() {\n\t\tconsole.log(this+\".setup\");\n\t\tx = random(radius,width-radius);\n\t\ty = random(radius,height-radius);\n\t\txm = random(-25,25);\n\t\tym = random(-25,25);\n\t}", "title": "" }, { "docid": "012e5dbe4eb646fb722048c07ea04285", "score": "0.583959", "text": "function randomXTile() {\n return Math.floor(Math.random() * MAP_WIDTH);\n}", "title": "" }, { "docid": "c84fc23433519bd72fa3cbfc277e9e3f", "score": "0.5834777", "text": "function randomBlob(shape, color, position, parent) {\n let randRad = []\n\n for (let i = 0; i < 4; i++)\n randRad[i] = Math.random() * 30 + 40;\n\n const [a, b, x, y] = randRad,\n $blob = $(\"<div>\", {\n \"id\": `${shape}${color}${position}`\n });\n\n $blob.css({\n \"width\": `${shape[0]}px`,\n \"height\": `${shape[1]}px`,\n \"position\": \"absolute\",\n \"left\": `${position[0]}px`,\n \"top\": `${position[1]}px`,\n \"background\": `${color}`,\n \"border-radius\": `${a}% ${100 - a}% ${b}% ${100 - b}% / ${x}% ${y}% ${100 - y}% ${100 - x}%`,\n \"opacity\": \"0.25\"\n });\n\n $(parent).append($blob);\n}", "title": "" }, { "docid": "355877f69bdf937f98e35f583caf2c29", "score": "0.5831015", "text": "function init() {\n\tfor (var i = 0; i < 20; i++) {\n\t\tpositions.push({x: Math.random()*1000, y:Math.random()*1000});\n\t}\n}", "title": "" }, { "docid": "2540f576a89e68ea993da16f6872e910", "score": "0.5828571", "text": "function getNewCoordinates() {\n var inputId = '';\n\n for (var i = 0; i < 7; i++) { // 7 points on shape\n var newPoint = new Point();\n\n // Offsets the real value of the coordinate to give impression that centre of grid is position (0,0)\n inputId = 'p' + i + '-input-x';\n newPoint.x = (parseInt(document.getElementById(inputId).value) * interfaceSettings.squareSize) + interfaceSettings.xIntercept;\n inputId = 'p' + i + '-input-y';\n newPoint.y = (parseInt(document.getElementById(inputId).value) * -1 * interfaceSettings.squareSize) + interfaceSettings.yIntercept;\n\n currentState.currentPosition[i] = newPoint;\n }\n drawShape();\n}", "title": "" }, { "docid": "fd1f41d603c1fcbddedd11c434387ebc", "score": "0.58250314", "text": "function getPositionX(){\r\n return Math.random()*(screenWidth - 150);//trapezoid takes more place to be drawn\r\n }", "title": "" }, { "docid": "5174e494e4f9f63ce6a95798d91713e2", "score": "0.58219934", "text": "function randomX(){\n var x = random(0+circleSize/2, canvasWidth-circleSize/2);\n //window.alert(\"X coord: \" + x);\n return x;\n}", "title": "" }, { "docid": "23673fe81a6db67cde90da4fb8fcf8cf", "score": "0.5807044", "text": "function makeShapeAppear() {\r\n var top = Math.random() * 400;\r\n\r\n var left = Math.random() * 400;\r\n\r\n var width = Math.random() * 200 + 100;\r\n\r\n var right = Math.random() * 200 + 100;\r\n\r\n // if else statement to get random shape - circle or square with time condition\r\n if (Math.random() > 0.5) {\r\n document.getElementById(\"shape\").style.borderRadius = \"50%\";\r\n } else {\r\n document.getElementById(\"shape\").style.borderRadius = \"0\";\r\n }\r\n // js to use randomcolor function\r\n document.getElementById(\"shape\").style.backgroundColor = getRandomColor();\r\n\r\n // document.getElementById(\"shape\").style.width = width + \"px\";\r\n\r\n // document.getElementById(\"shape\").style.top = top + \"px\";\r\n\r\n // document.getElementById(\"shape\").style.left = left + \"px\";\r\n\r\n // document.getElementById(\"shape\").style.right = right + \"px\";\r\n\r\n // document.getElementById(\"shape\").style.display = \"block\";\r\n\r\n start = new Date().getTime();\r\n\r\n}", "title": "" }, { "docid": "aae409f3a48ce2b8cc59781002b53795", "score": "0.58041435", "text": "buildShapes() {\n // Create two two-dimension arrays for storing the type of horizontal and vertical lines\n let hLineType = [], vLineType = [];\n for (let i = 0; i <= this.nRows; i++) {\n hLineType[i] = [];\n vLineType[i] = [];\n }\n\n for (let row = 0; row < this.nRows; row++) {\n for (let col = 0; col < this.nCols; col++) {\n hLineType[row][col] = row === 0 ? 0 : 1 + (this.randomLines ? Math.round(Math.random() * 9) : row + col) % 2;\n vLineType[row][col] = col === 0 ? 0 : 1 + (this.randomLines ? Math.round(Math.random() * 9) : col + row + 1) % 2;\n if (col === this.nCols - 1)\n vLineType[row][col + 1] = 0;\n if (row === this.nRows - 1)\n hLineType[row + 1][col] = 0;\n }\n }\n\n const w = 1 / this.nCols, h = 1 / this.nRows;\n for (let r = 0; r < this.nRows; r++) {\n for (let c = 0; c < this.nCols; c++) {\n const x = w * c;\n const y = h * r;\n const sd = new Path([new PathStroke('M', [x, y])]);\n this.hLine(sd, hLineType[r][c], x + 0, y + 0, w, h, false);\n this.vLine(sd, vLineType[r][c + 1], x + w, y + 0, w, h, false);\n this.hLine(sd, hLineType[r + 1][c], x + w, y + h, w, h, true);\n this.vLine(sd, vLineType[r][c], x + 0, y + h, w, h, true);\n sd.addStroke(new PathStroke('X'));\n sd.calcEnclosingRect();\n // Save the Path in `shapeData`\n this.shapeData[r * this.nCols + c] = sd;\n }\n }\n this.initiated = true;\n }", "title": "" }, { "docid": "3b7c7758fec69b9f6688f52fbf12af9b", "score": "0.58030635", "text": "function generateNDotArray(){\n var array = [];\n\n for (var i = 0; i < n_dots; i++) {\n // generate specified amount of dots\n\n // generate random position\n var posX = Math.floor((Math.random()*canvasWidth)+1)\n var posY = Math.floor((Math.random()*canvasHeight)+1)\n // math.random generates a pseudorandom number in the range [0,1]\n\n // new dot object\n var dot = {\n x: posX,\n y: posY\n }\n\n array.push(dot);\n // add dot to array\n }\n return array;\n }", "title": "" }, { "docid": "3241be9396e966fe07c8107672077f17", "score": "0.57836837", "text": "function randomSize(x, y) {\n return Math.floor(Math.random() * (y - x * 2) + x);\n }", "title": "" }, { "docid": "3bda732afad8724633ffa6244631fb4b", "score": "0.57761633", "text": "static distributeRandom(bound, count, dimensions = 2) {\n let pts = new Pt_1.Group();\n for (let i = 0; i < count; i++) {\n let p = [bound.x + Math.random() * bound.width];\n if (dimensions > 1)\n p.push(bound.y + Math.random() * bound.height);\n if (dimensions > 2)\n p.push(bound.z + Math.random() * bound.depth);\n pts.push(new Pt_1.Pt(p));\n }\n return pts;\n }", "title": "" }, { "docid": "9aca7c789e51b653c20bfb796c56b8e7", "score": "0.57712674", "text": "function create_food()\n\t{\n\t \n\t //This will create a cell with x/y between 0-44\n\t\t//Because there are 45(450/10) positions accross the rows and columns\n\t\tfood = {\n\t\t\tx: Math.round(Math.random()*(w-cellWidth)/cellWidth), \n\t\t\ty: Math.round(Math.random()*(h-cellWidth)/cellWidth), \n\t\t};\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "1fd9eca71fc0bae45691b29d0120f1c1", "score": "0.5762109", "text": "positionX(list) {\n\n let positionGenerator = Math.floor(Math.random() * list.length);\n let positionXstart = list[positionGenerator];\n this.x = positionXstart;\n }", "title": "" }, { "docid": "09b8a230aef0e625781e95512a18aa53", "score": "0.57540685", "text": "generateRandomPoint() {\n const width = 2;\n const depth = 5;\n const x = Math.abs(Math.random() * width);\n const y = -0.5;\n const z = Math.abs(Math.random() * depth);\n const point = new THREE.Vector3(x, y, z);\n return point;\n }", "title": "" }, { "docid": "01a92392c807a786ea63d4e8ed589901", "score": "0.5751098", "text": "function randomXOffset() {\n return -TILE_WIDTH - Math.random() * 300;\n}", "title": "" }, { "docid": "dfc9aaeb6d45abbceb614a1961553cb3", "score": "0.5742422", "text": "function everything() {\n for (var i = 0; i < 5000; i++) {\n var dimension = new Part(\n random(-w, h),\n random(-w, h),\n random(-sprinkle, sprinkle)\n );\n arr.push(dimension);\n }\n}", "title": "" }, { "docid": "b1002a230143232552462ca4ace4b7e1", "score": "0.57398766", "text": "createStartingShapes() {\n\t\tlet color = \"#00eac4\";\n\t\tfor (let i = 0, length = this.maxShapes; i < length; i++) {\n\t\t\t// Colour changing for testing purposes\n\t\t\t/*if (i === 0) {\n\t\t\t\tcolor = \"#000000\";\n\t\t\t} else {\n\t\t\t\tcolor = \"#00eac4\";\n\t\t\t}*/\n\t\t\tthis.createNewShape(false, color);\n\t\t}\n\t}", "title": "" }, { "docid": "09aa20076189de86609a6ec96ac6c84f", "score": "0.5738795", "text": "constructor() {\r\n super();\r\n this.xP = Math.random() * 400;\r\n this.yP = Math.random() * 600;\r\n }", "title": "" }, { "docid": "fcfc7dc24add7a8f98cddf8788554407", "score": "0.5737297", "text": "function generateDatapoints() {\t\t\n\t\treturn {\n\t\t\tx: [15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 23, 23, 24, 24, 25, 25, 28, 28, 28, 28, 29, 29, 30, 30, 33, 33, 33, 33, 34, 34, 37, 37, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 42, 42, 43, 43, 43, 43, 44, 44, 46, 46, 46, 46, 47, 47, 48, 48, 48, 48, 48, 48, 49, 49, 50, 50, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 57, 57, 58, 58, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 64, 64, 65, 65, 65, 65, 67, 67, 67, 67, 69, 69, 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 73, 73, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 81, 81, 85, 85, 86, 86, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 93, 93, 97, 97, 98, 98, 99, 99, 101, 101, 103, 103, 103, 103, 113, 113, 120, 120, 126, 126, 137, 137],\n\n\t\t\ty: [39, 81, 6, 77, 40, 76, 6, 94, 3, 72, 14, 99, 15, 77, 13, 79, 35, 66, 29, 98, 35, 73, 5, 73, 14, 82, 32, 61, 31, 87, 4, 73, 4, 92, 14, 81, 17, 73, 26, 75, 35, 92, 36, 61, 28, 65, 55, 47, 42, 42, 52, 60, 54, 60, 45, 41, 50, 46, 51, 46, 56, 55, 52, 59, 51, 59, 50, 48, 59, 47, 55, 42, 49, 56, 47, 54, 53, 48, 52, 42, 51, 55, 41, 44, 57, 46, 58, 55, 60, 46, 55, 41, 49, 40, 42, 52, 47, 50, 42, 49, 41, 48, 59, 55, 56, 42, 50, 46, 43, 48, 52, 54, 42, 46, 48, 50, 43, 59, 43, 57, 56, 40, 58, 91, 29, 77, 35, 95, 11, 75, 9, 75, 34, 71, 5, 88, 7, 73, 10, 72, 5, 93, 40, 87, 12, 97, 36, 74, 22, 90, 17, 88, 20, 76, 16, 89, 1, 78, 1, 73, 35, 83, 5, 93, 26, 75, 20, 95, 27, 63, 13, 75, 10, 92, 13, 86, 15, 69, 14, 90, 32, 86, 15, 88, 39, 97, 24, 68, 17, 85, 23, 69, 8, 91, 16, 79, 28, 74, 18, 83]\n\t\t}\n\t}", "title": "" }, { "docid": "4afeb5cb64a262b5314b6c42d4b7a1e9", "score": "0.5736818", "text": "function randPosX(){ \n return Math.floor(Math.random() * 560); \n }", "title": "" }, { "docid": "58bc315328fb6534e6865f241a42f9b9", "score": "0.572924", "text": "function addDrop() {\n let xPos = Math.floor(Math.random() * 800);\n let size = Math.floor(Math.random() * 5);\n raindrops.push(new raindrop(xPos, size));\n //console.log(raindrops);\n}", "title": "" }, { "docid": "042e5ccbe97cb594bb8146bf37d0637c", "score": "0.5718614", "text": "function randomCoord() {\r\n\treturn Math.floor(Math.random()*height);\r\n}", "title": "" }, { "docid": "106dd711b60e75028b6a12983abb5a2b", "score": "0.57180935", "text": "function randomizeOrigin() {\n var origin = {};\n origin.x = Math.floor(0.5 * WIDTH + Math.random() * 0.1 * WIDTH);\n origin.y = Math.floor(0.1 * HEIGHT + Math.random() * 0.2 * HEIGHT);\n return origin;\n }", "title": "" }, { "docid": "4f8e3231d9a71b0e826499a79c6b16d2", "score": "0.57175297", "text": "static createFood() {\n return { x: randomInt(0, LEVEL_WIDTH), y: randomInt(0, LEVEL_HEIGHT) };\n }", "title": "" }, { "docid": "8349ed9a6663ba4b65996ed75c6b4669", "score": "0.5716096", "text": "function initNoise(size) {\r\n\t\t// Start with an empty grid.\r\n\t\tvar grid = [];\r\n\t\t// Loop through the rows.\r\n\t\tfor (var y=0; y<size+1; y++) {\r\n\t\t\t// Start with an empty row.\r\n\t\t\tvar row = [];\r\n\t\t\t// Loop through the columns.\r\n\t\t\tfor (var x=0; x<size+1; x++) {\r\n\t\t\t\t// Set a random X value for the vector and randomize its direction.\r\n\t\t\t\tvar vX = Math.random()*(Math.random()>0.5?1:-1);\r\n\t\t\t\t// Set a random Y value for the vector and randomize its direction.\r\n\t\t\t\tvar vY= Math.random()*(Math.random()>0.5?1:-1);\r\n\t\t\t\t// Create a vector using the values and normalize it to a unit vector.\r\n\t\t\t\tvar gridVector = new Vector2(vX, vY).normalize();\r\n\r\n\t\t\t\t// Push the vector onto the end of the row.\r\n\t\t\t\trow.push(gridVector);\r\n\t\t\t}\r\n\r\n\t\t\t// After the row is completed, push the whole row onto the end of the grid.\r\n\t\t\tgrid.push(row);\r\n\t\t}\r\n\r\n\t\t// After all the rows are completed, return the grid.\r\n\t\treturn grid;\r\n\t}", "title": "" }, { "docid": "68adf0ea82c4de2aaf981fec1affbb9d", "score": "0.5714795", "text": "function generatingRandomCoordinate() {\n var rt = Math.floor(Math.random() * 20);\n return paddingZero(rt);\n}", "title": "" }, { "docid": "ac1cdfe4ecb7942a615eecdd06e94a3d", "score": "0.57104814", "text": "function setup() {\n createCanvas(500, 500);\n noLoop();\n\n pointCount = 100;\n\n // STORED RANDOM PLACEMENT\n for (let i = 0; i < pointCount; i++) {\n points.push({\n xPos: random() * width,\n yPos: random() * height\n });\n }\n\n createTreesAndSnowmen();\n\n // STORED GRID PLACEMENT\n // posOffset = 10;\n\n // for (let y = 0; y < 10; y++) {\n // for (let x = 0; x < 10; x++) {\n // points.push({\n // x: x * 50 + 25 + random() * posOffset,\n // y: y * 50 + 25 + random() * posOffset\n // });\n // }\n // }\n}", "title": "" } ]
b25aeac1d511ddf27e8c9ff08fba796d
creates a dialog box when picture is clicked
[ { "docid": "268c94f5f821646c23b0bd9115df6b26", "score": "0.5761532", "text": "function createDialog(){\n $( \"#resizeLeft\" ).click(function() {\n $('#dialogLeft' ).dialog();\n $( \"#dialogMiddle\" ).dialog( \"close\" );\n $( \"#dialogRight\" ).dialog( \"close\" );\n });\n $( \"#resizeMiddle\" ).click(function() {\n $('#dialogMiddle').dialog();\n $( \"#dialogLeft\" ).dialog( \"close\" );\n $( \"#dialogRight\" ).dialog( \"close\" );\n });\n $( \"#resizeRight\" ).click(function() {\n $( '#dialogRight' ).dialog();\n $( \"#dialogMiddle\" ).dialog( \"close\" );\n $( \"#dialogLeft\" ).dialog( \"close\" );\n\n });\n}", "title": "" } ]
[ { "docid": "8438f34853a65c97b82aac6eef5ebca1", "score": "0.69458735", "text": "function imageDialog() {\n // Dynamically create a div and store it in a variable.\n let $dialog3 = $('<div></div>').attr(`title`, ``);\n //use image source to append gif image\n $dialog3.append(\"<img src='\" + gifStr + \"'></img>\");\n //add the div to the page\n $('body').append($dialog3);\n $dialog3.dialog({\n autoOpen: true,\n modal: true,\n height: 500,\n width: 600,\n // contained within the body tag, and can't be dragged out of it.\n containment: 'body'\n });\n}", "title": "" }, { "docid": "b216e1fba99cc78803a49b2e0c7d9570", "score": "0.6659233", "text": "function popupImage(filename) {\n //\n // Use the same proportions as the dialog box\n //\n var w_width = $(window).width() * 0.8;\n var w_height = $(window).height() * 0.8;\n var w_params = \"menubar=no,width=\" + w_width + \",height=\" + w_height + \",toolbar=no,resizeable=yes,scrollbars=yes\"; \n window.open(filename, \"figWindow\", w_params);\n}", "title": "" }, { "docid": "c1332d90b24836c681e4ba4bb4bcb0f7", "score": "0.6510189", "text": "function setupCreateImageDialog(){\n dialogs_context.append('<div title=\"Create Image\" id=\"create_image_dialog\"></div>');\n $create_image_dialog = $('#create_image_dialog',dialogs_context);\n var dialog = $create_image_dialog;\n dialog.html(create_image_tmpl);\n\n var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window\n\n //Prepare jquery dialog\n dialog.dialog({\n autoOpen: false,\n modal:true,\n width: 520,\n height: height\n });\n\n $('#img_tabs',dialog).tabs();\n $('button',dialog).button();\n $('#img_type option',dialog).first().attr(\"selected\",\"selected\");\n $('#datablock_img',dialog).attr(\"disabled\",\"disabled\");\n\n $('select#img_type',dialog).change(function(){\n var value = $(this).val();\n var context = $create_image_dialog;\n switch (value){\n case \"DATABLOCK\":\n $('#datablock_img',context).removeAttr(\"disabled\");\n break;\n default:\n $('#datablock_img',context).attr(\"disabled\",\"disabled\");\n $('#path_img',context).attr(\"checked\",\"checked\");\n $('#img_source,#img_fstype,#img_size',context).parent().hide();\n $('#img_path',context).parent().show();\n }\n });\n\n $('#img_source,#img_fstype,#img_size',dialog).parent().hide();\n $('#path_img',dialog).attr(\"checked\",\"checked\");\n $('#img_path',dialog).parent().addClass(\"img_man\");\n\n $('#img_public',dialog).click(function(){\n $('#img_persistent',$create_image_dialog).removeAttr(\"checked\");\n });\n\n $('#img_persistent',dialog).click(function(){\n $('#img_public',$create_image_dialog).removeAttr(\"checked\");\n });\n\n\n\n $('#src_path_select input').click(function(){\n var context = $create_image_dialog;\n var value = $(this).val();\n switch (value){\n case \"path\":\n $('#img_source,#img_fstype,#img_size',context).parent().hide();\n $('#img_source,#img_fstype,#img_size',context).parent().removeClass(\"img_man\");\n $('#img_path',context).parent().show();\n $('#img_path',context).parent().addClass(\"img_man\");\n break;\n case \"source\":\n $('#img_path,#img_fstype,#img_size',context).parent().hide();\n $('#img_path,#img_fstype,#img_size',context).parent().removeClass(\"img_man\");\n $('#img_source',context).parent().show();\n $('#img_source',context).parent().addClass(\"img_man\");\n break;\n case \"datablock\":\n $('#img_source,#img_path',context).parent().hide();\n $('#img_source,#img_path',context).parent().removeClass(\"img_man\");\n $('#img_fstype,#img_size',context).parent().show();\n $('#img_fstype,#img_size',context).parent().addClass(\"img_man\");\n break;\n }\n });\n\n\n $('#create_image_form_easy',dialog).submit(function(){\n var exit = false;\n $('.img_man',this).each(function(){\n if (!$('input',this).val().length){\n notifyError(\"There are mandatory parameters missing\");\n exit = true;\n return false;\n }\n });\n if (exit) { return false; }\n var img_json = {};\n\n var name = $('#img_name',this).val();\n img_json[\"NAME\"] = name;\n\n var desc = $('#img_desc',this).val();\n if (desc.length){\n img_json[\"DESCRIPTION\"] = desc;\n }\n\n var type = $('#img_type',this).val();\n img_json[\"TYPE\"]= type;\n\n img_json[\"PUBLIC\"] = $('#img_public:checked',this).length ? \"YES\" : \"NO\";\n\n img_json[\"PERSISTENT\"] = $('#img_persistent:checked',this).length ? \"YES\" : \"NO\";\n\n var dev_prefix = $('#img_dev_prefix',this).val();\n if (dev_prefix.length){\n img_json[\"DEV_PREFIX\"] = dev_prefix;\n }\n\n var bus = $('#img_bus',this).val();\n img_json[\"BUS\"] = bus;\n\n switch ($('#src_path_select input:checked',this).val()){\n case \"path\":\n path = $('#img_path',this).val();\n img_json[\"PATH\"] = path;\n break;\n case \"source\":\n source = $('#img_source',this).val();\n img_json[\"SOURCE\"] = source;\n break;\n case \"datablock\":\n size = $('#img_size',this).val();\n fstype = $('#img_fstype',this).val();\n img_json[\"SIZE\"] = size;\n img_json[\"FSTYPE\"] = fstype;\n break;\n }\n var obj = { \"image\" : img_json };\n Sunstone.runAction(\"Image.create\", obj);\n\n $create_image_dialog.dialog('close');\n return false;\n });\n\n $('#create_image_form_manual',dialog).submit(function(){\n var template=$('#template',this).val();\n Sunstone.runAction(\"Image.create\",template);\n $create_image_dialog.dialog('close');\n return false;\n });\n}", "title": "" }, { "docid": "348df4b066c20c133e50cfdf453d7f85", "score": "0.62796867", "text": "function openDialogue(evt) {\n var chooser = document.querySelector('#files');\n chooser.click();\n}", "title": "" }, { "docid": "4bc38b0aed1793bac15691ab2124e6f2", "score": "0.62795097", "text": "function showInsertImageDialog(){\n resetToNoneState();\n\n draw();\n\n setUploadedImagesList();\n\n var dialogContent = document.getElementById('insert-image-dialog');\n $.modal(dialogContent,{minWidth:'380px', containerId: 'upload-image-dialog', overlayClose: true});\n // update dialog's position\n $.modal.setPosition();\n\n // empty upload errors in dialog\n var errorDiv = document.getElementById(uploadImageErrorDivId);\n errorDiv.innerHTML = '';\n}", "title": "" }, { "docid": "9eab3d79e6c6f56462133014e868d2d8", "score": "0.62768596", "text": "function EBX_DialogBox() {}", "title": "" }, { "docid": "8fa21702087a8f53dafc48c3030662ff", "score": "0.6181243", "text": "function Dialog(){}", "title": "" }, { "docid": "2f00bf740c9d7d058749c1b7b751ecc2", "score": "0.61702335", "text": "function createDialog(){\n\n\t// Create an empty dialog window near the upper left of the screen\n\tvar dlg = new Window('dialog', 'MICollage');\n\tdlg.frameLocation = [78, 100];\n\n\t// Add a panel to hold title and 'message text' strings\n\tdlg.msgPn0 = dlg.add('panel', undefined, 'Template File');\n\tdlg.msgPn0.orientation = \"column\";\n\tdlg.msgPn0.alignChildren = 'Right';\n\t// Add a panel to hold title and 'message text' strings\n\tdlg.msgPn0.TemplateFile = dlg.msgPn0.add('group');\n\tdlg.msgPn0.TemplateFile.orientation = \"row\";\n\tdlg.msgPn0.etTemplateFile = dlg.msgPn0.add(\"edittext\", undefined, exportInfo.destination.toString());\n\tdlg.msgPn0.etTemplateFile.preferredSize.width = 550;\n\tdlg.msgPn0.etTemplateFile.helpTip = \"Choose a collage template to populate.\";\n\n\tdlg.msgPn0.btnSelect = dlg.msgPn0.add(\"button\", undefined, strButtonSelect);\n\tdlg.msgPn0.btnSelect.helpTip = \"Select a collage template to populate.\";\n\tdlg.msgPn0.btnSelect.onClick = function() {\n\t\tvar dir = Folder(dlg.msgPn0.etTemplateFile.text.substr(0, dlg.msgPn0.etTemplateFile.text.lastIndexOf(\"\\\\\")+1));\n\t\tif (!dir.exists) var dir = Folder(templateFolder);\t\t\n\t\tdlg.selTemplateFile = dir.openDlg(dlg.msgPn0.etTemplateFile.text , \"Select:*.psd;*.psb\");\n\t\tif ( dlg.selTemplateFile != null ) {\n\t dlg.msgPn0.etTemplateFile.text = dlg.selTemplateFile.fsName;\n\t }\n\t\t//dlg.msgPn0.defaultElement.active = true;\n\t}\n\n\t// Add a panel to hold title and 'message text' strings\n\tdlg.msgPn2 = dlg.add('panel', undefined, 'Input Folder');\n\tdlg.msgPn2.orientation = \"column\";\n\tdlg.msgPn2.alignChildren = 'Right';\n\n\tdlg.msgPn2.InputFolder = dlg.msgPn2.add('group');\n\tdlg.msgPn2.InputFolder.orientation = \"row\";\n\tdlg.msgPn2.etInputFolder = dlg.msgPn2.add(\"edittext\", undefined, exportInfo.destination.toString());\n\tdlg.msgPn2.etInputFolder.preferredSize.width = 550;\n\tdlg.msgPn2.etInputFolder.helpTip = \"Choose a folder of images to process.\";\n\n\tdlg.msgPn2.btnBrowse = dlg.msgPn2.add(\"button\", undefined, strButtonBrowse);\n\tdlg.msgPn2.btnBrowse.helpTip = \"Select a folder of images to process.\";\n\tdlg.msgPn2.btnBrowse.onClick = function() {\n\t\tvar defaultFolder = dlg.msgPn2.etInputFolder.text;\n\t\tvar testFolder = new Folder(dlg.msgPn2.etInputFolder.text);\n\t\tif (!testFolder.exists) {\n//\t\t\tdefaultFolder = \"~\";\n\t\t\tdefaultFolder = imagePath;\n\t\t}\n\t\t// var selFolder = Folder.selectDialog(dlg.msgPn2.etInputFolder.text, defaultFolder);\n\t\tdlg.selInputFolder = Folder.selectDialog(dlg.msgPn2.etInputFolder.text, defaultFolder);\n\t\tif ( dlg.selInputFolder != null ) {\n\t dlg.msgPn2.etInputFolder.text = dlg.selInputFolder.fsName;\n\t }\n\t\t//dlg.msgPn2.defaultElement.active = true;\n\t}\n\n\t// Add a panel to hold title and 'message text' strings\n\tdlg.msgPn3 = dlg.add('panel', undefined, 'Output Folder');\n\tdlg.msgPn3.orientation = \"column\";\n\tdlg.msgPn3.alignChildren = 'Right';\n\n\tdlg.msgPn3.Destination = dlg.msgPn3.add('group');\n\tdlg.msgPn3.Destination.orientation = \"row\";\n\tdlg.msgPn3.etDestination = dlg.msgPn3.add(\"edittext\", undefined, exportInfo.destination.toString());\n\tdlg.msgPn3.etDestination.preferredSize.width = 550;\n\tdlg.msgPn3.etDestination.helpTip = \"Choose a folder to export your collages to.\";\n\n\tdlg.msgPn3.btnBrowse = dlg.msgPn3.add(\"button\", undefined, strButtonBrowse);\n\tdlg.msgPn3.btnBrowse.helpTip = \"Select a folder to export your collages to.\";\n\tdlg.msgPn3.btnBrowse.onClick = function() {\n\t\tvar defaultFolder = dlg.msgPn3.etDestination.text;\n\t\tvar testFolder = new Folder(dlg.msgPn3.etDestination.text);\n\t\tif (!testFolder.exists) {\n\t\t\tdefaultFolder = \"~\";\n\t\t}\n\t\tdlg.selOutputFolder = Folder.selectDialog(dlg.msgPn3.etDestination.text, defaultFolder);\n\t\tif ( dlg.selOutputFolder != null ) {\n\t dlg.msgPn3.etDestination.text = dlg.selOutputFolder.fsName;\n\t }\n\t\t//dlg.msgPn3.defaultElement.active = true;\n\t}\n\n\t// Add a panel to hold title and 'message text' strings\n\tdlg.msgPnl = dlg.add('panel', undefined, 'Options');\n\tdlg.msgPnl.orientation = \"column\";\n\tdlg.msgPnl.alignChildren = 'right';\n\n\t//dlg.msgPnl.StampFilename = dlg.msgPnl.add('group');\n\t//dlg.msgPnl.StampFilename.orientation = \"row\";\n\t//dlg.msgPnl.StampFilename.alignment='left';\n\t//dlg.msgPnl.StampFilename.st = dlg.msgPnl.StampFilename.add('checkbox', undefined, 'Stamp File Name on Collage OR');\n\t//dlg.msgPnl.StampFilename.helpTip = \"Stamp Filename on Collage.\";\n\n\tdlg.msgPnl.StampImage = dlg.msgPnl.add('group');\n\tdlg.msgPnl.StampImage.orientation = \"row\";\n\tdlg.msgPnl.StampImage.alignment='left';\n\tdlg.msgPnl.StampImage.st = dlg.msgPnl.StampImage.add('checkbox', undefined, 'Stamp Filename on Image');\n\tdlg.msgPnl.StampImage.helpTip = \"Stamp Filename on Image.\";\n\n\tdlg.msgPnl.grp5a =dlg.msgPnl.add('group');\n\tdlg.msgPnl.grp5a.orientation='row';\n\tdlg.msgPnl.grp5a.alignment='fill';\n\tdlg.msgPnl.grp5a.st1 = dlg.msgPnl.grp5a.add('statictext',undefined,'Name Stamp Text Location:');\n\tvar position =['Top Left','Top Center','Top Right','Center Left','Center','Center Right','Bottom Left','Bottom Center','Bottom Right'];\n\tdlg.msgPnl.grp5a.dd1 = dlg.msgPnl.grp5a.add('dropdownlist',undefined,position);\n\tdlg.msgPnl.grp5a.dd1.selection=textLocationDefault;\n\n\tdlg.msgPnl.grp6a =dlg.msgPnl.add('group');\n\tdlg.msgPnl.grp6a.orientation='row';\n\tdlg.msgPnl.grp6a.alignment='fill';\n\tdlg.msgPnl.grp6a.st1 = dlg.msgPnl.grp6a.add('statictext',undefined,'Font');\n\tfontlist = new Array();\n\tpsfontlist = new Array();\n\tfor (var i=0,len=app.fonts.length;i<len;i++) {\n\t\t//fontlist[i] = app.fonts[i].name;\n\t\ttry { \n\t\t\tif ( app.fonts[i].name!=app.fonts[i+1].name && app.fonts[i].name.indexOf(\"Acumin\") == -1) {\n\t\t\t\tfontlist.push(app.fonts[i].name);\n\t\t\t\tpsfontlist.push(app.fonts[i].postScriptName);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch(e) { \n\t\t\tif ( app.fonts[i].name.indexOf(\"Acumin\") == -1) {}\n\t\t\t\tfontlist.push(app.fonts[i].name);\n\t\t\t\tpsfontlist.push(app.fonts[i].postScriptName);\n\t\t\t}\n\t\t}\n\tdlg.msgPnl.grp6a.dd1 = dlg.msgPnl.grp6a.add('dropdownlist',undefined,fontlist);\n\tdlg.msgPnl.grp6a.dd1.selection=1;\n\n\tdlg.msgPnl.grp7a =dlg.msgPnl.add('group');\n\tdlg.msgPnl.grp7a.orientation='row';\n\tdlg.msgPnl.grp7a.alignment='fill';\n\tdlg.msgPnl.grp7a.st1 = dlg.msgPnl.grp7a.add('statictext',undefined,'Text Layer Style: ');\n\tdlg.msgPnl.grp7a.dd1 = dlg.msgPnl.grp7a.add('dropdownlist',undefined,textStyleList);\n\tdlg.msgPnl.grp7a.dd1.preferredSize.width = 160;\n\tdlg.msgPnl.grp7a.dd1.selection=textStyleDefault;\n\n\tdlg.msgPnl.grp8a =dlg.msgPnl.add('group');\n\tdlg.msgPnl.grp8a.orientation='row';\n\tdlg.msgPnl.grp8a.alignment='fill';\n\tdlg.msgPnl.grp8a.st1 = dlg.msgPnl.grp8a.add('statictext',undefined,'Image Layer Style:');\n\tdlg.msgPnl.grp8a.dd1 = dlg.msgPnl.grp8a.add('dropdownlist',undefined,imageStyleList);\n\tdlg.msgPnl.grp8a.dd1.preferredSize.width = 160;\n\tdlg.msgPnl.grp8a.dd1.selection=imageStyleDefault;\n\n\tdlg.msgPnl.SavePDFfile = dlg.msgPnl.add('group');\n\tdlg.msgPnl.SavePDFfile.orientation = \"row\";\n\tdlg.msgPnl.SavePDFfile.alignment='left';\n\tdlg.msgPnl.SavePDFfile.st = dlg.msgPnl.SavePDFfile.add('checkbox', undefined, 'Save PDF file');\n\tdlg.msgPnl.SavePDFfile.helpTip = \"Save a PDF file instead of a PSD file.\";\n\n\tdlg.msgPnl.SaveJPGfile = dlg.msgPnl.add('group');\n\tdlg.msgPnl.SaveJPGfile.orientation = \"row\";\n\tdlg.msgPnl.SaveJPGfile.alignment='left';\n\tdlg.msgPnl.SaveJPGfile.st = dlg.msgPnl.SaveJPGfile.add('checkbox', undefined, 'Save JPG file');\n\tdlg.msgPnl.SaveJPGfile.helpTip = \"Save a flat Jpeg file as well.\";\n\n\t// Add a panel with buttons to test parameters and\n\tdlg.buttonPanel = dlg.add('panel', undefined);\n\tdlg.buttonPanel.orientation = \"row\";\n\tdlg.buttonPanel.cancelBtn = dlg.buttonPanel.add ('button', undefined,'Cancel');\n\tdlg.buttonPanel.helpBtn = dlg.buttonPanel.add ('button', undefined,'Help');\n\tdlg.buttonPanel.runBtn = dlg.buttonPanel.add ('button', undefined,'Create Collages');\n\n\treturn dlg;\n\t}", "title": "" }, { "docid": "954930b5657afb66bce7e33018becd87", "score": "0.61672366", "text": "function _openPopup() {\n var $img = $('.starting-XI-image img');\n $img.on('load', function(){\n $('.starting-XI__form--submit .btn').show();\n $('.js-starting-XI-loading').hide();\n $('.starting-XI-image').trigger('click');\n });\n }", "title": "" }, { "docid": "e7664ecb2fa63c718b1e177efe7a5ab1", "score": "0.61478823", "text": "function showDialog(id, event) {\n event.stopPropagation();\n item = $('#' + id);\n posDialog = calculatePositionDialog(item);\n dialog.css({ top: posDialog[1], left: posDialog[0] });\n\n drawSymbolToDialog(item);\n $('#dialog-tags').html('Tags: ' + $('#' + id + '_tags').html());\n\n dialog.addClass('show');\n linkImage();\n}", "title": "" }, { "docid": "e125457961d10028f8dab83e141aeeb0", "score": "0.6127213", "text": "function IDialogShow() {}", "title": "" }, { "docid": "b32605377635944b48b7ac5cf7b30a63", "score": "0.6099329", "text": "function showDialog(kind)\r\n{\r\n // pause the game\r\n game.gameplay.pause();\r\n $(\"#dialog_container\").show();\r\n // show message\r\n $(\"#message\").attr('src', \"imgs/message_\" + kind + \".png\").show();\r\n $(\"#\"+kind).show();\r\n // make the game area transparent\r\n $(\"#game_area\").css(\"opacity\", 0.2);\r\n $(\"#running_man\").css(\"opacity\", 0.2);\r\n}", "title": "" }, { "docid": "6803a7dd22f345611dc07a1a0b1e83ac", "score": "0.6099143", "text": "function onInsertImageClick() {\n // Display journal dialog popup\n chooser.show(function(entry) {\n // No selection\n if (!entry) {\n return;\n }\n\n // Get object content\n var dataentry = new datastore.DatastoreObject(entry.objectId);\n dataentry.loadAsText(function(err, metadata, text) {\n //We load the drawing inside an image element\n var element = document.createElement('img');\n element.src = text;\n element.onload = function() {\n printImage = true;\n resizeImage = false;\n //We draw the drawing to the canvas\n var ctx = PaintApp.elements.canvas.getContext('2d');\n var imagedata = ctx.getImageData(0, 0, PaintApp.elements.canvas.width, PaintApp.elements.canvas.height);\n var xds= true;\n var width;\n var height;\n var x;\n var y;\n var imageWoRectangle;\n var touchScreen = ('ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);\n\n ctx.putImageData(imagedata, 0, 0);\n x = 65;\n y = 130;\n width = element.width;\n height = element.height;\n ctx.drawImage(element, x - 60, y - 125, width + 60, height + 70);\n imageWoRectangle = ctx.getImageData(0, 0, PaintApp.elements.canvas.width, PaintApp.elements.canvas.height);\n ctx.stroke();\n PaintApp.saveCanvas();\n ctx.beginPath();\n ctx.setLineDash([1, 10]);\n ctx.strokeStyle = '#101010';\n ctx.rect(x - 65, y - 130, width + 70, height + 80);\n ctx.stroke();\n\n //Calculate the size and print the image\n var imageMousemove = function(event) {\n if (printImage || resizeImage) {\n if(xds) ctx.putImageData(imagedata, 0, 0);\n if (touchScreen) event = event.touches[0];\n if (printImage) {\n x = event.clientX - (width/2);\n y = event.clientY - (height/2);\n } else {\n width = event.clientX - x;\n height = event.clientY - y\n }\n ctx.drawImage(element, x - 60, y - 125, width + 60, height + 70);\n imageWoRectangle = ctx.getImageData(0, 0, PaintApp.elements.canvas.width, PaintApp.elements.canvas.height);\n ctx.beginPath();\n ctx.setLineDash([1, 10]);\n ctx.strokeStyle = '#101010';\n ctx.rect(x - 65, y - 130, width + 70, height + 80);\n ctx.stroke();\n }\n }\n var imageMouseup = function(event) {\n if (printImage) {\n printImage = false;\n resizeImage = true;\n } else if (resizeImage) {\n if (touchScreen) event = event.touches[0];\n ctx.putImageData(imageWoRectangle, 0, 0);\n ctx.setLineDash([1]);\n imagedata = ctx.getImageData(0, 0, PaintApp.elements.canvas.width, PaintApp.elements.canvas.height);\n PaintApp.saveCanvas();\n ctx=0;\n printImage = false;\n resizeImage = false;\n\n /* If the activity is shared we send the element to everyone */\n if (PaintApp.data.isShared) {\n try {\n PaintApp.collaboration.sendMessage({\n action: 'toDataURL',\n data: {\n width: PaintApp.elements.canvas.width / window.devicePixelRatio,\n height: PaintApp.elements.canvas.height / window.devicePixelRatio,\n src: PaintApp.collaboration.compress(PaintApp.elements.canvas.toDataURL())\n }\n });\n console.log(width);\n } catch (e) {}\n\n }\n\n if (touchScreen) {\n removeEventListener(\"touchmove\", imageMousemove);\n removeEventListener(\"touchend\", imageMouseup);\n } else {\n removeEventListener(\"mousemove\", imageMousemove);\n removeEventListener(\"mouseup\", imageMouseup);\n }\n\n\n }\n }\n\n if (touchScreen) {\n addEventListener(\"touchmove\", imageMousemove, false);\n addEventListener(\"touchend\", imageMouseup, false);\n } else {\n addEventListener(\"mousemove\", imageMousemove);\n addEventListener(\"mouseup\", imageMouseup);\n }\n\n\n }\n });\n }, {mimetype: 'image/png'}, {mimetype: 'image/jpeg'});\n }", "title": "" }, { "docid": "e4ddd2e0aa66748943d8ff502b6904cf", "score": "0.60960174", "text": "function addPhoto() {\n\tdocument.getElementById(\"input_file\").click();\n}", "title": "" }, { "docid": "fb0054dcf827c41f9e9ff4d13ce22d98", "score": "0.607862", "text": "function openDialog(ev) {\n var element = document.getElementById(\"dialogWrapper\");\n element.style.zIndex = 99;\n element.style.opacity = 1;\n\n var details = document.getElementById(\"details\");\n details.style.visibility = \"hidden\";\n\n var dialog = document.getElementById(\"dialog\");\n dialog.style.visibility = \"visible\";\n dialog.style.zIndex = 100;\n dialog.style.opacity = 1;\n}", "title": "" }, { "docid": "1ba6f66a2671f8a15dd229b71d3ff32b", "score": "0.607272", "text": "function createDialog(titre,hasokbutton,okfonction){\nvar f = new Window ('palette',titre,undefined,{closeButton:true,resizeable:false});\nf.spacing = 2;\nf.margins = 5;\nf.alignChildren = ['fill','top'];\nf.groupe = f.add('group');\nf.groupe.alignChildren = ['fill','top'];\nvar fgroupeBoutons = addHGroup(f);\nfgroupeBoutons.alignment = ['fill','bottom'];\nfgroupeBoutons.margins = 10;\nif (hasokbutton)\n{\nvar fcancel = addButton(fgroupeBoutons,tr(\"Cancel\"));\nfcancel.onClick = function() { f.hide(); };\nfcancel.alignment = ['left','bottom'];\nvar fok = addButton(fgroupeBoutons,tr(\"OK\"));\nfok.alignment = ['right','bottom'];\nif (okfonction != undefined) fok.onClick = function() {f.hide(); okfonction();}\n}\nelse\n{\nvar fcancel = addButton(fgroupeBoutons,tr(\"Close\"));\nfcancel.onClick = function() { f.hide(); };\n}\n\nreturn f;\n}", "title": "" }, { "docid": "e20c301c1b316c518bc28f398327c0d8", "score": "0.60527617", "text": "function handler(e) {\n\n //id of the column that is clicked.\n let item = list[$(this).attr('id')];\n\n //Empty the dialog after each new onclick.\n $('#dialog').empty();\n //Dialog\n $( \"#dialog\" ).dialog({\n title: '',\n position: { my: 'top', at: 'top+75', of:window },\n closeOnEscape: true,\n width: 375,\n modal: true,\n });\n\n //Append stuff to dialog.\n $('<h2>').text(item.title).appendTo(\"#dialog\");\n $('<img>').addClass('img-fluid').attr('src',item.media.m).appendTo(\"#dialog\");\n\n }", "title": "" }, { "docid": "8b5f8c95cea7927024a1dd547067e4af", "score": "0.6032158", "text": "function clickBuy() {\n let $images = $('.toyImages');\n $images.click(\n function() {\n // call the dialog when the number of coins is insufficient to buy anything\n if (coins <= 40.20) {\n poorDialog();\n } else {\n //store the image source in a variable for converting to gif later\n pngStr = $(this).attr('src');\n console.log(pngStr);\n //decrease the user's coin when making a purchase\n coins = coins - 40.20;\n //convert image source from png to gif\n switchFormat();\n //show gif image in a dialog\n imageDialog();\n updateCoins();\n }\n })\n}", "title": "" }, { "docid": "64ebafe565a806c9d9b2b999c9c8277b", "score": "0.6019802", "text": "function clickedPhoto(event) {\n capturePhoto();\n }", "title": "" }, { "docid": "f62f6a5b85e40b53e8584e2d7931cc35", "score": "0.6012902", "text": "function openImageChooserDialog(options){\n\t\twindow._imageChooserDefered=new $.Deferred();\n\t\toptions=$.extend({},options);\n\t\tvar title=options.title||translate('fileManager.selectImage');\n\t\tvar width=options.width||850;\n\t\tvar filetype=options.filetype||'pic';\n\t\tvar dialogid=options.id||'wp-picmanage_panel';\n\t\tvar zindex=options.zIndex||1003;\n var multi=options.multi||0;\n var mask = options.overlay;\n\t\tif (typeof mask === 'undefined') mask = true;\n\t\t//show_dialog(parseToURL(\"wp_widgets\",\"common_pic_chooser\",{filetype:filetype}), title,width, 0);\n\t\twp_floatpanel(parseToURL('wp_widgets','common_pic_chooser',{filetype:filetype,multi:multi}),{\n\t\t\ttitle: title,\n\t\t\tid: dialogid,\n\t\t\twidth: width,\n\t\t\toverlay: mask,\n\t\t\tisCenter: true,\n\t\t\tswfFix: true,\n\t\t\tzIndex: zindex\n\t\t});\n\t\tif(!options.cancelNotCloseDialog){\n\t\t\twindow._imageChooserDefered.fail(function(){\n\t\t\t\t$.modal.close();\n\t\t\t})\n\t\t}\n\t\t\n\t\treturn window._imageChooserDefered.promise();\n\n}", "title": "" }, { "docid": "4e00e3b3ba471dd098bbaedd8cf163b6", "score": "0.60019445", "text": "function handlePlaceShowPhotoOptions(){\n\tcheckinPlacePhotoDialog.show();\n}", "title": "" }, { "docid": "50c3a832483f97081c37ad75390bdfe2", "score": "0.5971574", "text": "function photopopup (event){\n\tvar feature = event.target.getFeatures().getArray()[0];\n\tvar coordinate = feature.getGeometry().getCoordinates();\n\tvar photo = feature.get(\"Photo_Lo_1\");\n\tvar water = feature.get(\"Where_is_w\");\n\tvar gage = feature.get(\"Nearest__1\");\n\tvar gagereading = feature.get(\"Gage_Readi\");\n\tvar photoHtml = '<img src=\"' + photo + '\" class = \"popup-photo\" />';\n\tvar waterHtml = '<p>Water depth: ' + water + '</p>';\n\tvar usgsHtml = '<p>Nearest USGS gage: ' + gage + '</p>';\n\tvar readingHtml = '<p>Gage reading at time of photo: ' + gagereading + ' ft </p>';\n\tvar html = photoHtml + waterHtml + usgsHtml + readingHtml;\n\t$('#photopopup-content').html(html);\n\toverlay.setPosition(coordinate);\n \t$('#popup-closer').on('click', function() {\n \t overlay.setPosition(undefined);\n\t this.blur();\n\t return false;\n });\n}", "title": "" }, { "docid": "574a66c7be407d76a561e3a973110a9d", "score": "0.5959139", "text": "function browseFile()\n{\n var\tform\t= document.picForm;\n image\t= window.open(\"Images\", \"image\");\n}", "title": "" }, { "docid": "8393b573fd72772a0b7d80c5774d25e7", "score": "0.59393203", "text": "function showImage(id,category)\r\n{\r\n try\r\n {\r\n //determine orientation:\r\n var location = window.location.toString();\r\n var width = 680;\r\n var height = 550;\r\n \r\n var src = \"/popup.htm?img=\" + id + \"&category=\" + category;\r\n var w = window.open(src,\"gallery\",\"left=20,top=20,width=\" + width + \",height=\" + height + \",toolbar=0,resizable=0\")\r\n w.focus();\r\n }\r\n \r\n catch(e)\r\n {\r\n alert(\"Error in method showImage(): \"+e.message)\r\n }\r\n}", "title": "" }, { "docid": "19ea12b6e342df62f0146f6698982a49", "score": "0.5929296", "text": "function onImageClick(evt) {\n showImage(evt.target);\n }", "title": "" }, { "docid": "664b0fbb309c732a38b273f360acb1ec", "score": "0.59264195", "text": "function Box(canv, n, arr, num, title, func, dis){\n\tvar sel = null;\n\t$(canv).attr('title', title);\n\tvar canvas = document.createElement(\"canvas\");\n\tvar overlay = document.createElement(\"canvas\");\n\t\n\tcanvas.width = arr.length * cardWidth;\n\tcanvas.height = cardHeight;\n\tcanvas.style.left = \"0px\";\n\tcanvas.style.top = \"0px\";\n\tcanvas.style.position = \"absolute\";\n\tcanvas.id = \"can\";\n\t\n\toverlay.width = canvas.width;\n\toverlay.height = canvas.height;\n\toverlay.style.left = \"0px\";\n\toverlay.style.top = \"0px\";\n\toverlay.style.position = \"absolute\";\n\t\n\t//add mouse listeners\n\t\n\n\t//Create canvas for display\n\t//$(canv).empty();\n\t$(canv).append(canvas);\n\t$(canv).append(overlay);\n\t\n\t$mydialog = $(canv).dialog({\n\t\tcloseOnEscape: false,\n\t open: function(event, ui) {\n\t $(\".ui-dialog-titlebar-close\", ui.dialog | ui).hide();\n\t },\n\t dialogClass: \"no-close\",\n\t resizable: false,\n draggable: false,\n\t modal: true,\n\t width: 500,\n\t height: 300,\n\t show: {\n\t\teffect: \"slide\",\n\t\tduration: 300\n\t\t},\n\t hide: {\n\t\teffect: \"fade\",\n\t\tduration: 300\n\t\t},\n\t\tposition: {\n my: \"left\",\n at: \"left\",\n of: $('#field')\n },\n\t buttons: [\n\t {\n\t id: \"button_ok\",\n\t text: \"OK\",\n\t click: function() {\n\t \tif (sel != null){\n\t \t\tfunc(sel.selection().sort().reverse(), arr);\t \t\t\n\t \t}\t\n\t \t //Delete canvasses\n\t\t\t\n\t $( this ).dialog( \"close\" );\n\t $(this).dialog('destroy').remove();\n\t //Readd div\n\t $(\"#wrapper\").append(\"<div id='dialog'></div>\")\n\t }\n\t }\n\t ]\n\t});\n\tif (dis){\n\t\t$('#button_ok').button('disable');\n\t}\n\tif (arr.length == 0){\n\t\t$('#button_ok').button('enable');\n\t}\n\n\tvar offset = $('#field').offset().left;\n\toverlay.addEventListener(\"mousedown\", \n\t\tfunction(event){\n\t\t\t\n\t\t\tif (sel == null){\n\t\t\t\tsel = new MultiSelection(overlay, n);\n\t\t\t} \n\t\t\tsel.select(event, arr.length, offset);\n\t\t\t$('#button_ok').button('enable');\n\t\t}, \n\tfalse);\n\t\n\tvar ctx = canvas.getContext('2d');\n\t//draw the cards\n\tfor (index = 0; index < arr.length; index++){\n\t\tvar posX = cardWidth * index;\n\t\tarr[index].drawImg(ctx, posX, 0, cardWidth, cardHeight);\n\t}\n\n}", "title": "" }, { "docid": "8088016819f9fdcb3aa58aaac6ea98f7", "score": "0.59169585", "text": "function image(e) {\r\n var SearchImgModal = document.getElementById(\"SearchImgModal\");\r\n\r\n // Get the image and insert it inside the modal - use its \"alt\" text as a caption\r\n // var img = document.getElementById('myImg');\r\n var img = jQuery(e).attr(\"id\");\r\n\r\n var modalImg = document.getElementById(\"img01\");\r\n var captionText = document.getElementById(\"caption\");\r\n\r\n SearchImgModal.style.display = \"block\";\r\n modalImg.src = jQuery(e).attr(\"src\");\r\n captionText.innerHTML = jQuery(e).attr(\"alt\");\r\n\r\n // Get the <span> element that closes the modal\r\n var span = document.getElementsByClassName(\"close\")[0];\r\n\r\n // When the user clicks on <span> (x), close the modal\r\n span.onclick = function() {\r\n SearchImgModal.style.display = \"none\";\r\n };\r\n}", "title": "" }, { "docid": "8027f0c5a57929272269ce2746f89b7e", "score": "0.59114", "text": "function openImageModal(clicked_img_src, clicked_img_alt) {\n document.getElementById('image-modal').style.display = \"block\";\n document.getElementById(\"img-clicked\").src = clicked_img_src;\n // use its \"alt\" text as a caption\n document.getElementById(\"image-modal-caption\").innerHTML = clicked_img_alt;\n }", "title": "" }, { "docid": "71493c7541a151236d71bac0efd85cdd", "score": "0.5906955", "text": "function modalTrigger(imgpath) {\n var modal = document.getElementById('walkthrough_list_modal');\n var modalImg = document.getElementById(\"modal_image\");\n modal.style.display = \"block\";\n modalImg.src = imgpath;\n}", "title": "" }, { "docid": "aa4d829b959eccfaded80a298d1af4ea", "score": "0.5906775", "text": "function dialogue(content, title) {\n content = $('<div />', {\n 'class': 'dialogue clearfix'\n }).append(content);\n\n $.iLightBox([\n {\n URL: content,\n type: \"html\",\n title: (title) ? title : null\n }\n ],\n {\n skin: 'metro-white ilightbox-dialogue',\n minScale: 1,\n innerToolbar: true,\n show: {\n effect: false\n },\n hide: {\n effect: false\n },\n overlay: {\n blur: false\n },\n controls: {\n fullscreen: false\n },\n callback: {\n // Hide the iLightBox when any buttons in the dialogue are clicked\n onRender: function(api) {\n $('.btn', api.currentElement).click(function(){\n $('.btn', api.currentElement).unbind('click');\n api.hide();\n });\n },\n // Hide the iLightBox when any buttons in the dialogue are clicked\n onShow: function(api) {\n $('.btn-primary', api.currentElement).focus();\n }\n }\n });\n }", "title": "" }, { "docid": "41cc2d59339b91e511624d3af8767ee7", "score": "0.5903441", "text": "function onClick(element) {\n document.getElementById(\"img01\").src = element.src;\n document.getElementById(\"modal01\").style.display = \"block\";\n}", "title": "" }, { "docid": "ab0edce855adf2cdfb23f97816e144fa", "score": "0.58891225", "text": "function xOrODialogBox(){\n $(\"#xOrO\").dialog({autoOpen: true,\n modal: true,\n show:{\n effect: \"fade\",\n duration: 1000\n },\n hide:{\n effect: \"fade\",\n duration: 1000\n }\n });\n \n}", "title": "" }, { "docid": "c81951c91ac6c10367cd15d30b07740f", "score": "0.58722496", "text": "function openModalAlbum(musique){\n\tevent.target.style.color = \"white\";\n\tdocument.getElementById(\"fader\").style.display=\"block\";\n\tdocument.getElementById(\"popup_artiste\").innerHTML=\"\";\n\tlet popup_artiste = document.getElementById(\"popup_artiste\");\n\tlet div_info = document.createElement(\"div\");\n\tdiv_info.className = \"div_info\";\n\tdiv_info.innerHTML = \"<img src=\" + musique.img_album + \" style=width:400px>\" + \"<div id='nom_album'>\" + musique.nom_album + \"</div>\";\n\tdiv_info.style.fontSize = \"40px\";\n\tdiv_info.style.textAlign = \"center\";\n\tdiv_info.style.color = \"white\";\n\tdiv_info.style.width=\"380px\";\n\tdiv_info.style.marginLeft=\"auto\";\n\tdiv_info.style.marginRight=\"auto\";\n\tdiv_info.style.marginTop=\"100px\";\n\tdiv_info.style.marginBottom=\"100px\";\n\tpopup_artiste.appendChild(div_info);\n}", "title": "" }, { "docid": "4523e65c63023d6d948d096b27dc656e", "score": "0.5866535", "text": "function displayDialog ( )\n{\n var modal= document.getElementById('modal');\n var shade= document.getElementById('shade');\n \n //\n // if these elements do not exist, there is nothing to display\n //\n if (modal != null && shade != null)\n {\n modal.style.display = 'block';\n shade.style.display = 'block';\n document.getElementById('close_dialog').onclick= function() {\n modal.style.display=shade.style.display= 'none';\n };\n }\n}", "title": "" }, { "docid": "cce0ba64a942ce8f474f8ef70a569c14", "score": "0.5855022", "text": "function openFrame(e) {\n\tgalleryObscure();\n\t$('#feature-photo').attr('src', $(e.target).attr('full'));\n\t$('#photo-name').html(e.target.name);\n\t$('#photo-desc').text($(e.target).attr('desc'));\n\t// waits until image is loaded to open modal\n\t$('#feature-photo').on('load', function() {\n\t\t$('.aligner-hidden').addClass('aligner');\n\t\taddClickOutsideEventListener();\n\t})\n}", "title": "" }, { "docid": "1bfe273ed0acab9a9bddbad3cc499dba", "score": "0.58527356", "text": "function startDialog(_target)\n{\n\n}", "title": "" }, { "docid": "5855dbfb4d6b88a383f7538fa4985be6", "score": "0.58450925", "text": "function fake_photo(element_id, event) {\n\tconsole.log(element_id, event);\n\n\t//\tneeds implementation\n\t// if (!hasChosenFile) {\n\t// \tevent.preventDefault();\n\t// \tdocument.getElementById(element_id).click();\n\t// }\n\t// document.getElementById(element_id).click();\n}", "title": "" }, { "docid": "d250f55a21e251b78a9db7032d807f78", "score": "0.58436257", "text": "function openPhotoBox(){\n\tdocument.getElementById('photobox').style.display = document.getElementById('photobox').style.display == 'block' ? 'none' : 'block';\n}", "title": "" }, { "docid": "166764ff3cba0316f3113c67951d2750", "score": "0.5824379", "text": "function openImage(image, item) { //opens image in about with modal\n var modals = ['world', 'coding', 'cat', 'music', 'books'];\n\n // gets click-me content\n var clickMe1 = document.getElementById(\"arrow-gif\");\n var clickMe2 = document.getElementById(\"arrow-gif-text\");\n\n // Get the modal\n var modal = document.getElementById(item);\n\n // Get the image and insert it inside the modal - use its \"alt\" text as a caption\n modal.style.display = \"block\";\n\n // closes click me after first click\n clickMe1.style.display = \"none\";\n clickMe2.style.display = \"none\";\n\n // closes other modals\n for(var i = 0; i < modals.length; i++) {\n if(modals[i].localeCompare(item) != 0) {\n document.getElementById(modals[i]).style.display = \"none\";\n }\n \n }\n\n // Get the <span> element that closes the modal\n var span = document.getElementsByClassName(\"close \" + item)[0];\n\n // When the user clicks on <span> (x), close the modal\n span.onclick = function() { \n modal.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "66df0dc1ec5f0a189f8ad71e13b32be4", "score": "0.58211505", "text": "function handleAvatarPopupOkButton(){\n\tif(validateAvatarPopup()){\n\t\tif(SOUNDS_MODE){\n\t\t\taudioClick.play();\t\n\t\t}\n\t\n\t\tsetPlayerImagesLabels();\n\t\tdestroyAvatarPopupView();\n\t\tavatarPopupImageChanged = false;\n\t} else {\n\t\tif(SOUNDS_MODE){\n\t\t\taudioError.play();\t\n\t\t}\n\t\t\n\t\tavatarPopupLabel2.color = 'red';\n\t\tavatarPopupLabel2.text = 'Επέλεξε όνομα και avatar..';\n\t}\n}", "title": "" }, { "docid": "1dc25c6417427bc844e9ea1d1ace90e9", "score": "0.58150417", "text": "function showNewPhotoPage() {\n newPhotoDiv.style.display = \"block\";\n}", "title": "" }, { "docid": "fcc14da42f0ccceadbb361fc00cf88b5", "score": "0.5809463", "text": "function UpdateLogoDialog() {\n\n $('.logo_dialogbox').attr(\"title\", \"File Upload\");\n jQuery('.logo_dialogbox').dialog({\n autoOpen: true,\n closeOnEscape: false,\n width: 300,\n height: 150,\n modal: true,\n draggable: false,\n resizable: false,\n create: function (event, ui) {\n dlg = jQuery(\"div.ui-dialog\").detach();\n jQuery(\"form\").append(dlg);\n }\n });\n}", "title": "" }, { "docid": "1fa78ce84d00d9f7c1ed9d8a5c8d72c3", "score": "0.5803404", "text": "function mostrarclick(nombreaccesorio, descripcion, imagen) {\n\n $.confirm({\n title: '<span class=\"title_confirmjs\">' + nombreaccesorio + '</span>',\n columnClass: 'col-md-6 col-md-offset-3',\n content: '' + `<div class='report-module'>\n <div class=\"text-center\">\n <img src=\"../` + imagen + `\" class=\"imagepreview\">\n </div>\n <div class='post-content'>\n <p class='description'>` + descripcion + `</p>\n </div>\n </div>`,\n draggable: true,\n backgroundDismiss: true,\n buttons: {\n Cerrar: {\n btnClass: 'btn-blue',\n action: function () {}\n },\n }\n });\n}", "title": "" }, { "docid": "816585f657558608d2350ec177fa20dc", "score": "0.5802513", "text": "showImageDialog() {\n const dialogOptions = {\n showIcons: false,\n multiSelection: false\n };\n\n // Request user to select image\n Buildfire.imageLib.showDialog(dialogOptions, (err, result) => {\n if (err) return console.error(err);\n\n // Stop if we don't have any images\n if (!result || !result.selectedFiles || !result.selectedFiles.length) {\n return;\n }\n\n this.setState({ image: result.selectedFiles[0] });\n });\n }", "title": "" }, { "docid": "783426a0669c917dc16cd19f86ed0f80", "score": "0.57987005", "text": "function pfDialog(){ }", "title": "" }, { "docid": "b1c7ec5bd4545d2b7520b27a01f18d98", "score": "0.578994", "text": "function OnUserProfileDocumentReady() {\n $(\"#openFileDialog\").click(function() {\n $(\"#userImage\").click();\n });\n \n}", "title": "" }, { "docid": "42934efc195a456c726f30f9ac7a3098", "score": "0.5786863", "text": "function CommentFormDlg(url, dlgTitle, urlNew, EntityId) {\n showLoadingDialog();\n var quizObject = $(\"#ExternalResponse\");\n var ImageclassId = EntityId;\n quizObject.empty();\n quizObject.dialog(\n\n {\n bgiframe: true,\n autoOpen: false,\n title: dlgTitle,\n height: 400,\n width: 800,\n buttons:\n {\n \"Close\": function() { $(this).dialog(\"destroy\"); },\n \"New\": function() {\n $(this).dialog(\"destroy\");\n // if (ImageclassId != null) {\n // AddComentsclassImage(ImageclassId);\n // }\n\n ExternalResponseNewDlg(urlNew, 0);\n\n\n\n }\n }\n }\n );\n\n quizObject.load(url, {}, function() {\n $(\"#FormSubmit\").css('visibility', 'hidden');\n $(this).dialog(\"open\");\n hideLoadingDialog();\n });\n\n\n\n return false;\n}", "title": "" }, { "docid": "ad14fe4cf1ece08b02db89c2761a4df5", "score": "0.57744706", "text": "function patientBtnPressedPatientContext (fName, sName, id) {\n \tconsole.log(\"-----------patientBtnPressedPatientContext function\");\n \t$(\"#display\").empty();\n\t$(\"#dialog1\").empty();\n \t$(\"#dialog1\").append(\"<p>Please select the ward to place patient</p><p>\"+fName+\" \"+sName+\"</p>\");\n \tpatientLoaded=true;\n \n $( \"#dialog1\" ).dialog({\n modal: true,\n buttons: {\n Ok: function() {\n \tconsole.log(\"CALLED getWards()\");\n \t getWards(); \t\t\t\n $( this ).dialog( \"close\" );\n }\n } \n }).dialog(\"open\");\n}", "title": "" }, { "docid": "b39df52983e30b1a51e6eabecde277c5", "score": "0.57743937", "text": "popup(){}", "title": "" }, { "docid": "050b07344da4cb49bb487c4e4998a883", "score": "0.5765635", "text": "function chooseLevelDialogBox(){\n userTurn = true;\n gameOver = false;\n flashCounter = 0;\n $(\"#choose-level\").dialog({autoOpen: true, modal: true, show:{\n effect: \"fade\",\n duration: 1000\n },hide:{\n effect: \"fade\",\n duration: 1000\n } \n });\n \n}", "title": "" }, { "docid": "7a254cd77266d8d47fdfeda102718de4", "score": "0.576514", "text": "function loadRaceDialog() {\n var humanImg, elfImg, dwarfImg;\n\n humanImg = $(\"#select-human\").find(\"img\");\n elfImg = $(\"#select-elf\").find(\"img\");\n dwarfImg = $(\"#select-dwarf\").find(\"img\");\n\n //Cargar imagenes del dialog de selesccion de raza\n humanImg.attr('src', './img/race-human.png');\n elfImg.attr('src', './img/race-elf.png');\n dwarfImg.attr('src', './img/race-dwarf.png');\n\n //Asignar los handlers que se encargaran de ver que raza se escoge\n humanImg.click(() => {\n selectChaaracter(\"human\");\n });\n elfImg.click(() => {\n selectChaaracter(\"elf\");\n });\n dwarfImg.click(() => {\n selectChaaracter(\"dwarf\");\n });\n}", "title": "" }, { "docid": "68ccee2e076cea743434306936937647", "score": "0.5763782", "text": "function popUp(url) {\n \n setDisplay('smokescreen'); \n \n if( document.getElementById('popUpBox').style.display=='none' ) { \n \n document.getElementById('popUpBox').style.display = '';\n \n document.getElementById('popUp').innerHTML = \"<a onclick=\\\"setDisplay('popUpBox'); setDisplay('smokescreen');\\\"><img src=\\\"\" + url + \"\\\" \\/>\\<\\/a>\\<\\/p>\";\n \n } \n \n else { \n document.getElementById('popUpBox').style.display = 'none';\n }\n \n }", "title": "" }, { "docid": "71512cd48635efa9c32c0cc4fe3001a1", "score": "0.57609516", "text": "function openFreeSamplePurchaseAlert(){\n\t $(\"#freesamplepurchasePopup\").html(trackObjects[SeqID].freesamplemessage);\n\t $(\"#freesamplepurchasePopup\").dialog({\n resizable: false,\n draggable: false,\n modal: true, \n height: 250,\n width: 300,\n buttons: {\n \"Purchase\": function () {\n $(this).dialog('close');\n PurchaseContent(true);\n },\n \"Cancel\": function () {\n $(this).dialog('close');\n PurchaseContent(false);\n }\n }\n });\n $(\"#freesamplepurchasePopup\").show();\n}", "title": "" }, { "docid": "771d8b0365b3f3ab8839734729777868", "score": "0.575984", "text": "function displayMatchDialog(){\n\t$('#newMatch').removeClass(\"disableBackground\");\n\t$('#newMatch').addClass(\"newMatch\");\n\t$('#newMatch').addClass(\"dialog\")\n\t$('#newMatch').addClass(\"op-match--overlay\")\n\t$('#newMatch').show();\n\t$('#overlay').addClass(\"overlay\")\n\t$('#overlay').show();\n}", "title": "" }, { "docid": "9f072895ab9f5ce0755199d740aa11f8", "score": "0.57597524", "text": "function dialogUploadShopPicLoading(obj_frm)\r\n{\r\n\tvar notice_str = '<div class=\"addarea\"><div class=\"lyaeriIcon\"><div class=\"addfont\">圖片上傳中!! <br />若上傳成功,待iPeen管理小組審查後即可顯示囉!!</div></div></div>';\r\n\tobj_frm.submit();\r\n\tDialogShowByData(notice_str,250,58);\r\n\t//setTimeout(\"DialogHide()\",2500);\r\n\t//return false;\r\n}", "title": "" }, { "docid": "326f684d947b348fd9f69d634f5b4eec", "score": "0.574656", "text": "function imgPopBots(){\n$('a.external,button.external').unbind('click');\n$('a.external,,button.external').click(function(ev) {\n ev.preventDefault();\n activeSelect=$(this).prevAll(\".form-control.imagen\").first();\n var target = $(this).attr(\"href\")+\"?popup=true\";\n console.log(target);\n\t$(\"#externalModal .modal-body\").html('<iframe width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"yes\" allowtransparency=\"true\" src=\"'+target+'\"></iframe>');\n\t$(\"#externalModal\").modal(\"show\");\n });\n/* fin external modal, para imagenes, etc ***/\n\n}", "title": "" }, { "docid": "c16c83c4446361a7a2d1ac0ba3958871", "score": "0.5743548", "text": "_onSelectImagePicker() {\n\t\tAlert.alert(\n\t\t\t'Sélectionnez une image',\n\t\t\t\"Accédez votre bibliothèque ou lancez l'appareil photo.\",\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttext: 'Appareil photo',\n\t\t\t\t\tonPress: () => this._launchCamera(),\n\t\t\t\t},\n\t\t\t\t{ text: 'Bibliothèque', onPress: () => this._pickImage() },\n\t\t\t\t{\n\t\t\t\t\ttext: 'Annuler',\n\t\t\t\t\tonPress: () => {},\n\t\t\t\t\tstyle: 'cancel',\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ cancelable: false }\n\t\t);\n\t}", "title": "" }, { "docid": "4fc65d90bdcbe360c61df68979b1d8a4", "score": "0.57387954", "text": "function box_clicked(url){\n $('#view').attr('src', URLBASE + url.data);\n $('.modal-wrap').show();\n $('body').add('html').css('overflow', 'hidden');\n }", "title": "" }, { "docid": "f3a59639f3fcfd624b1f0e6fe111f5c2", "score": "0.57337546", "text": "function graphicpopup(title,src) {\n if (typeof popupwin != \"undefined\") {\n popupwin.close();\n }\n popupwin = window.open(\"\",\"popup\",\"resizable\");\n html = \"<HTML>\\n<HEAD>\\n<TITLE>\" + title + \"</TITLE>\\n\" + \n \"<BODY>\\n\" +\n \"<img src=\" + \"'\" + \"images/\" + src + \"'\" + \">\" + \"\\n\" +\n \"</BODY>\\n</HTML>\\n\";\n popupwin.document.write(html);\n popupwin.document.close();\n}", "title": "" }, { "docid": "f9f348eff9b015db4023d9c2a4784b38", "score": "0.57328457", "text": "function mouseClicked(){\n mouseClickedDialogue();\n}", "title": "" }, { "docid": "be82d08ce240111fd4fb66229d9b47e4", "score": "0.57303953", "text": "function open(dialog) {\n\t\n}", "title": "" }, { "docid": "274f8551e97958222786da202c9178ad", "score": "0.57294047", "text": "function openImagePopUp(imageURL) {\n var popUpWrapper = document.getElementById(\"popUpWrapper\");\n popUpWrapper.style.display = \"flex\";\n var popUpImage = document.getElementById(\"popUpImage\");\n popUpImage.src = imageURL;\n}", "title": "" }, { "docid": "982354dfd48d1dd345937b4628e57c46", "score": "0.57288545", "text": "function addPhoto(){\n //hammer appear\n hammer=createImg('assets/image/hammera.jpg');\n hammer.position(180,120);\n hammer.size(400,500);\n\n button1=createButton('apple?')\n button1.mousePressed(addApple);\n button1.position(570,300);\n button2=createButton('Angle iron?')\n button2.mousePressed(addAngle);\n button2.position(100,400);\n button3=createButton('Sponge?')\n button3.mousePressed(addSponge);\n button3.position(150,200);\n button4=createButton('Glasses?')\n button4.mousePressed(addGlasses);\n button4.position(550,500);\n button5=createButton('Balloon?')\n button5.mousePressed(addBalloon);\n button5.position(220,550);\n button6=createButton('Canned fish?')\n button6.mousePressed(addCan);\n button6.position(520,150);\n}", "title": "" }, { "docid": "0c08ea34c2824c2cf39042d9e449abd4", "score": "0.5727592", "text": "function popImg(img_id){\n var modal = document.getElementById(\"myModal\");\n // Get the image and insert it inside the modal - use its \"alt\" text as a caption\n var img = document.getElementById(img_id);\n var modalImg = document.getElementById(\"img01\");\n var captionText = document.getElementById(\"caption\");\n modal.style.display = \"block\";\n modalImg.src = img.src;\n captionText.innerHTML = img.alt;\n // Get the <span> element that closes the modal\n var span = document.getElementsByClassName(\"close\")[0];\n // When the user clicks on <span> (x), close the modal\n span.onclick = function() {\n modal.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "c6c015b19145e66c3676432bfb97aac7", "score": "0.5725865", "text": "function outcomeDialog(string){\n clickable = false;\n $(\".outcome\").css(\"display\", \"none\");\n if(string == \"win\"){\n $(\"#win\").css(\"display\", \"block\");\n }else if(string == \"tie\"){\n $(\"#tie\").css(\"display\", \"block\");\n }else if(string == \"loss\"){\n $(\"#loss\").css(\"display\", \"block\");\n }\n $(\"#play-again\").dialog({\n autoOpen: true,\n modal: true,\n show:{\n effect: \"fade\",\n duration: 1000\n },hide:{\n effect: \"fade\",\n duration: 1000\n }\n })\n}", "title": "" }, { "docid": "ba35eff0b7f75fae3130a61140c6c5ac", "score": "0.571325", "text": "function startBasicTutorial() {\n var next_img_btn = $('#next_img');\n next_img_btn.prop('onclick', null).off('click');\n\n // Building the tutorial dialog\n var title = 'Stimmung im Bild';\n var message = $('<div></div>').load('views/dialogs/dia_tutorial_image_front.html');\n var btn_name = 'Weiter';\n var callafter = function () {\n flipIn(5);\n setTimeout(function () {\n viewRightTutorialOverlay(\n 'Stichworte erstellen',\n $('<div></div>').load('views/dialogs/dia_tutorial_image_back.html'),\n 'Weiter',\n function () {\n enableTagFieldAndButton();\n next_img_btn.click(nextTutorialImage);\n },\n true);\n }, 5000);\n };\n var close = true;\n viewRightTutorialOverlay(title, message, btn_name, callafter, close);\n}", "title": "" }, { "docid": "7b80394df9652f1b341bc69bcd636f86", "score": "0.5699744", "text": "function insertImage(e, data) {\n\n $(\"#image_asset_list\").html(Template.image_list());\n $(data.popup).css('margin-left', '-348px');\n\n // Wire up the submit button click event\n $(data.popup).find(\".file-row\").click(function(e) {\n e.preventDefault();\n var editor = data.editor;\n editor.execCommand(data.command, '<img src=\"'+$(this).data('link')+'\" />', null, data.button);\n\n editor.hidePopups();\n editor.focus();\n });\n\n }", "title": "" }, { "docid": "f55ba262da75f1af8067b200e06dca02", "score": "0.56985873", "text": "function addDialog() {\n // Dynamically create a div and store it in a variable.\n //Set its title at the same time.\n let $dialog = $(`<div></div>`).attr(`title`, `PLEASE VERIFY YOUR AGE`);\n // Add a p tag to the dialog div that contains the question text\n $dialog.append(`<p>${question}</p>`);\n //add the div to the page\n $('body').append($dialog);\n //if \"yes\" is clicked, use is allowed into the webiste;\n //if \"no\" is clicked, nothing changes but user is not allowed to use the site\n $dialog.dialog({\n autoOpen: true,\n modal: true,\n dialogClass: 'no-close',\n buttons: {\n \"YES, I AM UNDER 18\": function() {\n $(this).dialog(`close`);\n },\n \"NO\": function() {\n $(this).effect(`shake`);\n }\n },\n // contained within the body tag, and can't be dragged out of it.\n containment: 'body'\n });\n}", "title": "" }, { "docid": "b8e27878ccfb2ddbcfc58890bdd09a8d", "score": "0.5698234", "text": "function onclick_preview_box(){\n $(\"#myfile\").click();\n}", "title": "" }, { "docid": "4c83983ba8ee528313e6bce93dbfd683", "score": "0.56929916", "text": "function showImage(pic) {\r\n console.log(pic.src);\r\n var modalImage = document.getElementById('modalImage');\r\n modalImage.src = pic.src;\r\n }", "title": "" }, { "docid": "a0aaafa29bc47d45af28ad820678a213", "score": "0.5688202", "text": "function changeURLImage() {\n $(\"#changeImagePopup\").show();\n}", "title": "" }, { "docid": "3fbc55bd1a4e3dee489225ea9fe89225", "score": "0.56877506", "text": "function openDialog() {\n var colorBoxOptions = {\n iframe: true,\n width: sizeLarge.w,\n height: sizeLarge.h,\n href: url,\n id: 'something_unique',\n onComplete: handlePostmessage\n };\n\n $.colorbox(colorBoxOptions);\n}", "title": "" }, { "docid": "423ea2508368c4d27c4834aeed9d9ee3", "score": "0.5686819", "text": "function selectFilePrompt() {\n s.avatarInput.click();\n }", "title": "" }, { "docid": "0dc1dae48db02f1f101e1c45ffb57ae9", "score": "0.56802994", "text": "function absClick() {\n\n var name = \"Abstract Syntactic Structure [OCaml]\";\n var desc = \"Designed, built, and debugged a lexer, parser,\\\n and interpreter for small-scale C programs using \\\n abstract syntactic structure and imperative programming. \\\n Then, fed the interpreter a C program to evaluate \\\n and output.\";\n\n // fade out container\n container.style.opacity = 0.1;\n\n // bring modal to front\n modal.style.display = \"block\";\n\n // adjust modal information and set github link\n document.getElementById(\"projectName\").innerHTML = name;\n document.getElementById(\"projectDescription\").innerHTML = desc;\n document.getElementById(\"projectImage\").src = \"./images/PNG/abstract-syntactic-structure-small.png\";\n document.getElementById(\"github-icon\").style.display = \"none\";\n\n // set modal state\n modalState = \"open\";\n}", "title": "" }, { "docid": "d8a84c1564fb77b40ad7dc41de198b8d", "score": "0.5677445", "text": "function picPop(tsvId, caption) {\n // need picNo reference:\n var picNo = 0;\n for (var x = 0; x < noOfPix; x++) {\n if (caption == captions[x]) {\n picNo = x;\n break;\n }\n }\n var nomapper = false;\n $('.mpguse').each(function () {\n if ($(this).val() == tsvId && $(this).hasClass('nomap')) {\n nomapper = true;\n return;\n }\n });\n var htmlDesc = '<p class=\"capLine\">' + caption;\n if (nomapper) {\n htmlDesc += '<br /><span style=\"color:brown\">No Location Data: ' +\n 'Photo Cannot Be Mapped</span></p>';\n }\n else {\n htmlDesc += '</p>';\n }\n $('.popupCap').css('display', 'block');\n $('.popupCap').css('position', 'absolute');\n $('.popupCap').css('top', capTop[picNo]);\n $('.popupCap').css('left', capLeft[picNo]);\n $('.popupCap').css('width', capWidth[picNo]);\n $('.popupCap').css('z-index', '10');\n $('.popupCap').prepend(htmlDesc);\n return;\n}", "title": "" }, { "docid": "2920c46dee96881588b99c64f92aa1f3", "score": "0.5674413", "text": "function showDialog() {\n // Making a dialog window that slowly fades in\n $('#dialog').fadeIn(\"slow\").dialog({\n // Adding options with anonymous functions\n buttons: {\n \"Yes\": function() {\n // The experiment state is called\n clickExperimentState();\n // The current dialog closes\n $(this).dialog('close');\n },\n \"No\": function() {\n // The current dialog closes\n $(this).dialog('close');\n }\n }\n });\n // A sound effect plays\n dialogSFX.play();\n}", "title": "" }, { "docid": "db5392afb027ac42c83e4ebbbce55160", "score": "0.56738615", "text": "function newGroup(){\n self.displayNewGroupDialog();\n}", "title": "" }, { "docid": "07277603332938bd0561ca63bed6f803", "score": "0.5672258", "text": "function PreviewDialog(image, metadata)\n{\n this.__base__ = Dialog;\n this.__base__();\n this.restyle();\n\n this.previewControl = new PreviewControl(this);\n this.previewControl.SetImage(image, metadata);\n\n // Buttons\n\n this.ok_Button = new PushButton(this);\n this.ok_Button.defaultButton = true;\n this.ok_Button.text = \"Close\";\n this.ok_Button.icon = this.scaledResource( \":/icons/close.png\" );\n this.ok_Button.onClick = function ()\n {\n this.dialog.ok();\n };\n\n this.buttons_Sizer = new HorizontalSizer;\n this.buttons_Sizer.scaledSpacing = 6;\n this.buttons_Sizer.addStretch();\n this.buttons_Sizer.add(this.ok_Button);\n\n // Global sizer\n this.sizer = new VerticalSizer;\n this.sizer.scaledMargin = 8;\n this.sizer.scaledSpacing = 6;\n this.sizer.add(this.previewControl);\n this.sizer.addSpacing(2);\n this.sizer.add(this.buttons_Sizer);\n\n this.windowTitle = \"Preview annotation\";\n this.adjustToContents();\n this.resize(800, 800);\n}", "title": "" }, { "docid": "fe46ab39067d88a8dbc48f263fdbdf3d", "score": "0.5668528", "text": "function openPicture(modal, img_src) {\n\tif (modal == null) return;\n\tmodal.classList.add('active');\n\toverlay.classList.add('active')\n\tmodal.querySelector('.opened_image').src = img_src;\n\tmodal.querySelector('.signin_input').classList.remove('error_fields');\n}", "title": "" }, { "docid": "afd11af00bb403836539ea16c4db21ff", "score": "0.56636447", "text": "function about_okAction(event) {\n\t$( \"#about_dialog\" ).dialog( \"close\" );\n}", "title": "" }, { "docid": "7f32b72d8190d476c0a32220d74b7325", "score": "0.5657934", "text": "function openFile() {\n //create a file input\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.accept = \"image/*\";\n input.click();\n //detect image selected\n input.addEventListener(\"change\", (event) => {\n readSelectedImage(event.target.files[0]);\n input.remove();\n });\n\n }", "title": "" }, { "docid": "528ae6b1fc3b38a9aaf994f5be97f062", "score": "0.56578964", "text": "function openModalArtiste(musique){\n\tevent.target.style.color = \"white\";\n\tdocument.getElementById(\"fader\").style.display=\"block\";\n\tdocument.getElementById(\"popup_artiste\").innerHTML=\"\";\n\tlet popup_artiste = document.getElementById(\"popup_artiste\");\n\tlet div_info = document.createElement(\"div\");\n\tdiv_info.className = \"div_info\";\n\tdiv_info.innerHTML = \"<img src=\" + musique.img_artiste + \" id=img_artiste style=width:400px>\" + \"<div id='nom_artiste'>\" + musique.nom_artiste + \"</div>\" + \"<div id='info_artiste_popup'>\" + musique.info_artiste + \"</div>\";\n\tdiv_info.style.fontSize = \"40px\";\n\tdiv_info.style.textAlign = \"center\";\n\tdiv_info.style.color = \"white\";\n\tdiv_info.style.width=\"380px\";\n\tdiv_info.style.marginLeft=\"auto\";\n\tdiv_info.style.marginRight=\"auto\";\n\tdiv_info.style.marginTop=\"100px\";\n\tdiv_info.style.marginBottom=\"100px\";\n\tpopup_artiste.appendChild(div_info);\n}", "title": "" }, { "docid": "0d55911efb3471115d1198ff9b02e1a8", "score": "0.56574893", "text": "function showImage(id) {\n\telementID = \"imageModal\" + id.toString();\n\telement = document.getElementById(elementID);\n\telement.style.display = \"block\";\n}", "title": "" }, { "docid": "3d29445d00b9100a7cf80498d3eeb63d", "score": "0.5639668", "text": "function makeImagePopUp(source) {\r\n let sectionPopUp = document.getElementById(\"popup\");\r\n sectionPopUp.innerHTML = '<section id=\"show_popup\" onclick=\"hide()\">' +\r\n '<img src=\"' + source + '\"/></section>';\r\n}", "title": "" }, { "docid": "4cd4ea4523faad5b77c230407b76828d", "score": "0.5637672", "text": "function abrirgrande(a){\n let obtenerdiv = document.getElementById(\"modalfotos\");\n obtenerdiv.style.display= \"flex\";\n obtenerdiv.setAttribute(\"onclick\", \"cerrargrande()\");\n let contenidoh2 = a.id;\n document.getElementById(\"modalgrande\").src= \"img/\" + contenidoh2 + \".jpg\";\n document.getElementById(\"titulomodal\").innerHTML= contenidoh2;\n}", "title": "" }, { "docid": "e612d8fdaa867f4e96880aa6c7336f62", "score": "0.5637272", "text": "function showDialog()\n{\n var html = HtmlService.createTemplateFromFile('dialog')\n .evaluate()\n .setWidth(800)\n .setHeight(600);\n DocumentApp.getUi()\n .showModalDialog(html, 'Create a new Monster');\n}", "title": "" }, { "docid": "916a3e02e5ba0dd4dffc072e6573e781", "score": "0.5624612", "text": "function showConfirmDialog(transId, error, message) {\n\n document.getElementById(\"popupImg\").src = error ? \"img/redcross.png\" : \"img/greencheck.png\";\n document.getElementById(\"popupHeader\").innerHTML = error ? \"Error!\" : \"Payment Success!\";\n document.getElementById(\"popupMessage\").innerHTML = message;\n\n document.getElementById(\"transId\").innerHTML = transId;\n document.getElementById(\"modalPopup\").classList.remove(\"closed-sam\");\n}", "title": "" }, { "docid": "a8598710cf372a2ff1445e8260d2526d", "score": "0.5621434", "text": "function OnPagePicture_SetActive()\n{\n\tvar pageControl = ThisEvent.Object;\n\tvar picControl = pageControl.Controls(\"Image1\");\n\t//Set the arguments of the Open dialog box\n\tvar szDefExt = \"jpg\";\n\tvar szFileFilter = \"Picture Files|*.jpg\";\n\tvar szTitle = \"Select Picture File\";\n\n\t//Show the Open dialog box and get the result\n\tvar szResult = CommonDialog.ShowOpen(szDefExt, szFileFilter, szTitle);//, lngFlags);\n\t//var szResult = CommonDialog.ShowPicture();//, lngFlags);\n\n\tif(szResult == null)\n\t{\n\t\t//cancel must have been clicked.\n\t\tg_strTreeIma_Name = \"\";\n\t\treturn;\n\t}\n\tpicControl.Value = szResult;\n\n\t//szResult is a string that looks like \\My Documents\\Pictures\\waterfall.jpg\n\t//need to only get filename\n\tvar filenamePos = szResult.lastIndexOf(\"\\\\\");\n\tvar filename = szResult.substr(filenamePos + 1);\n\n g_strTreeIma_Name = filename;\n\n\t//bail now that we have set the global tree image which is now used in the new audit\n //forget about inserting image stuff below as it is handled for us later\n\treturn;\n\t\n}", "title": "" }, { "docid": "c806113b0d43443134ccad373b95b4b0", "score": "0.56213826", "text": "function handleImgClick(e){\n modal.style.display = \"block\";\n let image=e.currentTarget.src;\n modalImg.src=image;\n captionText.innerHTML = e.currentTarget.getAttribute(\"alt\");\n}", "title": "" }, { "docid": "1ddaf2c9ccdbebd7b585d1bda34a7233", "score": "0.56124586", "text": "function uploadCameraModeClick() {\n\n application.api.popupModule.createPopup({\n\n templateName : 'popup-profile-upload_avatar',\n\n afterRender: function(){\n var $that = this,\n $webContainer = $that.find('.img_webcontainer'),\n $btnConfirm = $that.find('.js-confirm-upload-popup'),\n $btnClose = $that.find('.js-close-upload-popup');\n\n $webContainer.css({\n 'padding-left': '0',\n 'padding-top': '0',\n width: '600px',\n height: '450px'\n });\n\n $(\".inf_step_01, .txt_step_01, .take_picture, .btns_controlls, .js-container-buttons\").show();\n $(\".inf_step_02, .txt_step_02\").hide();\n $btnConfirm.removeClass(\"disabled_btn\");\n $btnConfirm.addClass('upl_from_camera' + \"disabled_btn\");\n\n // Публикуем камеру\n FileAPI.Camera.publish($webContainer, {start: true}, function (err, cam/**FileAPI.Camera*/) {\n if (typeof jcrop_api != \"undefined\") {\n jcrop_api.destroy();\n }\n\n camera = cam;\n\n $webContainer.append(\n \"<div class='fake_crop'></div>\"\n );\n\n $webContainer.find('.fake_crop').Jcrop({\n boxWidth: 600,\n boxHeight: 450,\n minSize: [220, 220],\n aspectRatio: 1,\n setSelect: [75, 0, 450, 450],\n onSelect: _updateCoords,\n onChange: _updateCoords\n }, function () {\n jcrop_api = this;\n });\n\n $btnClose\n .off('click', _closeCameraModeClick)\n .on('click', _closeCameraModeClick);\n $btnConfirm\n .off('click', _confirmCameraModeClick)\n .on('click', _confirmCameraModeClick);\n });\n }\n });\n }", "title": "" }, { "docid": "8d7556aed98a25ee263ca5ee642be97f", "score": "0.561138", "text": "function ShowPopup(divId, popupSetting, projectName, idx) {\n divIdent = divId;\n index = idx;\n cur = arrPicArrs[projectName][index];\n var curWidth = cur.width;\n var curHeight = cur.height;\n var screenHeight = window.screen.height;\n var screenWidth = window.screen.width;\n\n var popUpTop = screenHeight/2 - curHeight/8;\n var popUpLeft = screenWidth/2;\n\n var sliderDiv = document.getElementById(divId);\n sliderDiv.style.display = 'block';\n sliderDiv.style.position = 'relative';\n var element = sliderDiv.parentElement;\n popupSetting = popupSetting || {};\n\n if (!popupSetting.width) { popupSetting.width = curWidth; };\n if (!popupSetting.height) { popupSetting.height = curHeight; };\n if (!popupSetting.title) { popupSetting.title = 'Project Picture Slider'; };\n\n table = document.createElement('div');\n table.setAttribute('id', 'table' + divId);\n\n curImg = document.createElement(\"img\");\n curImg.src = cur.src;\n var curStyle = curImg.style;\n curStyle.position = 'relative';\n curStyle.top = 0;\n curStyle.left = 0; \n\n var rightButton = document.createElement(\"input\");\n rightButton.type = \"image\";\n rightButton.src = rArrow.src;\n var rbStyle = rightButton.style;\n rbStyle.position = 'absolute';\n rbStyle.top = (curHeight/2 - (lArrow.height/2)) +'px';\n rbStyle.right = 0;\n rbStyle.zIndex = 20;\n rbStyle.opacity = .6;\n rightButton.onclick = nextPic;\n\n var leftButton = document.createElement(\"input\");\n leftButton.type = \"image\";\n leftButton.src = lArrow.src;\n var lbStyle = leftButton.style;\n lbStyle.position = 'absolute';\n lbStyle.top = (curHeight/2 - (lArrow.height/2)) +'px';\n lbStyle.left = 0;\n lbStyle.zIndex = 20;\n lbStyle.opacity = .6;\n leftButton.onclick = prevPic;\n\n var closeButton = document.createElement(\"input\");\n closeButton.type = \"button\";\n closeButton.value = \"close\";\n var cbStyle = closeButton.style;\n cbStyle.color = \"red\";\n closeButton.onclick = ClosePopupDiv;\n\n function nextPic() {\n index++;\n if (index > 4) {\n index = 0;\n }\n cur = arrPicArrs[projectName][index];\n curImg.src = cur.src;\n };\n\n function prevPic() {\n index--;\n if (index < 0) {\n index = 4;\n }\n cur = arrPicArrs[projectName][index];\n curImg.src = cur.src;\n };\n\n\n tempElt = document.createElement('div');\n tempElt.setAttribute('id', 'tempElt' + sliderDiv.id);\n sliderDiv.parentElement.insertBefore(tempElt, sliderDiv);\n\n \n sliderDiv.appendChild(curImg);\n sliderDiv.appendChild(leftButton);\n sliderDiv.appendChild(rightButton);\n table.appendChild(sliderDiv);\n\n\n var cssText = 'display: block; z-index:12; background-color:white; top:'+popUpTop+'px; left:'+popUpLeft+'px;';\n cssText += 'width: ' + popupSetting.width + 'px; height: ' + popupSetting.height + 'px; margin-left: -' + Math.round(popupSetting.width / 2) + \n 'px; margin-top: -' + Math.round(popupSetting.height / 2) + 'px;';\n \n if (popupSetting.isFixed === true) { \n cssText += 'position: fixed;';\n }\n else { \n cssText += 'position: absolute;'; \n }\n\n table.setAttribute('style', cssText);\n element.appendChild(table);\n\n var shadeElt = document.createElement('div');\n shadeElt.id = \"ShadedBG\";\n shadeElt.className = \"ShadedBG\";\n tempElt.appendChild(shadeElt);\n}", "title": "" }, { "docid": "bc7b0569b37494b29ee69fe10a38721e", "score": "0.56093776", "text": "click(){\n createAddwindow();\n }", "title": "" }, { "docid": "2d4725fc8dc34c4b5657e3c20d9918c3", "score": "0.5609357", "text": "function view(e) {\n let img = e.path[1];\n let raw = img.innerHTML;\n let source = raw.split(`<img src=\"./images/`);\n let imgClicked = source[1];\n let coords = imgClicked.split(`.`);\n let number = parseFloat(coords[0]);\n\n let placeHolder = document.createElement(\"div\");\n placeHolder.classList.add(\"window\")\n let elem = document.createElement(`img`)\n elem.src = `./images/${number}.jpg`;\n placeHolder.appendChild(elem);\n document.body.appendChild(placeHolder);\n // To have the buttons\n button();\n // To exit or remove the window\n out();\n}", "title": "" }, { "docid": "6a3ef5ed246c80aac606eb0b1b7dc9af", "score": "0.56085575", "text": "function clickHandler(event) {\n\ttau.openPopup(popup);\n }", "title": "" }, { "docid": "c9360c29a27a18c4e2c75ea9dcbae7d6", "score": "0.5600034", "text": "openUploadMuscleImageWindow(){\n // click on inputFileElement in application template (browse window can only be called from application template)\n document.getElementById('inputMediaFileElement').click();\n }", "title": "" }, { "docid": "076ce895a6c1ba4b5dacea42a9ff3a5f", "score": "0.5596894", "text": "function showimageupload() {\r\n\t//click on image Click here to upload new Images\r\n\t$(\"#hide-campaign-nav\").bind(\"click\", function(event) {\r\n\t\tevent.preventDefault();\r\n\t\t$(\"#special-image a\").click();\r\n\t});\r\n}", "title": "" }, { "docid": "1080937b97453bccf435eee74e159e26", "score": "0.55963784", "text": "function uploadImgClick(event) {\n hiddenFileInput.current.click();\n }", "title": "" }, { "docid": "58ed11adfb589b5d935fe6c94effa7ae", "score": "0.55955976", "text": "chooseImage(e) {\n // 1) Uso IF para verificar que a lo que le hice click tiene class de modal-img.\n if (e.target.classList.contains(\"modal-img\")) {\n // 1) procedo a seleccionar la imagen que antes estaba seleccionada, y le quito la class de selected.\n const selected = this.modalImages.querySelector(\".selected\");\n selected.classList.remove(\"selected\");\n\n // 2) Llamo al metodo de setMainImage que cambia la imagen principal del modal y el titulo de la imagen y le paso el elemento html de la imagen a la que le hice lick\n this.setMainImage(e.target);\n\n // 3) A la imagen que le hice click le procedo a agregar la class de selected.\n e.target.classList.add(\"selected\");\n }\n }", "title": "" }, { "docid": "3b908b3fddb6beb01963b8f48759f558", "score": "0.55951077", "text": "function btnEditLtsPic(){\n $('#upload_new_stl_pic_modal').modal('show');\n }", "title": "" }, { "docid": "3ecc4f2465576a6d9ccaab5e32915fab", "score": "0.5591746", "text": "function showModal (event) {\n /*console.log (event.target);*/\n /*creando el div*/\n var modal = document.createElement (\"div\");\n modal.style.position = \"fixed\";\n modal.style.background = \"rgba(0,0,0,0.6)\";\n modal.style.top = \"0\";\n modal.style.left = \"0\";\n modal.style.width = \"100%\"; \n modal.style.height = \"100%\"; \n\n modal.appendChild(event.target);\n /*agregar a la imagen estilo*/\n event.target.style.margin = window.innherHeigth / 4 + \"px auto\";\n event.target.style.display = \"block\";\n\n document.body.appendChild(modal);\n\n modal.addEventListener (\"click\", function (event){\n event.target.parentElement.removeChild(event.target);\n });\n}", "title": "" } ]
a838365e4d9e0fbbabb6607682f4bcc3
Attempts to complete a multibyte UTF8 character using bytes from a Buffer.
[ { "docid": "c17497bb303000ed2dfcfdb7d8f99eb1", "score": "0.0", "text": "function utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}", "title": "" } ]
[ { "docid": "30e2ed4439b89e26be27040d7737452b", "score": "0.7112214", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return'\\ufffd';}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return'\\ufffd';}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return'\\ufffd';}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "30e2ed4439b89e26be27040d7737452b", "score": "0.7112214", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return'\\ufffd';}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return'\\ufffd';}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return'\\ufffd';}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "30e2ed4439b89e26be27040d7737452b", "score": "0.7112214", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return'\\ufffd';}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return'\\ufffd';}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return'\\ufffd';}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "004e221fcbe9dd3047c24b74c73b50d2", "score": "0.70137984", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "004e221fcbe9dd3047c24b74c73b50d2", "score": "0.70137984", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "004e221fcbe9dd3047c24b74c73b50d2", "score": "0.70137984", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "ceef3d0aefccfb07d9e2445bd8cc1c91", "score": "0.6783312", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "ceef3d0aefccfb07d9e2445bd8cc1c91", "score": "0.6783312", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "dd06fbd200a01dc9274448752db398c8", "score": "0.6702948", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "dd06fbd200a01dc9274448752db398c8", "score": "0.6702948", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "eec821b703afdcc3a640bb4c65326b64", "score": "0.66593575", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.6473297", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.6473297", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.6473297", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.6473297", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.6473297", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.6473297", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "70e11493b6aa757c31e8fa5595b85f02", "score": "0.63433176", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n} // For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "70e11493b6aa757c31e8fa5595b85f02", "score": "0.63433176", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n} // For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "70e11493b6aa757c31e8fa5595b85f02", "score": "0.63433176", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n} // For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "70e11493b6aa757c31e8fa5595b85f02", "score": "0.63433176", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n} // For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "3186b32d598fd38bddc9fa71f5a20a6e", "score": "0.62908924", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n } // For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "78f998d77bed03a4423895b6ce2f6524", "score": "0.61687195", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n }", "title": "" }, { "docid": "78f998d77bed03a4423895b6ce2f6524", "score": "0.61687195", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n }", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" }, { "docid": "2f50c8af42614ffcadf6c68ef78413ce", "score": "0.61684036", "text": "function utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}", "title": "" } ]
d65dc736dd4c965d82895c9a6f5132ed
handle update has a lot of moving parts, thats why so many console.logs
[ { "docid": "ce31446395fcc36a86404698223e1dd3", "score": "0.0", "text": "function handleUpdateClicked(){\n $('.js-bookmark-list').on('click','.js-update-bookmark-button', event =>{\n event.preventDefault();\n console.log('update clicked');\n const title = $('.js-add-updatedbookmark-title').val();\n console.log(`${title}`);\n const url = $('.js-add-updatedbookmark-link').val();\n const desc = $('.js-add-updatedbookmark-desc').val();\n const rate = $('input[name=rate]:checked').val();\n console.log(`${url}`);\n console.log(`${desc}`);\n console.log(`${rate}`);\n\n if(title === ''|| url === ''){\n return alert('title and url needed');\n }\n const updateData = ({title, url, desc, rating:rate}); \n const id = $('.js-expand-updatedbookmark-view').data('updateditem-id');\n console.log(id);\n api.updateBookmark(id, updateData, () => {\n updateData.expanded = false;\n store.findByIdandUpdate(id,updateData);\n \n render();\n });\n });\n \n }", "title": "" } ]
[ { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.74115723", "text": "function update() {}", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.74115723", "text": "function update() {}", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.74115723", "text": "function update() {}", "title": "" }, { "docid": "b666e5feadde13089dd41945e9d022b3", "score": "0.73428327", "text": "update()\n\t{\n\t\t//TODO:\n\t}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.72032356", "text": "update() {}", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.71600306", "text": "function update(){}", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.71600306", "text": "function update(){}", "title": "" }, { "docid": "254c1ac712fa31e76ff446d4ed041266", "score": "0.71414965", "text": "onUpdate() { }", "title": "" }, { "docid": "4e0d2c18f2072e695b33842838ca5d60", "score": "0.713891", "text": "Update() {}", "title": "" }, { "docid": "4ca3598f9fced2fca4e8bc4810e64956", "score": "0.70977664", "text": "Update() { }", "title": "" }, { "docid": "6e1072d64a21ce7ddcab88b4cb7f74bf", "score": "0.70924264", "text": "update() {\n \n }", "title": "" }, { "docid": "235659609c96c518653e6b18bae1d0a1", "score": "0.70606714", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7010447", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7010447", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7010447", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7010447", "text": "update() {\n }", "title": "" }, { "docid": "5c02f90b9097c89cff371b381dc8e442", "score": "0.6957359", "text": "update()\r\n {\r\n\r\n }", "title": "" }, { "docid": "4427c7ab5938f1c5665fd47fa27b789c", "score": "0.69352794", "text": "function updater() {\n\t\n\t}", "title": "" }, { "docid": "6c5a53bf946ffe731fdd062534b8391f", "score": "0.6932941", "text": "selfUpdated() { }", "title": "" }, { "docid": "86756ff36a7c68972ce1a639eba6a9e1", "score": "0.6922508", "text": "update() {\n return; /* Noop */\n }", "title": "" }, { "docid": "b03de059e82a0744e82b8af610a2ac27", "score": "0.69054383", "text": "function handleUpdate(e) {\n Update({ feedback: e });\n }", "title": "" }, { "docid": "987cd0a6cd2647a0199e543877b4a780", "score": "0.68832386", "text": "function update() {\n}", "title": "" }, { "docid": "a07c756a97e324a1a2aa690cc9683a8c", "score": "0.6882443", "text": "updated () {}", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.68796974", "text": "update() {\n\n }", "title": "" }, { "docid": "7d706da556688f2b8e598249e2e28a39", "score": "0.68422425", "text": "update() {\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.684036", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.684036", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.684036", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.684036", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.684036", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.684036", "text": "update() {\n\n }", "title": "" }, { "docid": "775bd0b5a6e430ebf0b0da60a9954992", "score": "0.68062484", "text": "_update(){}", "title": "" }, { "docid": "2a2f012de0286248911665c4e3b3967a", "score": "0.67977816", "text": "update() {\n //Nothing to do.\n }", "title": "" }, { "docid": "03675f5efcb7ae55833683274e1eed9e", "score": "0.67795473", "text": "update () {\n this._doUpdate(true)\n }", "title": "" }, { "docid": "c2aa4c7a7a40282cdd11c5d0b67fbee2", "score": "0.67754036", "text": "function fixedUpdate(args, ctx) {\n}", "title": "" }, { "docid": "8eff76c9448ee582ee8c25a3f264f63c", "score": "0.6764404", "text": "update(){\n \n }", "title": "" }, { "docid": "2c2572da501a65c296882301cd2965a0", "score": "0.6754977", "text": "function update() {\n \n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.67408967", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.67408967", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.67408967", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.67408967", "text": "function update() {\n\n}", "title": "" }, { "docid": "419facb3caf9938773e7bd8283a83d00", "score": "0.6712435", "text": "update(){\n }", "title": "" }, { "docid": "c5b6a2c6e841965c8804fdc10c8ab8a9", "score": "0.66948354", "text": "Update()\n {\n \n }", "title": "" }, { "docid": "d1946d3627563b2f3b339cd36879620f", "score": "0.66802645", "text": "function handleUpdate(update) {\n if (update.type === 'messageCount') {\n displayUpdateMessage('Learning from message #' + update.count);\n } else if (update.type === 'profilePicture') {\n displayUpdateMessage('Getting the profile picture');\n } else if (update.type === 'name') {\n displayUpdateMessage('Finding your name');\n } else if (update.type === 'messagesStart') {\n displayUpdateMessage('Fetching messages');\n } else {\n console.error('Unrecognized update type');\n console.error(update);\n }\n }", "title": "" }, { "docid": "962577faa4215bfb44bc1f4a782eebf0", "score": "0.66700363", "text": "update():void {}", "title": "" }, { "docid": "51aa2a1f69ba1825a29921b02d2ab715", "score": "0.66613674", "text": "didUpdate() {}", "title": "" }, { "docid": "054639537ec00563b2795a02319ab7f9", "score": "0.6647081", "text": "update(state) {\n\tconsole.log(state);\n\tfor (let update of Object.keys(state)) {\n\t if (update in this.updates) {\n\t\tthis.updates[update](state);\n\t }\n\t}\n\t\n }", "title": "" }, { "docid": "03904ff8c1cb5f18f139821c937a2590", "score": "0.6639404", "text": "_update(tick) {\n\n\t}", "title": "" }, { "docid": "b7a9c225376adaeb8a5ab3dd1e1f8cd8", "score": "0.66378134", "text": "function update(args, ctx) {\n}", "title": "" }, { "docid": "ea79a585ea364078412bf1b7687bf9cf", "score": "0.6625827", "text": "handleUpdate() {\n let item = this.state.products;\n this.updatePriceCart(item);\n this.updateItems(item);\n const price = this.updatePriceOrder(item);\n const discountMug = this.updateDiscountMug(item);\n const discountShirt = this.updateDiscountShirt(item);\n this.updateTotalCost(price, discountMug, discountShirt);\n }", "title": "" }, { "docid": "2eee027949d90d1381d9a0d632226e81", "score": "0.6625427", "text": "update() {\n\n console.log(\"update\");\n this.check_avatars()\n this.show_avatars()\n\n this.show_question()\n this.show_now_state()\n\n this.show_players()\n this.show_answer()\n this.show_reset_button()\n\n this.highlight_me()\n }", "title": "" }, { "docid": "8cab5101ba41fb61f03022b6b4eec74c", "score": "0.6612212", "text": "function update(){\n\n }", "title": "" }, { "docid": "56f464bf983d477d113f88acbe4eb58c", "score": "0.6607667", "text": "fixedUpdate() {\n\n }", "title": "" }, { "docid": "86bd6421e82f37f6324031abd7316620", "score": "0.6596358", "text": "beforeUpdate() {\n console.log(\"before update\");\n }", "title": "" }, { "docid": "b2547b848cb4efe2253dd50e5e24c7e7", "score": "0.65802777", "text": "update () {\n this.processServerMessage()\n this.interpolateEntities()\n }", "title": "" }, { "docid": "760a016e2c542a7b273b7f4404a3661d", "score": "0.6574624", "text": "update(){\n\n }", "title": "" }, { "docid": "a438d09aaa5b9a6086820f4d6ec985fc", "score": "0.65520585", "text": "update() {\n // Handles updating this block once each turn\n // Everything we need to do here is now handled in blockIsStructure\n state.handleUpdate();\n }", "title": "" }, { "docid": "f4aaf15962923f5d2e75d938ca8d1f2a", "score": "0.65278804", "text": "function kwmo_first_update()\n{\n DebugConsole.debug(9, null, \"kwmo_first_update() called.\");\n\n DebugConsole.debug(9, null, \"kwmo_first_update() finished.\");\n}", "title": "" }, { "docid": "30f92622b95f8973a3dcbb832805d9dc", "score": "0.6513433", "text": "update() {\n this.DELTA_TIME = Date.now() - this.LAST_TIME;\n this.LAST_TIME = Date.now();\n\n // CURSOR\n this.cursor.update(this.DELTA_TIME);\n let cursorBox = this.cursor.cursorBBox;\n\n // TUNNEL CONTROLLER\n this.tunnelController.update(this.DELTA_TIME);\n\n // PORTALS CONTROLLER\n this.portalsController.update(this.DELTA_TIME, cursorBox);\n\n // RENDER\n Scene.render()\n }", "title": "" }, { "docid": "0f0123844f295f0bd39c2f9c2a6a95ca", "score": "0.6506134", "text": "update() {\n const delta = (performance.now() - this.lastTime) / 1000;\n this.lastTime = performance.now();\n this.emit('update', delta);\n }", "title": "" }, { "docid": "f1d64ce0c2c62ba56177c125862e9e2e", "score": "0.64964813", "text": "update() {\n this.updateCallback();\n }", "title": "" }, { "docid": "f1d64ce0c2c62ba56177c125862e9e2e", "score": "0.64964813", "text": "update() {\n this.updateCallback();\n }", "title": "" }, { "docid": "85e92e1b4530364f22336b9b9a9a0e35", "score": "0.64882195", "text": "function update(){\n\n}", "title": "" }, { "docid": "4cbe51231321eb504316dc541e4bff48", "score": "0.6475933", "text": "updateConsole() {\r\n\r\n }", "title": "" }, { "docid": "59b89b87f1f1d0623635c5858bd8f737", "score": "0.64750826", "text": "function update ()\n{\n\n}", "title": "" }, { "docid": "344e0f34fb50c6b5890c3ed6f10be726", "score": "0.6447275", "text": "update(timePassed) {\n // nothing to handle\n }", "title": "" }, { "docid": "1a532a78c018e801ee74636f2184c5a8", "score": "0.641842", "text": "function update() {\n handleInput(this);\n}", "title": "" }, { "docid": "b5bc613cd2fe28e9378c8cd1ef589574", "score": "0.64053357", "text": "function process_updates(response){\n if(response['STATUS'] !== undefined){\n if(response['STATUS']) set_online(true)\n else set_online(false)\n }\n if(response['CONSOLE'] !== undefined){\n console.log(response['CONSOLE'])\n $('#console').append(response['CONSOLE']);\n $('#console').scrollTop($('#console')[0].scrollHeight);\n } \n fetch_updates()\n}", "title": "" }, { "docid": "ce9f394de82aabda017de25511d6b98e", "score": "0.63952947", "text": "handleUpdate(e){\n this.clearGraph();\n this.retriveData();\n this.retriveActivities();\n }", "title": "" }, { "docid": "c27cbf2e469b5ed51a1407c64bf7d049", "score": "0.6392988", "text": "__update() {\n this.__gameObjects.update();\n this.getCurrentEvents().flush();\n }", "title": "" }, { "docid": "d3a1bfde1af193aa89bb771fd9e7af9b", "score": "0.63857883", "text": "update(update) {\n changes = update.changes;\n }", "title": "" }, { "docid": "3552e20c41a929e619ee7805555ca7be", "score": "0.6344732", "text": "update(time, delta) {\n if(delta%100 == 0){\n console.log('Time : ', time, 'Delta : ', delta);\n }\n }", "title": "" }, { "docid": "b3c2bf7290e583a023547bd26f6a1b11", "score": "0.63164014", "text": "function handleUpdateSelf(data){\n playerSelf.model.momentum.x = data.momentum.x;\n playerSelf.model.momentum.y = data.momentum.y;\n playerSelf.model.position.x = data.position.x;\n playerSelf.model.position.y = data.position.y;\n playerSelf.model.direction = data.direction;\n playerSelf.model.score = data.score;\n playerSelf.model.crashed = data.crashed;\n\n checkCrashed(playerSelf.model, true);\n\n //\n // Remove messages from the queue up through the last one identified\n // by the server as having been processed.\n let done = false;\n while (!done && !messageHistory.empty) {\n if (messageHistory.front.id === data.lastMessageId) {\n done = true;\n }\n messageHistory.dequeue();\n }\n\n //\n // Update the client simulation since this last server update, by\n // replaying the remaining inputs.\n let memory = MyGame.utilities.Queue();\n while (!messageHistory.empty) {\n let message = messageHistory.dequeue();\n switch (message.type) {\n case 'thrust':\n playerSelf.model.thrust(message.elapsedTime);\n break;\n case 'rotate-right':\n playerSelf.model.rotateRight(message.elapsedTime);\n break;\n case 'rotate-left':\n playerSelf.model.rotateLeft(message.elapsedTime);\n break;\n }\n memory.enqueue(message);\n }\n messageHistory = memory;\n\n\n if(data.hyperspaceJump){\n playerSelf.model.hyperSpaceStatus = 0;\n handlers.ParticleHandler.handleNewGlobalParticleSubsytem({\n center:{\n x: data.position.x,\n y: data.position.y\n },\n type: 'hyperspace'\n });\n handlers.AudioHandler.handleNewGlobalAudio({\n center:{\n x: data.position.x,\n y: data.position.y\n },\n type: 'hyperspace'\n });\n }\n }", "title": "" }, { "docid": "920bbf05331d85c913bd3a25e6856807", "score": "0.6311191", "text": "handleModify() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "13635ad4ee3a97c89fc5deb0c80cd339", "score": "0.63029766", "text": "handleUpdate() {\n let payload = {}, // payload is an obj with old note object (current one) and the new one (edited one)\n id = this.state.note.id,\n message = 'note updated';\n payload.old = this.state.note;\n payload.new = this.state.note;\n // getting values from inputs\n payload.new.text = this.state.value.edit.text;\n payload.new.date = this.state.value.edit.date;\n // toggling of the panel\n this.setState({edit: false});\n // Redux dispatch update and database update\n this.props.handleUpdateNote(payload);\n crud.update('note', id, payload.new.text);\n this.props.handleAddToast(message);\n }", "title": "" }, { "docid": "2e6e8a4bd1d804c08a85947049fc8ab0", "score": "0.6287138", "text": "processUpdate(body) {\n\t this.bot.processUpdate(body);\n\t}", "title": "" }, { "docid": "020bb0b9258de9a6c65f9f14f3dbd404", "score": "0.6286741", "text": "updatedFromServer() {}", "title": "" }, { "docid": "b81eea340ab59c2da6d6b4b3b40f71f6", "score": "0.62588423", "text": "onUpdate(timestamp, delta){}", "title": "" }, { "docid": "00181150a7c2fa356f54e23cdda4bd61", "score": "0.6241871", "text": "function updatesHandler(req, res) {\n p_receivedUpdates(req, res);\n\n // print all updates to console\n for (var i = lat.length - 1; i >= 0; i--) {\n \tconsole.log(\"Latitude: \" +lat[i]+ \"\\t Longitude: \" +lon[i]+ \"\\n\");\n };\n }", "title": "" }, { "docid": "018a50fd53e4de629c0d121cd3f4fa61", "score": "0.62375784", "text": "update(deltaTime){\n \n }", "title": "" }, { "docid": "ba0fb4b0f5d3944b9568437e9b26e619", "score": "0.62341326", "text": "_update() {\n // change game objects state with this.__lastTick\n this._objects.map( (object) => {\n object.update(this.__lastTick);\n });\n }", "title": "" }, { "docid": "bc802bd400f4ed20e8adea6136ba40f6", "score": "0.6227878", "text": "update (time, delta){\r\n\r\n \r\n \r\n\r\n}", "title": "" }, { "docid": "224134aa9e6e04050e154f05668a89be", "score": "0.6214524", "text": "_update() {\n console.log(\"UPDATE:\" + this.currentTurn);\n // on vérifie toujours en premier lieu l'état de validité\n if (!this.isValid()) {\n this._terminate();\n } else {\n\n switch (this.state) {\n case GameStates.Starting: {\n this._starting();\n }\n break;\n\n case GameStates.NextPlayer: {\n this._nextPlayer();\n }\n break;\n\n case GameStates.Picking: {\n this._picking();\n }\n break;\n\n case GameStates.Drawing: {\n this._drawing();\n }\n break;\n\n case GameStates.Ended: {\n this._ended();\n }\n break;\n\n case GameStates.Terminating: {\n this._terminate();\n }\n break;\n }\n\n }\n this.sendState();\n }", "title": "" } ]
c4d3ee4061efd5cc49f41ce4700ce414
setting and clearing timer for the start and reset of the game prompting for initials, and storing user information into userScores array on localStorage
[ { "docid": "250c47a0e9396956c591c9dfcdb11eae", "score": "0.7512541", "text": "function setTime() {\n secondsLeft = 30 \n intervalTimer = setInterval(function() {\n secondsLeft--;\n countDown.textContent = secondsLeft-1;\n\n if(secondsLeft === 0 || currentQuestionIndex === 5) {\n var initials = prompt(\"Game Over, final score: \" + score + \". Please enter your initials for the scoreboard.\")\n var user = {\n initials: initials,\n score: score\n }\n userScores.push(user)\n localStorage.setItem(\"userScores\", JSON.stringify(userScores))\n\n startBtn.classList.remove(\"hideBtn\")\n \n btnA.classList.add(\"hideBtn\");\n btnB.classList.add(\"hideBtn\")\n btnC.classList.add(\"hideBtn\");\n btnD.classList.add(\"hideBtn\");\n currentQuestionIndex = 0\n header.textContent = \"Coding Quiz Challenge\"\n countDown.textContent = \"30 SECONDS TO PLAY\"\n message.textContent = \"Have Fun!!\"\n score = 0\n clearInterval(intervalTimer); \n }\n }, 1000);\n}", "title": "" } ]
[ { "docid": "8d80dbfa2b16cc395dab494991a88b02", "score": "0.751326", "text": "function endOfGame() {\r\n if (test) { console.log(\"--- endOfGame ---\"); }\r\n stopTime();\r\n clearDetails();\r\n\r\n timerTab.setAttribute(\"style\", \"visibility: hidden;\");\r\n\r\n let heading = document.createElement(\"p\");\r\n heading.setAttribute(\"id\", \"main-heading\");\r\n heading.textContent = \"GAME OVER - I hope you have enjoyed this\";\r\n\r\n // creates elements with the instructions for the game\r\n let instructions = document.createElement(\"p\");\r\n instructions.setAttribute(\"id\", \"instructions\");\r\n instructions.textContent = \" Your score is \" + score; \r\n\r\n // creates button to start the game\r\n let playAgain = document.createElement(\"button\");\r\n playAgain.setAttribute(\"id\", \"playAgain\");\r\n playAgain.setAttribute(\"class\", \"btn btn-secondary\");\r\n playAgain.textContent = \"Play again\";\r\n\r\n // creates input for user to add initials\r\n let par = document.createElement(\"p\");\r\n\r\n let initialsLabel = document.createElement(\"label\");\r\n initialsLabel.setAttribute(\"for\",\"userInitials\");\r\n initialsLabel.textContent = \"Enter Initials: \";\r\n\r\n let initialsInput = document.createElement(\"input\");\r\n initialsInput.setAttribute(\"id\",\"userInitials\");\r\n initialsInput.setAttribute(\"name\",\"userInitials\");\r\n initialsInput.setAttribute(\"minlength\",\"3\");\r\n initialsInput.setAttribute(\"maxlength\",\"3\");\r\n initialsInput.setAttribute(\"size\",\"3\");\r\n\r\n\r\n mainEl.appendChild(heading);\r\n mainEl.appendChild(instructions);\r\n mainEl.appendChild(initialsLabel);\r\n mainEl.appendChild(initialsInput);\r\n mainEl.appendChild(par);\r\n mainEl.appendChild(playAgain);\r\n\r\n playAgain.addEventListener(\"click\", init);\r\n\r\n initialsInput.addEventListener(\"input\", function() {\r\n initialsInput.value = initialsInput.value.toUpperCase();\r\n if ( initialsInput.value.length === 3 ) { \r\n\r\n //create object for this score\r\n let thisScore = [ { type: quizType, name: initialsInput.value, score: score } ]; \r\n\r\n //get highscores from memory\r\n let storedScores = JSON.parse(localStorage.getItem(\"highScores\")); \r\n if (test) { console.log(\"storedScore\",storedScores); }\r\n\r\n if (storedScores !== null) { \r\n storedScores.push(thisScore[0]); \r\n } else {\r\n storedScores = thisScore;\r\n }\r\n\r\n localStorage.setItem(\"highScores\", JSON.stringify(storedScores));\r\n highScores();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "24e9d1b517b42b756e0a613bb9ce2d1e", "score": "0.74312234", "text": "function resetScores() {\n miscButtonClick.play();\n if (userCount !== 2){\n alert(\"Two users should be logged in\");\n return;\n }\n refresh();\n player1Scores = 0;\n player2Scores = 0;\n drawCount = 0;\n updateScores();\n // saveGame();\n writeGameRT();\n }", "title": "" }, { "docid": "0dbfa9bc4a31ae3e7c4c2d5b49ed33d9", "score": "0.72105473", "text": "function setTime() {\n\n var timerInterval = setInterval(function () {\n secondsLeft--;\n timeEl.textContent = \"Time: \" + secondsLeft;\n\n if (secondsLeft <= 0 || questions.length < currentQuestionIndex + 1) {\n var finalScore = (secondsLeft * 2) + score;\n\n clearInterval(timerInterval);\n quizBox.classList.add(\"hide\");\n endBox.classList.remove(\"hide\");\n endBox.setAttribute(\"style\", \"color: green\");\n\n if (score === 0) {\n finalScore = \"0\";\n finalScoreEl.textContent = (\"Your final score is: \" + finalScore);\n }\n else {\n\n finalScoreEl.textContent = (\"Your final score is: \") + finalScore;\n }\n };\n\n submitBtn.addEventListener(\"click\", function () {\n endBox.classList.add(\"hide\");\n highscoreBox.classList.remove(\"hide\");\n\n var initials = document.querySelector(\"#initials\").value\n\n localStorage.getItem(\"initials\")\n localStorage.getItem(\"score\");\n localStorage.setItem(\"initials\", initials);\n localStorage.setItem(\"score\", finalScore);\n\n userScore.textContent = initials + \" = \" + finalScore;\n\n\n });\n\n $(\"#highscore-value\").prepend(finalScore);\n\n // clears highscoreBox\n clear.addEventListener(\"click\", function () {\n userScore.textContent = \"\";\n });\n\n }, 1000);\n }", "title": "" }, { "docid": "559167cbbbe3295db40278a8a9967c92", "score": "0.7178704", "text": "function startQuiz() {\n highscores = JSON.parse(localStorage.getItem(\"scores\"))\n\n // var highscores = localStorage.getItem(\"highScores\"); if(highscores){\n // highscores = JSON.parse(highscores); }else { highscores = []; } // loop over\n // high scores // add them to the page\n\n\n var timerInterval = setInterval(function () {\n timer.textContent = time;\n time--;\n\n if (questionIndex === questions.length) {\n\n clearInterval(timerInterval);\n\n }\n\n if (time <= 0) {\n\n clearInterval(timerInterval);\n endGame();\n\n }\n\n }, 1000);\n\n\n startcont.style.display = \"none\";\n\n showQuestions();\n\n}", "title": "" }, { "docid": "bc8f9377eb234991730a572fcf09b98a", "score": "0.7158646", "text": "function gameOver(){\n qContainer.classList.add(\"hside\");\n currentQ = 0;\n clearInterval(timer)\n var initials = prompt ('Gameover! Enter your initials here and check your score on the score board.')\n \n var userInfo = {\n userInitials: initials,\n timeLeft: time\n }\n scoreBoard.push(userInfo);\n localStorage.setItem(\"allScores\", JSON.stringify(scoreBoard))\n console.log(localStorage)\n \n }", "title": "" }, { "docid": "a10de93742aeb91ab632afac87d0cd2b", "score": "0.71245724", "text": "function resetGame() {\r\n notes.forEach(e => {\r\n e.div.style.transition = \"1s\"\r\n e.color = \"red\"\r\n })\r\n attemptStop = true\r\n running = false\r\n\r\n // set new score\r\n if (localStorage.bestScore) {\r\n // highscore\r\n if (Number(localStorage.bestScore) < score) {\r\n localStorage.bestScore = score\r\n // type == 1 means new highscore\r\n writeBestScore(1)\r\n }\r\n // not new highscore\r\n else {\r\n writeBestScore()\r\n }\r\n\r\n }\r\n // first time played, sets new score\r\n else {\r\n localStorage.setItem(\"bestScore\", score)\r\n writeBestScore()\r\n }\r\n}", "title": "" }, { "docid": "378ef930450a50990f3466ed10e00e54", "score": "0.7053099", "text": "function clearScores() {\n localStorage.removeItem('scores');\n checkWin();\n drawScores();\n}", "title": "" }, { "docid": "3d43736162e286ae57e87ed02cd2d32f", "score": "0.7021854", "text": "function displayScore() {\n clearInterval(interval);\n interval = undefined;\n score += secondsLeft;\n\n alert(\"Your score is: \" + score);\n let initials = prompt('Please Enter your initials');\n if(initials != null) {\n scores.push(initials + \": \" + score);\n localStorage.setItem('scores', JSON.stringify(scores));\n }\n}", "title": "" }, { "docid": "edf3ec27500e1ae48c7fe39dd27c5d20", "score": "0.70190614", "text": "function initialQuiz() {\n console.log(\"Page reloaded.\");\n quizLayout.innerHTML = \"Answer all the questions within the time limit! Incorrect answers will subtract \" + PENALTYTIME + \" seconds from the time.\";\n startBtn.style.display = \"visible\";\n\n // retrieve high scores lists from local storage.\n let storedHighScoresArray = JSON.parse(localStorage.getItem(\"highestScoresArray\"));\n if (storedHighScoresArray !== null) {\n highestScores = storedHighScoresArray;\n }\n let storedHighScoreList = JSON.parse(localStorage.getItem(\"storedHighScoreList\"));\n if (storedHighScoreList !== null) {\n highScoresObj = storedHighScoreList;\n }\n}", "title": "" }, { "docid": "cd7c8bffb0cacce54acaccc2d71394f9", "score": "0.69811964", "text": "function endGame() {\n // Resets the timer interval\n clearInterval(timer);\n // Prompt for user initials\n user = prompt(\"Please enter your initials here:\");\n // Sets the seconds left as the final score\n score = secondsLeft;\n // Stores values of user and score to localStorage\n localStorage.setItem(\"score\", secondsLeft);\n localStorage.setItem(\"user\", user);\n\n window.location.href = \"leaderboard.html\";\n}", "title": "" }, { "docid": "7eab4e4c9c6086c686c7914f454d4c9e", "score": "0.69584185", "text": "function quizOver() {\n //initials = prompt(\"enter your initials\");\n finalScore = timeLeft;\n localStorage.setItem(initials, finalScore);\n}", "title": "" }, { "docid": "aa2ccbdbcc48c31f45551867514ba227", "score": "0.69512445", "text": "function onInitialsEntered() {\n var initials = elements.inputInitials.value;\n\n if (!initials) {\n alert(\"No value entered!\");\n return\n } \n var finalScore = {\n initials: initials,\n score: secondsLeft\n }\n var allScores = getAllScores();\n \n allScores.push(finalScore);\n var newScore = JSON.stringify(allScores);\n localStorage.setItem(\"allScores\", newScore);\n showScores()\n\n}", "title": "" }, { "docid": "7121b37690d46c7707f84060169de0f5", "score": "0.6927651", "text": "function reset(){\nif(np_checkpoint < 3){\n swal(\"CHALLENGE INCOMPLETE!\", \"tsk tsk tsk dont play play ah\");\n}\n else{\n window.clearInterval(interval);\n status = \"stopped\";\n let timing = new Date() - startTime;\n console.log(timing/60000 + \"seconds\");\n localStorage.setItem(\"timing\",(timing/1000));\n // Storing timing data\n var firebaseConfig = {\n apiKey: \"AIzaSyAuqUON7LmCIIrvwKY1wNHDiQEx2DBAjE8\",\n authDomain: \"leaderboard-dc9d0.firebaseapp.com\",\n databaseURL: \"https://leaderboard-dc9d0-default-rtdb.firebaseio.com\",\n projectId: \"leaderboard-dc9d0\",\n storageBucket: \"leaderboard-dc9d0.appspot.com\",\n messagingSenderId: \"412968994325\",\n appId: \"1:412968994325:web:95e19dddd112a72e65f01c\",\n measurementId: \"G-23M250XY1Z\"\n };\n // Initialize Firebase\n firebase.initializeApp(firebaseConfig);\n \n var myName = localStorage.getItem(\"name\");\n var time = localStorage.getItem(\"timing\");\n var database = firebase.database();\n var ref = database.ref(\"scores\");\n \n var data = {\n \"name\": myName,\n \"timing\": parseFloat(time)\n }\n \n ref.push(data);\n }\n\n}", "title": "" }, { "docid": "626c9b6acbc35d1e9b3cecf5b7b30b8b", "score": "0.6879882", "text": "function reset() {\n localStorage.setItem(\"user_score\", 0);\n localStorage.setItem(\"opponent_score\", 0);\n you.textContent = 'You: ' + 0;\n opponent.textContent = 'Computer: ' + 0;\n}", "title": "" }, { "docid": "63d25351394f764da1674a584488f1c0", "score": "0.68674594", "text": "function initialsSave() {\n const initials = document.querySelector(\"#initials\");\n let initializer = initials.value.trim();\n if (initializer !== \"\") {\n let highScores = JSON.parse(window.localStorage.getItem(\"high-scores\") || \"[]\");\n\n let newScore = {\n score: secondsLeft,\n initials: initializer,\n }\n\n highScores.push(newScore);\n window.localStorage.setItem(\"high-scores\", JSON.stringify(highScores));\n\n window.location.href = \"index.html\";\n }\n}", "title": "" }, { "docid": "e8022a2e7b0cb9477d9cda980a48075c", "score": "0.6852605", "text": "function initialsSave() {\n const initials = document.querySelector(\"#initials\");\n let initializer = initials.value.trim();\n if (initializer !== \"\") {\n let highScores = JSON.parse(window.localStorage.getItem(\"high-scores\")|| \"[]\");\n\n let newScore = {\n score: secondsLeft,\n initials: initializer,\n }\n\n highScores.push(newScore);\n window.localStorage.setItem(\"high-scores\", JSON.stringify(highScores));\n window.location.href = \"index.html\";\n }\n}", "title": "" }, { "docid": "9e1a0ad0c091e0cc28ef5d8ee22bc203", "score": "0.6845669", "text": "function tallyScore (time){\n if(quizIndex>=4)\n {\n countdownEl.textContent =\"\";\n verifyEl.textContent =\"\";\n questionEl.textContent =\"All Done!\"\n contentEl.textContent =\"Your Score is \" + time;\n endGame.style.display =\"block\";\n \n }\n // Submit button grabbing intials and going to highscore page\n\n endGame.addEventListener(\"submit\", function(event){\n var scoreEntry = {\n name: document.getElementById(\"name\").value,\n score: time\n };\n \n \n var scoreLists = JSON.parse(localStorage.getItem(\"score\"));\n // just check to see if the user has an item in localStorage called \"score\"\n // if so, we'll use it like we're doing already\n // if not, let's create that item in their localStorage\n if (scoreLists !== null)\n {\n scoreLists.unshift(scoreEntry);\n console.log(scoreLists);\n localStorage.setItem(\"score\", JSON.stringify(scoreLists));\n }\n else{\n var newScoreList = [];\n newScoreList.unshift(scoreEntry);\n localStorage.setItem(\"score\", JSON.stringify(newScoreList));\n }\n \n \n})\n \n}", "title": "" }, { "docid": "58fda062d3b5ed101f28ac4a05640140", "score": "0.68418413", "text": "function playGame_afterServerUpdate() { //called every second\n if(user.end_round === \"false\") { //instead of using a while loop, use an interval\n if (user.dict_varData[user.username][1]) { // still in?\n if (user.yourTurn === true) { // your turn ?\n if (user.yourTurn_FirstCall) { //the first and only time this will execute when its your turn\n // - - - TIMER STUFF ***\n if (user.dict_varData[user.username][4]) { //you have been sandwiched\n user.timerObj.timeoutNum = 15000; //15 seconds to play\n } else {\n user.timerObj.timeoutNum = 45000; //45 seconds to play\n }\n /*\n if (localStorage.getItem('onTheClock') === \"T\") { //exited window or something ... ? bc 'onTheClock' should be false at this point\n user.timerObj.startTimeMS = localStorage.getItem('start_time');\n console.log(\"ls otc\");\n //console.log(\"Going to locStorage to get start time\");\n } else { //normal flow path if you havent left window/browser page\n localStorage.setItem('onTheClock', \"T\"); // Persists to browser storage\n console.log(\"reg otc\");\n //console.log(localStorage.getItem('onTheClock'));\n user.timerObj.startTimeMS = Math.round( ((new Date()).getTime())/1000 ); //start timer\n localStorage.setItem('start_time', user.timerObj.startTimeMS);\n }\n */\n user.timerObj.startTimeMS = Math.round( ((new Date()).getTime())/1000 ); //start timer\n // - - - TIMER STUFF ***\n resetSelected(); //before you begin your turn just clear the hand of any selected cards\n //console.log(\"Before_play\");\n //console.log(user.cardSelectedStack);\n //console.log(user.hand);\n user.yourTurn_FirstCall = false;\n }\n\n let divClock = document.getElementById(\"clock\");\n\n if(!user.hasPlayed) { //while user has not played, should start as false\n if (user.hand.length === 0) {//ran out of cards...\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"none\";\n document.getElementById(\"playButton\").style.display = \"none\";\n document.getElementById(\"battleButton\").style.display = \"none\";\n if (user.isBattle) {\n user.playedMove_toServ = [['outofcards'], 'outofcards', user.username, []]; //going to serv\n } else if (user.isDerby) {\n user.playedMove_toServ = [['pass'], 'pass', user.username, []];\n } else {\n user.playedMove_toServ = [['outofcards'], 'outofcards', user.username, []]; //going to serv\n }\n user.hasPlayed = true;\n } else if (user.hand.length > 0) {\n if (user.dict_varData[user.username][4]) { // sandwiched\n document.getElementById(\"playButton\").style.display = \"none\";\n document.getElementById(\"battleButton\").style.display = \"block\";\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"none\";\n } else if (user.isDerby && !user.isBattle) { //derby\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"block\";\n document.getElementById(\"battleButton\").style.display = \"none\";\n document.getElementById(\"playButton\").style.display = \"block\";\n } else if (user.isBattle) {\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"none\";\n document.getElementById(\"battleButton\").style.display = \"block\";\n document.getElementById(\"playButton\").style.display = \"block\";\n } else { //normal\n document.getElementById(\"foldButton\").style.display = \"block\";\n document.getElementById(\"passButton\").style.display = \"none\";\n document.getElementById(\"battleButton\").style.display = \"none\";\n document.getElementById(\"playButton\").style.display = \"block\";\n }\n }\n // - - - TIMER STUFF ***\n let curTime = Math.round( ((new Date()).getTime())/1000 ); //user.timerObj.timeoutVar - ( (new Date()).getTime() - user.timerObj.startTimeMS);\n let passedTime = Math.round( curTime - user.timerObj.startTimeMS );\n let timeLeft = Math.round( (user.timerObj.timeoutNum / 1000) - passedTime ); //in sec\n\n if (timeLeft >= 20 && divClock.innerHTML !== (\"\" + timeLeft) ) {\n divClock.style.backgroundColor = \"green\";\n divClock.innerHTML = timeLeft;\n } else if (timeLeft < 20 && timeLeft >= 10 && divClock.innerHTML !== (\"\" + timeLeft)) {\n divClock.style.backgroundColor = \"orange\";\n divClock.innerHTML = timeLeft;\n } else if (timeLeft < 10 && timeLeft >= 0 && divClock.innerHTML !== (\"\" + timeLeft)) {\n divClock.style.backgroundColor = \"red\";\n divClock.innerHTML = timeLeft;\n } else if (timeLeft < 0) {\n divClock.style.backgroundColor = \"white\";\n divClock.innerHTML = '45';\n autoPlay();\n }\n // - - - TIMER STUFF ***\n } else { //has played\n //document.getElementById(\"foldButton\").style.display = \"none\";\n //document.getElementById(\"passButton\").style.display = \"none\";\n //document.getElementById(\"playButton\").style.display = \"none\";\n //document.getElementById(\"battleButton\").style.display = \"none\";\n //document.getElementById(\"nineButton\").style.display = \"none\";\n //localStorage.setItem('onTheClock', \"F\"); //you are no longer on the clock\n //if (divClock.style.backgroundColor !== \"white\" || divClock.innerHTML !== '45') { // reset clock\n // divClock.style.backgroundColor = \"white\";\n // divClock.innerHTML = '45';\n //}\n //user.hasPlayed = false; //reset hasPlayed bool\n //user.yourTurn_FirstCall = true;\n //user.yourTurn = false;\n let post_obj = {};\n post_obj.roomID = roomID;\n post_obj.user = user.username;\n post_obj.usersHand = user.hand;\n post_obj.usersMove = user.playedMove_toServ;\n post_obj.isBattle = user.isBattle_toServ;\n post_obj.isSandwich = user.isSandwich_toServ;\n post_obj.isDerby = user.isDerby_toServ;\n let post_JSON = JSON.stringify(post_obj);\n //once played, send data to server, only after your turn\n try {\n $.post('/turnOver_update_clientToServer',\n {\n user_data: post_JSON\n },\n function(data, status) {\n console.log(\"Status Play\");\n console.log(status);\n if (status === \"success\") {\n user.hasPlayed = false; //reset hasPlayed bool\n user.yourTurn_FirstCall = true;\n user.yourTurn = false;\n user.isDerby_toServ = false;\n user.isBattle_toServ = [\"F\", \"\"];\n user.isSandwich_toServ = [\"F\", \"\", \"\", \"\"];\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"none\";\n document.getElementById(\"playButton\").style.display = \"none\";\n document.getElementById(\"battleButton\").style.display = \"none\";\n document.getElementById(\"nineButton\").style.display = \"none\";\n if (divClock.style.backgroundColor !== \"white\" || divClock.innerHTML !== '45') { // reset clock\n divClock.style.backgroundColor = \"white\";\n divClock.innerHTML = '45';\n }\n } else {\n alert(\"error, did not send... try again\");\n resetSelected();\n user.hand = user.hand_fallback;\n user.hasPlayed = false; // still need to play\n }\n });\n } catch {\n alert(\"uh... an error ocurred. It did not send.\");\n resetSelected();\n user.hand = user.hand_fallback;\n user.hasPlayed = false; // still need to play\n }\n }\n } else { //not your turn so wait or could have gotten sandwiched to get to this path\n //localStorage.setItem('onTheClock', \"F\"); //you are no longer on the clock\n user.yourTurn_FirstCall = true;\n let divClock = document.getElementById(\"clock\");\n if (divClock.style.backgroundColor !== \"white\" || divClock.innerHTML !== '45') { // reset clock\n divClock.style.backgroundColor = \"white\";\n divClock.innerHTML = '45';\n }\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"none\";\n document.getElementById(\"playButton\").style.display = \"none\";\n document.getElementById(\"nineButton\").style.display = \"none\";\n if (user.hand.length === 0) {\n document.getElementById(\"battleButton\").style.display = \"none\";\n } else {\n document.getElementById(\"battleButton\").style.display = \"block\";\n }\n }\n } else { //not in round\n user.yourTurn_FirstCall = true;\n let divClock = document.getElementById(\"clock\");\n if (divClock.style.backgroundColor !== \"white\" || divClock.innerHTML !== '45') { // reset clock\n divClock.style.backgroundColor = \"white\";\n divClock.innerHTML = '45';\n }\n document.getElementById(\"foldButton\").style.display = \"none\";\n document.getElementById(\"passButton\").style.display = \"none\";\n document.getElementById(\"playButton\").style.display = \"none\";\n document.getElementById(\"battleButton\").style.display = \"none\";\n }\n } else if (user.gameOver[0] === \"T\") { //game is over\n //Game is over!\n //alert(\"GAME OVER! Winner: \" + user.gameOver[1]);\n } else {\n //waiting 10 seconds for peeps to see who won/how because round is over\n }\n}", "title": "" }, { "docid": "b82edb251856e71bfb02ffd54fd8ae8c", "score": "0.6839658", "text": "function startGame() {\n hideStart();\n hideSaveScoreForm();\n resetFinalScore();\n clearCurrentQuestion();\n resetUserScore();\n displayCurrentQuestion();\n startTimer();\n}", "title": "" }, { "docid": "d851b8a3380443ba3c2c6c44266a7d20", "score": "0.6822791", "text": "function quizCompleted() {\n questionsList.innerHTML = \"\";\n timer.innerHTML = \"\";\n \n let initials = prompt(\"Enter initials here\")\n if (!initials) {\n window.alert(\"submit your initials\")\n return quizCompleted()\n } else {\n initials = initials.toUpperCase()\n }\n \n console.log(initials)\n\n // var with if else statements to store data to localStorage\n var userFinal = {\n initials,\n score: countDown\n }\n console.log(userFinal)\n var savedUserScore = localStorage.getItem(\"savedUserScore\");\n if (savedUserScore === null) {\n savedUserScore = [];\n } else {\n savedUserScore = JSON.parse(savedUserScore);\n }\n savedUserScore.push(userFinal);\n var newScore = JSON.stringify(savedUserScore);\n localStorage.setItem(\"savedUserScore\", newScore);\n \n displayMessage()\n }", "title": "" }, { "docid": "a84bb0a0b2a209093a35f8103938b128", "score": "0.68184817", "text": "function startGame(){\n\tif (playerArray.length == 0){\n\t\tgameOn = false;\n\t\talert(\"You must input a player name and click 'New Player' first!\");\n\t}\n\telse{\n\tgameOn = true;\n\t//user started the game. Save the time. Save the time + 30 seconds.\n\tgameStart = Date.now();\n\tgameEnd = Date.now() + 30000;\n\t//start the interval\n\ttimerInterval = setInterval(updateTimer, 1000);\n\tcurrentScore = 0;\n\tdocument.getElementById('currentScore').innerHTML = 0;\n\t}\n}", "title": "" }, { "docid": "05c2f8d98e97e83230b7a23d39e9147c", "score": "0.68067896", "text": "function resetGame() {\n game.player1.gameScore = 0;\n game.player2.gameScore = 0;\n gameScoreIndex++;\n pointScoreIndex = 0; //for after looking at matchStats\n // gameScoreIndex = 0;\n // game.gameScoreCollection.push(pushArr);\n if (game.startSer === 'player1') {\n swal(game.player2.name + \" serves first\");\n game.startSer = 'player2';\n game.player1.curSer = false;\n game.player2.curSer = true;\n }else if (game.startSer === 'player2'){\n swal(game.player1.name + \" serves first\");\n game.startSer = 'player1';\n game.player1.curSer = true;\n game.player2.curSer = false;\n }\n }", "title": "" }, { "docid": "844bf09136bcd3ebf70f1b970f2f75b3", "score": "0.6795875", "text": "function endGame () {\n clearInterval(timerInterval);\n timer.classList.add(\"hide\");\n questionsBox.classList.add(\"hide\");\n scoreInfo.classList.remove(\"hide\");\n reStart.classList.remove(\"hide\");\n highScore.classList.add(\"hide\");\n userScore.classList.remove(\"hide\");\n userScores.classList.remove(\"hide\");\n button.classList.add(\"hide\");\n\n //User Details text\n var userDetails = document.createElement(\"label\");\n userDetails.setAttribute(\"id\", \"userDetails\");\n userDetails.textContent = \"Enter Your Name: \";\n scoreInfo.appendChild(userDetails);\n\n //input form\n var inputForm = document.createElement(\"input\");\n inputForm.setAttribute(\"type\", \"text\"); \n inputForm.setAttribute(\"id\", \"initials\");\n inputForm.setAttribute(\"class\", \"text-center\");\n inputForm.textContent = \"\";\n scoreInfo.appendChild(inputForm);\n\n //submit button \n var userSubmit = document.createElement(\"button\");\n userSubmit.setAttribute(\"type\", \"submit\");\n userSubmit.setAttribute(\"id\", \"Submit\"); \n userSubmit.textContent = \"Submit\";\n scoreInfo.appendChild(userSubmit);\n\n //user score\n userScore.textContent = \"Your Final Score is \" + score + \" points!\"\n\n //event listener to display user name and score after entered. \n userSubmit.addEventListener('click', function(event) {\n event.preventDefault();\n \n var userName = {\n name: inputForm.value.trim(),\n thescore: score\n }\n\n \n\n if (userName.name === \"\") {\n alert(\"You must enter a name.\");\n } else {\n //Local Storage to set and display to user\n localStorage.setItem(\"user\", JSON.stringify(userName));\n\n var printUser = JSON.parse(localStorage.getItem(\"user\"));\n userScore.textContent = \"Player: \" + printUser.name;\n \n var printScore = JSON.parse(localStorage.getItem(\"user\"));\n userScores.textContent = \"Score: \" + printScore.thescore;\n }\n\n });\n}", "title": "" }, { "docid": "327303d66b2f0891412e0c6aafabf9a4", "score": "0.67951137", "text": "function resetGame() {\n account.score = 0;\n account.lines = 0;\n account.level = 0;\n board.reset();\n time = { start: 0, elapsed: 0, level: LEVEL[account.level] };\n}", "title": "" }, { "docid": "8ae5761a6b67ebd8a186b8aa3f8e95a7", "score": "0.6768203", "text": "function onRestart() {\n setGame({\n cards: helpers.generateCards(),\n firstCard: undefined,\n });\n setStartTime(0);\n setElapsedTime(0);\n timeoutIds.current.forEach((id) => clearTimeout(id));\n timeoutIds.current = [];\n setWin(false);\n setScoreCanBeSaved(false);\n }", "title": "" }, { "docid": "699f77237f96a6689f358b80f5be4cc2", "score": "0.6759733", "text": "function submitInitials() {\n var initials = initialsEl.value.trim()\n var userScore = {\n score: time,\n initials: initials\n }\n var highscores = [] || JSON.parse(window.localStorage.getItem('highscores'))\n highscores.push(userScore)\n window.localStorage.setItem(\"highscores\", JSON.stringify(highscores))\n\n var endScreen = document.getElementById('end-screen')\n endScreen.setAttribute('class', 'hide')\n\n var leaderBoardScreen = document.getElementById('leaderboard')\n leaderBoardScreen.removeAttribute('class') \n\n highscores.forEach(function(score) {\n var liTag = document.createElement('li')\n liTag.textContent = score.initials\n var listItem = document.getElementById('highscores')\n listItem.appendChild(liTag)\n })\n\n var returnButton = document.getElementById('return-home')\n \n returnButton.onclick = startQuiz\n}", "title": "" }, { "docid": "a6ea18a6b7ebd2a83188ceb45cec3cf2", "score": "0.6759428", "text": "function logScore() {\n\t\t\n\t\t$(\"#initial-input\").off();\n\t\t$(\".saver\").off();\n\t\tlet playerName = $(\"#initial-input\").val();\n\t\tlet results = [playerName, finalScore, timeRemaining];\n\t\tstoredScores.push(results);\n\t\tlocalStorage.setItem(\"scores\", JSON.stringify(storedScores));\n\t\trenderScores();\n\t\t$(\"#initial-input\").val(\"\");\n\t\t$(\"#initialsModal\").modal('hide');\t\n\t\t$(\"#scoreModal\").modal('show');\n\n\t}", "title": "" }, { "docid": "338dcd86974cbdb028abf7dcdf266bb8", "score": "0.6756158", "text": "function endQuiz() {\n clearInterval(timerInterval);\n title.innerText = \"Thanks for playing!\";\n choiceDisplay.innerText = \"\";\n showMenu();\n highScore = score + secondsLeft;\n questionDisplay.innerHTML =\n \"You got \" +\n score +\n \" out of \" +\n quizBank.length +\n \" right with a remaining time of \" +\n secondsLeft +\n \" for a final score of: \" +\n highScore;\n userInitials = prompt(\"Enter your initials: \");\n localStorage.setItem(\"Username\", userInitials);\n localStorage.setItem(\"Highscore\", highScore);\n}", "title": "" }, { "docid": "7a75a02be238346f29b1d33c9dd40baa", "score": "0.6741485", "text": "function clearScore() {\n localStorage.setItem(\"highscore\", \"\");\n\n localStorage.setItem(\"highscoreName\", \"\");\n\n resetGame();\n}", "title": "" }, { "docid": "9c79f21f6db05b040c66fed72a0a45f0", "score": "0.6736719", "text": "function endQuiz () {\n clearInterval (myVar);\n timerDisplay.innerHTML = \"\";\n buttonArea.innerHTML = \"\";\n feedback.innerHTML = \"\";\n heading.innerText = \"Your score: \" + score;\n content.innerHTML = \"\";\n var initials = prompt (\"Enter your initials\");\n if (!initials || initials == \"\") {initials = \" \";}; \n if (localStorage.getItem('scoreArray')) {\n var scoreArray = JSON.parse(window.localStorage.getItem('scoreArray'));\n var tempArray = [[score, initials]];\n var newArray = scoreArray.concat(tempArray);\n } else {\n var newArray = [[score, initials]];\n }\n localStorage.setItem('scoreArray', JSON.stringify(newArray));\n var scoreList = document.createElement(\"ul\")\n feedback.appendChild(scoreList);\n for (var i=0; i<newArray.length; i++){\n var scoreEntry = document.createElement(\"li\")\n scoreEntry.innerHTML = newArray[i][0] + \" \" + newArray[i][1];\n scoreList.appendChild(scoreEntry); \n }\n \n // offer chance to restart quiz\n content.innerText = \"Do you want to try again?\"\n var startButton = document.createElement(\"button\");\n startButton.textContent = \"Restart\";\n buttonArea.appendChild(startButton);\n startButton.addEventListener(\"click\", offerQuiz);\n var clearButton = document.createElement(\"button\");\n \n //allow user to clear localStorage\n clearButton.textContent = \"Clear Scores\";\n buttonArea.appendChild(clearButton);\n clearButton.addEventListener(\"click\", clearScores);\n}", "title": "" }, { "docid": "d43da9bfb5d5da4c7829967587c84066", "score": "0.67277104", "text": "function resetGame(){\n\n clearInterval(playGame);\n countdown.style.display = \"block\";\n countdown.textContent = \"YOU LOST!\";\n \n scores.push(score - 1);\n\n addScores();\n\n\n score = 0;\n appleArr = [];\n squareArr = [];\n snakeSpeed = 100;\n arrowPressed = \"left\";\n \n }", "title": "" }, { "docid": "1a1dfcbe066f920a8971fe9fda8a10eb", "score": "0.6719563", "text": "function restart(){\n\tlog = [];\n\tcardsInPlay = [];\n\tcurrentPlayer = 0;\n\tplayerScores = [0, 0];\n \ttrackedCards = [];\n \tseconds = 10;\n \tgameBoardSetup();\n \t$(\".playerScore\").empty().append(\"0\");\n \t$(\".playerOne\").css('color', 'red');\n \t$(\".playerTwo\").css('color', 'black');\n \tcountDownTimer();\n}", "title": "" }, { "docid": "b0d16cf359c1f7d883cb38f6c8f28136", "score": "0.67162544", "text": "function gameOver(){\n const highScoresList = document.getElementById(\"highScoresList\");\n var playerScore = secondsLeft;\n var toggleEL = document.getElementById('toggle');\n questionEl.innerText='Game Over';\n resetQuestionCard();\n var person = prompt(\"Please enter your initials!\", \"XX\");\n if (person == null || person == \"\") {\n txt = \"Player not recorded.\";\n };\n toggleEL.innerText=\"Score:\"; \n var scoreButton = document.getElementById('score-btn');\n scoreButton.classList.remove('hide');\n\n //local storage function for scores\n var thisScore ={score: playerScore, initials: person};\n var highScore = JSON.parse(localStorage.getItem('highScore')) || [];\n \n highScore.push(thisScore);\n localStorage.setItem('highScore', JSON.stringify(highScore));\n \n \n }", "title": "" }, { "docid": "7b36e9bfdadd9593ae4db968963a323f", "score": "0.67109", "text": "function submitScore() {\n //calclulate current score value, set to variable\n var currentScore = 75 - parseInt(timeLeft)\n //take initials from user input, set to variable\n var currentInitials = initialsEl.value\n\n // Get stored scores from localStorage\n var storedScores = JSON.parse(localStorage.getItem(\"scores\"));\n var storedInitials = JSON.parse(localStorage.getItem(\"initials\"));\n \n // If scores/initials were retrieved from localStorage, update the arrays to it\n if (storedScores !== null) {\n scoresArr = storedScores;\n }\n if (storedInitials !== null) {\n initialsArr = storedInitials;\n }\n\n //concat current score/initials to arrays containing previous scores/initials\n scoresArr.unshift(currentScore);\n initialsArr.unshift(currentInitials);\n \n //store both score and initials in local storage\n localStorage.setItem(\"scores\", JSON.stringify(scoresArr));\n localStorage.setItem(\"initials\", JSON.stringify(initialsArr));\n\n //Remove all scores from leaderboard html before rendering\n leaderboardEl.innerHTML = \"\";\n\n // Render a new li for each score\n for (var i = 0; i < scoresArr.length; i++) {\n var score = scoresArr[i];\n var initial = initialsArr[i];\n\n var leaderboardTop = document.createElement(\"li\");\n leaderboardTop.textContent = initial + \": \" + score + \" seconds\";\n leaderboardEl.appendChild(leaderboardTop);\n }\n\n //clear arrays to reset after render\n scoresArr = []\n initialsArr = []\n}", "title": "" }, { "docid": "421f698d354615e16d51b8c327e1d5f2", "score": "0.6707911", "text": "function clearScore() {\n localStorage.setItem(\"highscore\", \"\");\n localStorage.setItem(\"highscoreName\", \"\");\n \n resetGame()\n }", "title": "" }, { "docid": "7d48b642e9f0f1e85f1fadcd3edbdb32", "score": "0.66845036", "text": "function clearScore() {\n localStorage.setItem(\"highscore\", \"\");\n localStorage.setItem(\"highscoreName\", \"\");\n \n resetGame();\n}", "title": "" }, { "docid": "6fe1e4897f3f0d643692d96a3d57f11d", "score": "0.667761", "text": "function reset(){\r\n\r\n gameState=PLAY;\r\n \r\nif(localStorage[\"HighScore\"]<score){\r\n\r\n localStorage[\"HighScore\"]=score;\r\n\r\n}\r\n\r\n score=0;\r\n}", "title": "" }, { "docid": "9aebbb0520b188a66d0f2a7d3d76536b", "score": "0.6672687", "text": "function setScores (initials){\n resultEl.innerHTML = \"\";\n\n const scores = (() => {\n const studentGrades = localStorage.getItem('studentGrades');\n return studentGrades === null ? []: JSON.parse(studentGrades);\n })();\n\n scores.push({\"initials\":initials,\"score\":timeLeft})\n \n // Use .setItem() to store object in storage and JSON.stringify to convert it as a string\n localStorage.setItem(\"studentGrades\", JSON.stringify(scores));\n\n // call a function that displays score\n displayScores();\n\n}", "title": "" }, { "docid": "ff5c5c4ae8c99f0e644e8d5ac25d5463", "score": "0.6672054", "text": "function resetGame() {\n score = 0;\n countdown = 500;\n questionSet = [...questions];\n count = 0;\n userName = '';\n}", "title": "" }, { "docid": "41437ff3c8e7c6fb70c11bfdd484bd2d", "score": "0.6670877", "text": "function newGame() {\n userScore = 0;\n gameStart();\n }", "title": "" }, { "docid": "67b1ce259b5a912a5874d859c3048220", "score": "0.666416", "text": "function clearScore() {\n localStorage.setItem(\"highscore\", \"\");\n localStorage.setItem(\"highscoreName\", \"\");\n\n resetGame();\n}", "title": "" }, { "docid": "17196429d62a27613992de52508ff38a", "score": "0.66597146", "text": "function endGame() {\n\n console.log(\"end game\");\n $(\".container\").addClass('hide');\n highScoreLink.removeClass('hide');\n score = sec;\n let userName = prompt(\"please enter a username\");\n if (score > localStorage.getItem(\"score\")) {\n localStorage.setItem(\"user\", userName);\n localStorage.setItem(\"score\", score);\n }\n // localStorage.setItem(\"user\", userName);\n // localStorage.setItem(\"score\", score);\n}", "title": "" }, { "docid": "d58c6ee4eef2837572905ce92aea5a11", "score": "0.6659013", "text": "function countDown() {\n startingTime--;\n document.getElementById(\"timer\").innerHTML = \"Timer: \" + startingTime;\n if (startingTime <= 0) {\n window.localStorage.setItem('finalScore', startingTime);\n location.assign(\"scores.html\");\n }\n}", "title": "" }, { "docid": "66ff44d9d1db3b81017b79e72171323c", "score": "0.6658192", "text": "function displaystats(){\n\n console.log(\"Display Stats\");\n\n // Hides the quiz //\n quizcontainerEl.classList.add(\"hide\");\n\n // Displays current score and asks for initials //\n if(timeLeft > 1) {\n var username = prompt(\"Game Over. Your score is: \" + timeLeft + \". Please enter your initials: \");\n\n } else {\n outoftime();\n }\n\n // Temporarily stores player's initials (username) and score (timeLeft) //\n var currentScore = {\n score: timeLeft,\n name:username\n };\n\n // Adds new data to highScores array--which was pulled from local storage when declaring the variable highScores in line 5 above //\n highScores.push(currentScore);\n\n // Sorts the high scores from highest to lowest //\n highScores.sort((a, b) => b.score - a.score);\n\n // Removes any score other than the top 5 in the highScore array //\n highScores.splice(5);\n\n // Displays high scores //\n highscorecontainerEl.classList.remove(\"hide\");\n playagainbuttonEl.classList.remove(\"hide\");\n h3subtitleEl.classList.remove(\"hide\");\n \n // If there are less than 5 high scores in local storage, this conditional displays only the number of existing scores //\n if (highScores.length > 4) {\n // displays the unorderd list of names //\n name0El.innerHTML = highScores[0].name;\n name1El.innerHTML = highScores[1].name;\n name2El.innerHTML = highScores[2].name;\n name3El.innerHTML = highScores[3].name;\n name4El.innerHTML = highScores[4].name;\n\n // displays the ordered list of scores //\n score0El.innerHTML = highScores[0].score;\n score1El.innerHTML = highScores[1].score;\n score2El.innerHTML = highScores[2].score;\n score3El.innerHTML = highScores[3].score;\n score4El.innerHTML = highScores[4].score;\n\n } else {\n \n if (highScores.length > 3) {\n name0El.innerHTML = highScores[0].name;\n name1El.innerHTML = highScores[1].name;\n name2El.innerHTML = highScores[2].name;\n name3El.innerHTML = highScores[3].name;\n score0El.innerHTML = highScores[0].score;\n score1El.innerHTML = highScores[1].score;\n score2El.innerHTML = highScores[2].score;\n score3El.innerHTML = highScores[3].score;\n\n } else {\n\n if (highScores.length > 2 ) {\n name0El.innerHTML = highScores[0].name;\n name1El.innerHTML = highScores[1].name;\n name2El.innerHTML = highScores[2].name;\n score0El.innerHTML = highScores[0].score;\n score1El.innerHTML = highScores[1].score;\n score2El.innerHTML = highScores[2].score;\n\n } else {\n\n if (highScores.length > 1) {\n name0El.innerHTML = highScores[0].name;\n name1El.innerHTML = highScores[1].name;\n score0El.innerHTML = highScores[0].score;\n score1El.innerHTML = highScores[1].score;\n\n } else {\n name0El.innerHTML = highScores[0].name;\n score0El.innerHTML = highScores[0].score;\n }\n }\n } \n }\n\n // Resets the high scores in local storage //\n localStorage.setItem(\"highScores\", JSON.stringify(highScores));\n\n // Listens for a click on the play again button. If so execute playagain() //\n playagainbuttonEl.addEventListener(\"click\", playagain);\n\n }", "title": "" }, { "docid": "c9f9b75c8950655de2fb0c8811865d98", "score": "0.66566217", "text": "function setTime() {\n loadQuestions();\n var timerInterval = setInterval(function () {\n secondsLeft--;\n timer.textContent = \"\";\n timer.textContent = \"Time: \" + secondsLeft;\n if (secondsLeft <= 0 || questionCount === questions.length) {\n clearInterval(timerInterval);\n userScore();\n }\n }, 1000);\n}", "title": "" }, { "docid": "71aad16718ab93d5a98742c664bd0840", "score": "0.6656071", "text": "function clearScore() {\n localStorage.setItem(\"highscore\", \"\");\n localStorage.setItem(\"highscoreName\", \"\");\n resetGame();\n}", "title": "" }, { "docid": "f412027403e0303884a004bbbd5305f6", "score": "0.66413486", "text": "function gameOver() {\n\n timer.textContent = \"00\";\n \n // prompts user to input high score\n header.children[0].textContent = \"Enter your initials to save your highscore\";\n \n // clear content and bottom sections\n if (content.children[0] != null){\n content.removeChild(content.children[0]);\n }\n\n if (bottom.children[0] != null){\n bottom.removeChild(bottom.children[0]);\n }\n\n // adds form for initials and button to submit\n // creates a form for entering initials\n var form = document.createElement(\"form\");\n // makes the input field\n var input = document.createElement(\"input\");\n // makes submit button\n var newBtn = document.createElement(\"button\");\n // sets the input field to accept text\n input.setAttribute(\"type\", \"text\");\n // adds the input to the form\n form.appendChild(input);\n // makes the button have submit written on it\n newBtn.textContent = \"Submit\";\n // adds the button to the form\n form.appendChild(newBtn);\n // adds the entire form to the page\n content.appendChild(form);\n\n // event listener for submit button clicked\n newBtn.addEventListener(\"click\", function(event){\n event.preventDefault();\n // reads the users input initials\n var saveName = input.value;\n // sets the user's remaining time as the score\n if (secondsLeft < 0){\n secondsLeft = 0;\n }\n var saveScore = secondsLeft;\n // adds a score object to the scoresArray\n var newScore = {name : saveName, score : saveScore};\n scoresArray.push(newScore);\n\n // sorts the array of scores based on the score field of the score objects\n // score2.score - score1.score specifies to sort in descending order\n // if above is greater than 0, it swaps the array elements\n scoresArray.sort((score1,score2) => score2.score - score1.score);\n\n // stores updated array in local storage\n localStorage.setItem(\"scores\", JSON.stringify(scoresArray));\n // takes to highscore page\n renderScores();\n });\n}", "title": "" }, { "docid": "1617e39611468405a5536cf0d34a324d", "score": "0.66356397", "text": "finish() {\n document.querySelector(\".game-page\").style.display = \"none\";\n document.querySelector(\".scores-page\").style.display = \"block\";\n localStorage.setItem(\n \"game\" + Date.now(),\n this.player.name + \",\" + this.player.score\n );\n this.reset();\n mylib.createHighscoresTable();\n }", "title": "" }, { "docid": "3fd6061af3f3583868fc95a9efc7cf53", "score": "0.66333413", "text": "function reset() {\n roomName = null;\n playerNumb = null;\n userName = null;\n userColor = null;\n score = 0;\n balance = 0;\n clients = 0;\n players = {};\n playerCount = 0;\n gameCodeInput.value = \"\";\n gameCodeDisplay.innerText = \"error\";\n initialSceen.style.display = \"flex\";\n gameScreen.style.display = \"none\";\n settingsScreen.style.display = \"none\";\n document.getElementById('gameUserList').innerHTML = '';\n document.getElementById('startGameBtn').style.display = 'inline-block';\n document.getElementById('scoreboard').style.display = \"none\";\n document.getElementById('shopScreen').style.display = \"none\";\n}", "title": "" }, { "docid": "edcb45507d2ac70e20ac46efe4088503", "score": "0.6613746", "text": "function scoreScreen() {\n var input = document.createElement(\"input\");\n var body = document.body;\n var userScore = timeLeft;\n var h2El = document.createElement('h2');\n var submit = document.createElement('button');\n\n h2El.textContent = 'Your final score is ' + userScore + \". Please enter your initials:\";\n body.appendChild(h2El);\n\n input.setAttribute('id', 'initials');\n input.setAttribute('style', 'margin-top: 5%; margin-left: 45%;');\n input.placeholder = \"Your initials\";\n body.appendChild(input);\n\n submit.className = \"questionChoices\"\n submit.setAttribute('style', 'margin-top: 5%; margin-left: 45%;');\n submit.textContent = 'Submit';\n body.appendChild(submit);\n\n submit.addEventListener(\"click\", function(event) {\n event.preventDefault();\n\n userInput.push(initials.value);\n storeScore();\n var Final = {\n Name: userInput,\n Score: timeLeft\n }\n scores.push(Final);\n localStorage.setItem(\"Quiz Score\", JSON.stringify(scores));\n scorePage();\n })\n \n}", "title": "" }, { "docid": "74ce0f248ada4f54996e7d1e605f9f34", "score": "0.6612031", "text": "function startTime() {\n // Set currentQuestion to first question\n currentQuestion = 0;\n // Set seconds to 60\n secondsLeft = 60;\n // Timer function and how to handle when time runs out\n gameTimer = setInterval(function() {\n // text will show next to seconds as they count down\n timeEl.textContent = secondsLeft + \" seconds left!\";\n // seconds left will count down\n secondsLeft--;\n // When the clock reaches 0\n if (secondsLeft <= 0) {\n // stop the clock\n clearInterval(gameTimer);\n // add text that time is up\n timeEl.textContent = \"Time is up, game is over!\";\n // Reset Questions and Choices to empty\n gameQuestionEl.innerHTML = \"\";\n gameChoicesEl.innerHTML = \"\";\n // Alert for user to try again\n alert(\"You ran out of time, no high score to record. Click Start Game to try again!\");\n location.reload();\n }\n }, 1000);\n// Make start button disappear\nstartBtn.innerHTML = \"\";\n// Run displayQuestions function\ndisplayQuestions();\n}", "title": "" }, { "docid": "81550e2f59d0514e59d1f0395f45b2d0", "score": "0.66013664", "text": "function startGame() {\n timer.reset();\n timer.start();\n $('#summary').empty();\n $('#correctAnswers').empty();\n $('#incorrectAnswers').empty();\n $('#unanswered').empty();\n\n correctAnswers = 0;\n incorrectAnswers = 0;\n unanswered = 0;\n currentQuestion = 0;\n question();\n}", "title": "" }, { "docid": "a74d9cf7b4b4e45bd0b3d2a69fe95df1", "score": "0.66003674", "text": "function startGame() {\n\n $(\"#game\").empty();\n\n questionCount = 0;\n correctAnswers = 0;\n incorrectAnswers = 0;\n unansweredQuestions = 0;\n\n $(\"#time\").html(\"<h2>Time Remaining: \" + seconds + \" Seconds</h2>\");\n $(\".question\").first().show().addClass(\"question_asked\").removeClass(\"question\");\n\n clearInterval(intervalId);\n resetSeconds();\n\n }", "title": "" }, { "docid": "3a9ab998689716190d0e9ef1e024d326", "score": "0.6600244", "text": "function initScores() {\n storedScores = JSON.parse(localStorage.getItem(\"scores\"));\n\n if (storedScores !== null) {\n scoreList = storedScores;\n }\n renderScores();\n}", "title": "" }, { "docid": "727924a7f2372941acb260aca7873561", "score": "0.65878206", "text": "function clearScores(){\n window.localStorage.clear();\n updateScoreBoard();\n}", "title": "" }, { "docid": "bbb52b289bb2fda60af85c0e0ef01070", "score": "0.65642655", "text": "function clearHighScore() {\n playerScores = [];\n playerInitals = [];\n lsPlayerScores = \"\";\n lsPlayerInitals = \"\";\n localStorage.setItem(\"playerInital\", \"\");\n localStorage.setItem(\"playerScore\", \"\");\n viewHS();\n }", "title": "" }, { "docid": "cae7ee20c0381161a6ed7d05435d1701", "score": "0.6560191", "text": "function setScores(){\n var view ={\n score: secondsRemaining,\n initials: highscoreInput.value,\n }\n localStorage.setItem('individual', JSON.stringify(view))\n\n}", "title": "" }, { "docid": "fba35ec935d8d79deb17c97f7490de9d", "score": "0.6559556", "text": "function startApp(){\n \n timerInterval = setInterval(function() {\n timerSetting--;\n timer.textContent = \"Time: \" + timerSetting;\n\n if(timerSetting === 0) {\n clearInterval(timerInterval);\n alert(\"Game Over!\");\n alert(\"Your score is: \" + score);\n prompt(\"Enter your initials: \" );\n }\n }, 1000);\n questionSelect()\n\n }", "title": "" }, { "docid": "b96203b87fe261f44b5e0684cec7ce13", "score": "0.655217", "text": "function playQuiz() {\n if(questionArray.length > 1){\n isAnswerCorrect();\n questionArray.splice(indexFinder, 1);\n getQuestion();\n getAnswers();\n }\n else{\n isAnswerCorrect();\n clearInterval(timeInterval);\n playerScore = timerDisplay.innerText;\n localStorage.setItem(\"playerScore\", playerScore); \n endGame();\n }\n}", "title": "" }, { "docid": "76c72d5f370a82c59f80f3e9898a51be", "score": "0.65430564", "text": "function saveUser() {\n\n // get previous scores from local storage and place in array or use empty array\n var scores = JSON.parse(localStorage.getItem(\"scores\")) || [];\n\n // create score object\n var score = {\n \"score\": timer,\n \"date\": Date()\n }\n\n if ((scores.length >= 10 && score.score > scores[9].score) || (scores.length < 10)) {\n\n // prompt user for name\n score.initials = prompt(\"You earned a high score! Enter your initials!\");\n\n // add current score to score array\n scores.push(score);\n\n // sort score array by score value \n scores.sort((a, b) => {\n if (a.score < b.score) {\n return 1\n } else if (a.score > b.score) {\n return -1\n }\n return 0;\n\n })\n\n if(scores.length > 10){\n scores.splice(10, 1);\n }\n\n console.log(scores);\n\n // save latest score to local storage for special styling\n localStorage.setItem(\"latestScore\", JSON.stringify(score));\n // save score list to local storage\n localStorage.setItem(\"scores\", JSON.stringify(scores));\n\n }\n else{\n alert(\"you didn't make the high score list. Try harder next time!\");\n }\n displayScores(score);\n}", "title": "" }, { "docid": "93106f6609bd5c6823665e5402041756", "score": "0.65360844", "text": "function restoreDefaultScores(){\n RPS.gameState.userScore = 0;\n RPS.gameState.computerScore = 0;\n RPS.gameState.ties = 0;\n RPS.gameState.roundCount = 0;\n $(\"#userScore\").html(RPS.gameState.userScore);\n $(\"#computerScore\").html(RPS.gameState.computerScore);\n $(\"#ties\").html(RPS.gameState.ties);\n $(\"#roundNumber\").html(RPS.gameState.roundCount);\n}", "title": "" }, { "docid": "5f7e1997e0a97186e75e2363525f2f90", "score": "0.6532457", "text": "function startGame(){\n hideContent();\n unhideContent();\n assignButtonColours();\n generateDiffuseOrder();\n clearInterval(interval);\n setlevel();\n countdown(localStorage.getItem(\"theTime\"));\n listeningForClick();\n}", "title": "" }, { "docid": "8f5558be9f53c0ccfd7de6dd0226c8a7", "score": "0.65316606", "text": "function save() {\n let username = document.querySelector(\"#input\").value;\n let timeCompleted = document.querySelector(\"#final-time\").innerHTML;\n let totalIncorrects = document.querySelector(\"#final-incorrect-score\").innerHTML;\n let overallScore = document.querySelector(\"#final-overall-score\").innerHTML;\n \n // to store all users data\n let new_data = {\"username\":username, \"time_completed\":timeCompleted, \"incorrect_tiles_matched\":totalIncorrects, \"overall_score\":overallScore};\n \n // Brings user back to Game screen once score has been submitted. \n $(document).ready(function() {\n window.setTimeout(() => {\n window.location.reload(true);\n }, 200);\n });\n \n // if nothing saved at start then save empty array\n if(localStorage.getItem(\"data\") == null){\n localStorage.setItem(\"data\", \"[]\");\n }\n \n //Takes data from local storage and store to old data variable\n let old_data = JSON.parse(localStorage.getItem(\"data\"));\n\n //Adds users score old_data variable\n //Sorts overall score so that user with lowest overall score appears on top\n old_data.push(new_data);\n old_data.sort( (a,b) => a.overall_score - b.overall_score)\n \n //Stores data to local storage\n localStorage.setItem(\"data\", JSON.stringify(old_data));\n }", "title": "" }, { "docid": "e3af22c23b079c8b6bd46b393fca0b9a", "score": "0.65311015", "text": "function startGame(){\n // disable the start button when the timer is still going\n isFinished = false\n headerIntro.style.display = \"none\";\n\n // call renderQuestion() to render the question\n renderQuestion();\n\n // run timer\n var timeInterval = setInterval(function(){\n timeLeft--;\n timerDisplay.textContent = timeLeft;\n\n // Check is the time has run out or if all the questions have been answered\n if (isFinished || timeLeft === 0){\n clearInterval(timeInterval);\n renderScore(); // call renderScore() to display the score and submit initials\n }\n }, 1000);\n \n}", "title": "" }, { "docid": "97d90a798095de267e8ca8cc661326df", "score": "0.65310097", "text": "function saveScores() {\n var initials = userInitialsInput.value.trim();\n //Calls a new var \"user\" that will allow you to pass the dat through local storage\n if (initials !== \"\") {\n var highscores = JSON.parse(window.localStorage.getItem(\"highscores\")) || [];\n var user = {\n initials: initials,\n score: time/1000\n };\n highscores.push(user);\n window.localStorage.setItem(\"highscores\", JSON.stringify(highscores));\n }\n window.location.href = \"highscore.html\";\n}", "title": "" }, { "docid": "8714fd22d5b625a710fe26efb9ba778d", "score": "0.65294003", "text": "function startGame() {\n let gameTime = window.setInterval(function() {\n gameTimerEl.textContent = gameTimer;\n gameTimer --;\n scoreEl.textContent = score;\n if (gameTimer <= -1) {\n clearInterval(gameTime);\n finalScore = parseInt(score);\n savedFinalScore = window.localStorage.setItem(\"finalscore\", JSON.stringify(finalScore)); \n window.location.href = 'endscreen.html';\n }\n }, 1000)\n\n //filters the questions array to drop any used questions (at this point will be none, but will allow functions to always use filteredQuestions), then gets the next question to start the game. Also sets the time the question was started to the current gametime\n filteredQuestions = questions.filter(item => Object.values(item)[3]);\n // console.log(filteredQuestions);\n correctAnswer = getNextQuestion(filteredQuestions);\n startOfQuestionTimer = gameTimer;\n\n \n //buttons are made visible and event listeners are added to each one. when clicked the will run the function to see if they are the correct answer\n btnsEl.style.visibility = 'visible';\n\n answer1El.addEventListener('click', function (){\n let userAnswer = answer1El.textContent;\n checkIfCorrect(correctAnswer, userAnswer);\n });\n answer2El.addEventListener('click', function (){\n let userAnswer = answer2El.textContent;\n checkIfCorrect(correctAnswer, userAnswer);\n });\n answer3El.addEventListener('click', function (){\n let userAnswer = answer3El.textContent;\n checkIfCorrect(correctAnswer, userAnswer);\n });\n answer4El.addEventListener('click', function (){\n let userAnswer = answer4El.textContent;\n checkIfCorrect(correctAnswer, userAnswer);\n });\n }", "title": "" }, { "docid": "e110b27e1f2b4106b8cddf05e62021f3", "score": "0.6528793", "text": "function HighScore() {\n\n // Add highscore template.\n\n let highscoreClone = this.clone.querySelector('.highscore');\n this.answerBox.appendChild(highscoreClone);\n\n // Set the end time for the highscore time and calculate total time.\n\n this.user.end = new Date();\n this.user.total = (this.user.end - this.user.start)/1000;\n\n // Get the highscore list from storage and if none then add array.\n // Add the sessions name and time to the list and save to storage again.\n\n let oldList = JSON.parse(localStorage.getItem('highScoreList')) || [];\n\n oldList.push(this.user);\n\n // Sort the list after total time.\n\n function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }\n\n oldList.sort(sortList);\n\n // Only the 5 fastest in list.\n\n if (oldList.length > 5) {\n oldList.length = 5;\n }\n\n localStorage.setItem('highScoreList', JSON.stringify(oldList));\n\n // Append top 5 to highscore list.\n\n for (let i = 0; i < oldList.length; i++) {\n let liClone = document.createElement('li');\n liClone.appendChild(document.createTextNode(oldList[i].name + ' - ' + oldList[i].total + 's'));\n highscoreClone.querySelector('.highscoreList').appendChild(liClone);\n }\n\n\n // Start over button.\n\n let button = highscoreClone.querySelector('.playagain');\n\n\n // Add listener for reload.\n\n button.addEventListener('click', function() {\n\n location.reload();\n\n });\n\n}", "title": "" }, { "docid": "fbffc24e9ff1b84779e69f50b45fe1bb", "score": "0.6523363", "text": "function reset_start(){\n timer = Date.now() + 50000;\n playing = true;\n score = 0;\n menu.addClass(\"hidden\");\n moles.forEach(mole => {\n mole.position.y = -6;\n mole.nextEvent = getStartUpTime();\n mole.nextDown = null;\n });\n updateScore();\n run();\n}", "title": "" }, { "docid": "3fe175710352239e1f801ccf7b6aab49", "score": "0.65221167", "text": "function checkButton() {\n if (secondsLeft <= 0) {\n location.reload()\n } else if (win = !win && initials.value == \"\") {\n alert(\"Initials field cannot be blank.\\n Please enter your initials\")\n } else {\n var storeScore = {\n initials: initials.value.trim(),\n score: secondsLeft,\n }\n }\n highScoresArray = JSON.parse(localStorage.getItem(\"saveHighScores\"))\n console.log(highScoresArray)\n if (highScoresArray == null) {\n highScoresArray = storeScore\n localStorage.setItem(\"saveHighScores\", JSON.stringify([highScoresArray])) \n } else \n if (highScoresArray !== null) {\n highScoresArray.push(storeScore)\n localStorage.setItem(\"saveHighScores\", JSON.stringify(highScoresArray))\n }\n processScore()\n}", "title": "" }, { "docid": "95f7f91bbde76f95bbf3f7fe54b60091", "score": "0.6520107", "text": "function gameReset() {\n totalScore = 0;\n setupGame();\n }", "title": "" }, { "docid": "c2c98821124fbf3913978e451c210c15", "score": "0.65196145", "text": "function storeHighScores(event) {\n event.preventDefault();\n\n // stop function is initial is blank\n if (initialInput.value === \"\") {\n alert(\"Please enter your initials!\");\n return;\n } \n\n startDiv.style.display = \"none\";\n timer.style.display = \"none\";\n timesUp.style.display = \"none\";\n summary.style.display = \"none\";\n highScoreSection.style.display = \"block\"; \n\n // store scores into local storage\n var savedHighScores = localStorage.getItem(\"high scores\");\n var scoresArray;\n\n if (savedHighScores === null) {\n scoresArray = [];\n } else {\n scoresArray = JSON.parse(savedHighScores)\n }\n\n var userScore = {\n initials: initialInput.value,\n score: finalScore.textContent\n };\n\n console.log(userScore);\n scoresArray.push(userScore);\n\n // stringify array in order to store in local\n var scoresArrayString = JSON.stringify(scoresArray);\n window.localStorage.setItem(\"high scores\", scoresArrayString);\n \n // show current highscores\n showHighScores();\n}", "title": "" }, { "docid": "b914d63f2c49390c486ded85d7d15add", "score": "0.6516278", "text": "function startNewGame() {\n\n scores = [0,0];\n roundScore = 0;\n currentPlayer = 0;\n rollButton.style.pointerEvents = 'auto';\n holdButton.style.pointerEvents = 'auto';\n clearDivs();\n}", "title": "" }, { "docid": "029923ee14c964e73565c24d0a93bf34", "score": "0.65155494", "text": "function saveScore(event) {\n event.preventDefault();\n let score = {\n initials: playerInitialsEl.value.toUpperCase().trim(),\n score: time,\n };\n // push player input and time to the score array\n topScores.push(score);\n topScores.sort((a, b) => b.score - a.score);\n // convert the data in the array to a string so it will look nice on the screen\n localStorage.setItem(\"topScores\", JSON.stringify(topScores));\n displayScores();\n // show and hide stuff\n showAndHideStuff();\n}", "title": "" }, { "docid": "9a489625071e0eb31fd2f8bdd8e59fca", "score": "0.65097886", "text": "function storeScore(event) {\n scores.push({\n initials: userInitials.value,\n score: secondsLeft\n })\n event.preventDefault();\n localStorage.setItem(\"scores\", JSON.stringify(scores))\n clearInterval(timeInterval);\n window.location = \"highscore.html\"\n}", "title": "" }, { "docid": "416473bed70a8e699fa9fc15736af0f1", "score": "0.65089387", "text": "function resetGame() {\n counter = 0;\n correctCounter = 0;\n incorrectCounter = 0;\n unansweredCounter = 0;\n timer = 30;\n startGame();\n timerHolder();\n }", "title": "" }, { "docid": "a959c6cc18adf2d5a0da0e914f3a3eab", "score": "0.650889", "text": "function claimScore() {\n let scores = localStorage.getItem('scores') || {};\n if (Object.entries(scores).length) {\n scores = JSON.parse(scores);\n }\n // if nickname input is empty - replace with 'no-name'\n const nickname = document.getElementById('score-nickname').value || 'no-name';\n if (!scores[difficulty]) {\n scores[difficulty] = [{ nickname, score }];\n } else if (scores[difficulty].length !== 3) {\n scores[difficulty].push({ nickname, score });\n } else {\n const lesserScore = scores[difficulty].find(item => item.score >= score);\n if (lesserScore) {\n // only 3 records can be in top list at same time\n const lesserIndex = scores[difficulty].indexOf(lesserScore);\n scores[difficulty].splice(lesserIndex, 0, { nickname, score }).slice(0, 3);\n scores[difficulty] = scores[difficulty].slice(0, 3);\n }\n }\n // update scores, re-draw them and reset game board\n localStorage.setItem('scores', JSON.stringify(scores));\n drawScores();\n reset();\n}", "title": "" }, { "docid": "c1c9bc803310a3b9625b55e5766ac9e7", "score": "0.65072995", "text": "function finisher() {\n questionArea.innerHTML = \"\";\n timeLeft.innerHTML = \"\";\n\n var newH1 = document.createElement(\"h1\");\n newH1.setAttribute(\"id\", \"newH1\");\n newH1.textContent = \"Finished!\";\n\n questionArea.appendChild(newH1);\n\n var newP = document.createElement(\"p\");\n newP.setAttribute(\"id\",\"newP\");\n\n questionArea.appendChild(newP);\n\n // time and score tracker\n if (seconds >= 0) {\n var remainingTime = seconds;\n var newP2 = document.createElement(\"p\");\n clearInterval(hold);\n newP.textContent = \"Your score is \" + remainingTime;\n\n questionArea.appendChild(newP2);\n }\n // create a Label\n var newLabel = document.createElement(\"label\");\n newLabel.setAttribute(\"id\", \"newLabel\");\n newLabel.textContent = \"Enter your initials: \";\n\n questionArea.appendChild(newLabel);\n\n // input\n var newInput = document.createElement(\"input\");\n newInput.setAttribute(\"type\", \"text\");\n newInput.setAttribute(\"id\", \"initials\");\n newInput.textContent = \"\";\n\n questionArea.appendChild(newInput);\n\n // create a submit button\n var newSubmit = document.createElement(\"button\");\n newSubmit.setAttribute(\"type\", \"submit\");\n newSubmit.setAttribute(\"id\", \"submit\");\n newSubmit.textContent = \"Submit\";\n\n questionArea.appendChild(newSubmit);\n\n // using an event listener to record initials and store the initials and score in local storage\n newSubmit.addEventListener(\"click\", function () {\n var initials = newInput.value;\n\n if (initials === null) {\n\n console.log(\"No initials entered!\");\n\n } else {\n var finalScore = {\n initials: initials,\n score: remainingTime\n }\n console.log(finalScore);\n var allScores = localStorage.getItem(\"allScores\");\n if (allScores === null) {\n allScores = [];\n } else {\n allScores = JSON.parse(allScores);\n }\n allScores.push(finalScore);\n var newScore = JSON.stringify(allScores);\n localStorage.setItem(\"allScores\", newScore);\n // send the user to the highscore page\n window.location.replace(\"./highscore.html\");\n }\n });\n\n}", "title": "" }, { "docid": "05f01c4fc31b69037bcf3238b84eab6d", "score": "0.6505426", "text": "function startGame() {\n currentScoreDisplay.textContent = 0;\n player1Score.textContent = 0;\n player2Score.textContent = 0;\n player = Math.floor(Math.random() * 2) + 1;\n gameStarted = true;\n showPlayer(player);\n displayScores();\n}", "title": "" }, { "docid": "4375762793489916739dd15b1dd3f5f0", "score": "0.6501827", "text": "function start() {\n if (this.userName === '') {\n this.userName = 'Alex';\n }\n var newScore = {ScoreValue: this.scoreValue, UserName: this.userName};\n scoresData.push(newScore);\n\n this.userName = '';\n this.state.start('Game');\n }", "title": "" }, { "docid": "a083d3c8109adbd69ad2966bb2ad4af2", "score": "0.64981383", "text": "function init()\n{\n scores = [0,0];\n totalScore = 0;\n dice;\n activePlayer = 0;\n gamePlaying =\"true\";\n document.querySelector('#name-0').textContent = \"Player 1\";\n document.querySelector('#name-1').textContent = \"Player 2\";\n document.querySelector('#score-0').textContent = \"0\";\n document.querySelector('#score-1').textContent = \"0\";\n document.getElementById('current-0').textContent = 0;\n document.getElementById('current-1').textContent = 0;\n\n\n}", "title": "" }, { "docid": "391c737a47e129128e798a442f34d189", "score": "0.649693", "text": "function init(){\n score = [0,0];\n activePlayer = 0;\n roundScore = 0;\n gamePlaying = true;\n\n //Don't display dice when we are starting game\n document.querySelector('.dice').style.display = 'none';\n\n //Set all the values to 0 at starting point.\n document.getElementById('score-0').textContent = 0;\n document.getElementById('score-1').textContent = 0;\n document.getElementById('current-0').textContent = 0;\n document.getElementById('current-1').textContent = 0;\n\n /*Doesn't affect anything when we call for first time. \n But need this when game is completed, to reset all text along with CSS classes to default.\n */\n document.getElementById('name-0').textContent = 'Player 1';\n document.getElementById('name-1').textContent = 'Player 2';\n document.querySelector('.player-0-panel').classList.remove('winner');\n document.querySelector('.player-1-panel').classList.remove('winner');\n document.querySelector('.player-0-panel').classList.remove('active');\n document.querySelector('.player-1-panel').classList.remove('active');\n document.querySelector('.player-0-panel').classList.add('active');\n}", "title": "" }, { "docid": "8055dd271832e6e0847cd68f69309a9f", "score": "0.6490319", "text": "function resetGame() {\n userScore = 0;\n computerScore = 0;\n gameSwitch(winningScore);\n}", "title": "" }, { "docid": "dd581a81d8f79a98858741da6ef5fc06", "score": "0.64894474", "text": "function resetScore() {\r\n setTimeout(() => {\r\n userScore = 0;\r\n compScore = 0;\r\n userScore_span.innerHTML = userScore;\r\n compScore_span.innerHTML = compScore;\r\n result_p.innerHTML = \"Feel free to start another game.\";\r\n }, 300);\r\n}", "title": "" }, { "docid": "6a160cb059cfd9dc859311d008e0f683", "score": "0.64878243", "text": "function Resetter() {\n localStorage.removeItem('highScore')\n print(localStorage.getItem('highScore'))\n}", "title": "" }, { "docid": "a807a8de1098faa9c7c3e6ec0d2e200a", "score": "0.6486788", "text": "function resetScore(){\n localStorage.removeItem('game1HighScore');\n highScoreBoard.textContent='HIGH SCORE: ' + 0;\n}", "title": "" }, { "docid": "b08632af5582a8b4d727451a11ca0e7e", "score": "0.6482342", "text": "function restart () {\n quiz.isGameOver = false\n quiz.currentQuestion = 0\n quiz.player1Score = 0\n quiz.player2Score = 0\n}", "title": "" }, { "docid": "d7ed8634f1fc3d4802c2d93974bb6c09", "score": "0.64786977", "text": "function restart() {\n if (health === 0) {\n if (score > localStorage.getItem('top-score')) {\n localStorage.setItem('top-score', score);\n }\n health = 100;\n healthText.text = 'Shields: ' + health;\n\n score = 0;\n scoreText.text = 'Score: ' + score;\n let topScore = localStorage.getItem('top-score');\n topScoreText.text = 'Top Score: ' + topScore;\n\n ship.reset(game.width / 2, 700)\n ship.revive();\n gameOver.visible = false;\n restartText.visible = false;\n }\n}", "title": "" }, { "docid": "23018a96a36eeea2bd8ec05151e3fee0", "score": "0.64664733", "text": "function reset() {\r\n localStorage.setItem(\"score1\", '0');\r\n localStorage.setItem(\"score2\", '0');\r\n CONSTS.gameSpeed = 20;\r\n CONSTS.score1 = 0;\r\n CONSTS.score2 = 0;\r\n CONSTS.stick1Speed = 0;\r\n CONSTS.stick2Speed = 0;\r\n CONSTS.ballTopSpeed = 0;\r\n CONSTS.ballLeftSpeed = 0;\r\n CSS.stick1.top = 253;\r\n CSS.stick2.top = 253;\r\n $(\"#score1-div\").remove();\r\n $(\"#score2-div\").remove();\r\n $(\"#score1-val\").remove();\r\n $(\"#score2-val\").remove();\r\n $(\"#pong-game\").remove();\r\n $(\"#pong-line\").remove();\r\n $(\"#pong-ball\").remove();\r\n clearInterval(window.pongLoop);\r\n start();\r\n }", "title": "" }, { "docid": "1fce889399c73f3b92e80dff687bd457", "score": "0.64656544", "text": "function scoreHistory() {\n\tvar initials = initialsInput.value;\n\tvar scoreEntry = initials + \" - \" + secondsLeft;\n\tscores.push(scoreEntry);\n\tlocalStorage.setItem(\"scores\", JSON.stringify(scores));\n\tquizscoreDiv.classList.toggle(\"collapse\");\n\tscoreHistoryDiv.classList.toggle(\"collapse\");\n\tactiveDiv = scoreHistoryDiv;\n\tlistofscores();\n}", "title": "" }, { "docid": "1d8c426fbd708a79643e33190b390295", "score": "0.64631313", "text": "function startPoint() {\n\tscores = [0, 0];\n\tactivePlayer = 0;\n\troundScore = 0;\n\tgamePlaying = true;\n\n\t// Sets every thing on the screen to some default value\n\tdocument.querySelector('.win').textContent = 'Win Socre';\n\tdocument.querySelector('#name-0').textContent = 'Player 1';\n\tdocument.querySelector('#name-1').textContent = 'Player 2';\n\tdocument.querySelector('.player-0-panel').classList.remove('winner');\n\tdocument.querySelector('.player-1-panel').classList.remove('winner');\n\tdocument.querySelector('.player-0-panel').classList.remove('active');\n\tdocument.querySelector('.player-1-panel').classList.remove('active');\n\tdocument.querySelector('.player-0-panel').classList.add('active');\n\tdocument.querySelector(\"#score-0\").textContent = '0';\n\tdocument.querySelector(\"#score-1\").textContent = '0';\n\tdocument.querySelector(\"#current-0\").textContent = '0';\n\tdocument.querySelector(\"#current-1\").textContent = '0';\n\tdocument.querySelector(\"#dice1\").style.display = \"none\";\n\tdocument.querySelector(\"#dice2\").style.display = \"none\";\n}", "title": "" }, { "docid": "0d2b428128e03c5e3760c32b21dced11", "score": "0.6459966", "text": "function resetAllStates() {\n // Set the timer back to 75\n time = 75;\n // Show the timer to the user\n shownTime.text(time);\n // Set endQuiz variable to false\n quizEnded = false;\n // Set the userAnswers array to be empty\n userAnswers = [];\n // Set the scoreboard input value to be empty\n userNameInput.val('');\n}", "title": "" }, { "docid": "9fc5e4ecde5d4f0ff5fe8f5e349f4525", "score": "0.64567024", "text": "function setScore(){\r\n var userIni = document.getElementById(\"initials\").value;\r\n let storeInfo = totalScore + \" points - \" + userIni\r\n document.getElementById(\"high\").textContent = storeInfo;\r\n localStorage.setItem(\"highestInfo\", storeInfo);\r\n localStorage.setItem(\"highestScore\", totalScore);\r\n document.getElementById(\"setHighScore\").style.display = \"none\";\r\n document.getElementById(\"initials\").style.display = \"none\";\r\n document.getElementById(\"userScore\").textContent = \"Thank You For Playing\" ;\r\n}", "title": "" }, { "docid": "17eef1579c1a3fa67ed5165a4133a3d6", "score": "0.6454725", "text": "function startTimer() {\n\t\tlet timer = localStorage.getItem('Timer') * 60; // turn minutes into seconds\n\t\tlet minutes;\n\t\tlet seconds;\n\t\tconst countdown = document.getElementById('timer');\n\t\tconst overlayEnd = document.getElementById('endgame-overlay');\n\n\t\tsetInterval(() => {\n\t\t\tminutes = parseInt(timer / 60, 10);\n\t\t\tseconds = parseInt(timer % 60, 10);\n\n\t\t\tminutes = minutes < 10 ? `0${minutes}` : minutes;\n\t\t\tseconds = seconds < 10 ? `0${seconds}` : seconds;\n\n\t\t\tlocalStorage.setItem('TimerMinutes', minutes);\n\t\t\tlocalStorage.setItem('TimerSeconds', seconds);\n\n\t\t\tconst xminutes = localStorage.getItem('TimerMinutes');\n\t\t\tconst xseconds = localStorage.getItem('TimerSeconds');\n\n\t\t\tif (xminutes && xseconds) {\n\t\t\t\t// putting timer in html\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\tcountdown.textContent = `${xminutes}:${xseconds}`;\n\t\t\t} else {\n\t\t\t\tcountdown.textContent = '00:00';\n\t\t\t}\n\n\t\t\t// when the timer has stopped\n\t\t\tif (--timer < 0) {\n\t\t\t\tcountdown.textContent = 'Game over';\n\t\t\t\toverlayEnd.style.display = 'flex';\n\t\t\t\tdeleteTimer();\n\t\t\t}\n\t\t}, 1000);\n\t\t// function to show progress bar\n\t\tstartBar();\n\t}", "title": "" }, { "docid": "8e91e5183eabe0f9554d70aedf1d5206", "score": "0.64534134", "text": "function GameStart() {\n\t\tcomputerGuess = \"\";\n\t\tusersChoice = \"\";\n\t\tuserGuess = \"\";\n\t\tchosenCrystal = false;\n\t\t$(\"#computer-guess, #user-tally\").empty();\n\t\t\n\t}", "title": "" }, { "docid": "4cc8aa19dea7bec9f8ed82be6ad700ae", "score": "0.6453092", "text": "firstTimePlay() {\n if (localStorage.getItem(\"playedBefore\") !== \"true\") {\n // User Global Settings\n localStorage.setItem(\"playedBefore\", \"true\");\n\n localStorage.setItem(\"registedInServer\", \"false\");\n localStorage.setItem(\"score\", 0);\n\n localStorage.setItem(\"musicConfig\", JSON.stringify({volume: 0.1, loop: true}));\n localStorage.setItem(\"VFXConfig\", JSON.stringify({volume: 0.1}));\n\n // format: [5, 5, 3, ...] where the first element is respective to chapter 1 and is the level the user has access to\n localStorage.setItem(\"levelsReached\", JSON.stringify([0]));\n\n // levels' scores\n localStorage.setItem(\"levelsScores\", JSON.stringify({}));\n\n // skins that user owns\n localStorage.setItem(\"skins\", JSON.stringify([\"player\"]));\n }\n }", "title": "" }, { "docid": "7c030356254cf3660995340143a1f162", "score": "0.64516324", "text": "function initGameStatus() {\n scoreText.text = 'Score: ' + score;\n scoreText.update();\n\n lifeText.text = 'Life: ' + life;\n lifeText.update();\n\n if (life == 0) {\n clearInterval(gameArea.interval);\n setTimeout(function () {\n retryGame();\n if (localStorage.getItem('revUserId') != null) {\n //save score\n }\n gameArea.interval = setInterval(retryGameArea, 20);\n },250);\n // gameArea.stop();\n }\n}", "title": "" }, { "docid": "18ee13f7c6cc231761059644aee1e3ac", "score": "0.6448718", "text": "function restart() {\n $(\".highScore1\").hide();\n $(\".highScore2\").hide();\n $(\".highScore3\").hide();\n $(\".playAgain\").remove();\n $(\".userhighscore\").remove();\n $(\"h1\").text(\"Test your Javascript Knowledge!\");\n $(\".scoreboardPTags\").hide();\n $(\".welcome-p\").show();\n $(\".welcome-p\").text(\"Back for another go?!\");\n $(\".welcome-p2\").show();\n $(\".welcome-p2\").text(\n \"You'll be prompted with a Javascript question with four mulitple choice answers. Click the answer you believe to be true. If you select the wrong answer you'll lose 5 seconds off your time. time starts at 60 seconds!\"\n );\n\n $(\"#startBtn\").show();\n startingTime = 60;\n questionPlusAnswer = -1;\n scoreTracker = 0;\n }", "title": "" }, { "docid": "2a3ceb88fb13722fcfce7c0a0eae8100", "score": "0.6440576", "text": "function resetGame() {\n elapsedTime = 0;\n score = 0;\n userName.innerHTML = ``;\n console.log(\"resetGame\");\n}", "title": "" }, { "docid": "e8e0822ec59d58782b9e30c544543d35", "score": "0.6434862", "text": "function clearScores() {\n\n\t\tif ($(\"#highScores tr\").length > 1) {\n\n\t\t\tlocalStorage.removeItem(\"scores\");\n\t\t\tstoredScores = [];\n\t\t\t\n\t\t\t// Fun animation, fun sound, and removal of localStorage/High Score elements.\n\t\t\t$(\".added\").animate({\n\n\t\t\t\t'padding': \"0px\",\n\t\t\t\t'height': \"0px\",\n\t\t\t\t'font-size': \"0px\",\n\t\t\t\t'margin': \"0px\"\n\n\t\t\t}, 4800, function() {\n\n\t\t\t\t$(\".added\").remove();\n\n\t\t\t});\n\t\t\tsounds.shutdown();\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "a7a8d4cfb8bf0d246ecb9c2e362e1b36", "score": "0.6434004", "text": "function startGame() {\n $(\".score\").text(\"Score: 0\"); // Reset score to 0\n $(\".hiScore\").text(\"High Score: \" + localStorage.getItem(\"highscore\")); // Display high score\n $(\".gameContainer\").show(); // Show game div\n $(\".msgContainer\").fadeOut(300); // Fade out start message div\n setTimeout(nextSequence, 1000); // In one second, start the sequence\n started = true; // Game now started\n} // End of startGame function", "title": "" } ]
45fa6d681fb11cfaf111650f0ca10ad0
it is a backbone objectc
[ { "docid": "d301c187120aa21c599bf5de7b10c8f8", "score": "0.0", "text": "function Signaler(root, roomid) {\n var socket;\n\n // unique identifier for the current user\n var userid = root.userid || getToken();\n\n if (!root.userid) {\n root.userid = userid;\n }\n\n // self instance\n var signaler = this;\n\n // object to store all connected peers\n var peers = {};\n\n // object to store ICE candidates for answerer\n var candidates = {};\n\n var numberOfParticipants = 0;\n\n // it is called when your signaling implementation fires \"onmessage\"\n this.onmessage = function(message) {\n // if new room detected\n console.log(signaler.sentParticipationRequest);\n console.log(roomid , \" \" , message);\n if(message.roomid!=null && message.userid!=null){\n screen_roomid =message.roomid;\n screen_userid =message.userid;\n console.log(\"incoming shared screen\");\n }\n if (message.roomid == roomid && message.broadcasting && !signaler.sentParticipationRequest){\n screen.onscreen(message);\n }else {\n // for pretty logging\n console.debug(JSON.stringify(message, function(key, value) {\n if (value.sdp) {\n console.log(value.sdp.type, '————', value.sdp.sdp);\n return '';\n } else return value;\n }, '————'));\n }\n\n // if someone shared SDP\n if (message.sdp && message.to == userid)\n this.onsdp(message);\n\n // if someone shared ICE\n if (message.candidate && message.to == userid)\n this.onice(message);\n\n // if someone sent participation request\n if (message.participationRequest && message.to == userid) {\n var _options = options;\n _options.to = message.userid;\n _options.stream = root.stream;\n peers[message.userid] = Offer.createOffer(_options);\n numberOfParticipants++;\n if (root.onNumberOfParticipantsChnaged) root.onNumberOfParticipantsChnaged(numberOfParticipants);\n }\n };\n\n // if someone shared SDP\n this.onsdp = function(message) {\n var sdp = JSON.parse(message.sdp);\n\n if (sdp.type == 'offer') {\n var _options = options;\n _options.stream = root.stream;\n _options.sdp = sdp;\n _options.to = message.userid;\n peers[message.userid] = Answer.createAnswer(_options);\n }\n\n if (sdp.type == 'answer') {\n peers[message.userid].setRemoteDescription(sdp);\n }\n };\n\n // if someone shared ICE\n this.onice = function(message) {\n message.candidate = JSON.parse(message.candidate);\n\n var peer = peers[message.userid];\n if (!peer) {\n var candidate = candidates[message.userid];\n if (candidate) candidates[message.userid][candidate.length] = message.candidate;\n else candidates[message.userid] = [message.candidate];\n } else {\n peer.addIceCandidate(message.candidate);\n\n var _candidates = candidates[message.userid] || [];\n if (_candidates.length) {\n for (var i = 0; i < _candidates.length; i++) {\n peer.addIceCandidate(_candidates[i]);\n }\n candidates[message.userid] = [];\n }\n }\n };\n\n // it is passed over Offer/Answer objects for reusability\n var options = {\n onsdp: function(sdp, to) {\n console.log('local-sdp', JSON.stringify(sdp.sdp, null, '\\t'));\n\n signaler.signal({\n sdp: JSON.stringify(sdp),\n to: to\n });\n },\n onicecandidate: function(candidate, to) {\n signaler.signal({\n candidate: JSON.stringify(candidate),\n to: to\n });\n },\n onaddstream: function(stream, _userid) {\n console.log('onaddstream>>>>>>'+ stream);\n //document.getElementById(\"viewScreenShareButton\").disabled=false;\n /*document.getElementById(\"viewScreenShareButton\").removeAttribute(\"disabled\");*/\n\n stream.onended = function() {\n if (root.onuserleft) root.onuserleft(_userid);\n };\n\n var video = document.createElement('video');\n video.id = _userid;\n video[isFirefox ? 'mozSrcObject' : 'src'] = isFirefox ? stream : window.webkitURL.createObjectURL(stream);\n video.autoplay = true;\n video.controls = true;\n video.play();\n\n function onRemoteStreamStartsFlowing() {\n if (isMobileDevice) {\n return afterRemoteStreamStartedFlowing();\n }\n\n if (!(video.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA || video.paused || video.currentTime <= 0)) {\n afterRemoteStreamStartedFlowing();\n } else\n setTimeout(onRemoteStreamStartsFlowing, 300);\n }\n\n function afterRemoteStreamStartedFlowing() {\n if (!screen.onaddstream) return;\n screen.onaddstream({\n video: video,\n stream: stream,\n userid: _userid,\n type: 'remote'\n });\n }\n\n onRemoteStreamStartsFlowing();\n }\n };\n\n // call only for session initiator\n this.broadcast = function(_config) {\n signaler.roomid = _config.roomid || getToken();\n\n if (_config.userid) {\n userid = _config.userid;\n }\n\n signaler.isbroadcaster = true;\n (function transmit() {\n signaler.signal({\n roomid: signaler.roomid,\n broadcasting: true\n });\n\n if (!signaler.stopBroadcasting && !root.transmitOnce)\n setTimeout(transmit, 3000);\n })();\n\n // if broadcaster leaves; clear all JSON files from Firebase servers\n if (socket.onDisconnect) socket.onDisconnect().remove();\n };\n\n // called for each new participant\n this.join = function(_config) {\n signaler.roomid = _config.roomid;\n this.signal({\n participationRequest: true,\n to: _config.to\n });\n signaler.sentParticipationRequest = true;\n };\n\n window.addEventListener('beforeunload', function() {\n leaveScreenRoom();\n }, false);\n\n window.addEventListener('keyup', function(e) {\n if (e.keyCode == 116) {\n leaveScreenRoom();\n }\n }, false);\n\n function leaveScreenRoom() {\n signaler.signal({\n leaving: true\n });\n\n /* \n rtcMultiConnection.removeStream({\n screen: true, // it will remove all screen streams\n stop: true // ask to stop old stream\n });*/\n \n rtcMultiConnection.removeStream(\"screen\"+rtcMultiConnection.channel);\n\n socket.emit(\"leave-channel\", {\n channel: rtcMultiConnection.channel,\n sender: rtcMultiConnection.userid\n });\n\n // stop broadcasting room\n if (signaler.isbroadcaster) signaler.stopBroadcasting = true;\n\n // leave user media resources\n if (root.stream) root.stream.stop();\n\n // if firebase; remove data from their servers\n if (window.Firebase) socket.remove();\n\n changeScreenshareButtonStatus(\"on\");\n alert(\"Leaving\");\n }\n\n root.leave = leaveScreenRoom;\n\n // signaling implementation\n // if no custom signaling channel is provided; use Firebase\n if (!root.openSignalingChannel) {\n if (!window.Firebase) throw 'You must link <https://cdn.firebase.com/v0/firebase.js> file.';\n\n // Firebase is capable to store data in JSON format\n // root.transmitOnce = true;\n socket = new window.Firebase('https://' + (root.firebase || 'signaling') + '.firebaseIO.com/' + root.channel);\n socket.on('child_added', function(snap) {\n var data = snap.val();\n\n var isRemoteMessage = false;\n if (typeof userid === 'number' && parseInt(data.userid) != userid) {\n isRemoteMessage = true;\n }\n if (typeof userid === 'string' && data.userid + '' != userid) {\n isRemoteMessage = true;\n }\n\n if (isRemoteMessage) {\n if (data.to) {\n if (typeof userid == 'number') data.to = parseInt(data.to);\n if (typeof userid == 'string') data.to = data.to + '';\n }\n\n if (!data.leaving) signaler.onmessage(data);\n else {\n numberOfParticipants--;\n if (root.onNumberOfParticipantsChnaged) {\n root.onNumberOfParticipantsChnaged(numberOfParticipants);\n }\n\n root.onuserleft(data.userid);\n }\n }\n\n // we want socket.io behavior; \n // that's why data is removed from firebase servers \n // as soon as it is received\n // data.userid != userid && \n if (isRemoteMessage) snap.ref().remove();\n });\n\n // method to signal the data\n this.signal = function(data) {\n data.userid = userid;\n socket.push(data);\n };\n } else {\n // custom signaling implementations\n // e.g. WebSocket, Socket.io, SignalR, WebSycn, XMLHttpRequest, Long-Polling etc.\n socket = root.openSignalingChannel(function(message) {\n message = JSON.parse(message);\n\n var isRemoteMessage = false;\n if (typeof userid === 'number' && parseInt(message.userid) != userid) {\n isRemoteMessage = true;\n }\n if (typeof userid === 'string' && message.userid + '' != userid) {\n isRemoteMessage = true;\n }\n\n if (isRemoteMessage) {\n if (message.to) {\n if (typeof userid == 'number') message.to = parseInt(message.to);\n if (typeof userid == 'string') message.to = message.to + '';\n }\n\n if (!message.leaving) signaler.onmessage(message);\n else {\n root.onuserleft(message.userid);\n numberOfParticipants--;\n if (root.onNumberOfParticipantsChnaged) root.onNumberOfParticipantsChnaged(numberOfParticipants);\n }\n }\n });\n\n // method to signal the data\n this.signal = function(data) {\n data.userid = userid;\n socket.send(JSON.stringify(data));\n };\n }\n }", "title": "" } ]
[ { "docid": "74f6e306bfe175a621970adb831ef55b", "score": "0.6628317", "text": "function get_backbone_obj(id){\n /* XXX nikita/arik: need better way */\n var main = E.is_rmt || id!='be_bg_main' ? bg.RMT : bg.be_bg_main;\n return main && main.be_browser.backbone.server.obj[id];\n}", "title": "" }, { "docid": "6dd26b69c6c7177f4737962f7cd0b7fe", "score": "0.62193435", "text": "get object() { return this._object; }", "title": "" }, { "docid": "ccdf5e0f01fcad8420d35ad87dc9f38b", "score": "0.6059721", "text": "static LoadCARenderFromObj(render, obj)\n {\n var map = obj.CellularAutomata;\n obj.CellularAutomata = new CellularAutomata(obj);\n obj.CellularAutomata.grid.setNewMap(map);\n \n render.ReInstantiate(obj);\n }", "title": "" }, { "docid": "5b36260245314cc67278700083dd84c5", "score": "0.6007897", "text": "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "title": "" }, { "docid": "df03a94d82fc6bd7321fe33dcd21d245", "score": "0.5949211", "text": "init(data) {\r\n this.object = data.object;\r\n }", "title": "" }, { "docid": "df03a94d82fc6bd7321fe33dcd21d245", "score": "0.5949211", "text": "init(data) {\r\n this.object = data.object;\r\n }", "title": "" }, { "docid": "48e49cc2355d8d07c684cb2890adcf9e", "score": "0.5937282", "text": "function SE_Obj (){}", "title": "" }, { "docid": "f144fdc9cabe4c5afb60cedfd0f07cc8", "score": "0.5936976", "text": "get object() {\n\t\treturn this.__object;\n\t}", "title": "" }, { "docid": "687a493952ea2868a542b33d711c4720", "score": "0.58353996", "text": "getCurrentObj() {\n return this.model;\n }", "title": "" }, { "docid": "687a493952ea2868a542b33d711c4720", "score": "0.58353996", "text": "getCurrentObj() {\n return this.model;\n }", "title": "" }, { "docid": "51c5108f9931bfbfdf6484f70644c74d", "score": "0.5765713", "text": "function Model() {}", "title": "" }, { "docid": "1d0e3074034f2a833843e7d3c0140be3", "score": "0.5681144", "text": "get objectInstance() {\n return this.parent.objectInstance;\n }", "title": "" }, { "docid": "b794fe96368d726d100c2c9208fd732e", "score": "0.56511295", "text": "constructor() {\r\n // Objマネージャーに登録\r\n super();\r\n\r\n this.container = new createjs.Container();\r\n }", "title": "" }, { "docid": "4e97320073cd87c744d53376104c5a0e", "score": "0.5650679", "text": "get obj() { return this.object; }", "title": "" }, { "docid": "242921a8fe8a7c35653795636625df55", "score": "0.56501764", "text": "constructor(app) {\n this.app = app;\n this.element = E.div('objinfo');\n const id = int(this.app.params.get('id'));\n this.obj = this.app.game.objects[id];\n if(!this.obj) {\n alert(\"Object not found\");\n }\n }", "title": "" }, { "docid": "84ca3885c82cb4c3849a9d4ae96ef716", "score": "0.5626974", "text": "function viewObjectAs(object,cName) {\n object = E.getObjectState(object);\n for(var i=0; i<object.length; i++) {\n\tif (cName === object[i][0]) {\n\t return E.createObject(object.slice(i)); \n\t}\n }\n throw new Error(\"Not an object: \" + JSON.stringify(object));\n}", "title": "" }, { "docid": "f09c0dbe73bdf31e9f167d768945de84", "score": "0.5618387", "text": "constructor()\n {\n /**\n * The transformation of the display object.\n *\n * @member {Transform}\n */\n this.transform = new math.Transform();\n\n /**\n * Is this object visible? When set to false, the object is not rendered.\n *\n * @member {boolean}\n * @default true\n */\n this.visible = true;\n\n /**\n * The alpha of the object when rendered.\n * 0 = transparent, 1 = opaque.\n *\n * @member {number}\n * @default 1\n */\n this.alpha = 1;\n\n /**\n * The world alpha of the object (local alpha * parent alpha).\n * 0 = transparent, 1 = opaque.\n *\n * @member {number}\n * @default 1\n */\n this.worldAlpha = 1;\n\n /**\n * The parent scene object this belongs to.\n *\n * @member {Container}\n */\n this.parent = null;\n\n /**\n * Dispatched when this object is added to a new parent.\n *\n * The callback looks like {@link SceneObject.OnAddedToParentCallback}\n *\n * @member {Signal}\n */\n this.onAddedToParent = new Signal();\n\n /**\n * Dispatched when this object is removed from its parent.\n *\n * The callback looks like {@link SceneObject.OnRemovedFromParentCallback}\n *\n * @member {Signal}\n */\n this.onRemovedFromParent = new Signal();\n\n /**\n * The bounding box of this scene object.\n *\n * @private\n * @member {BoundingBox}\n */\n this._bounds = new math.BoundingBox();\n\n /**\n * Tracker for if the bounds are dirty. Each time the object\n * is updated, the bounds are marked as dirty and recalculated\n * next time they are requested.\n *\n * @private\n * @member {boolean}\n */\n this._boundsDirty = true;\n\n /**\n * When added to a new parent, the parent is passed in the dispatch.\n *\n * @memberof SceneObject\n * @callback OnAddedToParentCallback\n * @param {SceneObject} parent - The parent it was added to.\n */\n\n /**\n * When removed from a parent, the parent is passed in the dispatch.\n *\n * @memberof SceneObject\n * @callback OnRemovedFromParentCallback\n * @param {SceneObject} parent - The parent it was added to.\n */\n }", "title": "" }, { "docid": "de0e7f6e0d8f319ff83b8a89b0d77c86", "score": "0.5604899", "text": "function ModelHelper() {\n\t\n}", "title": "" }, { "docid": "5978b796d59c758a500fceef9cd368ac", "score": "0.55977094", "text": "function getObjectModel()\n{\n return FlowscriptUtils.getObjectModel(cocoon);\n}", "title": "" }, { "docid": "72e40b150b67ee036f3a665661b192a8", "score": "0.5591631", "text": "function ReObject() {}", "title": "" }, { "docid": "f773a06171135d5a3635186aa296e779", "score": "0.5578086", "text": "function getObjectModel()\n{\n\treturn FlowscriptUtils.getObjectModel(cocoon);\n}", "title": "" }, { "docid": "a22c7cd612866d4ff8b9bf7fce3d0eb9", "score": "0.5571829", "text": "function Model() {\n return;\n}", "title": "" }, { "docid": "9a10e7d6b3899c7ad646d0919d3500e9", "score": "0.5571759", "text": "function getObjectModel()\n{\n return FlowscriptUtils.getObjectModel(cocoon);\n}", "title": "" }, { "docid": "a5f09d477a6befc95e5f3cec51396847", "score": "0.55479556", "text": "constructor(obj){\n this.visualization = new THREE.BoxHelper(obj);\n this.box = new THREE.Box3().setFromObject(obj);\n //If you want to see the visualization, un-comment the next line\n //scene.add(this.visualization);\n }", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.5545985", "text": "function TView() {}", "title": "" }, { "docid": "b98c8f966b2a33fdf8c660d280a140ef", "score": "0.5536157", "text": "get model() {\r\n return this._model;\r\n }", "title": "" }, { "docid": "5196b3d65d8f4fb9853949c6987bda5a", "score": "0.55309194", "text": "function Collection(obj){\n this.obj = obj;\n}", "title": "" }, { "docid": "de8794765e4950be25b1c7db5a026d7e", "score": "0.5509557", "text": "isCoreObject(object) {\n return _.has(object, \"_chOriginal\");\n }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5497861", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5497861", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5497861", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5497861", "text": "function TView() { }", "title": "" }, { "docid": "b5282f0da26dd18742453b07cf56e07a", "score": "0.5486749", "text": "getObject() {\n return this.object;\n }", "title": "" }, { "docid": "0e8f5b738bf16eead26b4b195225e79a", "score": "0.54532164", "text": "constructor() {\n super({objectMode: true});\n }", "title": "" }, { "docid": "2dedba6dbb3e0b9bd316625ad98e4a6e", "score": "0.54502094", "text": "get serializedObject() {}", "title": "" }, { "docid": "e5f7af5427d734e9fae4e861f35e88ac", "score": "0.5443614", "text": "get view() {\n return {\n owner: this.owner,\n type: this.readableType,\n }\n }", "title": "" }, { "docid": "5e8d2f64a0b9b20fb6e348f39c7a15cd", "score": "0.5438203", "text": "constructor() {\n super({ objectMode: true });\n }", "title": "" }, { "docid": "68680c8f62e275372d59e707b88f18bf", "score": "0.5431349", "text": "function BBObject(){\n\n this.position = {x:0,y:0};\n this.dimension = {};\n this.color;\n this.stage;\n\n\n this.render = function(ctx){\n console.log(\"render\");\n };\n\n\n this.getCurrentPosition = function(){\n return this.position;\n };\n\n this.setPosition = function(x,y){\n this.position.x = x;\n this.position.y = y;\n };\n\n this.getCanvas = function(){\n return this.stage;\n };\n}", "title": "" }, { "docid": "e6db593127c4942bd760a92a591cf332", "score": "0.54305094", "text": "model() {}", "title": "" }, { "docid": "5450ab20be23e9debb6d0ed04b4d2650", "score": "0.5409775", "text": "constructor(model) {\n\tsuper();\n this.model = model;\n }", "title": "" }, { "docid": "402d501cbb240786286cf0411a37bd50", "score": "0.54095066", "text": "function HouseView(){}", "title": "" }, { "docid": "14d7f575774034a664becce7973e1d78", "score": "0.54062736", "text": "function DisplayObject() {\n this.last = this, this.first = this, this.position = new Point, this.scale = new Point(1, 1), this.pivot = new Point(0, 0), this.rotation = 0, this.alpha = 1, this.visible = !0, this.hitArea = null, this.buttonMode = !1, this.renderable = !1, this.parent = null, this.stage = null, this.worldAlpha = 1, this._interactive = !1, this.defaultCursor = \"pointer\", this.worldTransform = mat3.create(), this.localTransform = mat3.create(), this.color = [], this.dynamic = !0, this._sr = 0, this._cr = 1, this.filterArea = new Rectangle(0, 0, 1, 1);\n}", "title": "" }, { "docid": "b8643f8f0a64e750fea805808ea13767", "score": "0.540058", "text": "getObject() {\n return this.object;\n }", "title": "" }, { "docid": "3f46836292dd7e1e3e4e21a3f2c6e1bb", "score": "0.5396708", "text": "get model() {\n return this._model;\n }", "title": "" }, { "docid": "3f46836292dd7e1e3e4e21a3f2c6e1bb", "score": "0.5396708", "text": "get model() {\n return this._model;\n }", "title": "" }, { "docid": "3f46836292dd7e1e3e4e21a3f2c6e1bb", "score": "0.5396708", "text": "get model() {\n return this._model;\n }", "title": "" }, { "docid": "fe9cded26e6ce8316d60783bd7451f67", "score": "0.5393236", "text": "function HeliumView(){\n\t\n this.name = \"helium\";\n}", "title": "" }, { "docid": "d0a736ed228fa172d67aa96a352610d6", "score": "0.5382623", "text": "onRender(c){\n\n\t}", "title": "" }, { "docid": "e3de8043fb78eb3344bbf245443877c1", "score": "0.5371585", "text": "render(obj) {\n super.render(obj)\n this.renderEntity('lastTime', Date)\n this.renderEntity('avatar', Tank)\n }", "title": "" }, { "docid": "23d84fde568a844879a725022bcc8a81", "score": "0.5370822", "text": "edit(obj){\n this.object = obj;\n }", "title": "" }, { "docid": "ba399b47e4cb51d14a3865856950d386", "score": "0.5370639", "text": "function Be(a){Be.s.constructor.call(this,a);ze(this)}", "title": "" }, { "docid": "b7f20024e80f8044abd74af889d8297b", "score": "0.5362914", "text": "constructor(){\n\t\tthis.view = view;\n\t}", "title": "" }, { "docid": "d28d707862e6694418f75bf1204177bd", "score": "0.5357484", "text": "function isAModel(obj){\n var markers = ['isSet', 'isReadOnly', 'isDirty', 'originalData', 'changedData', 'data'];\n for(var i = 0, len = markers.length; i < len; i++){if(!obj.hasOwnProperty(markers[i])){return false;}}\n return true;\n }", "title": "" }, { "docid": "89d47487dc32003e2d05908df44501f8", "score": "0.5356711", "text": "constructor() {\n super();\n this.__avaliable = true;\n this.__instanceID = Ubject.__nextInstanceID++;\n this._uuid = Graphic_1.GL.Math.generateUUID();\n Ubject.__ubjects[this._uuid] = this;\n }", "title": "" }, { "docid": "f178bdfd4d075b1ce0c5ab6f64ed4af5", "score": "0.5356467", "text": "function VaporObject(name) {\n if (typeof name === \"undefined\") { name = \"VaporObject\"; }\n this.Name = name;\n }", "title": "" }, { "docid": "3820a4aad5679684c94491e2b2505939", "score": "0.5343225", "text": "constructor(obj) {\n this.color = obj.color\n this.model = obj.model\n this.brand = obj.brand\n }", "title": "" }, { "docid": "bf974d351a6cc882bed93d5c391f5393", "score": "0.5341074", "text": "static createModel(inobj) {\n\t\tconst model = super.createModel(inobj);\n\t\tmodel.creationDate = new Date();\n\t\tmodel.pid = process.pid;\n\t\treturn model;\n\t}", "title": "" }, { "docid": "445457e88ac3808c6a36a17376c7444a", "score": "0.5328557", "text": "initGameObjets(){\n\t\tlet modele = this.controller.modele;\n\t\t//Init les objets\n\t\tthis.scene.add(modele.table.model);\n\t\tthis.scene.add(modele.environment.model)\n\t\tthis.scene.add(modele.board.model)\t\t\n\t}", "title": "" }, { "docid": "e9bd6bdf935188d98aa50896fa7134b6", "score": "0.5327395", "text": "function gy(){var t=this;ci()(this,{$geometry:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$geometryContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.geometryContainer}}})}", "title": "" }, { "docid": "c65ea886d6edc2a4bd735440578cae0d", "score": "0.531484", "text": "get model() {\n return { name: this.name, id: this.id };\n }", "title": "" }, { "docid": "0154d0c074b1ef5b8a1ece519d635903", "score": "0.5307506", "text": "function viewer_display_object(index) {\n\tvar obj;\n\t\n\t//create visually the object depending on the type\n\tif(_current_location.objects[index].type === \"rect\") {\n\t\tobj = new fabric.Rect(_current_location.objects[index]);\n\t} else {\n\t\tif(_current_location.objects[index].type === \"triangle\") {\n\t\t\tobj = new fabric.Triangle(_current_location.objects[index]);\n\t\t} else {\n\t\t\tobj = new fabric.Circle(_current_location.objects[index]);\n\t\t}\n\t}\n\t\n\tif(_lockObject === true) {\n\t\tobj.lockMovementX = true;\n\t\tobj.lockMovementY = true;\n\t\tobj.lockRotation = true;\n\t\tobj.lockScalingX = true;\n\t\tobj.lockScalingY = true;\n\t\tobj.lockUniScaling = true;\n\t\tobj.hasBorders = false;\n\t\tobj.hasControls = false;\n\t}\n\t\n\t//circle.set('device_id',_current_location.objects[index].device_id);\n\t_canvas.add(obj);\n\t\t\n\t//need to display image ?\n\tif(typeof(_current_location.objects[index].display_icon) !== 'undefined' && _current_location.objects[index].display_icon == \"1\") {\n\t\tfabric.Image.fromURL(family_icon_path + _current_location.objects[index].family_icon_name, function(img) {\n\t\t\timg.set({\n\t\t\t\tleft: obj.left,\n\t\t\t\ttop: obj.top,\n\t\t\t\toriginX: \"center\",\n\t\t\t\toriginY: \"center\"\n\t\t\t});\n\n\t\t\timg.perPixelTargetFind = true;\n\t\t\timg.targetFindTolerance = 4;\n\t\t\timg.hasControls = img.hasBorders = false;\n\t\t\timg.evented = false; //img doesn't received event\n\t\t\t\n\t\t\tif(obj.getHeight() < obj.getWidth())\n\t\t\t\timg.scaleToHeight(obj.getHeight());\n\t\t\telse\n\t\t\t\timg.scaleToWidth(obj.getWidth());\n\n\t\t\timg.setAngle(obj.getAngle()); //rotation\n\t\t\t\t\n\t\t\timg.setLeft(obj.getLeft());\n\t\t\timg.setTop(obj.getTop());\n\t\t\n\t\t\t//link object and image\n\t\t\timg.device_id = obj.device_id;\n\t\t\tobj.linked_image = img;\n\t\t\timg.linked_object = obj;\n\t\t\t\n\t\t\t_canvas.add(img);\n\t\t});\n\t};\n\n\treturn obj;\n}", "title": "" }, { "docid": "c8291fbd627b5470b82e92fdb40fe01e", "score": "0.53040224", "text": "model() {\n return this.Model\n }", "title": "" }, { "docid": "55780e5fc463ff154d6196bf19e94af4", "score": "0.530364", "text": "update(obj){\n if(obj != undefined){\n //this.visualization.update();\n this.box = this.box.setFromObject(obj);\n }\n\n }", "title": "" }, { "docid": "e33e614fd11ab80f51ffa5c89de9891e", "score": "0.52985114", "text": "function ObjectFormController() {\n\t}", "title": "" }, { "docid": "961d9ca7f59de772aa9b777e03664f8f", "score": "0.5290064", "text": "CustomConcreteCrud(o,params) {\n params= params == undefined ? [] : params;\n params[\"todos\"]=true;\n var secondObject = this.cloneCCC(o);\n if (params[\"todos\"]) {\n secondObject.todos = secondObject.cloneCCC(\"todos\"); \n }\n if (params[\"children\"]) {\n secondObject.childrenF=params[\"children\"];\n }\n if (params[\"childrenF\"]) {\n for (var i = 0; i < params[\"childrenF\"].length; i++) {\n secondObject[params[\"childrenF\"][i]]=secondObject.cloneCCC(params[\"childrenF\"][i]);\n }\n }\n return secondObject;\n }", "title": "" }, { "docid": "58fd510cb0347707288cbbb6d0b24cc5", "score": "0.5288565", "text": "function DMObj() {}", "title": "" }, { "docid": "9019ed8a15ae915ce5caf29b516f333b", "score": "0.52869606", "text": "get _model(){\n return this.model\n }", "title": "" }, { "docid": "6352af1592c291e8790d280db8c2698e", "score": "0.5265018", "text": "function BardObject__init()\n{\n return this;\n}", "title": "" }, { "docid": "70f924f4511db4fa6d9a1760da60591c", "score": "0.525575", "text": "model() {\n return {};\n }", "title": "" }, { "docid": "7fffcfaa78ccb52dd8ebbe0cd52ad696", "score": "0.5236055", "text": "function ObjectivesModel(){\n\tthis._children = new CMIComponent(\"_children\", \"id,score,status\", \"readonly\", \"CMIString255\");\n\tthis._count = new CMIComponent(\"_count\", 0, \"readonly\", \"CMIInteger\");\n\tthis.objArray = ObjectiveArrayModel;\n\tthis.objArr = new Array();\n}", "title": "" }, { "docid": "a8694599d51a03cc3afde48cab0c4cbb", "score": "0.5229251", "text": "getObjects() {\n return this.scene;\n }", "title": "" }, { "docid": "3c9df8493fc209edb16f72f2b43c5422", "score": "0.5228485", "text": "function View() {}", "title": "" }, { "docid": "3c9df8493fc209edb16f72f2b43c5422", "score": "0.5228485", "text": "function View() {}", "title": "" }, { "docid": "196567be4e92a99347e4a745c5ad9d6d", "score": "0.5228352", "text": "function PeopleCollection(){ //Essentially a facotryu that makes instances of people\n this.models = {}; \n}", "title": "" }, { "docid": "ff911fb48a9408a0add7e48c6ed57767", "score": "0.52097166", "text": "function GestureObjectModel(){\n \tthis.options=[];\n }", "title": "" }, { "docid": "fbf0aea5cc4fc54af4de5298162cd948", "score": "0.5198636", "text": "function eoDisplayObj(type){\r\n this.name = \"\";\r\n}", "title": "" }, { "docid": "0daa9536465bc05800e421bdccf2cd60", "score": "0.5191938", "text": "get boja(){\n return this._boja;\n }", "title": "" }, { "docid": "a9bd44f8d3c22b3fec10a3449a07b22f", "score": "0.5186145", "text": "constructor(name, model, noLeds, location, cameraModel){ \n super(name, model, noLeds, location);\n this.cameraModel = cameraModel; //De esta manera puedo agregar un nuevo atributo\n }", "title": "" }, { "docid": "7fa9a35f17697bd52ab6e19666f823cb", "score": "0.5171115", "text": "function Anco(){\n \t\tthis.init();\n \t}", "title": "" }, { "docid": "59d3c6aae815103efd3660db630e3215", "score": "0.5170823", "text": "getModel(model){\r\n return this.models[model];\r\n }", "title": "" }, { "docid": "fd38c172664e114e7403d233df8fd7ba", "score": "0.5169347", "text": "constructor(model) {\n this.model = model;\n }", "title": "" }, { "docid": "99c91c573129c4cee70aef462e5f37fc", "score": "0.5166863", "text": "get To(){return this._o;}", "title": "" }, { "docid": "ab2f66667fe0883f0d99cbb813f6b0fb", "score": "0.5164293", "text": "function HBV () {\n var hbv = new Object();\n // c stands for Context object\n hbv.c = new Context();\n // d stands for Data object\n hbv.d = new Data();\n // p stands for Plot object\n hbv.p = new Plot();\n // s stands for Schema object\n hbv.s = new Schema();\n // info stands for Information object\n hbv.info = new Object();\n return hbv;\n}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.5151874", "text": "get gameObject() {}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.5151874", "text": "get gameObject() {}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.5151874", "text": "get gameObject() {}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.5151874", "text": "get gameObject() {}", "title": "" }, { "docid": "a9ae5dc0c4e4e7036a3a4c503458801e", "score": "0.5150589", "text": "_displayObjs() {\n return <ViroNode>{this._makeObj()}</ViroNode>;\n }", "title": "" }, { "docid": "2f16b2d634ffdc2e709ec00abfbc15f8", "score": "0.5149816", "text": "get view(){return this._tempState.view;}", "title": "" }, { "docid": "a2d3d69c68abbc988da4f7efde93909c", "score": "0.51488566", "text": "function buildModel() {\n var MM = new Model('MetaVisu');\n\n var ClassA = Class.newInstance(\"A\");\n ClassA.addAttribute('wheels', Number);\n ClassA.setReference('next',ClassA,1)\n\n var ClassB = Class.newInstance(\"B\");\n ClassB.setAttribute('name',String)\n ClassB.addAttribute('quality', String);\n ClassB.setReference('wheelQuality',ClassA,-1);\n\n ClassA.setReference('xf',ClassB,1);\n\n var ClassC = Class.newInstance(\"C\");\n ClassC.addAttribute('name', String);\n\n ClassA.setReference('reminder',ClassC,-1);\n\n MM.add([ClassA,ClassB,ClassC])\n\n var smallA = ClassA.newInstance();\n smallA.wheels = 4;\n\n\n var bigA = ClassA.newInstance();\n bigA.wheels = 6;\n bigA.next=smallA\n\n var smallB = ClassB.newInstance();\n smallB.name='TUV'\n smallB.quality = 'good';\n smallB.wheelQuality=[smallA, bigA];\n\n var xA = ClassA.newInstance({wheels: 2});\n\n var xxA = ClassA.newInstance({wheels: 1});\n\n smallA.next=xA;\n xA.next=xxA;\n\n var smallx = ClassB.newInstance({name: 'NordVerif', quality: 'medium'});\n smallx.wheelQuality=[xA,xxA];\n\n var cein = ClassC.newInstance({name: 'Change'});\n smallA.reminder=cein;\n xxA.reminder=cein;\n\n var M = new Model('Testvisu')\n\n M.setReferenceModel(MM);\n\n M.add([smallA, smallB, bigA, cein, xA, xxA, smallx]);\n\n return M;\n}", "title": "" }, { "docid": "79d8a93cc45832d35292990436da4926", "score": "0.5143574", "text": "function whoIsThis(){\n\n return this;\n }", "title": "" }, { "docid": "7f346d7507ffad6a46bee802acf9f42c", "score": "0.513983", "text": "initialize(options) {\n\t\tconsole.log(options);\n\t\t// this.name = options.name;\n\t\t// i dont' have to do this because backbone did it for me:\n\t\t// this.model = options.model;\n\t\tconsole.log(this.model);\n\t}", "title": "" }, { "docid": "dc6e630114832ac65937ebf96bd09bc3", "score": "0.51373625", "text": "function v(t,e){g||(g=n(71));var r=function(t,e,n){var r=this;this.$parent=n,g.apply(this,arguments),this.$session(this.ownerDocument().$session()),n&&(n.on(\"save\",(function(){r.emit(\"save\",r),r.constructor.emit(\"save\",r)})),n.on(\"isNew\",(function(t){r.isNew=t,r.emit(\"isNew\",t),r.constructor.emit(\"isNew\",t)})))},i=null!=e?e.prototype:g.prototype;for(var s in(r.prototype=Object.create(i)).$__setSchema(t),r.prototype.constructor=r,r.schema=t,r.$isSingleNested=!0,r.events=new o,r.prototype.toBSON=function(){return this.toObject(_)},t.methods)r.prototype[s]=t.methods[s];for(var a in t.statics)r[a]=t.statics[a];for(var c in o.prototype)r[c]=o.prototype[c];return r}", "title": "" }, { "docid": "e961f2751bc0299b253b14867c479516", "score": "0.51362926", "text": "function Car(model){\n this.model = model;\n}", "title": "" }, { "docid": "e961f2751bc0299b253b14867c479516", "score": "0.51362926", "text": "function Car(model){\n this.model = model;\n}", "title": "" }, { "docid": "207a95e51560f17ad95b20649d396817", "score": "0.5134995", "text": "render(){\r\n \r\n }", "title": "" }, { "docid": "380009e9c101ba3dafb20541d6da638c", "score": "0.51346403", "text": "navigateConObject() {\n this[NavigationMixin.Navigate]({\n \"type\": \"standard__objectPage\",\n \"attributes\": {\n \"objectApiName\": \"Contact\",\n \"actionName\": \"home\"\n }\n });\n }", "title": "" }, { "docid": "87c3cc88551e95c496759a792ea23b51", "score": "0.5133127", "text": "render () {\n\n\t\treturn (\n <div>\n { geom ? <ModelView geometry = {geom}/>\n : this.loadModelFromUrl()}\n\n </div>\n\n\t\t)\n\t}", "title": "" }, { "docid": "f9bb1d62b7f52613baf03c7a2ed94e41", "score": "0.5133026", "text": "respondTo(type) {\n\n if (super.respondTo(type) != null) {\n return super.respondTo(type);\n }\n\n if (type == \"arcade-carousel\") {\n let obj = {};\n obj.background = \"/imperium/img/arcade/arcade-banner-background.png\";\n obj.title = \"Red Imperium\";\n return obj;\n }\n\n return null;\n\n }", "title": "" }, { "docid": "902782daa8b3f59ff9ce4c956e68ed63", "score": "0.5128109", "text": "_setModel(_) {\n super._setModel(Matches.#model);\n }", "title": "" }, { "docid": "f10b34de36b9a20c6b2fb988beeff7bb", "score": "0.5127928", "text": "function whoIsThisStric(){\n\n return this;\n }", "title": "" } ]
d2b5c4142bd510b9635f192d006ffbea
Checks each side of the current character, returns an object with values showing if they are on an unexplored edge
[ { "docid": "47902dd928128d8449bf03993850ddda", "score": "0.6215952", "text": "checkSidesOfCharacter() {\r\n let sides = { top: false, right: false, bottom: false, left: false }\r\n let playerPos = this.getTileAndSquareForCharacter(this.state.players[0])\r\n for (let side = 0; side < 4; side++) {\r\n switch (side) {\r\n case 0:\r\n if (playerPos.squareY === 0) {\r\n let tileAlreadyExists = false\r\n for (let item of this.state.cleanTileSet) {\r\n if (item.y === playerPos.tileY - 1 && item.x === playerPos.tileX) {\r\n tileAlreadyExists = true\r\n break\r\n }\r\n }\r\n if (!tileAlreadyExists) sides.top = true\r\n }\r\n case 1:\r\n if (playerPos.squareX === 3) {\r\n let tileAlreadyExists = false\r\n for (let item of this.state.cleanTileSet) {\r\n if (item.y === playerPos.tileY && item.x === playerPos.tileX + 1) {\r\n tileAlreadyExists = true\r\n break\r\n }\r\n }\r\n if (!tileAlreadyExists) sides.right = true\r\n }\r\n case 2:\r\n if (playerPos.squareY === 3) {\r\n let tileAlreadyExists = false\r\n for (let item of this.state.cleanTileSet) {\r\n if (item.y === playerPos.tileY + 1 && item.x === playerPos.tileX) {\r\n tileAlreadyExists = true\r\n break\r\n }\r\n }\r\n if (!tileAlreadyExists) sides.bottom = true\r\n }\r\n case 3:\r\n if (playerPos.squareX === 0) {\r\n let tileAlreadyExists = false\r\n for (let item of this.state.cleanTileSet) {\r\n if (item.y === playerPos.tileY && item.x === playerPos.tileX - 1) {\r\n tileAlreadyExists = true\r\n break\r\n }\r\n }\r\n if (!tileAlreadyExists) sides.left = true\r\n }\r\n }\r\n }\r\n this.setState({ explore: sides })\r\n }", "title": "" } ]
[ { "docid": "bf527d7026c79dfc1c7e26695053d25f", "score": "0.58354115", "text": "function isGameOver(state) {\n //if no blank spaces left, game over\n if (state[0].indexOf('blank') < 0) {\n return true;\n }//end if\n //check the rows\n for (var row = 0; row < state.length; row++) {\n var rowString = state[row].join();\n if (rowString.match(/red,red,red,red/) || rowString.match(/blue,blue,blue,blue/)) {\n return true;\n }//end if\n }//end for\n //check the columns\n for (var col = 0; col < state[0].length; col++) {\n var currentColumnArray = [];\n for (var row = 0; row < state.length; row++) {\n currentColumnArray.push(state[row][col]);\n }//end inner for\n var currentColumnString = currentColumnArray.join();\n if (currentColumnString.match(/red,red,red,red/) || currentColumnString.match(/blue,blue,blue,blue/)) {\n return true;\n }//end if\n }//end outer for\n //check diagonal\n for (var row = 0; row < state.length; row++) {\n for (var col = 0; col < state[row].length; col++) {\n if (state[row-3] && state[row-3][col+3]) {\n var diagRight = [state[row][col], state[row-1][col+1], state[row-2][col+2], state[row-3][col+3]];\n var diagRightString = diagRight.join();\n if (diagRightString.match(/red,red,red,red/) || diagRightString.match(/blue,blue,blue,blue/)) {\n return true;\n }//end if\n }//end if\n if (state[row-3] && state[row-3][col-3]) {\n var diagLeft = [state[row][col], state[row-1][col-1], state[row-2][col-2], state[row-3][col-3]];\n var diagLeftString = diagLeft.join();\n if (diagLeftString.match(/red,red,red,red/) || diagLeftString.match(/blue,blue,blue,blue/)) {\n return true;\n }//end inner if\n }//end if\n }//end outer for\n }//end outer for\n\n //return false if game is not over\n return false;\n}//end", "title": "" }, { "docid": "6b6ea39306a7c457a0e63f7ba35c8cf1", "score": "0.5809289", "text": "function hasReachedSides(item) {\n\t\tif ((item.x < 0) && item.isActive === true) {\n\t\t\titem.isActive = false;\n\t\t\t//console.log(item.name, \"has escaped left (x < 1)\");\n\t\t}\n\n\t\tif ((item.x > 1) && item.isActive === true) {\n\t\t\titem.isActive = false;\n\t\t\t//console.log(item.name, \"has espaced right(x > 1)\");\n\t\t}\n\t}", "title": "" }, { "docid": "9d3ac232341dbe1f05c1f3dc669cfb38", "score": "0.5791771", "text": "checkEdgeIsIsolated() {\r\n\r\n const edgeTiles = new Set();\r\n const edgeWitnesses = new Set();\r\n\r\n let everything = true;\r\n\r\n // load each tile on this edge into a set\r\n for (let i = 0; i < this.mask.length; i++) {\r\n if (this.mask[i]) {\r\n //edgeTiles.add(...this.boxes[i].tiles);\r\n for (let j = 0; j < this.boxes[i].tiles.length; j++) {\r\n edgeTiles.add(this.boxes[i].tiles[j]);\r\n }\r\n\r\n for (let j = 0; j < this.boxes[i].boxWitnesses.length; j++) {\r\n edgeWitnesses.add(this.boxes[i].boxWitnesses[j].tile);\r\n }\r\n \r\n } else {\r\n everything = false;\r\n }\r\n }\r\n\r\n //var text = \"\";\r\n //for (var i = 0; i < edgeTiles.size; i++) {\r\n // text = text + edgeTiles[i].asText() + \" \";\r\n //}\r\n //console.log(text);\r\n\r\n // if this edge is everything then it isn't an isolated edge\r\n //if (everything) {\r\n // this.writeToConsole(\"Not isolated because the edge is everything\");\r\n // return false;\r\n //}\r\n\r\n if (this.isolatedEdgeBruteForce != null && edgeTiles.size >= this.isolatedEdgeBruteForce.tiles.length) {\r\n this.writeToConsole(\"Already found an isolated edge of smaller size\");\r\n }\r\n\r\n // check whether every tile adjacent to the tiles on the edge is itself on the edge\r\n for (let i = 0; i < this.mask.length; i++) {\r\n if (this.mask[i]) {\r\n for (let j = 0; j < this.boxes[i].tiles.length; j++) {\r\n const tile = this.boxes[i].tiles[j];\r\n const adjTiles = this.board.getAdjacent(tile);\r\n for (let k = 0; k < adjTiles.length; k++) {\r\n const adjTile = adjTiles[k];\r\n if (adjTile.isCovered() && !adjTile.isSolverFoundBomb() && !edgeTiles.has(adjTile)) {\r\n this.writeToConsole(\"Not isolated because a tile's adjacent tiles isn't on the edge: \" + tile.asText() + \" ==> \" + adjTile.asText());\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.writeToConsole(\"*** Isolated Edge found ***\");\r\n\r\n const tiles = [...edgeTiles];\r\n const witnesses = [...edgeWitnesses];\r\n const mines = this.workingProbs[0].mineCount;\r\n // build a web of the isolated edge and use it to build a brute force\r\n const isolatedEdge = new ProbabilityEngine(this.board, witnesses, tiles, tiles.length, mines, this.options);\r\n isolatedEdge.generateIndependentWitnesses();\r\n const iterator = new WitnessWebIterator(isolatedEdge, tiles, -1);\r\n\r\n const bruteForce = new Cruncher(this.board, iterator);\r\n \r\n this.isolatedEdgeBruteForce = bruteForce;\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "b88be3883d5b13b5e2237c911945e2de", "score": "0.57692933", "text": "_detectEdges() {\n if (this.position.x < this.size) this.movement.x *= -1;\n if (this.position.y < this.size) this.movement.y *= -1;\n if (this.position.x > this.engine.size.x-this.size) this.movement.x *= -1;\n if (this.position.y > this.engine.size.y-this.size) this.movement.y *= -1;\n }", "title": "" }, { "docid": "a445bd2e70a605d6371923592af80cfd", "score": "0.5672711", "text": "darkness(x, y, boardState){\n let topRow = x-1\n let bottomRow = x + 1\n let leftColumn = y-1\n let rightColumn = y+1\n for (let i = 0; i < 3; i++) {\n boardState[topRow][leftColumn-i].status\n = boardState[topRow][leftColumn-i].char === null ? \"cells \" + boardState[topRow][leftColumn-i].tile_type\n : \"cells \" + boardState[topRow][leftColumn-i].char.type\n boardState[topRow-i][leftColumn].status\n = boardState[topRow-i][leftColumn].char === null ? \"cells \" + boardState[topRow-i][leftColumn].tile_type\n : \"cells \" + boardState[topRow-i][leftColumn].char.type\n boardState[topRow-i][y].status\n = boardState[topRow-i][y].char === null ? \"cells \" + boardState[topRow-i][y].tile_type\n : \"cells \" + boardState[topRow-i][y].char.type\n boardState[topRow][rightColumn+i].status\n = boardState[topRow][rightColumn+i].char === null ? \"cells \" + boardState[topRow][rightColumn+i].tile_type\n : \"cells \" + boardState[topRow][rightColumn+i].char.type\n boardState[topRow-i][rightColumn].status\n = boardState[topRow-i][rightColumn].char === null ? \"cells \" + boardState[topRow-i][rightColumn].tile_type\n : \"cells \" + boardState[topRow-i][rightColumn].char.type\n boardState[x][leftColumn-i].status\n = boardState[x][leftColumn-i].char === null ? \"cells \" + boardState[x][leftColumn-i].tile_type\n : \"cells \" + boardState[x][leftColumn-i].char.type\n boardState[x][rightColumn+i].status\n = boardState[x][rightColumn+i].char === null ? \"cells \" + boardState[x][rightColumn+i].tile_type\n : \"cells \" + boardState[x][rightColumn+i].char.type\n boardState[bottomRow][leftColumn-i].status\n = boardState[bottomRow][leftColumn-i].char === null ? \"cells \" + boardState[bottomRow][leftColumn-i].tile_type\n : \"cells \" + boardState[bottomRow][leftColumn-i].char.type\n boardState[bottomRow+i][leftColumn].status\n = boardState[bottomRow+i][leftColumn].char === null ? \"cells \" + boardState[bottomRow+i][leftColumn].tile_type\n : \"cells \" + boardState[bottomRow+i][leftColumn].char.type\n boardState[bottomRow+i][y].status\n = boardState[bottomRow+i][y].char === null ? \"cells \" + boardState[bottomRow+i][y].tile_type\n : \"cells \" + boardState[bottomRow+i][y].char.type\n boardState[bottomRow+i][rightColumn].status\n = boardState[bottomRow+i][rightColumn].char === null ? \"cells \" + boardState[bottomRow+i][rightColumn].tile_type\n : \"cells \" + boardState[bottomRow+i][rightColumn].char.type\n boardState[bottomRow][rightColumn+i].status\n = boardState[bottomRow][rightColumn+i].char === null ? \"cells \" + boardState[bottomRow][rightColumn+i].tile_type\n : \"cells \" + boardState[bottomRow][rightColumn+i].char.type\n }\n for (let i = 0; i < 2; i++) {\n boardState[topRow-i][leftColumn-i].status\n = boardState[topRow-i][leftColumn-i].char === null ? \"cells \" + boardState[topRow-i][leftColumn-i].tile_type\n : \"cells \" + boardState[topRow-i][leftColumn-i].char.type\nboardState[topRow-i][rightColumn+i].status\n = boardState[topRow-i][rightColumn+i].char === null ? \"cells \" + boardState[topRow-i][rightColumn+i].tile_type\n : \"cells \" + boardState[topRow-i][rightColumn+i].char.type\nboardState[bottomRow+i][leftColumn-i].status\n = boardState[bottomRow+i][leftColumn-i].char === null ? \"cells \" + boardState[bottomRow+i][leftColumn-i].tile_type\n : \"cells \" + boardState[bottomRow+i][leftColumn-i].char.type\nboardState[bottomRow+i][rightColumn+i].status\n = boardState[bottomRow+i][rightColumn+i].char === null ? \"cells \" + boardState[bottomRow+i][rightColumn+i].tile_type\n : \"cells \" + boardState[bottomRow+i][rightColumn+i].char.type\n }\n }", "title": "" }, { "docid": "54486d3f178ecb0767763b34d0ea24b7", "score": "0.5636821", "text": "function player_on_game_edge() {\n var player_loc = get_char_coords();\n\n switch(player_loc) {\n case !(player_loc.left >= game_edges[0]) : return true; break;\n case !(player_loc.right >= game_edges[1]) : return true; break;\n case !(player_loc.top >= game_edges[2]) : return true; break;\n case !(player_loc.bottom >= game_edges[3]) : return true; break;\n default: return false;\n }\n }", "title": "" }, { "docid": "c4aad5b3f156c4fece5400dc4f8186b5", "score": "0.56268805", "text": "function detectEdges() {\n if (evil.x > width || evil.x < 0) {\n evil.xspeed = evil.xspeed * -1;\n }\n if (evil.y > height || evil.y < 0) {\n evil.yspeed = evil.yspeed * -1;\n }\n}", "title": "" }, { "docid": "0ba98c8d5f199da88ba88d6c06d59196", "score": "0.56251216", "text": "is_edge() {\n return this.level > 0;\n }", "title": "" }, { "docid": "b91f13c8495a266c2ceb0b20983e36e8", "score": "0.55930173", "text": "function drawEdges(x, y) {\n var tile = getTile(x,y);\n var edges = '';\n var edgeType;\n\n if (getTile(tile.x, tile.y - 1) != undefined && tile.type != getTile(tile.x, tile.y - 1).type) {\n edges+='N';\n edgeType = getTile(tile.x, tile.y - 1).type;\n }\n if (getTile(tile.x, tile.y + 1) != undefined && tile.type != getTile(tile.x, tile.y + 1).type) {\n edges+='S';\n edgeType = getTile(tile.x, tile.y + 1).type;\n }\n if (getTile(tile.x + 1, tile.y) != undefined && tile.type != getTile(tile.x + 1, tile.y).type) {\n edges+='E';\n edgeType = getTile(tile.x + 1, tile.y).type;\n }\n if (getTile(tile.x - 1, tile.y) != undefined && tile.type != getTile(tile.x - 1, tile.y).type) {\n edges+='W';\n edgeType = getTile(tile.x - 1, tile.y).type;\n }\n\n if (edges == ''){\n if (getTile(tile.x - 1, tile.y - 1) != undefined && tile.type != getTile(tile.x - 1, tile.y - 1).type) {\n edges = 'N+W';\n edgeType = getTile(tile.x - 1, tile.y - 1).type;\n }\n if (getTile(tile.x + 1, tile.y - 1) != undefined && tile.type != getTile(tile.x + 1, tile.y - 1).type) {\n edges = 'N+E';\n edgeType = getTile(tile.x + 1, tile.y - 1).type;\n }\n if (getTile(tile.x + 1, tile.y + 1) != undefined && tile.type != getTile(tile.x + 1, tile.y + 1).type) {\n edges = 'S+E';\n edgeType = getTile(tile.x + 1, tile.y + 1).type;\n }\n if (getTile(tile.x - 1, tile.y + 1) != undefined && tile.type != getTile(tile.x - 1, tile.y + 1).type) {\n edges = 'S+W';\n edgeType = getTile(tile.x - 1, tile.y + 1).type;\n }\n } else {\n undrawable.push([tile.x, tile.y]);\n }\n\n if ( edges != ''){\n if (sprites[tile.type+'-'+edgeType+edges] != undefined) drawTile(x,y,tile.type+'-'+edgeType+edges);\n }\n}", "title": "" }, { "docid": "fd5ef7258cca97d301167bd8e9bf565f", "score": "0.5545128", "text": "checkEdges() {\n if (this.position.y > height) {\n // A little dampening when hitting the bottom\n this.position.y = 0\n }\n if (this.position.y < 0) {\n // A little dampening when hitting the bottom\n this.position.y = height\n }\n if (this.position.x > width) {\n // A little dampening when hitting the bottom\n this.position.x = 0\n }\n if (this.position.x < 0) {\n // A little dampening when hitting the bottom\n this.position.x = width\n }\n }", "title": "" }, { "docid": "4d9c52169c329e8e6e1aabe0a9d71c14", "score": "0.5542356", "text": "get LeftElbow() {}", "title": "" }, { "docid": "744d00e4a3ecf35d8436ad9b529c184a", "score": "0.5520843", "text": "function checkLeftDiag() {\r\n\r\n}", "title": "" }, { "docid": "8a87bfd2726e61273fc10e9c3eb01900", "score": "0.5465258", "text": "checkEdges() {\n if(this.head.x > 800 ||\n this.head.x < 0 ||\n this.head.y > 800 ||\n this.head.y < 0){\n gameState = 3;\n }\n }", "title": "" }, { "docid": "48dad81e02dcb22c69280c3dd03e4126", "score": "0.54376715", "text": "function isE( x, y ) {\n return onB( x, y ) && layout[y][x][0] !== side;\n }", "title": "" }, { "docid": "498e6f870012945a06c661d62154539d", "score": "0.5430789", "text": "function JudgeIfWin(rowCount, colCount, colorState, index) {\n var lines = ['', '', '', '']; \n \n var [curi, curj] = DevideIndex(index, rowCount);\n var curColor = colorState[index];\n console.log(curi);\n console.log(curj);\n var remainCount = rowCount * colCount;\n for (let i = 0; i < rowCount; i++) {\n for (let j = 0; j < colCount; j++) {\n var piece = colorState[i * rowCount + j];\n if(i === curi) {\n lines[0] += piece;\n } \n if(j === curj){\n lines[1] += piece;\n }\n if((j === curj && i === curi) || (j - curj) / (i - curi) === 1){\n lines[2] += piece;\n }\n if((j === curj && i === curi) || (j - curj) / (i - curi) === -1){\n lines[3] += piece;\n }\n if(piece != null)\n remainCount--;\n }\n }\n if(remainCount === 0){\n return WIN_DRAW;\n }\n console.log(lines);\n var judge = curColor === 'w' ? 'wwwww' : 'bbbbb';\n for(var i = 0; i < lines.length; i++){\n if(lines[i].indexOf(judge) >=0){\n return curColor === 'w' ? WIN_WHITE : WIN_BLACK; \n        }\n    }\n return WIN_NOBODY;\n}", "title": "" }, { "docid": "a07728ab473ee0596aae7a7e7cd3f1c6", "score": "0.54212487", "text": "checkIfPixelIsEdge(x, y, dataArray){\n \n const xCurr = x,\n yCurr = y,\n \n size = 1;\n \n \n const data = dataArray;\n \n let alphaCount = 0;\n \n for(let y = yCurr - size; y <= yCurr + size; y+=size)\n for(let x = xCurr - size; x <= xCurr + size; x+=size)\n { \n if((y !== yCurr || x !== xCurr))\n {\n if(!data[((y * this.width + x) * 4) + 3])\n alphaCount++;\n }\n }\n \n return alphaCount;\n \n }", "title": "" }, { "docid": "ac2e3b47c0c912fdeab580e388dc2af5", "score": "0.53826624", "text": "function checkRightDiag() {\r\n\r\n}", "title": "" }, { "docid": "5f1ab915a2c4657bbbb8983ab6ad976c", "score": "0.53544647", "text": "edgeCheck() {\n if (this.posX + this.rad >= height || this.posY - this.rad <= 0) {\n this.deltaY *= -1;\n }\n }", "title": "" }, { "docid": "394866e05b5cf307fd59d7347a5ea5ec", "score": "0.53487515", "text": "function check_color_state(){\n let sz = g_canvas.cell_size;\n let sz2 = sz / 2;\n let x = 1+ g_bot.x*sz; \n let y = 1+ g_bot.y*sz;\n let big = sz -2; \n let acolors = get( x + sz2, y + sz2 ); // Get cell interior pixel color [RGBA] array.\r\n\r\n let state = 0; \r\n // compares cell color to colors in the sequence, ignoring Alpha component\r\n for(var i = 0; i <= 4; i++){\r\n if(acolors[0] == color_sqn[i][0] && acolors[1] == color_sqn[i][1] && acolors[2] == color_sqn[i][2]){\r\n state = i;\r\n\t\t}\r\n\t}\r\n return state;\r\n}", "title": "" }, { "docid": "7510565c4e14b391e43cc098d8c53dbf", "score": "0.5324876", "text": "diagWin() {\n let idxDiag1 = [[0, 0], [1, 1], [2, 2]];\n let idxDiag2 = [[2, 0],[1, 1],[0, 2]];\n let diag1 = [];\n idxDiag1.forEach((pos) => diag1.push(this.grid[pos[0]][pos[1]]));\n let diag2 = [];\n idxDiag2.forEach((pos) => diag2.push(this.grid[pos[0]][pos[1]]));\n if (diag1.every( el => el === diag1[0]) && diag1[0] !==null) {\n this.winningSymble = diag1[0];\n return true;\n }\n if (diag2.every( el => el === diag2[0]) && diag2[0] !==null){\n this.winningSymble = diag2[0];\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "224c36be6e94e0f9f85c88b3763d6e43", "score": "0.5319698", "text": "getWinner() {\r\n const lines = [...this.getRows(), ...this.getCols(), ...this.getDiags()]\r\n \r\n let isDraw = true\r\n \r\n for (let line of lines) {\r\n const winner = Board.getLineWinner(line)\r\n \r\n if ([\"X\", \"O\"].includes(winner)) {\r\n return winner\r\n }\r\n \r\n if (winner === \"E\") {\r\n isDraw = false\r\n }\r\n }\r\n \r\n return isDraw ? \"D\" : \"L\"\r\n }", "title": "" }, { "docid": "92455773a706fba79baeb3dde1cbb78d", "score": "0.53128004", "text": "startAcrossWord(x, y) {\r\n return this.hasBlack(x, y, 'left') && x < this.width - 1 && !this.isBlack(x, y) && !this.hasBlack(x, y, 'right');\r\n }", "title": "" }, { "docid": "c9f13e177ac6b06b2caced0a41d348a6", "score": "0.53027034", "text": "checkHorizontals() {\n let colors = ['red', 'yellow'];\n for (let color of colors) {\n for (let row = 0; row < 6; row++) {\n for (let col = 0; col < 7; col++) {\n let won = true;\n for (let i = 0; i < 4; i++) {\n if (col + i > 6) {\n // this column does not exists so just set won to false\n // and skip this iteration of the loop / continue\n won = false;\n continue;\n }\n won = won && this.board[row][col + i].color === color;\n }\n if (won) { return color; }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "9042d1def9a551f96b27f1a92a269599", "score": "0.5287612", "text": "function Cell(col, row) {\n this.col = col;\n this.row = row;\n this.hue = map(row, 0, rows, 0, 200);\n this.brt = map(col, 0, columns, 100, 150);\n\n this.walls = [true, true, true, true]; // top, right, bottom, left\n this.visited = false;\n\n this.draw = function() {\n var x = this.col * sideLength;\n var y = this.row * sideLength;\n\n if (this.visited) {\n // fill(\"#8F8\");\n // fill(this.hue, this.brt, 255);\n noStroke();\n rect(x, y, sideLength, sideLength);\n\n stroke(0);\n strokeWeight(10);\n if (this.walls[0]) line(x, y, x + sideLength, y);\n if (this.walls[1]) line(x + sideLength, y, x + sideLength, y + sideLength);\n if (this.walls[2]) line(x + sideLength, y + sideLength, x, y + sideLength);\n if (this.walls[3]) line(x, y + sideLength, x, y);\n }\n }\n\n this.checkNeighbors = function() {\n var neighbors = [];\n var top, right, bottom, left;\n\n top = grid[getIndex(this.row - 1, this.col)]\n right = grid[getIndex(this.row, this.col + 1)]\n bottom = grid[getIndex(this.row + 1, this.col)]\n left = grid[getIndex(this.row, this.col - 1)]\n\n if (top && !top.visited) neighbors.push(top);\n if (right && !right.visited) neighbors.push(right);\n if (bottom && !bottom.visited) neighbors.push(bottom);\n if (left && !left.visited) neighbors.push(left);\n\n // if there is a valid neighbor, go to it\n if (neighbors.length > 0) {\n // get the next chosen cell\n var nextCell = neighbors[floor(random(0, neighbors.length))];\n return nextCell;\n } else {\n return undefined;\n }\n }\n\n this.removeWalls = function(otherCell) {\n var diffX = otherCell.col - this.col;\n if (diffX === 1) { // going right\n this.walls[1] = false;\n otherCell.walls[3] = false;\n return;\n } else if (diffX === -1) { // going left\n this.walls[3] = false;\n otherCell.walls[1] = false;\n return;\n }\n\n var diffY = otherCell.row - this.row;\n if (diffY === 1) { // going down\n this.walls[2] = false;\n otherCell.walls[0] = false;\n return;\n } else if (diffY === -1) { // going up\n this.walls[0] = false;\n otherCell.walls[2] = false;\n return;\n }\n }\n}", "title": "" }, { "docid": "486892a7fb08d0bb43063ad222b806ee", "score": "0.52853286", "text": "function emptyRule(state, r, c) {\n // Going Up\n if (occupiedOnLine(state, r, c, -1, -1))\n return 'L';\n if (occupiedOnLine(state, r, c, -1, 0))\n return 'L';\n if (occupiedOnLine(state, r, c, -1, 1))\n return 'L';\n\n // Sideways\n if (occupiedOnLine(state, r, c, 0, -1))\n return 'L';\n // if (occupiedOnLine(state, r, c, 0, 0))\n // return 'L';\n if (occupiedOnLine(state, r, c, 0, 1))\n return 'L';\n\n // Going Down\n if (occupiedOnLine(state, r, c, 1, -1))\n return 'L';\n if (occupiedOnLine(state, r, c, 1, 0))\n return 'L';\n if (occupiedOnLine(state, r, c, 1, 1))\n return 'L';\n\n return '#';\n}", "title": "" }, { "docid": "353023b13444a43211c9fbd359bf0985", "score": "0.52761024", "text": "function areKingsOpposite() {\n var myKing = getKingCell(false);\n var enemyKing = getKingCell(true);\n var colDistance = Math.abs(myKing.i - enemyKing.i);\n var rowDistance = Math.abs(myKing.j - enemyKing.j);\n if ((colDistance === 0 && rowDistance === 2) || (colDistance === 2 && rowDistance === 0)) {\n if (bestDirection === \"right\") {\n if (myKing.i < enemyKing.i)\n return true;\n }\n else if (bestDirection === \"left\") {\n if (myKing.i > enemyKing.i)\n return true;\n }\n else if (bestDirection === \"up\") {\n if (myKing.j < enemyKing.j)\n return true;\n }\n else if (bestDirection === \"down\") {\n if (myKing.j > enemyKing.j)\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "bb8222650d933bbb388992e54e45fc1c", "score": "0.5274197", "text": "get EmissiveIsBlack() {}", "title": "" }, { "docid": "0ba190a5ee57fc5221af980d73976630", "score": "0.5265331", "text": "function lineCheck(){\n for(var row = 0; row < table.length; row++){\n for(var col = 0; col < table.length; col++){\n if(sameColor(getCurrentColor(row, col), getCurrentColor(row+1, col), getCurrentColor(row+2, col), getCurrentColor(row+3, col)) || //vertical win\n sameColor(getCurrentColor(row, col), getCurrentColor(row, col+1),getCurrentColor(row, col+2), getCurrentColor(row, col+3))){ //horizontal win\n console.log(\"Detect a win\");\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "959f18c88b0749d720792c039917029e", "score": "0.52563184", "text": "checkWeapons(x, y, boardState){\n let topRow = x-1\n let bottomRow = x + 1\n let leftColumn = y-1\n let rightColumn = y+1\n if (boardState[topRow][y].char !== null && boardState[topRow][y].char.type === \"weapon\") {\n return \"North\"\n }\n if (boardState[bottomRow][y].char !== null && boardState[bottomRow][y].char.type === \"weapon\") {\n return \"South\"\n }\n if (boardState[x][leftColumn].char !== null && boardState[x][leftColumn].char.type === \"weapon\") {\n return \"West\"\n }\n if (boardState[x][rightColumn].char !== null && boardState[x][rightColumn].char.type === \"weapon\") {\n return \"East\"\n }\n return false\n }", "title": "" }, { "docid": "aacd0a7a05e62d394167f3177c9d65b3", "score": "0.5255585", "text": "function kingChecks(color, i,j) {\r\n let attackingPiece = (color === \"w\") ? \"kb\" : \"kw\";\r\n for (let iCurr = i - 1; iCurr < i + 2; iCurr++) {\r\n for (let jCurr = j - 1; jCurr < j + 2; jCurr++) {\r\n if (iCurr < HEIGHT && jCurr < WIDTH && iCurr >= 0 && jCurr >= 0 && iCurr != i && jCurr != j) {\r\n if (game.state[iCurr][jCurr] === attackingPiece) return true;\r\n }\r\n \r\n }\r\n }\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "692b570d5a55dfe06ac10996da0c2ae2", "score": "0.5250125", "text": "fixUp() {\n let t = this;\n return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \n t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\n }", "title": "" }, { "docid": "2f7517e20927a537f85c9343d2d02b6b", "score": "0.5248435", "text": "function heyNeighbor(row, col, lastRow, lastCol) {\n let nw = [row - 1, col - 1],\n n = [row - 1, col],\n ne = [row - 1, col + 1],\n e = [row, col + 1],\n w = [row, col - 1],\n sw = [row + 1, col - 1],\n s = [row + 1, col],\n se = [row + 1, col + 1];\n\n // Handle top and bottom edge neighbors\n if (row === 0) {\n // Handle northwest and northeast corner cells\n switch (col) {\n case 0: // Northwest corner cell\n nw = [lastRow, lastCol];\n ne = [lastRow, col + 1];\n break;\n case lastCol: // Northeast corner cell\n nw = [lastRow, col - 1];\n ne = [lastRow, 0];\n break;\n default:\n // Everybody else\n nw = [lastRow, col - 1];\n ne = [lastRow, col + 1];\n break;\n }\n\n n = [lastRow, col];\n } else if (row === lastRow) {\n //Handle southwest and southeast corner cells\n switch (col) {\n case 0: // Southwest corner cell\n sw = [0, lastCol];\n se = [0, col + 1];\n break;\n case lastCol: // Southeast corner cell\n sw = [0, col - 1];\n se = [0, 0];\n break;\n default:\n // Everybody else\n sw = [0, col - 1];\n se = [0, col + 1];\n break;\n }\n\n s = [0, col];\n }\n\n // Handle left and right edge neighbors\n if (col === 0) {\n // Handle northwest and southwest corner cells\n switch (row) {\n case 0: // Northwest corner cell\n sw = [row + 1, lastCol];\n break;\n case lastRow: // Southwest corner cell\n nw = [row - 1, lastCol];\n break;\n default:\n // Everybody else\n sw = [row + 1, lastCol];\n nw = [row - 1, lastCol];\n break;\n }\n\n w = [row, lastCol];\n } else if (col === lastCol) {\n // Handle northeast and southeast corner cells\n switch (row) {\n case 0: // Northeast corner cell\n se = [row + 1, 0];\n break;\n case lastRow: // Southeast corner cell\n ne = [row - 1, 0];\n break;\n default:\n // Everybody else\n se = [row + 1, 0];\n ne = [row - 1, 0];\n break;\n }\n\n e = [row, 0];\n }\n\n return [nw, n, ne, e, w, sw, s, se];\n}", "title": "" }, { "docid": "8da81be522bb537de2a0030eb24d00d5", "score": "0.5244108", "text": "function handle_edge_detection(entity, step) //I recommend the step being divisible by 15.\r\n{\r\n if (Entity.IsValid(entity) && Entity.IsAlive(entity) && !Entity.IsDormant(entity)) {\r\n var ent_headpos = Entity.GetHitboxPosition(entity, 0);\r\n var ent_eyeangles = [0, 0, 0];\r\n if (entity == local) {\r\n ent_eyeangles = Local.GetViewAngles();\r\n } else {\r\n ent_eyeangles = Entity.GetProp(entity, \"CCSPlayer\", \"m_angEyeAngles\");\r\n }\r\n var left_fractions = 0;\r\n var right_fractions = 0;\r\n\r\n var base_yaw = ent_eyeangles[1] - 90;\r\n var end_yaw = ent_eyeangles[1] + 90;\r\n\r\n for (var current_step = base_yaw; current_step <= end_yaw; current_step += step) {\r\n if (current_step == ent_eyeangles[1]) {\r\n continue; //Not exactly a side, I guess.\r\n }\r\n var point_next_to_ent = vector_add(ent_headpos, [Math.cos(deg2rad(current_step)) * 450, Math.sin(deg2rad(current_step)) * 450, 0]);\r\n var ray = Trace.Line(entity, ent_headpos, point_next_to_ent);\r\n current_step < ent_eyeangles[1] ? left_fractions += ray[1] : right_fractions += ray[1];\r\n }\r\n\r\n left_fractions /= (90 / step);\r\n right_fractions /= (90 / step);\r\n\r\n return left_fractions > right_fractions ? 1 : -1;\r\n }\r\n return 0;\r\n}", "title": "" }, { "docid": "192c8ff302102dfa474cb7ae2bf7d995", "score": "0.5233599", "text": "function getDirection(el, e) {\nvar xPos, yPos, offset, dir, set;\ndir = \"\";\nset = getOffset(e);\nxPos = set.offsetX;\nyPos = set.offsetY;\noffset = 8; //The distance from the edge in pixels\n//if (yPos<offset) dir += \"n\";\n//else if (yPos > el.offsetHeight-offset) dir += \"s\";\n//if (xPos<offset) dir += \"w\";\n//else\n if (xPos > el.offsetWidth-offset) dir += \"e\";\n\nreturn dir;\n}", "title": "" }, { "docid": "6c6345b6fad9ea463522c9eaf9724572", "score": "0.5229373", "text": "function getAdjacentUnrevealed( x, y ) {\n\treturn getAdjacentCondition( x, y, function(a,b){return (!board[a][b].revealed && !board[a][b].flagged)} );\n}", "title": "" }, { "docid": "905dde17c3352fc06c77c5d8084c6645", "score": "0.5227322", "text": "checkEdges(){\n\t\tif (this.location.x > clientWidth) {\n this.location.x = 0;\n }\n else if (this.location.x < 0) {\n this.location.x = clientWidth;\n }\n \n \n if (this.location.y > clientHeight) {\n this.location.y = 0;\n }\n else if (this.location.y < 0) {\n this.location.y = clientHeight;\n }\n\n }", "title": "" }, { "docid": "f77462109eef170d76c6abdacd48e096", "score": "0.52256846", "text": "check() {\r\n\t if (this.isRed() && this.left.isRed()) {\r\n\t throw fail();\r\n\t }\r\n\t if (this.right.isRed()) {\r\n\t throw fail();\r\n\t }\r\n\t const blackDepth = this.left.check();\r\n\t if (blackDepth !== this.right.check()) {\r\n\t throw fail();\r\n\t }\r\n\t else {\r\n\t return blackDepth + (this.isRed() ? 0 : 1);\r\n\t }\r\n\t }", "title": "" }, { "docid": "fd8f570d98437be9ed583a57b6f9fed9", "score": "0.5215121", "text": "function getAdjacentHexes(rArray, rObj){\n var adjArray = [];\n //Slot 1\n //Get x+1\n if(rArray[rObj.xCord+1]===undefined){\n adjArray[1] = undefined;\n }else{\n adjArray[1] = rArray[rObj.xCord+1][rObj.yCord];\n }\n //Slot 4\n //Get x-1\n if(rArray[rObj.xCord-1]===undefined){\n adjArray[4] = undefined;\n }else{\n adjArray[4] = rArray[rObj.xCord-1][rObj.yCord];\n }\n if(rObj.yCord%2){ //If y odd\n if(rArray[rObj.xCord+1]===undefined){\n adjArray[0] = undefined;\n adjArray[2] = undefined;\n }else{\n //Get y-1, x+1 //Slot 0\n adjArray[0] = rArray[rObj.xCord+1][rObj.yCord-1];\n //Get y+1. x+1 //Slot 2\n adjArray[2] = rArray[rObj.xCord+1][rObj.yCord+1];\n }\n //Get y+1 //Slot 3\n adjArray[3] = rArray[rObj.xCord][rObj.yCord+1];\n //Get y-1 //Slot 5\n adjArray[5] = rArray[rObj.xCord][rObj.yCord-1];\n }else{\n //Get y-1 //Slot 0\n adjArray[0] = rArray[rObj.xCord][rObj.yCord-1];\n //Get y+1 //Slot 2\n adjArray[2] = rArray[rObj.xCord][rObj.yCord+1];\n if(rArray[rObj.xCord-1]===undefined){\n adjArray[3] = undefined;\n }else{\n //Get y+1. x+1 //Slot 3\n adjArray[3] = rArray[rObj.xCord-1][rObj.yCord+1];\n }\n if(rArray[rObj.xCord-1]===undefined){\n adjArray[5] = undefined;\n }else{\n //Get y-1, x-1 //Slot 5\n adjArray[5] = rArray[rObj.xCord-1][rObj.yCord-1];\n }\n }\n\n return adjArray;\n}", "title": "" }, { "docid": "e14c185d55fe4356ff63e87e46654713", "score": "0.52136546", "text": "function checkCoord(arr, x, y, charCheck) {\n let adjacentCount = 0;\n let leftCheck = (x - 1) >= 0;\n let rightCheck = (x + 1) < arr[y].length;\n let upCheck = (y - 1) >= 0;\n let downCheck = (y + 1) < arr.length;\n\n // Left\n if (leftCheck && arr[y][x - 1] === charCheck) {\n adjacentCount++;\n }\n // Upper Left\n if (leftCheck && upCheck && arr[y - 1][x - 1] === charCheck) {\n adjacentCount++;\n }\n // Up\n if (upCheck && arr[y - 1][x] === charCheck) {\n adjacentCount++;\n }\n // Upper Right\n if (rightCheck && upCheck && arr[y - 1][x + 1] === charCheck) {\n adjacentCount++;\n }\n // Right\n if (rightCheck && arr[y][x + 1] === charCheck) {\n adjacentCount++;\n }\n // Lower Right\n if (rightCheck && downCheck && arr[y + 1][x + 1] === charCheck) {\n adjacentCount++;\n }\n // Down\n if (downCheck && arr[y + 1][x] === charCheck) {\n adjacentCount++;\n }\n // Lower Left\n if (leftCheck && downCheck && arr[y + 1][x - 1] === charCheck) {\n adjacentCount++;\n }\n\n return adjacentCount;\n}", "title": "" }, { "docid": "60da61883db66e259112582ecc922b7f", "score": "0.521194", "text": "selection_contains_edge() {\n return Array.from(this.selection).some((cell) => cell.is_edge());\n }", "title": "" }, { "docid": "2fc9457fadd8430a07f9153579ccd407", "score": "0.5211096", "text": "function oppositeEdge() {\n var last_move_code = eval(last_move).code;\n \n if (last_move_code == 2 && open_spaces.indexOf(8) != -1) {\n next_move = 8;\n return true;\n }\n else if (last_move_code == 8 && open_spaces.indexOf(2) != -1) {\n next_move = 2;\n return true;\n }\n else if (last_move_code == 4 && open_spaces.indexOf(6) != -1) {\n next_move = 6;\n return true;\n }\n else if (last_move_code == 6 && open_spaces.indexOf(4) != -1) {\n next_move = 4;\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "f06f3f2119f18a3def02e6b4851cbbd2", "score": "0.5209281", "text": "isIsosceles() { return this.sideA === this.sideB || this.sideB === this.sideC || this.sideC === this.sideA }", "title": "" }, { "docid": "112d39994b1b15ce23fc132543a68b00", "score": "0.52084863", "text": "edgeDetect() {\n\t\tif (this.y + this.radius + this.velocity.y > this.canvas.height) {\n\t\t\tthis.velocity.y *= -1;\n\t\t} else if (this.y - this.radius <= 0) {\n\t\t\tthis.velocity.y *= -1;\n\t\t}\n\n\t\tif (this.x + this.radius + this.velocity.x > this.canvas.width) {\n\t\t\tthis.velocity.x *= -1;\n\t\t} else if (this.x - this.radius <= 0) {\n\t\t\tthis.velocity.x *= -1;\n\t\t}\n\t}", "title": "" }, { "docid": "6b4f67ccd3ab62db9e888e312bc9cd61", "score": "0.5205945", "text": "function checkForWin() {\n var count = 0\n , won = false\n , directions, x = 0\n , y = 0\n , lastColor;\n directions = [\n {\n x: 0\n , y: 1\n }\n , {\n x: 1\n , y: 0\n }\n , {\n x: 1\n , y: 1\n }\n , {\n x: 1\n , y: -1\n }\n ];\n \n //check for each column\n for (var col = 0; col < 3; col++) {\n for (var i = 0; i < 4; i++) {\n if (lastColor == board.elms[col + i][0][0].occupiedBy) {\n lastColor = board.elms[col + i][0][0].occupiedBy;\n count++;\n if (count == 4) {\n console.log(lastColor + ' won!');\n return;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "080ebefb31c4500ac5b04e9d06c32ad0", "score": "0.5201472", "text": "function emptySide() {\n let sides = [2,4,6,8];\n for (let i=0;i<sides.length;i++) {\n if (currentBoard[sides[i]] === '') {\n return sides[i];\n }\n }\n return false;\n }", "title": "" }, { "docid": "b28bf0321ae86bc07829d26f54b749ec", "score": "0.51991093", "text": "get straight() {\n if (this.left && this.right && !this.up && !this.down) return true;\n if (!this.left && !this.right && this.up && this.down) return true;\n return false;\n }", "title": "" }, { "docid": "04f5531ee0bf9a7c2457fa8da5454980", "score": "0.51947844", "text": "getEdgeCells(e) {\n let ret = [];\n let leftBound = this.getPosColNumber(e.endpoint1);\n let rightBound = this.getPosColNumber(e.endpoint2);\n let bottomBound = this.getPosRowNumber(e.endpoint1);\n let topBound = this.getPosRowNumber(e.endpoint2);\n if (leftBound > rightBound) {\n rightBound = leftBound;\n leftBound = this.getPosColNumber(e.endpoint2);\n }\n if (bottomBound > topBound) {\n topBound = bottomBound;\n bottomBound = this.getPosRowNumber(e.endpoint2);\n }\n rightBound = Math.min(rightBound, this.gridSize[0]);\n topBound = Math.min(topBound, this.gridSize[1]);\n for (let j = bottomBound; j <= topBound; j++) {\n for (let i = leftBound; i <= rightBound; i++) {\n let cellNumber = this.gridSize[0] * j + i;\n if (cellNumber < 0 || cellNumber >= this.gridSize[0] * this.gridSize[1]) {\n continue; // cell out of bounds\n }\n if (e.intersectQuad(vec2.fromValues(i * this.cellWidth, j * this.cellWidth), vec2.fromValues((i + 1) * this.cellWidth, (j + 1) * this.cellWidth))) {\n ret.push(cellNumber);\n }\n }\n }\n return ret;\n }", "title": "" }, { "docid": "5aa6efd50bd0b05140b0e85b8ccd304a", "score": "0.51916206", "text": "edges() {\n if (this.pos.x < 0 || this.pos.x > width) {\n this.vel.x *= -1;\n }\n\n if (this.pos.y < 0 || this.pos.y > height) {\n this.vel.y *= -1;\n }\n }", "title": "" }, { "docid": "1bfc0f51fe127236011123c14f642c54", "score": "0.5190952", "text": "checkHorizontal(cell, color) {\n\n // Derecha\n let piecesFoundRigth = 0;\n let auxCellRigth = new Celda(cell.getColor(), cell.getPosRow(), cell.getPosColumn());\n let nextRigthCell = new Celda(cell.getColor(), cell.getPosRow(), this.nextPositionRight(cell.getPosColumn()));\n for (let i = 1; i <= 3; i++) {\n let c1 = nextRigthCell.getColor();\n let c2 = auxCellRigth.getColor();\n if (this.findCell(nextRigthCell.getPosRow(), nextRigthCell.getPosColumn(), color) && (c1 === c2)) {\n piecesFoundRigth ++;\n auxCellRigth.setPosColumn(nextRigthCell.getPosColumn());\n nextRigthCell.setPosColumn(this.nextPositionRight(nextRigthCell.getPosColumn()));\n }\n }\n\n // Izquierda\n let piecesFoundLeft = 0;\n let auxCellLeft = new Celda(cell.getColor(), cell.getPosRow(), cell.getPosColumn());\n let nextLeftCell = new Celda(cell.getColor(), cell.getPosRow(), this.nextPositionLeft(cell.getPosColumn()));\n for (let j = 1; j <= 3; j++) {\n let c3 = nextLeftCell.getColor();\n let c4 = auxCellLeft.getColor();\n if (this.findCell(nextLeftCell.getPosRow(), nextLeftCell.getPosColumn(), color) && (c3 === c4)) {\n piecesFoundLeft ++;\n auxCellLeft.setPosColumn(nextLeftCell.getPosColumn());\n nextLeftCell.setPosColumn(this.nextPositionLeft(nextLeftCell.getPosColumn()));\n } \n }\n //console.log(\"------------------------\");\n //console.log(\"izq: \" + piecesFoundLeft);\n //console.log(\"der: \" + piecesFoundRigth);\n let total = piecesFoundLeft + piecesFoundRigth;\n //console.log(\"total: \" + total);\n return total; \n }", "title": "" }, { "docid": "8142ca00bbbcbcbd6ac7a582c5341ac6", "score": "0.51857215", "text": "function seperateSides(sketch){\n var left = new srlib.core.data.container.Sketch(),\n right = new srlib.core.data.container.Sketch();\n var left_pts = [],\n right_pts = [];\n var key = 0;\n for(str_i in sketch.strokes){\n key += 1;\n stroke = sketch.strokes[str_i];\n var left_right = 0;//negative if left\n for(pt_i in stroke.points){\n if(stroke.points[pt_i].x > noseCenter.x)\n left_right +=1;\n else\n left_right -=1;\n }\n if(left_right<0){\n for(pt_i in stroke.points){\n left_pts.push(stroke.points[pt_i]);\n }\n }else{\n for(pt_i in stroke.points){\n right_pts.push(stroke.points[pt_i]);\n }\n }\n }\n left.setPoints(left_pts);\n right.setPoints(right_pts);\n return [left,right];\n}", "title": "" }, { "docid": "5703386a18a5e36b2d80b62370ce3fd9", "score": "0.5179013", "text": "enteredEdge(e) {\n let targetBounds = e.target.getBoundingClientRect();\n let mouseX = e.clientX;\n let mouseY = e.clientY;\n\n let topDist = Math.abs(targetBounds.top - mouseY);\n let bottomDist = Math.abs(targetBounds.bottom - mouseY);\n let leftDist = Math.abs(targetBounds.left - mouseX);\n let rightDist = Math.abs(targetBounds.right - mouseX);\n\n let min = Math.min(topDist, bottomDist, leftDist, rightDist);\n\n switch (min) {\n case leftDist:\n return \"left\";\n case rightDist:\n return \"right\";\n case topDist:\n return \"top\";\n case bottomDist:\n return \"bottom\";\n }\n }", "title": "" }, { "docid": "54694c6c049fb0394d43703fc49fb268", "score": "0.5174031", "text": "isOver(col, row)\n {\n //create Sets for each direction. Since a Set has unique entries, if there\n //is only one entry and it is not an empty string, that entry is the winner\n var horizontal = new Set()\n var vertical = new Set()\n\n var posDiagonal = new Set()\n var negDiagonal = new Set()\n\n for (var y=0; y < game.n; y++){\n //check the possible horizontal and vertical wins for the given placement\n horizontal.add(game.board[row][y])\n vertical.add(game.board[y][col])\n //check the possible diagonal wins by checking the main diagonals\n posDiagonal.add(game.board[y][y])\n negDiagonal.add(game.board[game.n-1-y][y])\n }\n var gameOver = false;\n //if all entries in a row or column are the same, then the game is over\n //we don't need to check that the only entry is not a blank string, since\n //these Sets will include the piece that was just placed, which cannot possibly be blank\n if(horizontal.size === 1)\n {\n gameOver = true\n game.isDraw = false\n //set angles, and coords to draw the winning line animation\n var lineAngle = -90\n var startingY = game.startingX + (game.squareSize * (row)) - game.squareSize/2 - 15\n var endingX = game.screenWidth + 100\n game.drawWinningLine(game.startingX - 15, startingY, endingX, startingY, lineAngle, 45)\n }\n if(vertical.size === 1)\n {\n gameOver = true\n game.isDraw = false\n //set angles, and coords to draw the winning line animation\n var lineAngle = 0\n var startingX = game.startingX + (game.squareSize * (col+1)) - game.squareSize/2\n game.drawWinningLine(startingX, game.startingY - 15, startingX, 800, lineAngle, 45)\n }\n //if all entries in a diagonal are the same AND that entry is not blank,\n //then the game is over\n if(posDiagonal.size === 1 && !posDiagonal.has(\"\"))\n {\n gameOver = true\n game.isDraw = false\n //set angles, and coords to draw the winning line animation\n var lineAngle = -45\n var startingX = game.startingX\n var startingY = game.startingY + 15\n var endingX = game.screenWidth + 100\n var endingY = 800\n game.drawWinningLine(startingX, startingY, endingX, endingY, lineAngle, 120)\n\n }\n if(negDiagonal.size === 1 && !negDiagonal.has(\"\"))\n {\n gameOver = true\n game.isDraw = false\n //set angles, and coords to draw the winning line animation\n var lineAngle = -135\n var startingX = game.startingX\n var startingY = game.startingY + (game.squareSize * game.n)\n var endingX = game.screenWidth + 100\n var endingY = -100\n game.drawWinningLine(startingX, startingY, endingX, endingY, lineAngle, 120)\n }\n if(game.turns >= 8 && !gameOver)\n {\n gameOver = true;\n game.isDraw = true\n }\n\n return gameOver\n\n }", "title": "" }, { "docid": "1b836f0fc0d2f24f4c484f12c527a10c", "score": "0.5160347", "text": "isOnEdge(patch) {\n const { x, y } = patch\n const { minX, maxX, minY, maxY } = this.model.world\n return x === minX || x === maxX || y === minY || y === maxY\n }", "title": "" }, { "docid": "c22c148f4434e62ac82c40677a7a0c33", "score": "0.5159339", "text": "get RightElbow() {}", "title": "" }, { "docid": "fd576fb831f52f7c11a09a17dce6e74a", "score": "0.5155541", "text": "function getAdjacentRevealed( x, y ) {\n\treturn getAdjacentCondition( x, y, function(a,b){return board[a][b].revealed;} );\n}", "title": "" }, { "docid": "696637423e29b92e2f65107b23b81acb", "score": "0.51513946", "text": "checkWin()\n {\n let win = false;\n const isConsistent = (item, i, arr) =>\n {\n return item.token == arr[0].token && !item.isEmpty();\n };\n\n for(let i = 0; i < this.width; i++)\n {\n const horizontalSlots = [];\n const verticalSlots = [];\n const diagonalTopToBottomSlots = [];\n const diagonalBottomToTopSlots = [];\n\n /* Check horizontal and vertical. */\n for(let j = 0; j < this.height; j++)\n {\n horizontalSlots.push(this.field[i][j]);\n verticalSlots.push(this.field[j][i]);\n }\n\n let h = this.height - 1;\n for(let j = 0; j < this.height; j++)\n {\n diagonalTopToBottomSlots.push(this.field[j][j]);\n diagonalBottomToTopSlots.push(this.field[h][j]);\n diagonalBottomToTopSlots.push(this.field[j][h]);\n h--;\n }\n\n win = [\n verticalSlots.every(isConsistent),\n horizontalSlots.every(isConsistent),\n diagonalTopToBottomSlots.every(isConsistent),\n diagonalBottomToTopSlots.every(isConsistent)\n ].some(i => i);\n\n if(win)\n break;\n }\n\n return win;\n }", "title": "" }, { "docid": "047a3d407066011340b3252871542554", "score": "0.51509374", "text": "function lineNeighbors(arr, i, j) {\n\tvar rowLimit = arr.length-1;\n\tvar colLimit = arr[0].length-1;\n\tvar neighbors = [];\n\t// up-\n\tfor (let x= Math.max(i-1, 0); x>=0 && x!=i; x--) {\n\t\tif (arr[x][j]== \"#\"|| arr[x][j]== \"L\") {\n\t\t\t// console.log(x, j);\n\t\t\tneighbors.push(arr[x][j]);\n\t\t\tbreak;\n\t\t} \n\t}\n\t\n\n \t// down-\n \tfor (let x=Math.min(i+1, rowLimit); x<=rowLimit && x!=i; x++) {\n \t\tif (arr[x][j]== \"#\"|| arr[x][j]== \"L\") {\n \t\t\t// console.log(x, j);\n \t\t\tneighbors.push(arr[x][j]);\n\t\t\tbreak;\n \t\t} \n \t}\n\n \t// left-\n \tfor (let y=Math.max(j-1, 0); y>=0 && y!=j; y--) {\n \t\tif (arr[i][y]==\"#\"|| arr[i][y]==\"L\") {\n \t\t\t// console.log(i, y);\n \t\t\tneighbors.push(arr[i][y]);\n \t\t\tbreak;\n \t\t} \n \t}\n \t\n \t// right-\n \tfor (let y=Math.min(j+1, colLimit); y<=colLimit && y!=j; y++) {\n \t\tif (arr[i][y]==\"#\"|| arr[i][y]==\"L\") {\n \t\t\t// console.log(i, y);\n \t\t\tneighbors.push(arr[i][y]);\n \t\t\tbreak;\n \t\t} \n \t}\n \t\n\n\n \t// up-left:\n \tfor (let x= Math.max(i-1, 0),y=Math.max(j-1, 0); x>=0 && x!=i && y>=0 && y!=j; x--,y--) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y)\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t}\n \t\n\n \t// up-right:\n \tfor (let x= Math.max(i-1, 0),y=Math.min(j+1, colLimit); x>=0 && x!=i && y<=colLimit && y!=j; x--, y++) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y);\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t}\n \t\n\n \t// down-left:\n \tfor (let x=Math.min(i+1, rowLimit), y=Math.max(j-1, 0); x<=rowLimit && x!=i && y>=0 && y!=j; x++, y--) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y)\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\n \t}\n \t\t \n \t\n\n \t// down-right:\n \tfor (let x=Math.min(i+1, rowLimit), y=Math.min(j+1, colLimit); x<=rowLimit && x!=i && y<=colLimit && y!=j; x++, y++) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y);\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\n \t}\n\n\treturn neighbors;\n}", "title": "" }, { "docid": "98387a94ebc256b7bd2a989b2964f984", "score": "0.5149299", "text": "function checkForwardDiagonal() {\n // IMPLEMENT ME\n return EMPTY_CELL;\n}", "title": "" }, { "docid": "6f4612f81bc87fa08060c4f62ff03dd1", "score": "0.513786", "text": "isOffBoard() {\n let [x, y] = this.position\n\n return (\n x < 0 || y < 0 || x > this.height - 1 || y > this.width - 1\n )\n }", "title": "" }, { "docid": "9ba55e6414e302aa5e135b06649570e1", "score": "0.51338255", "text": "function checkMoveLeftAble() {\n let liesCounter = 0;\n for (let i = (valueArray.length - 1); i > -1; i--) {\n for (let j = (valueArray[i].length - 1); j > -1; j--) {\n if (valueArray[i][j][0] === pieceCounter) {\n if (j === 0) {\n liesCounter = liesCounter + 1;\n }\n else {\n if (valueArray[i][j - 1][0] === \"・\" || valueArray[i][j - 1][0] === pieceCounter) {\n liesCounter = liesCounter;\n }\n else {\n liesCounter = liesCounter + 1;\n }\n }\n }\n }\n }\n if (liesCounter > 0) {\n moveLeftAble = false;\n }\n else {\n moveLeftAble = true;\n }\n}", "title": "" }, { "docid": "8392b1d57c0764d040b001ccf3dc8b69", "score": "0.5131712", "text": "function checkWalls(data, possibleMoves) {\n var bodyData = data.you.body.data;\n if (bodyData[0].x === 0) {\n if (bodyData[1].x === 1) {\n return ['up', 'down'];\n } else if (bodyData[1].y === bodyData[0].y - 1) {\n return ['right', 'down'];\n } else if (bodyData[1].y === bodyData[0].y + 1) {\n return ['right', 'up'];\n } else {\n return ['right', 'up', 'down'];\n }\n } else if (bodyData[0].x === data.width - 1) {\n if (bodyData[1].x === bodyData[0].x - 1) {\n return ['up', 'down'];\n } else if (bodyData[1].y === bodyData[0].y - 1) {\n return ['left', 'down'];\n } else if (bodyData[1].y === bodyData[0].y + 1) {\n return ['left', 'up'];\n } else {\n return ['up', 'down', 'left'];\n }\n } else if (bodyData[0].y === 0) {\n if (bodyData[1].y === bodyData[0].y + 1) {\n return ['left', 'right'];\n } else if (bodyData[1].x === bodyData[0].x - 1) {\n return ['down', 'right'];\n } else if (bodyData[1].x === bodyData[0].x + 1) {\n return ['down', 'left'];\n } else {\n return ['left', 'right', 'down'];\n }\n } else if (bodyData[0].y === data.height - 1) {\n if (bodyData[1].y === bodyData[0].y - 1) {\n return ['left', 'right'];\n } else if (bodyData[1].x === bodyData[0].x - 1) {\n return ['up', 'right'];\n } else if (bodyData[1].x === bodyData[0].x + 1) {\n return ['up', 'left'];\n } else {\n return ['up', 'left', 'right'];\n }\n } else {\n return possibleMoves;\n }\n}", "title": "" }, { "docid": "59d736901f1051cab298194de00618e0", "score": "0.5128012", "text": "function checkEnemiesFromDownLeft(cell, color) {\n for (var i = cell.i - 1, j = cell.j - 1; j >= 0 && i >= 0; j--, i--) {\n var currentCell = getCell(i, j);\n if (isNonEmpty(currentCell) && !(isType(currentCell, Type.King) && isColor(currentCell, color))) { //there's someone in the cell\n if (!isColor(currentCell, color)) { // the piece is enemy piece\n if (isType(currentCell, Type.Bishop) || isType(currentCell, Type.Queen)) {\n return true;\n }\n if (i === cell.i - 1 && j === cell.j - 1) {\n if (isType(currentCell, Type.King)) {\n return true;\n }\n if (isType(currentCell, Type.Pawn) && color.equals(Color.Black)) {\n return true;\n }\n }\n }\n else {\n return false;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "593419cacb05d035034108abb894c150", "score": "0.5122186", "text": "function horizontalwincheck(){\n for(var row=0;row<6;row++){\n for(var col=0;col<4;col++){\n if(colormatchcheck(returncolor(row,col),returncolor(row,col+1),returncolor(row,col+2),returncolor(row,col+3))){\n console.log('Horizontal');\n reportwin(row,col);\n return true;\n }else{\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "fd93e389a24574be379b1271d0f6c465", "score": "0.51193166", "text": "function winOrLose(){\n\t\tvar i, j;\n\n\t\t//Check Row-wise\n\t\tfor(i = 0; i < 9; i += 3){\n\t\t\tif(grid[i] === grid[i + 1] && grid[i + 1] === grid[i + 2]){\n\t\t\t\tif(grid[i] == 'X')\n\t\t\t\t\treturn -1;\n\t\t\t\telse if(grid[i] == 'O')\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\t//Check Column-wise\n\t\tfor(i = 0; i < 3; i++){\n\t\t\tif(grid[i] === grid[i + 3] && grid[i + 3] === grid[i + 6]){\n\t\t\t\tif(grid[i] == 'X')\n\t\t\t\t\treturn -1;\n\t\t\t\telse if(grid[i] == 'O')\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\t//Check Diagonally\n\t\tif((grid[0] === grid[4] && grid[4] == grid[8]) || (grid[2] == grid[4] && grid[4] == grid[6])){\n\t\t\tif(grid[4] == 'X')\n\t\t\t\t\treturn -1;\n\t\t\t\telse if(grid[4] == 'O')\n\t\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "dbcf84f394750a6c7476d76db39b1ab2", "score": "0.51170444", "text": "function checkForWin (columns) {\n const directions = [[0, 1], [1, 1], [1, 0], [1, -1]];\n for (let sx = 0; sx < columns.length; sx++) {\n for (let sy = 0; sy < columns[0].length; sy++) {\n const colorAtPos = columns[sx][sy];\n if (!colorAtPos) {\n continue;\n }\n for (let di = 0; di < directions.length; di++) {\n const dir = directions[di];\n const nextPos = { x: sx, y: sy };\n let connected = 1;\n for (let i = 0; i < 3; i++) {\n nextPos.x += dir[0];\n nextPos.y += dir[1];\n if (\n (nextPos.x >= columns.length) ||\n (nextPos.y < 0) ||\n (nextPos.y >= columns[0].length)\n ) {\n break;\n }\n const colorAtNextPos = columns[nextPos.x][nextPos.y];\n if (colorAtNextPos !== colorAtPos) {\n break;\n }\n connected++;\n }\n if (connected === 4) {\n return colorAtPos;\n }\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "ff43d7ac2ff5b9efe6a1c2773d4b981d", "score": "0.51149446", "text": "function diagonalwincheck(){\n for(var col=0;col<5;col++){\n for(var row=0;row<7;row++){\n if(colormatchcheck(returncolor(row,col),returncolor(row+1,col+1),returncolor(row+2,col+2),returncolor(row+3,col+3))){\n console.log('Diagonal');\n reportwin(row,col);\n return true;\n }else if(colormatchcheck(returncolor(row,col),returncolor(row-1,col+1),returncolor(row-2,col+2),returncolor(row-3,col+3))){\n console.log('Diagonal');\n reportwin(row,col);\n return true;\n }else{\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "07e907e7605041bfd32b734bd1a88090", "score": "0.5113988", "text": "function isDraw() {\n return pieces.every(elem => [\"X\", \"O\"].includes(elem))\n}", "title": "" }, { "docid": "10765131500d075ef30b0d4c0888038f", "score": "0.5112331", "text": "function getCleanCells() {\r\n var counter = 0;\r\n for (var i = 0; i < gLevel.SIZE; i++) {\r\n for (var j = 0; j < gLevel.SIZE; j++) {\r\n if (!gBoard[i][j].isMine &&\r\n !gBoard[i][j].isShown) {\r\n gSafeCells.push({ i, j });\r\n counter++;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ce6e5c800c7a499ec0eb68a9baf9120d", "score": "0.5110271", "text": "function checkBackwardDiagonal() {\n // IMPLEMENT ME\n return EMPTY_CELL;\n}", "title": "" }, { "docid": "91f1c5f01155bea1f8e7c83c1595a12d", "score": "0.51049966", "text": "isTerminal() {\n // check rows\n for (let i = 0; i <= 6; i = i + 3) {\n if (this.board[i] !== \"E\" && this.board[i] === this.board[i + 1] && this.board[i + 1] === this.board[i + 2]) {\n this.result = `${this.board[i]}-wins`;\n return true;\n }\n }\n // check columns\n for (let i = 0; i <= 2; i++) {\n if (this.board[i] !== \"E\" && this.board[i] === this.board[i + 3] && this.board[i + 3] === this.board[i + 6]) {\n this.result = `${this.board[i]}-wins`;\n return true;\n }\n }\n // check diagonals\n for (let i = 0, j = 4; i <= 2; i = i + 2, j = j - 2) {\n if (this.board[i] !== \"E\" && this.board[i] == this.board[i + j] && this.board[i + j] === this.board[i + 2 * j]) {\n this.result = `${this.board[i]}-wins`;\n return true;\n }\n }\n // check for draw\n let freeCells = this.emptyCells();\n if (freeCells.length === 0) {\n this.result = 'draw';\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "5107a1601eb60e4b8ed4e8ddc7b246e6", "score": "0.5094541", "text": "function checkSides(){\n\t\tif (positionX > BOARD_WIDTH) { \n\t\t\tchangeDirection();\n\t\t}\n\t\telse if (positionX < 0) {\n\t\t\tchangeDirection();\n\t\t}\n\t}", "title": "" }, { "docid": "d78ce71e4baa308a98db86e0d97dbdca", "score": "0.50942415", "text": "function drawGameChar()\n{\n\t// draw game character\n if(isLeft && isFalling)\n {\n strokeWeight(0);\n fill(50);\n ellipse(gameChar_x - 4, gameChar_y - 3,10,8);\n fill(252, 98, 3);\n rect(gameChar_x - 5, gameChar_y - 65,20,60);\n fill(0);\n rect(gameChar_x - 5, gameChar_y - 20,20,1);\n fill(0);\n rect(gameChar_x - 5, gameChar_y - 40,20,1);\n fill(128, 82, 23);\n ellipse(gameChar_x - 5, gameChar_y - 30,10,8);\n fill(0);\n ellipse(gameChar_x + 8, gameChar_y - 3,10,8); \n }\n else if(isRight && isFalling)\n {\n strokeWeight(0);\n fill(50);\n ellipse(gameChar_x+4, gameChar_y-3,10,8);\n fill(252, 98, 3);\n rect(gameChar_x-15, gameChar_y-65,20,60);\n fill(0);\n rect(gameChar_x-15, gameChar_y-20,20,1);\n fill(0);\n rect(gameChar_x-15, gameChar_y-40,20,1);\n fill(128, 82, 23);\n ellipse(gameChar_x+5, gameChar_y-30,10,8);\n fill(0);\n ellipse(gameChar_x-8, gameChar_y-3,10,8);\n }\n else if(isLeft)\n {\n strokeWeight(0);\n fill(50);\n ellipse(gameChar_x - 4, gameChar_y - 3,10,8);\n fill(252, 98, 3);\n rect(gameChar_x - 5, gameChar_y - 65,20,60);\n fill(0);\n rect(gameChar_x - 5, gameChar_y - 20,20,1);\n fill(0);\n rect(gameChar_x - 5, gameChar_y - 40,20,1);\n fill(128, 82, 23);\n ellipse(gameChar_x - 5, gameChar_y - 30,10,8);\n fill(0);\n ellipse(gameChar_x + 8, gameChar_y - 3,10,8); \n }\n else if(isRight)\n {\n strokeWeight(0);\n fill(50);\n ellipse(gameChar_x+4, gameChar_y-3,10,8);\n fill(252, 98, 3);\n rect(gameChar_x-15, gameChar_y-65,20,60);\n fill(0);\n rect(gameChar_x-15, gameChar_y-20,20,1);\n fill(0);\n rect(gameChar_x-15, gameChar_y-40,20,1);\n fill(128, 82, 23);\n ellipse(gameChar_x+5, gameChar_y-30,10,8);\n fill(0);\n ellipse(gameChar_x-8, gameChar_y-3,10,8);\n }\n else if(isFalling || isPlummeting)\n {\n strokeWeight(0);\n fill(252, 98, 3);\n rect(gameChar_x - 15, gameChar_y - 65,30,60);\n fill(237, 199, 149);\n rect(gameChar_x - 10, gameChar_y - 60,20,20);\n fill(0);\n rect(gameChar_x, gameChar_y - 40,1,20);\n fill(0);\n rect(gameChar_x - 15, gameChar_y - 20,30,1);\n fill(0);\n rect(gameChar_x - 15, gameChar_y - 40,30,1);\n fill(255);\n ellipse(gameChar_x - 6, gameChar_y - 51,6);\n fill(255);\n ellipse(gameChar_x + 6, gameChar_y - 51,6);\n fill(0);\n ellipse(gameChar_x - 5, gameChar_y - 50,2);\n fill(0);\n ellipse(gameChar_x + 5, gameChar_y - 50,2);\n fill(128, 82, 23);\n ellipse(gameChar_x + 18, gameChar_y - 30,10,8);\n fill(128, 82, 23);\n ellipse(gameChar_x - 18, gameChar_y - 30,10,8);\n fill(0);\n ellipse(gameChar_x + 8, gameChar_y - 3,10,8);\n fill(0);\n ellipse(gameChar_x - 8, gameChar_y - 3,10,8);\n }\n else\n {\n strokeWeight(0);\n fill(252, 98, 3);\n rect(gameChar_x - 15, gameChar_y - 65,30,60);\n fill(237, 199, 149);\n rect(gameChar_x - 10, gameChar_y - 60,20,20);\n fill(0);\n rect(gameChar_x, gameChar_y - 40,1,20);\n fill(0);\n rect(gameChar_x - 15, gameChar_y - 20,30,1);\n fill(0);\n rect(gameChar_x - 15, gameChar_y - 40,30,1);\n fill(255);\n ellipse(gameChar_x - 6, gameChar_y - 51,6);\n fill(255);\n ellipse(gameChar_x + 6, gameChar_y - 51,6);\n fill(0);\n ellipse(gameChar_x - 5, gameChar_y - 50,2);\n fill(0);\n ellipse(gameChar_x + 5, gameChar_y - 50,2);\n fill(128, 82, 23);\n ellipse(gameChar_x + 18, gameChar_y - 30,10,8);\n fill(128, 82, 23);\n ellipse(gameChar_x - 18, gameChar_y - 30,10,8);\n fill(0);\n ellipse(gameChar_x + 8, gameChar_y - 3,10,8);\n fill(0);\n ellipse(gameChar_x - 8, gameChar_y - 3,10,8);\n }\n}", "title": "" }, { "docid": "15326990dd7fafba8b611383e23acc1b", "score": "0.5092171", "text": "function checkEdge(number){\n if(weapon.tabWeapon[number].y<0){ //If the weapon of the ship is out of the map...\n ctx.clearRect(weapon.tabWeapon[number].x, weapon.tabWeapon[number].y, 10, 40); // ...we clear it...\n weapon.tabWeapon.splice(number,1); //.. and delete the weapon's coordinates from the list.\n }\n}", "title": "" }, { "docid": "703047e00662626a8cff68e1c9518e58", "score": "0.5088479", "text": "function winCheck(currentCell) {\n if (!Game.gameOver) {\n var currentMark = currentCell.text();\n var currentRow = parseInt(currentCell.parent().attr('id').split('-')[1]);\n currentCell = parseInt(currentCell.attr('id').split('-')[1]);\n\n checks.topRight(currentRow, currentCell, currentMark);\n\n // All the readable positions \n var left = $('#row-' + currentRow).find('#cell-' + (currentCell - 1)).text();\n var topLeft = $('#row-' + (currentRow - 1)).find('#cell-' + (currentCell - 1)).text();\n var top = $('#row-' + (currentRow - 1)).find('#cell-' + currentCell).text();\n var topRight = $('#row-' + (currentRow - 1)).find('#cell-' + (currentCell + 1)).text();\n var right = $('#row-' + currentRow).find('#cell-' + (currentCell + 1)).text();\n var bottomRight = $('#row-' + (currentRow + 1)).find('#cell-' + (currentCell + 1)).text();\n var bottom = $('#row-' + (currentRow + 1)).find('#cell-' + currentCell).text();\n var bottomLeft = $('#row-' + (currentRow + 1)).find('#cell-' + (currentCell - 1)).text();\n\n var farLeft = $('#row-' + currentRow).find('#cell-' + (currentCell - 2)).text();\n var farTopLeft = $('#row-' + (currentRow - 2)).find('#cell-' + (currentCell - 2)).text();\n var farTop = $('#row-' + (currentRow - 2)).find('#cell-' + currentCell).text(); \n var farTopRight = $('#row-' + (currentRow - 2)).find('#cell-' + (currentCell + 2)).text();\n var farRight = $('#row-' + currentRow).find('#cell-' + (currentCell + 2)).text();\n var farBottomRight = $('#row-' + (currentRow + 2)).find('#cell-' + (currentCell + 2)).text();\n var farBottom = $('#row-' + (currentRow + 2)).find('#cell-' + currentCell).text();\n var farBottomLeft = $('#row-' + (currentRow + 2)).find('#cell-' + (currentCell - 2)).text();\n }\n}", "title": "" }, { "docid": "909ae617179c1837567a2fcda8ae4764", "score": "0.5083605", "text": "function checkHorizontals() {\n return checkWin({ i: 0, j: -1 }, { i: 0, j: 1 })\n }", "title": "" }, { "docid": "cc9ea0cbb95988071db4c396d317f64f", "score": "0.50809", "text": "function isTerminal (state) {\n\t\tvar result = {\n\t\t\tterminal: false,\n\t\t\twinnerCells: [],\n\t\t\twinnerSymbol: ''\n\t\t}\n\t\t//Check rows\n\t\tfor (var i = 0; i <= 6; i += 3){\n\t\t\tif (state[i] && state[i] === state[i+1] && state[i+1] === state[i+2]){\n\t\t\t\tresult.terminal= true;\n\t\t\t\tresult.winnerCells = new Array(i, i + 1, i +2);\n\t\t\t\tresult.winnerSymbol = state[i];\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\t//Check columns\n\t\tfor (var i = 0; i <= 2; i ++) {\n\t\t\tif (state[i] && state[i] === state[i+3] && state[i+3] === state[i+6]){\n\t\t\t\tresult.terminal = true;\n\t\t\t\tresult.winnerCells = new Array(i, i + 3, i +6);\n\t\t\t\tresult.winnerSymbol = state[i];\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\t//Check first diagonal\n\t\tif (state[0] && state[0] === state[4] && state[4] === state[8]){\n\t\t\tresult.terminal = true;\n\t\t\tresult.winnerCells = new Array(0,4,8);\n\t\t\tresult.winnerSymbol = state[0];\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\n\t\t//Check second diagonal\n\t\tif (state[2] && state[2] === state[4] && state[4] === state[6]){\n\t\t\tresult.terminal = true;\n\t\t\tresult.winnerCells = new Array(2,4,6);\n\t\t\tresult.winnerSymbol = state[2];\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\n\t\t//Get the available indices\t\t\n\t\tvar availIndices = getAvailableIndices(state);\n\n\t\t//If there is no empty box, the result is draw\n\t\tif (availIndices.length === 0){\n\t\t\tresult.terminal = true;\n\t\t\tresult.winnerCells = [];\n\t\t\tresult.winnerSymbol = '#';\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "12262270c22d66a6aef769359d0e2da8", "score": "0.5076131", "text": "static get validDirections() {\n return {\n N: 'N',\n E: 'E',\n S: 'S',\n W: 'W'\n }\n }", "title": "" }, { "docid": "c9597e37d70efee21a14957a92435f57", "score": "0.5071099", "text": "getDirection()\n {\n if(this.left_active_ == true && this.right_active_ == false)\n return 'left';\n\n if(this.right_active_ == true && this.left_active_ == false)\n return 'right';\n\n return 'straight';\n }", "title": "" }, { "docid": "b8b3dfd4116ecd223d13be6c21f4b9e2", "score": "0.5069004", "text": "hits(obj) {\n let result = false;\n if (this.x >= obj.x && this.x <= obj.x + obj.width || (this.x + charWidth >= obj.x && this.x + charWidth <= obj.x + obj.width)) {\n if (this.y >= obj.y && this.y <= obj.y + obj.height || (this.y + charWidth >= obj.y && this.y + charWidth <= obj.y + obj.height)) {\n result = true;\n }\n }\n if (this.obj >= this.x && obj.x <= this.x + this.width || (obj.x + obj.width >= this.x && obj.x + obj.width <= this.x + this.width)) {\n if (obj.y >= this.y && obj.y <= this.y + this.height || (obj.y + obj.height >= this.y && obj.y + obj.height <= this.y + this.height)) {\n result = true;\n }\n }\n return result;\n }", "title": "" }, { "docid": "63cd9f3747c8b8c760086a8024b47d44", "score": "0.50666076", "text": "isEdge(type) {\n return [this.types.NW, this.types.NE, this.types.SW, this.types.SE].indexOf(type) > -1\n }", "title": "" }, { "docid": "f7a4ea84ce504d5c581e58cbdff0eccb", "score": "0.5065439", "text": "edges() {\n if (this.pos.x < 0 || this.pos.x > width) {\n this.fastVel.x *= -1;\n this.slowVel.x *= -1;\n }\n if (this.pos.y < 0 || this.pos.y > height) {\n this.fastVel.y *= -1;\n this.slowVel.y *= -1;\n }\n }", "title": "" }, { "docid": "40221377338219081229f47593ba6b83", "score": "0.5062757", "text": "function whichClues(cursor) {\n var moves = (cursor.isAcross ? [left, up] : [up, left]);\n var results = [];\n for (var i = 0; i < 2; i++) {\n var square = cursor.square;\n var last = '';\n while (square.inRange && board(square) != '.') {\n last = annotation(square);\n square = moves[i](square);\n }\n if (last == '') {\n results.push(null);\n } else {\n results.push([last, (moves[i] == left ? 'across' : 'down')]);\n }\n }\n return results;\n}", "title": "" }, { "docid": "42cca6616119f45b834fc3b3505f2abc", "score": "0.5061892", "text": "getWordsInAxis(vertical = true) {\n let currWords = [];\n\n for (let i = 0; i < 15; i++) {\n let word = '';\n\n for (let j = 0; j < 15; j++) {\n let x = vertical ? i : j;\n let y = vertical ? j : i;\n\n if (this.board[y][x] !== '-') {\n word += this.board[y][x];\n }\n\n if (word.length === 2) {\n let prevX = vertical ? i : j - 1;\n let prevY = vertical ? j - 1 : i;\n if (this.board[prevY][prevX] === '-') {\n word = this.board[y][x];\n }\n }\n\n if (this.board[y][x] === '-' && word.length > 1) {\n let node = {\n word: word,\n vertical: vertical,\n x: vertical ? x : x - word.length,\n y: vertical ? y - word.length : y\n }\n currWords.push(node);\n word = '';\n }\n\n }\n\n if (word.length > 1) {\n let node = {\n word: word,\n vertical: vertical,\n x: vertical ? 15 - word.length : i,\n y: vertical ? i : 15 - word.length\n }\n currWords.push(node);\n word = '';\n }\n }\n\n return currWords;\n }", "title": "" }, { "docid": "4599e455940286b4037bd868acbd7568", "score": "0.50599116", "text": "function checkMoveRightAble() {\n let liesCounter = 0;\n for (let i = (valueArray.length - 1); i > -1; i--) {\n for (let j = (valueArray[i].length - 1); j > -1; j--) {\n if (valueArray[i][j][0] === pieceCounter) {\n if (j === (valueArray[i].length - 1)) {\n liesCounter = liesCounter + 1;\n }\n else {\n if (valueArray[i][j + 1][0] === \"・\" || valueArray[i][j + 1][0] === pieceCounter) {\n liesCounter = liesCounter;\n }\n else {\n liesCounter = liesCounter + 1;\n }\n }\n }\n }\n }\n if (liesCounter > 0) {\n moveRightAble = false;\n }\n else {\n moveRightAble = true;\n }\n}", "title": "" }, { "docid": "938ff54976f67a30b5643ef80de004a6", "score": "0.50574607", "text": "function findNeighbour(current){\r\n var open=new Object();\r\n var id=0;\r\n var skip=false;\r\n for(var i= current[0]-1;i<=current[0]+1;i++){\r\n for(var j= current[1]-1;j<=current[1]+1;j++) {\r\n if(i==current[0]&&j==current[1]){\r\n continue;\r\n }\r\n for(var node in closedList){\r\n if(i==closedList[node][0] && j==closedList[node][1]){\r\n skip=true;\r\n }\r\n }\r\n if(skip){\r\n skip=false;\r\n continue;\r\n }\r\n if(i>=0 && j>=0 && i<map.length && j<map[0].length){\r\n if(map[i][j]==1) {\r\n open[id] = [i, j];\r\n open[id].parent=current;\r\n ctx.fillStyle = \"green\";\r\n ctx.fillRect(hashMap[(map[i].length*i)+j][0], hashMap[(map[i].length*i)+j][1], cellsize-1, cellsize-1);\r\n ctx.fillStyle = \"#FF0000\";\r\n ctx.fillRect(hashMap[(map[source[0]].length*source[0])+source[1]][0], hashMap[(map[source[0]].length*source[0])+source[1]][1], cellsize-1, cellsize-1);\r\n ctx.fillStyle = \"blue\";\r\n ctx.fillRect(hashMap[(map[goal[0]].length*goal[0])+goal[1]][0], hashMap[(map[goal[0]].length*goal[0])+goal[1]][1], cellsize-1, cellsize-1);\r\n id++;\r\n }\r\n }\r\n }\r\n }\r\n return open;\r\n}", "title": "" }, { "docid": "61e8058bcc00407c68b65daf51161303", "score": "0.5049515", "text": "get isValidHalfEdgeGraphAllowRaggedBoundary() {\n return this.numWithMatchedEdgeMate + this.numUndefinedEdgeMate === this.numTested\n && this.numUndefinedFS === 0\n && this.numUndefinedFP === 0\n && this.numFSFPError === 0\n && this.numMatePairError === 0;\n }", "title": "" }, { "docid": "f02e60663bd7db324801f869056c9de1", "score": "0.50410765", "text": "function checkDiagonals(desk) {\n let winnerFound = true;\n\n for (let i = 1; i < desk.length; i++) {\n if (desk[0][0] !== desk[i][i] || desk[i][i] === undefined) {\n winnerFound = false;\n break;\n }\n }\n\n if (winnerFound) {\n return true;\n } else {\n winnerFound = true;\n }\n\n for (let i = 1; i < desk.length; i++) {\n if (\n desk[0][desk.length - 1] !== desk[i][desk.length - 1 - i] ||\n desk[i][desk.length - 1 - i] === undefined\n ) {\n winnerFound = false;\n break;\n }\n }\n\n return winnerFound;\n}", "title": "" }, { "docid": "1ea555bc581accf1d09153f213cf0847", "score": "0.5036884", "text": "function checkOffScreen() {\n //is cat going off canvas;\n if (cat.x < 0 || cat.x > width || cat.y < 0 || cat.y > height)\n state = `escaped`;\n}", "title": "" }, { "docid": "f1d33cb54fcc3b0f9c2996c519765f6d", "score": "0.5036857", "text": "function heuristic() {\n\tlet m = 0, aligned = true;\n\n\tfor(let i = 8; i < 12; i++) {\n\t\t// count edge that don't have correct bottom color\n\t\tif(!this.correctBottomColor(i))\n\t\t\tm++;\n\t\t// keep track of alignment of other color of the edge\n\t\telse if(this.edges.edges[i] !== this.edges.solvedEdges[i-8])\n\t\t\taligned = false;\n\t}\n\n\t// if at least 1 edge was not aligned\n\t// it must take at leat another move to solve cross\n\treturn aligned ? m : m+1;\n}", "title": "" }, { "docid": "e6c802ebf8b77e9dc5a3b0b5583875a7", "score": "0.50363", "text": "function edgeMid() {\r\n if (caseLock == false) { // Only the first time this function is called\r\n caseLock = true;\r\n if (squares[secondMove - 1].name == squares[firstMove - 1].mid2) {\r\n holder = squares[firstMove - 1].adj1;\r\n } else {\r\n holder = squares[firstMove - 1].opp1;\r\n }\r\n $(\"[name=\" + holder + \"]\").html(\"O\").css({\r\n \"color\": \"red\",\r\n \"cursor\": \"default\"\r\n });\r\n squares[holder - 1].filled = true;\r\n turnCounter++;\r\n\r\n $(\"td\").off();\r\n $(\"td\").on(\"click\", edgeMid);\r\n } else {\r\n if (squares[($(this).attr(\"name\")) - 1].filled == false) {\r\n turnCounter++;\r\n squares[($(this).attr(\"name\")) - 1].filled = true;\r\n $(\"td\").css(\"color\", \"black\");\r\n $(this).html(\"X\").css(\"cursor\", \"default\");\r\n }\r\n\r\n if (turnCounter == 5) {\r\n if ($(this).attr(\"name\") == squares[holder - 1].pair) {\r\n holder = squares[holder - 1].mid2;\r\n $(\"[name=\" + holder + \"]\").html(\"O\").css({\r\n \"color\": \"red\",\r\n \"cursor\": \"default\"\r\n });\r\n } else {\r\n holder = squares[holder - 1].pair;\r\n $(\"[name=\" + holder + \"]\").html(\"O\");\r\n if (holder == 3 || holder == 7) {\r\n endGame(\"diag2\");\r\n } else {\r\n endGame(\"diag1\");\r\n }\r\n }\r\n squares[holder - 1].filled = true;\r\n turnCounter++;\r\n }\r\n\r\n if (turnCounter == 7) {\r\n if ($(this).attr(\"name\") == squares[holder - 1].pair) {\r\n holder = squares[holder - 1].opp2;\r\n $(\"[name=\" + holder + \"]\").html(\"O\").css({\r\n \"color\": \"red\",\r\n \"cursor\": \"default\"\r\n });\r\n } else {\r\n holder = squares[holder - 1].pair;\r\n $(\"[name=\" + holder + \"]\").html(\"O\");\r\n if (holder == 1 || holder == 9) {\r\n endGame(\"diag1\");\r\n } else {\r\n endGame(\"diag2\");\r\n }\r\n }\r\n squares[holder - 1].filled = true;\r\n turnCounter++;\r\n }\r\n\r\n if (turnCounter == 9) {\r\n endGame(\"cats\");\r\n }\r\n }\r\n }", "title": "" }, { "docid": "2fa0dfce75ef41568b80f9faf7c15a9f", "score": "0.50307983", "text": "function checkCoord2(arr, x, y, charCheck) {\n let adjacentCount = 0;\n let leftCheck = (x - 1) >= 0;\n let rightCheck = (x + 1) < arr[y].length;\n let upCheck = (y - 1) >= 0;\n let downCheck = (y + 1) < arr.length;\n\n // Left\n if (leftCheck) {\n adjacentCount += checkVector(arr, y, x, 0, -1, -1, -1);\n }\n // Upper Left\n if (leftCheck && upCheck) {\n adjacentCount += checkVector(arr, y, x, -1, -1, -1, -1);\n }\n // Up\n if (upCheck) {\n adjacentCount += checkVector(arr, y, x, -1, 0, -1, -1);\n }\n // Upper Right\n if (rightCheck && upCheck) {\n adjacentCount += checkVector(arr, y, x, -1, 1, -1, arr[y].length);\n }\n // Right\n if (rightCheck) {\n adjacentCount += checkVector(arr, y, x, 0, 1, -1, arr[y].length);\n }\n // Lower Right\n if (rightCheck && downCheck) {\n adjacentCount += checkVector(arr, y, x, 1, 1, arr.length, arr[y].length);\n }\n // Down\n if (downCheck) {\n adjacentCount += checkVector(arr, y, x, 1, 0, arr.length, arr[y].length);\n }\n // Lower Left\n if (leftCheck && downCheck) {\n adjacentCount += checkVector(arr, y, x, 1, -1, arr.length, -1);\n }\n\n return adjacentCount;\n}", "title": "" }, { "docid": "b2b8197966700f8432b5ac81eb7859a6", "score": "0.5029206", "text": "function checkCells(piece,row,col,forward,color,twice){\n if (piece.hasClass(\"king\")){\n markValidCell(row,col,1,forward*-1,color,twice);//right cell\n markValidCell(row,col,-1,forward*-1,color,twice);//left cell\n }\n markValidCell(row,col,1,forward,color,twice);//right cell\n markValidCell(row,col,-1,forward,color,twice);//left cell\n }", "title": "" }, { "docid": "d2c277f29b417f615cf040eaa1781579", "score": "0.50250983", "text": "isConnector() {\n return this.mxcell.isEdge();\n }", "title": "" }, { "docid": "13739243728fe78da734980316d3b674", "score": "0.5024936", "text": "function verticalwincheck(){\n for(var col=0;col<7;col++){\n for(var row=0;row<3;row++){\n if(colormatchcheck(returncolor(row,col),returncolor(row+1,col),returncolor(row+2,col),returncolor(row+3,col))){\n console.log('Vertical');\n reportwin(row,col);\n return true;\n }else{\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "d697b4c03532a56fdfaaf6f4b3301a25", "score": "0.5020912", "text": "function WinCheck(arena){\n\n\tlet str;\n\n\t// diagonal _check\n\n\tvar p_dia = (+arena[0][0]) + (+arena[1][1]) + (+arena[2][2]);\n\tvar s_dia = (+arena[0][2]) + (+arena[1][1]) + (+arena[2][0]);\n\n\tif (p_dia == 3 || s_dia == 3){\n\t\tstr = \"X\";\n\t\treturn str;\n\t}\n\n\telse if (p_dia == -3 || s_dia == -3){\n\t\t\tstr = \"O\";\n\t\t\treturn str;\n\t}\n\n\t// checking along column\n\n\tfor(let i=0; i<3; i++){\n\n\t\tlet sum = 0;\n\n\t\tfor(let j=0; j<3; j++){\n\t\t\tsum += (+arena[i][j]);\n\t\t}\n\n\t\tif (sum == 3){\n\n\t\t\tstr = \"X\";\n\t\t\treturn str;\n\t\t}\n\n\t\telse if(sum == -3){\n\n\t\t\tstr = \"O\";\n\t\t\treturn str;\n\t\t}\n\n\t}\n\n\t// checking along row\n\n\tfor(let i=0; i<3; i++){\n\n\t\tlet sum = 0;\n\n\t\tfor(let j=0; j<3; j++){\n\t\t\tsum += (+arena[j][i]);\n\t\t}\n\n\t\tif (sum == 3){\n\n\t\t\tstr = \"X\";\n\t\t\treturn str;\n\t\t}\n\n\t\telse if(sum == -3){\n\n\t\t\tstr = \"O\";\n\t\t\treturn str;\n\t\t}\n\t}\n\n\tfor (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (+arena[i][j] == 0) {\n return false;\n }\n }\n }\n\treturn str;\n}", "title": "" }, { "docid": "75e62d605e4dc095b37621566aca9849", "score": "0.5020907", "text": "get edgeMate() { return this._edgeMate; }", "title": "" }, { "docid": "ae484b677616bbaaa3823b9f9b7109c0", "score": "0.5020387", "text": "function hasWon( rowFilled , colSelected ) {\n if(verticalWin( rowFilled , colSelected ) ) return WINNER;\n if(horizontalWin( rowFilled , colSelected ) ) return WINNER;\n if(diagonalWin( rowFilled , colSelected ) ) return WINNER;\n}", "title": "" }, { "docid": "e007ed90f4307097c815d95b41fa75a5", "score": "0.5016525", "text": "function altCheck(piece, opp) {\n\n // get king position\n const king = board.pieces.find(p => p.type == 'king' && p.color == piece.color);\n\n // check horizontally, vertically, or diagonally\n if (king.row == piece.row && opp.row == piece.row) { piece.moveset = piece.moveset.filter(m => m[1] == piece.id[1]); } \n else if (king.col == piece.col && opp.col == piece.col) { piece.moveset = piece.moveset.filter(m => m[0] == piece.id[0]); } \n else {\n // if it is not a straight diagonal, there is no danger\n const dy = king.row - piece.row;\n const dx = king.col - piece.col;\n const slope = Math.abs(dy / dx);\n const dy2 = king.row - opp.row;\n const dx2 = king.col - opp.col;\n const slope2 = Math.abs(dy2 / dx2);\n if (slope != 1 || slope2 != 1) return;\n\n // knights and rooks cannot respond to a diagonal threat\n if (piece.type == 'rook' || piece.type == 'knight') {\n piece.moveset = [];\n } else {\n // finds diagonal safe moves between king and attacker\n const pCol = piece.col;\n const oCol = opp.col;\n piece.moveset = piece.moveset.filter(m => {\n if (m == opp.id) return true;\n const included = opp.moveset.includes(m);\n const mCol = toNumber(m[0]);\n const vrDiff = (opp.row > piece.row) ? (m[1] < opp.row && m[1] > piece.row) : (m[1] > opp.row && m[1] < piece.row);\n const hrDiff = (oCol < pCol) ? (mCol < pCol && mCol > oCol) : (mCol > pCol && mCol < oCol);\n return included && hrDiff && vrDiff;\n });\n }\n }\n\n if (piece.moveset.length == 0) {\n const grid = document.getElementById(opp.id);\n if (!grid.classList.contains('danger')) {\n grid.classList.add('danger');\n setTimeout( () => {\n grid.classList.remove('danger');\n }, 1000);\n }\n }\n\n}", "title": "" }, { "docid": "f1b26ef71bcee0e808853c2079f4c2da", "score": "0.5015522", "text": "correctConnection(c) {\r\n\r\n if (c.x2 > c.x1 && c.y2 > c.y1) {\r\n if (c.corner == \"left\"){\r\n c.x1 = c.from.x\r\n c.y1 = c.from.y + 25\r\n c.x2 = c.to.x - 25\r\n c.y2 = c.to.y\r\n }\r\n else {\r\n c.x1 = c.from.x + 25\r\n c.y1 = c.from.y\r\n c.x2 = c.to.x\r\n c.y2 = c.to.y - 25\r\n }\r\n }\r\n else if (c.x2 > c.x1 && c.y2 < c.y1) {\r\n if (c.corner == \"left\"){\r\n c.x1 = c.from.x\r\n c.y1 = c.from.y - 25\r\n c.x2 = c.to.x - 25\r\n c.y2 = c.to.y\r\n }\r\n else {\r\n c.x1 = c.from.x + 25\r\n c.y1 = c.from.y\r\n c.x2 = c.to.x\r\n c.y2 = c.to.y + 25\r\n }\r\n }\r\n else if (c.x2 < c.x1 && c.y2 < c.y1) {\r\n if (c.corner == \"right\"){\r\n c.x1 = c.from.x - 25\r\n c.y1 = c.from.y\r\n c.x2 = c.to.x\r\n c.y2 = c.to.y + 25\r\n }\r\n else {\r\n c.x1 = c.from.x\r\n c.y1 = c.from.y - 25\r\n c.x2 = c.to.x + 25\r\n c.y2 = c.to.y\r\n }\r\n }\r\n else if (c.x2 < c.x1 && c.y2 > c.y1) {\r\n if (c.corner == \"right\"){\r\n c.x1 = c.from.x - 25\r\n c.y1 = c.from.y\r\n c.x2 = c.to.x\r\n c.y2 = c.to.y - 25\r\n }\r\n else {\r\n c.x1 = c.from.x\r\n c.y1 = c.from.y + 25\r\n c.x2 = c.to.x + 25\r\n c.y2 = c.to.y\r\n }\r\n }\r\n //if we get in the else clause it might mean the connection line does not connect the from and to objects anymore, due to moving an object\r\n //Check if connection has from and to object set and reset it to the middle, calling the correction again\r\n else {\r\n if (c.from != 0 && c.to != 0) {\r\n c.x1 = c.from.x\r\n c.y1 = c.from.y\r\n c.x2 = c.to.x\r\n c.y2 = c.to.y\r\n this.correctConnection(c)\r\n }\r\n }\r\n if (this.state.movingObject == 0 ) //While moving do not refresh the screen.\r\n this.forceUpdate()\r\n //this.setState({connections : stateCopy.connections})\r\n }", "title": "" }, { "docid": "5644cf38c9b426f756669ab7e02dd674", "score": "0.5009194", "text": "function determineDraw(){\n\n let piece1 = null; // temp variables used to make code easier to read\n let piece2 = null;\n\n // king vs king\n if (boardData.whitePieces.length === 1 &&\n boardData.blackPieces.length === 1 ){\n return true;\n }\n\n // lone white king, black bishop + king\n if (boardData.whitePieces.length === 1 &&\n boardData.blackPieces.length === 2 ){\n piece1 = boardData.blackPieces[0];\n piece2 = boardData.blackPieces[1];\n if (boardMap[ piece1.y ][ piece1.x ].pcType === Pieces.BISHOP ||\n boardMap[ piece2.y ][ piece2.x ].pcType === Pieces.BISHOP) {\n return true;\n }\n }\n\n // lone black king, white bishop + king\n if (boardData.blackPieces.length === 1 &&\n boardData.whitePieces.length === 2 ){\n piece1 = boardData.whitePieces[0];\n piece2 = boardData.whitePieces[1];\n if (boardMap[ piece1.y ][ piece1.x ].pcType === Pieces.BISHOP ||\n boardMap[ piece2.y ][ piece2.x ].pcType === Pieces.BISHOP) {\n return true;\n }\n }\n\n // lone white king, black knight + king\n if (boardData.whitePieces.length === 1 &&\n boardData.blackPieces.length === 2 ){\n piece1 = boardData.blackPieces[0];\n piece2 = boardData.blackPieces[1];\n if (boardMap[ piece1.y ][ piece1.x ].pcType === Pieces.KNIGHT ||\n boardMap[ piece2.y ][ piece2.x ].pcType === Pieces.KNIGHT) {\n return true;\n }\n }\n\n // lone black king, white knight + king\n if (boardData.blackPieces.length === 1 &&\n boardData.whitePieces.length === 2 ){\n piece1 = boardData.whitePieces[0];\n piece2 = boardData.whitePieces[1];\n if (boardMap[ piece1.y ][ piece1.x ].pcType === Pieces.KNIGHT ||\n boardMap[ piece2.y ][ piece2.x ].pcType === Pieces.KNIGHT) {\n return true;\n }\n }\n\n\n // both players have king + bishop, both bishops are same color\n if (boardData.blackPieces.length === 2 &&\n boardData.whitePieces.length === 2 ){\n let blackBishop = null;\n let whiteBishop = null;\n for ( let i = 0; i < 2; i++){\n if (boardMap[ boardData.whitePieces[i].y ][ boardData.whitePieces[i].x ].pcType === Pieces.BISHOP ) {\n whiteBishop = boardData.whitePieces[i];\n for ( let k = 0; k < 2; k++){\n if (boardMap[ boardData.blackPieces[k].y ][ boardData.blackPieces[k].x ].pcType === Pieces.BISHOP ) {\n blackBishop = boardData.blackPieces[k];\n\n // calculates if bishops are on same color square\n if (((blackBishop.y + blackBishop.x) % 2) ===\n ((whiteBishop.y + whiteBishop.x) % 2)) {\n return true;\n }\n break;\n }\n }\n break;\n }\n }\n }\n return false;\n }", "title": "" } ]
bc9b3275db00dbc9ae7b1c817e0cb844
checks a cache object for emptiness
[ { "docid": "27554deac3f0bb7e34b795783bc800ca", "score": "0.0", "text": "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" } ]
[ { "docid": "a186382e59f7e564fe14ab81da132afa", "score": "0.71035826", "text": "getCacheEmpty() {\n return gKeyIndex.length === 0;\n }", "title": "" }, { "docid": "843fc1b61d052f5fb962cf1941162cfa", "score": "0.6533182", "text": "function clearCache() {\n _cache = {};\n }", "title": "" }, { "docid": "d5cf69b16e1b102e6a2f461f7c490575", "score": "0.6521569", "text": "function cacheClear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.64923435", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.64923435", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.64923435", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "c3fb35685889db9ca24a5e0b6d2c9142", "score": "0.6437229", "text": "static clearCache() {\n simpleCache.forEach((v, k) => {\n if (v.expires < +new Date()) {\n simpleCache.delete(k);\n }\n });\n }", "title": "" }, { "docid": "dcdee677573eed7157b521613f5c3e98", "score": "0.6411703", "text": "clearCache() {\n Object.keys(cache).forEach(key => {\n if ( cache.hasOwnProperty(key) ) delete cache[key];\n });\n }", "title": "" }, { "docid": "1608d3ff258cc7472cbc2a4c64991ae7", "score": "0.6352594", "text": "function clearCache() {\r\n\tfor ( i in cache ) {\r\n\t\tif ( cache[i].expires <= new Date() ) {\r\n\t\t\tcache.splice( i, 1 );\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "9b995050470d2b41b085f325585ba501", "score": "0.633226", "text": "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\t// 如果cache.data 为空,跳过本次循环,不判断了\n\t\t// 如果不跳过啊,就走到下面了吧,name !== data 杠杠的\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t//toJSON是内置的,如果看到其他name,就不为空\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "e222b20a8caa6914baa6d5027485d21d", "score": "0.6302241", "text": "clear() { this.cache = {}; }", "title": "" }, { "docid": "943ccdbb2d36951385b244ab43f7e497", "score": "0.6247862", "text": "function clearCache() {\n cache = null;\n }", "title": "" }, { "docid": "ead2720fb97456ab90ccc8e73dd68dd0", "score": "0.6237558", "text": "function createEmptyCache() {\n return {\n isSet: false,\n value: undefined,\n nextObjects: new WeakMap(),\n nextPrimitives: new Map(),\n };\n}", "title": "" }, { "docid": "87ea01bc6296c3154ecfd3c3db905fa4", "score": "0.6196967", "text": "_validateCache() {\n if (this.cacheTime + this.refreshInterval < util.time()) {\n console.log('Fetching new player & tribe data from ark files');\n this.cacheTime = util.time();\n this.cache = this._fetch();\n }\n }", "title": "" }, { "docid": "9e05f3805f191273ef1ef324fe93cfd6", "score": "0.61486995", "text": "clear() {\n this.cache_ = {};\n this.cacheSize_ = 0;\n }", "title": "" }, { "docid": "de82c48320b8aef182fb47c8a6abda73", "score": "0.6145585", "text": "clearCache() {\n this._cache = {};\n this._lru = new LinkedList(this._maxSize);\n }", "title": "" }, { "docid": "9a9c935f6617ea2ec48cb2a78e768608", "score": "0.6145209", "text": "function clearCache() {\n cache.caches = {}\n}", "title": "" }, { "docid": "856975e42e732e0f7d2a3a028af7e783", "score": "0.6134505", "text": "function listCacheClear(){this.__data__=[];this.size=0}", "title": "" }, { "docid": "a37acfaebb1f1b46c90d0945fd65112e", "score": "0.6126392", "text": "isCacheValid(cacheData) {\n if (cacheData && cacheData.Count) {\n const {lastUpdatedTime = 0}= _.get(cacheData, 'Items.0', {});\n const timeDiff = (Date.now() - lastUpdatedTime) / 1000;\n if (timeDiff < 600) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "74d8aab60219020e497d4780ccab3413", "score": "0.61106604", "text": "function clearCache() {\n Object.keys(cache).forEach(function (key) {\n delete cache[key];\n });\n\n}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.6102824", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.60985166", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "a6491677a111b640196d505ef24dbf77", "score": "0.60698813", "text": "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "title": "" }, { "docid": "a6491677a111b640196d505ef24dbf77", "score": "0.60698813", "text": "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "title": "" }, { "docid": "a6491677a111b640196d505ef24dbf77", "score": "0.60698813", "text": "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "title": "" }, { "docid": "fb63202086b78abba9a0d3bb5c7be63c", "score": "0.6067746", "text": "isEmpty () {\n return this._storage.length === 0;\n }", "title": "" }, { "docid": "730a5d06a1a9720ad73834b69af3d890", "score": "0.60631156", "text": "clearCache() {\n\t\tcache.reset();\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "2e516f1c0dbf96ee5121c6cb1dc77343", "score": "0.60554475", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "bb68cbc07c11d0efe357746045938ff7", "score": "0.60489887", "text": "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "title": "" }, { "docid": "bb68cbc07c11d0efe357746045938ff7", "score": "0.60489887", "text": "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "title": "" }, { "docid": "bb68cbc07c11d0efe357746045938ff7", "score": "0.60489887", "text": "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "title": "" } ]
26215f314490898b27d28285cc7ae3bd
Determine if we're running in a standard browser environment This allows axios to run in a web worker, and reactnative. Both environments support XMLHttpRequest, but not fully standard globals. web workers: typeof window > undefined typeof document > undefined reactnative: navigator.product > 'ReactNative'
[ { "docid": "bba7d95c60ccb50ccde6908b3ea4d54a", "score": "0.0", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" } ]
[ { "docid": "d161f518ca5b59e0865b8b3c6a2f81f5", "score": "0.81490695", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n }", "title": "" }, { "docid": "4253fe087feddaf6c250065bafc6e63c", "score": "0.8133686", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "4253fe087feddaf6c250065bafc6e63c", "score": "0.8133686", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "4253fe087feddaf6c250065bafc6e63c", "score": "0.8133686", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "4253fe087feddaf6c250065bafc6e63c", "score": "0.8133686", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "4253fe087feddaf6c250065bafc6e63c", "score": "0.8133686", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "4253fe087feddaf6c250065bafc6e63c", "score": "0.8133686", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "683f1a54c16f90c46831d5906fa8336d", "score": "0.8129744", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "683f1a54c16f90c46831d5906fa8336d", "score": "0.8129744", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "aab1a9911c89d10f0acb11f6cdb6846b", "score": "0.8122959", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' &&\n (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (typeof window !== 'undefined' && typeof document !== 'undefined');\n}", "title": "" }, { "docid": "66327edfcb3c9a2d18520511b2c3c1c5", "score": "0.81197196", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "title": "" }, { "docid": "66327edfcb3c9a2d18520511b2c3c1c5", "score": "0.81197196", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "title": "" }, { "docid": "66327edfcb3c9a2d18520511b2c3c1c5", "score": "0.81197196", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "title": "" }, { "docid": "66327edfcb3c9a2d18520511b2c3c1c5", "score": "0.81197196", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "title": "" }, { "docid": "9e8aa1ea7659211230195cb7750c86b7", "score": "0.81051385", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "105a121298ee93e0efcc79cfbfe20509", "score": "0.8101771", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" }, { "docid": "15da67d213c06c814bd9be6c3c245a12", "score": "0.80982924", "text": "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "title": "" } ]
e35515cffeb00103939822a363caa4a9
Get URL to network IP where the server is alive.
[ { "docid": "66a0edd72cdde7f8def730c316a4db1f", "score": "0.0", "text": "getServerUrl() {\n return `http:${this.webpackConfig.getServerUrl()}`;\n }", "title": "" } ]
[ { "docid": "0c2f7273ae608e1812447d35944ecd2a", "score": "0.66243184", "text": "get serverUrl(){\n\t\tif (!$server.request) return \"\";\n\t\tif ($req.headers.getKeys().join().listContains(\"x-forwarded-host\")){\n\t\t\t\t\n\t\t\tvar proto = \"http\";\n\t\t\tif (\"x-forwarded-proto\" in $req.headers){\n\t\t\t\tproto = $req.headers[\"x-forwarded-proto\"][0];\n\t\t\t}\n\t\t\treturn proto+\"://\"+$req.headers[\"x-forwarded-host\"][0]\t\t\n\t\t} else {\n\t\t\tvar URL = String($server_gateway.environment.get(\"requestURL\"));\n\t\t\tvar URI = String($server_gateway.environment.get(\"requestURI\"));\n\t\t\t//return URL + \":\" +URI;\n\t\t\treturn URL.left(URL.length-URI.length);\n\t\t}\n\t}", "title": "" }, { "docid": "c242f43b9f68ce7a7d73c028882e9224", "score": "0.65841347", "text": "function getServerUrl() {\n return (\n \"http\" +\n (location.hostname == \"localhost\" ? \"\" : \"s\") +\n \"://\" +\n location.hostname +\n (location.hostname == \"localhost\" ? \":\" + serverPort : \"\")\n );\n}", "title": "" }, { "docid": "952566f7aa72855587987d3052b21e4e", "score": "0.64385575", "text": "function getServerIp() {\n\n var os = require('os');\n var ifaces = os.networkInterfaces();\n var values = Object.keys(ifaces).map(function (name) {\n return ifaces[name];\n });\n values = [].concat.apply([], values).filter(function (val) {\n return val.family == 'IPv4' && val.internal == false;\n });\n\n return values.length ? values[0].address : '0.0.0.0';\n}", "title": "" }, { "docid": "211392085701306c61568d3118b5459f", "score": "0.6375504", "text": "function getServerURL() {\n\treturn (sessionStorage.SERVERIP+\":\"+sessionStorage.SERVERPORT);\n}", "title": "" }, { "docid": "bff32861186236c0a47135e59000e83d", "score": "0.63010305", "text": "function getHostURL() {\n var hostURL = window.location.protocol + '//' + window.location.hostname + ':' + host_port;\n return hostURL;\n}", "title": "" }, { "docid": "bff32861186236c0a47135e59000e83d", "score": "0.63010305", "text": "function getHostURL() {\n var hostURL = window.location.protocol + '//' + window.location.hostname + ':' + host_port;\n return hostURL;\n}", "title": "" }, { "docid": "8263240a5620d7d2648e3c30828dd8fb", "score": "0.62270033", "text": "static get connectionTesterIP() {}", "title": "" }, { "docid": "ffe77cc66ddf340e6f6a1937acf9ebeb", "score": "0.6207485", "text": "serverAddress(val) {\n\n if (val != null) {\n\n if (val.toLowerCase().indexOf('http') !== 0) {\n throw new Error(`Invalid url: ${val}`);\n }\n\n this._serverAddress = val;\n\n onNetworkChanged(this);\n }\n\n return this._serverAddress;\n }", "title": "" }, { "docid": "1bd4c468b1ed990ba32a5a6c54e13d23", "score": "0.6169278", "text": "static get proxyIP() {}", "title": "" }, { "docid": "4a39cd1da02517e968a13e2c3266ef49", "score": "0.61110514", "text": "function __getIPAddress() {\n var host = java.net.InetAddress.getLocalHost();\n var address = host.getHostAddress();\n return String(address).valueOf();\n}", "title": "" }, { "docid": "b6f34e2ae88f65036353c55aafd2273d", "score": "0.6081555", "text": "get remoteAddr(){\n\t\tif ($server.isThread) return \"localhost/Thread\";\n\t\tif (!(\"request\" in $server) || !$server.request) return \"unknown\";\t\t\n\t\tvar ip =String($server.request.getRemoteAddr());\n\t\tif (\"X-Forwarded-For\" in $req.headers){\n\t\t\tip = String($req.headers[\"X-Forwarded-For\"][0])\n\t\t}\n\t\treturn ip;\n\t}", "title": "" }, { "docid": "3b135a462fafb9dee1aff821b7c4cb59", "score": "0.6063711", "text": "function getAddressInfo() {\n return new Promise((resolve) => {\n const server = require(\"http\").createServer();\n\n server.listen(0, \"localhost\", () => {\n const addressInfo = server.address();\n server.close();\n return resolve(addressInfo);\n });\n })\n}", "title": "" }, { "docid": "e2fa0d64ad9b3fc268433bc586a8f1bb", "score": "0.60414404", "text": "function getURL(){\n //return \"http://dali.cs.kuleuven.be:8080\";\n return \"http://dali.cs.kuleuven.be:8443\";\n }", "title": "" }, { "docid": "8f89adc1af91fa34b5c0aba97c690336", "score": "0.6037102", "text": "async function getHostServerLocation(){\n const response = await fetch(\"https://api.ipify.org/?format=json\");\n const hostIPJson = await response.json();\n const hostIP = await hostIPJson.ip;\n console.log(\"Host Server IP number is: \" + hostIP);\n\n const request = await fetch(\"https://ipinfo.io/\"+ hostIP + \"?token=ce97437d272c61\");\n const jsonResponse = await request.json();\n const hostLoc = await jsonResponse.loc;\n console.log(\"host Server IP location is: \" + hostLoc);\n socket.emit(\"hostServerLocation\", hostLoc);\n return (hostLoc)\n }", "title": "" }, { "docid": "4e9ebf7ffbfdd4635e8bb4cca5a02602", "score": "0.60010046", "text": "function getUserPublicIP() {\n\t// create request\n\tvar options = {\n\t\tmethod: 'GET',\n\t\turi: 'http://bot.whatismyipaddress.com',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json; odata=verbose',\n\t\t\t'Accept': 'application/json; odata=verbose'\n\t\t},\n\t\tjson: true\n\t};\n\n\t// submit request\n\treturn requestPromise(options);\n}", "title": "" }, { "docid": "9cd1bef3beceba05f123033c262a6251", "score": "0.59455", "text": "function getIPAddress() {\n var interfaces = require('os').networkInterfaces();\n for (var devName in interfaces) {\n var iface = interfaces[devName];\n for (var i = 0; i < iface.length; i++) {\n var alias = iface[i];\n if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal)\n return alias.address;\n }\n }\n return '0.0.0.0';\n}", "title": "" }, { "docid": "bba1aa80427ec88ad32a1b76769323cb", "score": "0.5933246", "text": "function getLocalIpAddress() {\n const obj = Object.values(os.networkInterfaces())\n .reduce((acc, arr) => acc.concat(arr), [])\n .find(({family, internal}) => family === 'IPv4' && !internal)\n\n return obj ? obj.address : '0.0.0.0'\n}", "title": "" }, { "docid": "8e20fad2a12299d67cc06274d671b4b1", "score": "0.59060407", "text": "function getPublicIp() {\n return P.promisify(needle.get)('http://api.ipify.org?format=json')\n .then(response => response.body)\n .then(({ip}) => ip);\n}", "title": "" }, { "docid": "9c921c56305556e668e4ae98f8a35a5c", "score": "0.58681136", "text": "function getServerURL(server) {\n let address = server.address();\n return (\n \"http://\" +\n (address.family === \"IPv6\"\n ? \"[\" + address.address + \"]\"\n : address.address) +\n \":\" +\n address.port\n );\n}", "title": "" }, { "docid": "6fd932d89c33b5dbcb752632faacd6e0", "score": "0.5848438", "text": "function getHost() {\n\t\t\tvar host = window.location.protocol + '//' + window.location.hostname;\n\t\t\tif (host.indexOf(\"localhost\") !== -1 || host.indexOf(\"127.0.0.1\") !== -1) {\n\t\t\t\thost = window.location.protocol + '//' + \"geomsolutions.developer.12thdoor.com\";\n\t\t\t}\n\t\t\treturn host;\n }", "title": "" }, { "docid": "1d28440f74bf518c7ab151c57ee73596", "score": "0.5839681", "text": "get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }", "title": "" }, { "docid": "1d28440f74bf518c7ab151c57ee73596", "score": "0.5839681", "text": "get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }", "title": "" }, { "docid": "df180c50830ab2c89d70dbaa679b0835", "score": "0.579566", "text": "get serverUrl() {\n return `http://${this.host}:${this.port}`;\n }", "title": "" }, { "docid": "22ddb47dfb309d351f1da750baabc7b6", "score": "0.5793829", "text": "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "22ddb47dfb309d351f1da750baabc7b6", "score": "0.5793829", "text": "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "22ddb47dfb309d351f1da750baabc7b6", "score": "0.5793829", "text": "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "22ddb47dfb309d351f1da750baabc7b6", "score": "0.5793829", "text": "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "22ddb47dfb309d351f1da750baabc7b6", "score": "0.5793829", "text": "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.57897073", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "e298836ccca25e6619be1f56ea888359", "score": "0.5783661", "text": "function getLocalIP(){\n var netInterfaces = os.networkInterfaces()['Wi-Fi'];\n var localIP = '127.0.0.1';\n if(netInterfaces){\n Object.keys(netInterfaces).forEach(function (index) {\n if (netInterfaces[index].family == 'IPv4' &&\n netInterfaces[index].internal == false) {\n localIP = netInterfaces[index].address;\n }\n });\n }\n return localIP;\n}", "title": "" }, { "docid": "15a424ca891bf653c3d846b7ee98ac0f", "score": "0.5777992", "text": "function getIPAddress(){\n // Get the IP Adress from the device via the cordova-plugin-networkinterface plugin\n networkinterface.getIPAddress(\n function(ip){\n ipaddress = ip;\n return ip;\n },function(iperror){\n return false;\n }\n );\n }", "title": "" }, { "docid": "679505943e3fd02fff5a93228ada6001", "score": "0.5774851", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "679505943e3fd02fff5a93228ada6001", "score": "0.5774851", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "679505943e3fd02fff5a93228ada6001", "score": "0.5774851", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "679505943e3fd02fff5a93228ada6001", "score": "0.5774851", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "679505943e3fd02fff5a93228ada6001", "score": "0.5774851", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d49fbb411f6cf14424e2a3bb5cd8c27b", "score": "0.57586116", "text": "function get_network_ip() {\n var address = \"localhost\"\n for (var dev in ifaces) {\n var dev = ifaces[dev]\n for (var i in dev) {\n var iface = dev[i]\n if (!iface.internal && iface.family == \"IPv4\") {\n return iface.address\n }\n }\n }\n return address\n}", "title": "" }, { "docid": "70b718ae50aa684d3618aab6447e0026", "score": "0.574993", "text": "async _getExternalIP (circuit) {\n return await new AdvancedProxiedRequest.IPCheckRequest({\n url: this.EXTERNAL_IP_CHECK_URL,\n reqArgs: {\n proxyClient: circuit.pollingClient,\n },\n }).runAsync();\n }", "title": "" }, { "docid": "cf9cc5757bdb3620e8e00b39a9e4e35e", "score": "0.5725725", "text": "function getIP(){\n\t$.get(\"http://ipinfo.io\", function(e) {\n\t\t\talert(e.ip);\n\t\t\t$('#demo').text(e.ip);\n\t\t}, \"jsonp\");\n}", "title": "" }, { "docid": "107f2df4d10fa879e40777d26f226541", "score": "0.5719378", "text": "function getIpAddress(req) {\n\treturn req.headers['x-forwarded-for'] || req.connection.remoteAddress;\n}", "title": "" }, { "docid": "51dc03b43b034b4f836d381b4e8443b0", "score": "0.57183117", "text": "function address(){\n \tif (config.nodejs)\n \t\treturn {val: config.serverurl};\n \telse\n \t\treturn fwBridge.address;\n}", "title": "" }, { "docid": "1b70c565d8397174f7aeb8ad00060d20", "score": "0.5699537", "text": "get ip() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.socket.remoteAddress;\n }", "title": "" }, { "docid": "759ca7aff2949d5b710c16e3915e9ef8", "score": "0.5694038", "text": "function getServerURL() {\n var host = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"localhost\";\n var port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"8081\";\n var allowSSL = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n // Check for SSL\n if (allowSSL && null) {\n var _stub = 'https://' + (host || \"localhost\");\n\n // If we're on port 443, that's 'regular' SSL so no need to specify port\n if (null === '443') return _stub;\n return _stub + ':' + null;\n }\n\n // Plain HTTP\n var stub = 'http://' + (host || \"localhost\");\n\n // If we're on port 80, that's 'regular' HTTP so no need to specify port\n if (port === '80') return stub;\n return stub + ':' + port;\n}", "title": "" }, { "docid": "0f0f7e8ea1e16e149acacb28a2a09449", "score": "0.56796235", "text": "static ip(req) {\n let ip = '';\n\n try {\n ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;\n } catch (err) {\n // ignora os erros de recuperação de IP\n }\n\n return ip;\n }", "title": "" }, { "docid": "7b237d7eb172eda859edced94cd607a5", "score": "0.5650029", "text": "getClientIP( request ) {\n let { headers, connection, socket } = request;\n\n if ( headers && headers['x-forwarded-for'] ) {\n return String( headers['x-forwarded-for'] ).trim().split( /[\\,\\s]+/g ).shift();\n }\n if ( connection && connection.remoteAddress ) {\n return String( connection.remoteAddress ).trim();\n }\n if ( socket && socket.remoteAddress ) {\n return String( socket.remoteAddress ).trim();\n }\n if ( connection && connection.socket && connection.socket.remoteAddress ) {\n return String( connection.socket.remoteAddress ).trim();\n }\n return '';\n }", "title": "" }, { "docid": "21f9b9278a47e576a1f15b220a47a19f", "score": "0.56295854", "text": "function publicIp(callback){ \n http.request(\n {\n host: publicIp.HOST,\n path: publicIp.PATH\n }, \n (response)=>{\n var str = ''; \n response.on('data', (chunk)=>{str += chunk}); \n response.on('end', ()=>{callback(str.replace(/[^0-9.]/g,''))});\n }\n ).end();\n}", "title": "" }, { "docid": "5ce6467873694f4cb75b0f0563bb5d3b", "score": "0.5620947", "text": "get ip() {\n return this.request.connection.remoteAddress;\n }", "title": "" }, { "docid": "e4afe8e34841f1fa97ef27b6d7c4f76c", "score": "0.5603959", "text": "function _getIP() {\n\treturn settings.get_string('ip');\n}", "title": "" }, { "docid": "7c5a09641f1b33567c45d8b5f26cab02", "score": "0.5600365", "text": "function getIP() {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"https://ipinfo.io/ip\", true);\n\n xhr.onreadystatechange = function() {\n if (xhr.status == 200) {\n var resp = xhr.responseText;\n if (resp != null) {\n userIP = resp;\n } else {\n userIP = randomIP();\n }\n } else {\n userIP = randomIP();\n }\n return userIP;\n };\n xhr.send();\n}", "title": "" }, { "docid": "45a821f415f55981b8858f9f49aa7946", "score": "0.5579884", "text": "function checkNetwork() {\n getPublicIp()\n\n .then(ip => {\n return getInterfaces().then(({hostname, interfaces}) => {\n return {\n hostname,\n interfaces,\n public_ip: ip,\n };\n });\n })\n\n .then(info => {\n console.log(`IP Info:\\n${JSON.stringify(info, null, 2)}`);\n // TODO:\n // - check with database\n // - report to IP service\n })\n\n .catch(error => {\n logger.error('Error fetching networking info:', error);\n })\n\n .finally(() => setTimeout(checkNetwork, 60000));\n}", "title": "" }, { "docid": "c7494a1103ae8ece241df43022976cf8", "score": "0.55730957", "text": "getHostName() {\n let location = this.url;\n return (new URL(location)).hostname;\n }", "title": "" }, { "docid": "abc99b9ab7743d60dde1ce2ae728bd5d", "score": "0.5566647", "text": "static getServerURL() {\n return __awaiter$1(this, void 0, void 0, function* () {\n try {\n const result = yield CodePush.getServerURL();\n return result.value;\n }\n catch (e) {\n return DefaultServerUrl;\n }\n });\n }", "title": "" }, { "docid": "81b11111c97a4a18f470ed5405d0bd4d", "score": "0.55618924", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = proxy.getProxyUrl(Url.parse(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "74d1d44b197727f4d2deda6bcb10447f", "score": "0.5552977", "text": "function getPoolHost() {\n if(typeof poolHost != \"undefined\") return poolHost;\n if(lastStats.config.poolHost) return lastStats.config.poolHost;\n else return window.location.hostname;\n}", "title": "" }, { "docid": "09998ef82e07b6d3af6d0cda591186df", "score": "0.55354273", "text": "function serverUrl() {\n return '';\n}", "title": "" }, { "docid": "48aef341caf6892b3ed02f9905b74873", "score": "0.55273813", "text": "function getHost() {\n return document.location.host;\n }", "title": "" }, { "docid": "05a5fb6b7d13fa646d76b66d7198cf10", "score": "0.55155945", "text": "async function getIPAddress() {\r\n try {\r\n const response = await fetch(\"https://ip.seeip.org/json\");\r\n const data = await response.json();\r\n return data;\r\n } catch (err) {\r\n console.log(err);\r\n return null;\r\n }\r\n}", "title": "" }, { "docid": "a2f7fe7ad9eb14ff16ac16a7299f5d94", "score": "0.5504176", "text": "function getIpAddress(myurl) {\r\n\r\n if (!myurl) myurl = 'http://iframe.ip138.com/ic.asp';\r\n var exp = /([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})/g,\r\n ipaddress = '',\r\n xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', myurl, false);\r\n\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 200 || xhr.status === 304) {\r\n var r = xhr.responseText;\r\n if (!exp.test(r)) {\r\n if (myurl === 'http://iframe.ip138.com/ipcity.asp') {\r\n getIpAddress('http://jsonip.com/');\r\n }\r\n\r\n return;\r\n }\r\n else {\r\n ipaddress = r.match(exp)[0];\r\n }\r\n \r\n if (MixOne.Auth.TX && ipaddress) {\r\n MixOne.Auth.TX.ipaddress = ipaddress;\r\n }\r\n localStorage.setItem('ipaddress', ipaddress);\r\n }\r\n else if (myurl === 'http://iframe.ip138.com/ipcity.asp') {\r\n getIpAddress('http://jsonip.com/');\r\n return;\r\n }\r\n }\r\n }\r\n\r\n xhr.onerror = function () {\r\n var preIP = localStorage.getItem('ipaddress');\r\n if (preIP !== null && exp.test(preIP)) {\r\n ipaddress = preIP;\r\n }\r\n }\r\n\r\n xhr.timeout = 10000;\r\n xhr.ontimeout = function () {\r\n var preIP = localStorage.getItem('ipaddress');\r\n if (preIP !== null && exp.test(preIP)) {\r\n ipaddress = preIP;\r\n }\r\n }\r\n\r\n xhr.send(null);\r\n }", "title": "" }, { "docid": "f186b2e95f0bf5d80fc268d79e5e0eed", "score": "0.54536235", "text": "function getIPAdress(){ \n var interfaces = require('os').networkInterfaces(); \n for(var devName in interfaces){ \n var iface = interfaces[devName]; \n for(var i=0;i<iface.length;i++){ \n var alias = iface[i]; \n if(alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal){ \n return alias.address; \n } \n } \n } \n}", "title": "" }, { "docid": "1fc10b0fd432c7520b73eda12fa02698", "score": "0.54316217", "text": "static getOnlineClassroomURL () {\n if (typeof cordova === 'undefined') {\n return window.location.origin + '/onlineClassroomServer'\n }\n return localStorage.getItem('baseURL')\n }", "title": "" }, { "docid": "d1c917982a59e52965d647f030b392b4", "score": "0.5417263", "text": "getHostName() {\n let tmpURL = new URL(this.url);\n return tmpURL.hostname;\n }", "title": "" }, { "docid": "f857eb7922a99af6dd8799db722f754a", "score": "0.5403231", "text": "async function getURL() {\n const url = await ngrok.connect(port)\n console.log(url)\n}", "title": "" }, { "docid": "1a7b3347819ec79923cae27f4010eaaa", "score": "0.53909165", "text": "function printLanAddress() //https://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js\n{\n\tconsole.log();//blank space\n\tlet os = require('os');\n\tlet ifaces = os.networkInterfaces();\n\n\tObject.keys(ifaces).forEach(function (ifname) {\n\t\tifaces[ifname].forEach(function (iface) {\n\t\t\tif ('IPv4' !== iface.family || iface.internal !== false) {\n\t\t\t\t// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconsole.log(\"Running Lan Server over: \" + ifname + \" | \" + iface.address + \" | (\" + HTTP_PORT + \" / \" + HTTPS_PORT + \")\");\n\t\t});\n\t});\n\tconsole.log();//blank space\n}", "title": "" }, { "docid": "f808a217456e9b54d217e8823782ff18", "score": "0.5388531", "text": "getServerURL () {\r\n\r\n return \"http://localhost:1337\";\r\n\r\n }", "title": "" }, { "docid": "20a8d06fb49168df26b20823797dc7d5", "score": "0.5384114", "text": "function verIP() {\n if (enable) {\n wifi.getIP(res => {\n //ToastAndroid.show(ip, ToastAndroid.SHORT);\n console.log(res);\n });\n } else {\n //ligar wifi\n }\n }", "title": "" }, { "docid": "f51195f816278fa253c06bed4c5e9161", "score": "0.5379018", "text": "function getClientIp(req) {\n return (req.headers['x-forwarded-for'] || '').split(',')[0] ||\n req.connection.remoteAddress ||\n req.socket.remoteAddress ||\n req.connection.socket.remoteAddress;\n}", "title": "" }, { "docid": "2080b454f2e759a82fb4643b43f319a0", "score": "0.53652775", "text": "async function get(url) {\n try {\n await requests.get(`http://${url}:8093/ping`, { timeout: 1000 });\n return url;\n } catch (ex) {\n return false;\n }\n }", "title": "" }, { "docid": "1c91ab3b55a6c8e47bac153124ba7179", "score": "0.5355101", "text": "getStatusUrl() {\n\t \treturn this.statusUrl;\n\t }", "title": "" }, { "docid": "fae8b085c6397392ab9a0036c5008da6", "score": "0.53538316", "text": "function getIP(req) {\n return (req.headers[\"X-Forwarded-For\"] || req.headers[\"x-forwarded-for\"] || req.client.remoteAddress);\n }", "title": "" }, { "docid": "51904321a81eea713d66a9487d0a7b75", "score": "0.5339049", "text": "function getHost(url) {\n return url.replace(/^(\\w+:\\/\\/[^/]*)\\/?.*$/, '$1');\n }", "title": "" }, { "docid": "37f2dc59ef8d13b7f4be9ea73caeb5f7", "score": "0.5324073", "text": "function get_client_ip(req)\n{\n var headers = req.headers;\n\n if ('x-real-ip' in headers)\n {\n return String(headers['x-real-ip']);\n }\n\n return String(req.connection.remoteAddress);\n}", "title": "" }, { "docid": "e0c170f5b6a5a18766cc12a97c68b532", "score": "0.53233975", "text": "getDefaultServerUrl() {\n let retval = \"\";\n\n // Use the first in the list:\n try{\n if(this.serverList.length > 0) {\n retval = this.serverList[0].url;\n }\n }catch(e) {/* No op */}\n\n return retval;\n }", "title": "" }, { "docid": "df67d425458a407946b285ae6a158150", "score": "0.5305801", "text": "function getClientIP(req) {\n return req.headers['x-forwarded-for'] || // 判断是否有反向代理 IP\n req.connection.remoteAddress || // 判断 connection 的远程 IP\n req.socket.remoteAddress || // 判断后端的 socket 的 IP\n req.connection.socket.remoteAddress;\n}", "title": "" }, { "docid": "f338aa0066177dba2155ad182acf357f", "score": "0.53032553", "text": "function getLocationOrigin() {\n // eslint-disable-next-line max-len\n return window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');\n}", "title": "" }, { "docid": "484dff87d4d55ee621a0bdca87e055f7", "score": "0.5301953", "text": "function networkFetch(url) {\n return `${url} - Response from network`\n}", "title": "" }, { "docid": "6c2034e7578117e3f12401cbcaf31c6c", "score": "0.52910525", "text": "function get_client_ipv4(req) {\n //获取任意浏览器的IP地址,\n var ip = req.headers['x-forwarded-for'] ||\n req.ip ||\n req.connection.remoteAddress ||\n req.socket.remoteAddress ||\n req.connection.socket.remoteAddress || '';\n //获取到的IP地址中存在IPV4和IPV6的地址,我们只需要IPV4的地址\n // if(ip.split(',').length>0){\n // ip = (ip.split(',')[0]).match(/(\\d+\\.\\d+\\.\\d+\\.\\d+)/)[0];\n // }\n return ip;\n}", "title": "" }, { "docid": "908651738b7aa85b3f1358b3474a91d3", "score": "0.5290048", "text": "function getHost() {\n return content.window.location.host;\n }", "title": "" }, { "docid": "5ef1953e9849536091cc9d430838b7d5", "score": "0.5263972", "text": "_checkNetworkOnline(connectionManager) {\n const checkUrl = `${location.origin}/?checkOnline=${+ new Date()}`;\n \n // Try to reach the server\n let request = new Request(checkUrl, {\n method: 'HEAD',\n });\n \n fetch(request)\n .then(() => {\n // We are really online\n connectionManager._setIsOnline(true);\n })\n .catch(() => {\n // Request was unsuccessful, so we are most likely offline\n connectionManager._setIsOnline(false);\n });\n }", "title": "" }, { "docid": "d58e5e3fc2f8999755967aecda9c4e15", "score": "0.52618414", "text": "get currentUrl(){ \n\t\tvar cPath = $server.currentDir;\n\t\t\n\t\treturn String($server.rootUrl + cPath.substring($server.rootDir.length));\n\t}", "title": "" }, { "docid": "4a6c61bccc808e5b648726b12871519e", "score": "0.526151", "text": "function boz_wsconn_geturl() {\n if (this.ws == null) {\n console.log(\"boz_wsconn_geturl: No ws initialized\");\n return null;\n }\n\n return this.url;\n}", "title": "" }, { "docid": "a534458de88ab4f5c95a0d64e88089e0", "score": "0.52528566", "text": "function getServerURL() {\n // Parse.serverURL has the /parse at the end, which we need to remove\n return Parse.serverURL.replace(\"/parse\", \"\");\n}", "title": "" }, { "docid": "f9f508957b8bdb6360c1cc5f34ad6240", "score": "0.52489406", "text": "ping() {\n return this.request('/ping')\n }", "title": "" }, { "docid": "694779238aa8b0a13ba8343d18648de4", "score": "0.52427405", "text": "function getRemoteIP(request) {\n var ip = request.headers['x-forwarded-for'] || request.connection.remoteAddress || request.socket.remoteAddress || request.connection.socket.remoteAddress;\n // IPv4 is mapped to IPv6, this reverts this\n ip = ip.replace(/^.*:/, '');\n return ip;\n}", "title": "" }, { "docid": "def74270460ccdfaa5f7b7027c7b1333", "score": "0.5231607", "text": "hostname() { return os.hostname(); }", "title": "" }, { "docid": "bb2a4bd947991f92a1932b67d4683cdc", "score": "0.52299076", "text": "async getExtIp(){\n try {\n let soapResult = null;\n if(this.GETEXTIP && this.GETEXTIP == true){\n if (this.connection == '1.WANPPPConnection.1'){\n soapResult = await this.soapAction('/upnp/control/wanpppconn1', 'urn:dslforum-org:service:' + 'WANPPPConnection:1', 'GetInfo', null, soapResult);\n }else{\n soapResult = await this.soapAction('/upnp/control/wanipconnection1', 'urn:dslforum-org:service:' + 'WANIPConnection:1', 'GetInfo', null, soapResult);\n }\n if (soapResult){\n return soapResult['NewExternalIPAddress']; \n }else{\n const mesg = soapResult == null ? '' : soapResult; \n throw new exceptionSoapCommand('GetInfo WANConnection', 'Cannot get external ip address ' + JSON.stringify(mesg)); \n }\n }\n } catch (error) {\n this.adapter.log.warn('getExtIp: ' + error.name + ' ' + error.message);\n return '';\n }\n }", "title": "" }, { "docid": "93571af8f236160a51c7ecb266d96732", "score": "0.52283", "text": "function getip(req) {\n //from http://stackoverflow.com/questions/29496257/knowing-request-ip-in-hapi-js-restful-api\n const xFF = req.headers['x-forwarded-for'];\n const ip = xFF ? xFF.split(',')[0] : req.info.remoteAddress;\n var geo = geoip.lookup(ip);\n return (geo)\n}", "title": "" }, { "docid": "4ec397aa9ecfbe85cafd2b3d5d360496", "score": "0.522575", "text": "get requestServerUrl(){\n\t\t//Myna.log(\"WARNING\",\"Deprecated property 'requestServerUrl' called.\",Myna.dump($req.data));\n\t\treturn $server.serverUrl\n\t}", "title": "" }, { "docid": "3cd40ba2594da1f0322c9652cd8ff206", "score": "0.52127826", "text": "getHostName() { return this.hostname(); }", "title": "" }, { "docid": "d51e5e99d313ccfc335412f974e433f8", "score": "0.51988816", "text": "full_addr(){ return this.addr(); }", "title": "" }, { "docid": "ca7912f05c56fb4c675e7446b38c0699", "score": "0.51962924", "text": "function getLocalIP(callback) {\n require('dns').lookup( require('os').hostname(),\n function (err, add, fam) {\n typeof callback == 'function' ? callback(add) : null;\n });\n}", "title": "" } ]
3096962b342d6eccb4f9b6941fcb267a
Checks if agents have correct plugins versions, if not install them
[ { "docid": "5b3d862c6bd817914a3b0451e1fb225c", "score": "0.6584409", "text": "function validate_plugin_installation(map, structure, runId, agentKey) {\n const agents = agentsService.agentsStatus();\n return new Promise((resolve, reject) => {\n let plugins = executions[runId].executionContext.plugins;\n // check if agents has the right version of the plugins.\n const filesPaths = plugins.reduce((total, current) => {\n if (agents[agentKey].alive && current.version !== agents[agentKey].installed_plugins[current.name]) {\n total.push(current.file);\n }\n return total;\n }, []);\n if (filesPaths && filesPaths.length > 0) {\n Promise.all(filesPaths.map(function (filePath) {\n return agentsService.installPluginOnAgent(filePath, agents[agentKey]);\n })).then(() => {\n winston.log('success', 'Done installing plugins');\n }).catch((error) => {\n winston.log('error', \"Error installing plugins on agent\", error);\n }).then(() => {\n resolve();\n })\n }\n else {\n resolve();\n }\n });\n}", "title": "" } ]
[ { "docid": "7edda7c0796b3532e6a476d9f99d8196", "score": "0.6700149", "text": "_checkPluginsCompatible() {\n const pluginIds = Object.getOwnPropertyNames(this.room._plugins);\n\n for (let pluginId of pluginIds) {\n let pluginRoom = this.getPluginById(pluginId);\n let pluginSpec = pluginRoom.getPluginSpec();\n\n if (!pluginSpec.hasOwnProperty(`incompatible_with`)) {\n continue;\n }\n\n for (let incompatiblePluginName of pluginSpec.incompatible_with) {\n const incompatiblePluginId = this.getPluginId(incompatiblePluginName);\n if (incompatiblePluginId in pluginIds) {\n HHM.log.error(`Incompatible plugins: ${pluginId} incompatible with`\n + `${incompatiblePluginName}`);\n HHM.log.error(this._createDependencyChain(this.getPluginName(pluginId)));\n HHM.log.error(this._createDependencyChain(incompatiblePluginName));\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "a2e931f7cc406db1b204813a10178506", "score": "0.62657136", "text": "_checkDependencies() {\n const pluginNames = Object.getOwnPropertyNames(this.room._plugins);\n\n // Check user config plugins\n for (let pluginName of Object.getOwnPropertyNames(HHM.config.plugins))\n {\n this._checkDependencyLoaded(pluginName, pluginNames);\n }\n\n for (let pluginName of pluginNames) {\n let pluginRoom = this.room._plugins[pluginName];\n let pluginSpec = pluginRoom.getPluginSpec();\n\n if (!pluginSpec.hasOwnProperty(`dependencies`)) {\n continue;\n }\n\n for (let dependency of\n Object.getOwnPropertyNames(pluginSpec.dependencies)) {\n this._checkDependencyLoaded(dependency, pluginNames);\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "cf5b835a57de6710ed555e2c4c001d21", "score": "0.5998784", "text": "checkPluginRequirements (opts = {}) {\n for (const plugin of this._plugins) {\n for (const requirement of plugin.requirements) {\n if ((opts.context === 'launch') && (requirement === 'headful') && opts.options.headless) {\n console.warn(`Warning: Plugin '${plugin.name}' is not supported in headless mode.`)\n }\n if ((opts.context === 'connect') && (requirement === 'launch')) {\n console.warn(`Warning: Plugin '${plugin.name}' doesn't support puppeteer.connect().`)\n }\n }\n }\n }", "title": "" }, { "docid": "11106fd860ffe14511bcdd49e6024b15", "score": "0.59642684", "text": "validateAgentInfo () {\n\t\t// we don't expect any version info concerning the agent\n\t}", "title": "" }, { "docid": "3d39151a4fbfcb928b1995bc8edd1f0c", "score": "0.59601545", "text": "function checkVersion ()\n{\n return true;\n\n /***************************\n var ver = new String(InstallTrigger.getVersion(\"jslib\"));\n\n // strip off build info \n ver = ver.substring(0, ver.lastIndexOf(\".\"));\n\n return (G_VER >= ver);\n ***************************/\n}", "title": "" }, { "docid": "313f86bf1b0b54a9d4a5bb6887b5c782", "score": "0.59195274", "text": "function needsBothLoaders(){\n var versionCheck, packageCheck;\n\n versionCheck = !isNaN(+version) && +version < 45;\n packageCheck = options.packages.indexOf(\"geochart\") > -1 ||\n options.packages.indexOf(\"map\") > -1;\n\n return versionCheck && packageCheck;\n }", "title": "" }, { "docid": "c244000be15c5f01aac2c037d08b5440", "score": "0.58525413", "text": "function getInstalledPlugins() {\n var fs = require('fs');\n\n var modulePath = \"/usr/local/lib/node_modules/\";\n var modules = fs.readdirSync(modulePath);\n var plugins = [];\n for (var moduleID in modules) {\n var moduleName = modules[moduleID];\n if (moduleName.startsWith('homebridge-')) {\n var packagePath = modulePath + moduleName + \"/package.json\";\n var packageJSON = require(packagePath);\n var plugin = {\n \"name\": moduleName,\n \"version\": packageJSON.version,\n \"latestVersion\": \"n/a\",\n \"isLatestVersion\": \"n/a\",\n \"platformUsage\": 0,\n \"accessoryUsage\": 0\n }\n plugins.push(plugin);\n }\n }\n _plugins = plugins;\n enrichUsageInfo();\n enrichMetadata();\n}", "title": "" }, { "docid": "f73c9731ef0484fc171de974c4e7a496", "score": "0.55853593", "text": "function isPluginExecutable(plugin) {\n if (plugin.tiddler.isTagged(\"systemConfigForce\")) {\n plugin.log.push(config.messages.pluginForced);\n return true;\n }\n if (plugin[\"CoreVersion\"]) {\n var coreVersion = plugin[\"CoreVersion\"].split(\".\");\n var w = parseInt(coreVersion[0], 10) - version.major;\n if (w == 0 && coreVersion[1])\n w = parseInt(coreVersion[1], 10) - version.minor;\n if (w == 0 && coreVersion[2])\n w = parseInt(coreVersion[2], 10) - version.revision;\n if (w > 0) {\n plugin.log.push(config.messages.pluginVersionError);\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "4426f941c3e0c7f6485581f7fc503d5a", "score": "0.55776596", "text": "resolvePluginDependencies () {\n // Request missing dependencies from all plugins and flatten to a single Set\n const missingPlugins = this._plugins\n .map(p => p._getMissingDependencies(this._plugins))\n .reduce((combined, list) => {\n return new Set([...combined, ...list])\n }, new Set())\n if (!missingPlugins.size) {\n debug('no dependencies are missing')\n return\n }\n debug('dependencies missing', missingPlugins)\n // Loop through all dependencies declared missing by plugins\n for (let name of [...missingPlugins]) {\n // Check if the dependency hasn't been registered as plugin already.\n // This might happen when multiple plugins have nested dependencies.\n if (this.pluginNames.includes(name)) {\n debug(`ignoring dependency '${name}', which has been required already.`)\n continue\n }\n // We follow a plugin naming convention, but let's rather enforce it <3\n name = name.startsWith('puppeteer-extra-plugin') ? name : `puppeteer-extra-plugin-${name}`\n // In case a module sub resource is requested print out the main package name\n // e.g. puppeteer-extra-plugin-stealth/evasions/console.debug => puppeteer-extra-plugin-stealth\n const packageName = name.split('/')[0]\n let dep = null\n try {\n // Try to require and instantiate the stated dependency\n dep = require(name)()\n // Register it with `puppeteer-extra` as plugin\n this.use(dep)\n } catch (err) {\n console.warn(`\n A plugin listed '${name}' as dependency,\n which is currently missing. Please install it:\n\n yarn add ${packageName}\n\n Note: You don't need to require the plugin yourself,\n unless you want to modify it's default settings.\n `)\n throw err\n }\n // Handle nested dependencies :D\n if (dep.dependencies.size) {\n this.resolvePluginDependencies()\n }\n }\n }", "title": "" }, { "docid": "e160dde5722c3d9f0c7d6d3c26a57b3d", "score": "0.5526589", "text": "async function reconcilePluginDeps({ dryRun, upgradeRemote }) {\n try {\n let startTime = new Date();\n\n // Locate any external plugins and install them.\n const results = await reconcileRemotePlugins({\n dryRun,\n upgradeRemote,\n });\n\n let status;\n if (dryRun) {\n status = '[dry-run] success'.green;\n } else {\n status = 'success'.green;\n }\n\n let message;\n if (results.upgradable.length === 0 && results.fetchable.length === 0) {\n message = 'Already up-to-date.';\n } else if (results.upgradable.length === 0) {\n message = `Fetched ${results.fetchable.length} new plugins.`;\n } else if (results.fetchable.length === 0) {\n message = `Upgraded ${results.upgradable.length} new plugins.`;\n } else {\n message = `Fetched ${results.fetchable.length} new plugins, upgraded ${\n results.upgradable.length\n } plugins.`;\n }\n\n console.log(`\\n${status} ${message}`);\n\n let endTime = new Date();\n\n let totalTime = ((endTime.getTime() - startTime.getTime()) / 1000).toFixed(\n 2\n );\n console.log(`✨ Done in ${totalTime}s.`);\n } catch (err) {\n console.error(err);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "5c214360c418b263e638e7d215290ccf", "score": "0.5513792", "text": "function checkVersions(_) {\n\tconsole.log(\"CHECK \" + localHost.status + \" \" + hosts.mainVersion);\n\tif (localHost.status !== STATUS_INIT) return;\n\tvar commonVersion;\n\tif (hosts.mainVersion) {\n\t\tif (hosts.mainVersion === localHost.version) {\n\t\t\tcommonVersion = hosts.mainVersion;\n\t\t}\n\t} else { // no main version yet: test for common version\n\t\tcommonVersion = localHost.version;\n\t\thosts.forEach(function(host) {\n\t\t\t// only active hosts\n\t\t\tif (host.status > 0 && !host.local) {\n\t\t\t\tif (commonVersion && commonVersion !== host.version) {\n\t\t\t\t\tcommonVersion = null;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (commonVersion) {\n\t\t\thosts.mainVersion = commonVersion;\n\t\t}\n\t}\n\tif (commonVersion) {\n\t\tstartChildProcesses(true, _);\n\t} else {\n\t\tlocalHost.status = STATUS_WRONG_VERSION;\n\t}\n}", "title": "" }, { "docid": "563c4319e173ef0cc126b0354004c7e9", "score": "0.5467307", "text": "function checkVenomVersion(spinnies) {\n latest_version_1.default('whatsapp_elmenoufi').then(function (latest) {\n if (!semver_1.upToDate(version, latest)) {\n logUpdateAvailable(version, latest);\n }\n spinnies.succeed('venom-version-spinner', { text: 'Checking for updates' });\n });\n}", "title": "" }, { "docid": "8b78b31459692e8d8bd96b35aa8871d0", "score": "0.5464581", "text": "function detectPlugin(){\n\tvar agt = navigator.userAgent.toLowerCase();\n\tvar ie = (agt.indexOf(\"msie\") != -1);\n\tvar mo = (navigator.appName.indexOf(\"Mozilla\") != -1);\n\tvar ns = (navigator.appName.indexOf(\"Netscape\") != -1);\n\tvar win = ((agt.indexOf(\"win\")!=-1) || (agt.indexOf(\"32bit\")!=-1));\n\tvar mac = (agt.indexOf(\"mac\")!=-1);\n\tvar mimetest = false;\n\tif (ie && win) {\tpluginlist = detectIE(\"Adobe.SVGCtl\",\"SVG Viewer\") + detectIE(\"SWCtl.SWCtl.1\",\"Shockwave Director\") + detectIE(\"ShockwaveFlash.ShockwaveFlash.1\",\"Shockwave Flash\") + detectIE(\"rmocx.RealPlayer G2 Control.1\",\"RealPlayer\") + detectIE(\"QuickTimeCheckObject.QuickTimeCheck.1\",\"QuickTime\") + detectIE(\"MediaPlayer.MediaPlayer.1\",\"Windows Media Player\") + detectIE(\"PDF.PdfCtrl.5\",\"Acrobat Reader\"); }\n\tif (ns || mo || !win) {\n\t\tnse = \"\"; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();\n\t\tpluginlist = detectNS(\"image/svg+xml\",\"SVG Viewer\") + detectNS(\"application/x-director\",\"Shockwave Director\") + detectNS(\"application/x-shockwave-flash\",\"Shockwave Flash\") + detectNS(\"audio/x-pn-realaudio-plugin\",\"RealPlayer\") + detectNS(\"video/quicktime\",\"QuickTime\") + detectNS(\"application/x-mplayer2\",\"Windows Media Player\") + detectNS(\"application/pdf\",\"Acrobat Reader\");\n\t}\n\tfunction detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\\n on error resume next \\n result = IsObject(CreateObject(\"' + ClassID + '\"))</SCRIPT>\\n'); if (result) return name+','; else return ''; }\n\tfunction detectNS(ClassID,name) { n = \"\"; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+\",\"; return n; }\n\tpluginlist += navigator.javaEnabled() ? \"Java,\" : \"\";\n\tif (pluginlist.length > 0) {pluginlist = pluginlist.substring(0,pluginlist.length-1);}\n\t/* check for browsers with native rendering native browser tests*/\n\tif (navigator.mimeTypes != null&& navigator.mimeTypes.length > 0){if (navigator.mimeTypes[\"image/svg+xml\"] != null){mimetest = true;}}\n\t//detect \"SVG Viewer\"\n\tif (pluginlist.indexOf(\"SVG Viewer\")==-1 && !mimetest) {noPlugin('svgRegion');}\n} // End detectPlugin()", "title": "" }, { "docid": "58d4c037f6152ad89f25ddd0ec40a898", "score": "0.5463015", "text": "async _loadUserPlugins() {\n for (let pluginName of Object.getOwnPropertyNames(HHM.config.plugins || {})) {\n await this.addPluginByName(pluginName);\n\n if (!this.room.hasPlugin(pluginName)) {\n HHM.log.error(`Unable to load user plugin: ${pluginName}`);\n HHM.log.error(`HHM start aborted, please check your config`);\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "f3adfab21374dd5515daf4f992a33227", "score": "0.53841853", "text": "function HasVMRCPlugin() {\n Plugin.checkIE();\n\n if (Plugin.isIE) {\n return Plugin.detect(Plugin.activeXObjects.vmrc);\n } else {\n return Plugin.detect(\"VMware Remote Console\");\n }\n}", "title": "" }, { "docid": "a951d6c6009f3730dae1879b076e343b", "score": "0.5315049", "text": "function OnInstalled() {\n if (WeBuilder.BuildNumber < 194) {\n return \"Newer editor version is required for this plugin to work\";\n }\n Alert(\"Gulp Taskrunner 1.01 by Peter Klein installed sucessfully!\");\n}", "title": "" }, { "docid": "9ca32719a64ac73c7195a1faa691bbf4", "score": "0.5313729", "text": "function availableVersions() {\n return initNPM()\n .then(function () {\n return Q.nfcall(npm.commands.view, [\"hbook\", \"versions\", \"dist-tags\"], true);\n })\n .then(function (result) {\n //console.log(result);\n\n result = _.chain(result).values().first().value();\n result = {\n versions: _.chain(result.versions)\n .filter(function (v) {\n return tags.isValid(v);\n })\n .sort(tags.sort)\n .value(),\n tags: _.chain(result['dist-tags'])\n .omit(function (tagVersion, tagName) {\n return !tags.isValid(tagVersion);\n })\n .value()\n };\n\n if (result.versions.length == 0) throw new Error(\"No valid version on the NPM registry\");\n return result;\n });\n}", "title": "" }, { "docid": "87db91888ecd51f7016cf9c450a7294a", "score": "0.53107566", "text": "function checkVersion() {\r\n var lastUpdateCheck = GM_getValue('lastUpdateCheck','NEVER');\r\n var curTime = new Date().getTime();\r\n if ((lastUpdateCheck == 'NEVER') || (parseInt(lastUpdateCheck) < (curTime - 345600000))) { // every 4 days\r\n GM_setValue('lastUpdateCheck',''+curTime);\r\n GM_get('http://userscripts.org/scripts/source/85176.meta.js',\r\n function(responseText) {\r\n var v = responseText.match(/@version\\s*([0-9.]+)/);\r\n if (v) {\r\n //GM_log('found version: '+v[1]);\r\n GM_setValue('newversion',v[1]); \r\n }\r\n });\r\n }\r\n}", "title": "" }, { "docid": "465034e55c75b8f4a88927b25e4bd716", "score": "0.52749324", "text": "function check()\r\n {\r\n delete localStorage[\"ytd-update-version\"];\r\n delete localStorage[\"ytd-last-update\"];\r\n window.addEventListener(\"message\", function(event) {\r\n var remoteVersion = /^\\/\\/ @version\\s+(.+)$/m.exec(event.data)[1];\r\n if (remoteVersion)\r\n {\r\n localStorage[\"ytd-last-update\"] = Date.now();\r\n localStorage[\"ytd-update-version\"] = remoteVersion;\r\n if (remoteVersion != version)\r\n Interface.notifyUpdate();\r\n }\r\n }, false);\r\n var iframe = document.createElement(\"iframe\");\r\n iframe.setAttribute(\"src\", \"https://userscripts.org/scripts/source/62634.meta.js\");\r\n iframe.setAttribute(\"style\", \"position: absolute; left: -1px; top: -1px; width: 1px; height: 1px; opacity: 0;\");\r\n document.body.appendChild(iframe);\r\n }", "title": "" }, { "docid": "7b15e08f867d28a1861cd90f2cb19111", "score": "0.52726877", "text": "function register_plugins() {\n // retrieve list\n var plugins = dm4c.restc.get_plugins()\n if (dm4c.LOG_PLUGIN_LOADING) dm4c.log(\"Plugins installed at server-side: \" + plugins.length)\n // register\n for (var i = 0, plugin; plugin = plugins[i]; i++) {\n if (plugin.has_client_component) {\n if (dm4c.LOG_PLUGIN_LOADING) dm4c.log(\"..... plugin \\\"\" + plugin.plugin_uri +\n \"\\\" -- has client component\")\n register_plugin(\"/\" + plugin.plugin_uri + \"/script/plugin.js\")\n } else {\n if (dm4c.LOG_PLUGIN_LOADING) dm4c.log(\"..... plugin \\\"\" + plugin.plugin_uri + \"\\\"\")\n }\n }\n }", "title": "" }, { "docid": "d854e9a70c1994e003e55b88af5c74d0", "score": "0.5234511", "text": "handlePluginInstallation(plugin) {\n Installer.installPlugin(plugin).then((response) => {\n console.log(response);\n }, (err) => {\n console.log(err);\n })\n }", "title": "" }, { "docid": "014a017b968744409c58c8832001f099", "score": "0.52219623", "text": "function checkVersion(packag, force) {\n\tvar installedVersion = getPackVersion(packag.name);\n\n\tif (installedVersion > packag.version && !force) {\n\t\tlog(\"Installed version is newer \" + installedVersion);\n\t\treturn 0;\n\t} else {\n\t\tif (installedVersion == packag.version && !force) {\n\t\t\tlog(packag.name + \", version \" + installedVersion + \", already installed in '\" + findLocalDBTargetByName(packag.name) + \"'.\");\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6fb5bc584f61fe10fb7c90adf491cce1", "score": "0.521986", "text": "validateAgentHeaders () {\n\t\t// we don't expect any version headers concerning the agent\n\t}", "title": "" }, { "docid": "545c8aacf4b973d6e2f0ec79602117b1", "score": "0.51876897", "text": "_enablePluginAndDependencies(pluginId) {\n let dependenciesEnabled = false;\n for (let dependency of\n this.getPluginById(pluginId).getPluginSpec().dependencies || []) {\n dependenciesEnabled = dependenciesEnabled\n || this._enablePluginAndDependencies(this.getPluginId(dependency));\n }\n\n const pluginIndex = this.room._pluginsDisabled.indexOf(pluginId);\n if (pluginIndex !== -1) {\n this.room._pluginsDisabled.splice(pluginIndex, 1);\n return true;\n }\n\n return dependenciesEnabled;\n }", "title": "" }, { "docid": "bc2ef1c37ea202527ba9831a620d19f7", "score": "0.5184113", "text": "async checkESVersion() {\n try {\n const info = await this.client.nodes.info();\n if (!info._nodes || !info.nodes) {\n throw new Error('no nodes info');\n }\n\n for (const [nodeName, nodeInfo] of Object.entries(info.nodes)) {\n this.esVersion = nodeInfo.version;\n\n const filteredInfo = {\n name: nodeInfo.name,\n version: nodeInfo.version,\n plugins: nodeInfo.plugins.map((pluginInfo) => {\n return {\n name: pluginInfo.name,\n version: pluginInfo.version,\n };\n }),\n };\n\n this.esNodeInfos[nodeName] = filteredInfo;\n }\n }\n catch (error) {\n logger.error('Couldn\\'t check ES version:', error);\n }\n }", "title": "" }, { "docid": "0650ce634c980795619ed1bc9355da13", "score": "0.5176966", "text": "function loadInstallers() {\n var steps = [];\n steps.push.apply(steps, VagrantInstaller.steps);\n steps.push.apply(steps, VirtualboxInstaller.steps);\n return steps;\n}", "title": "" }, { "docid": "05dc8b4044f35efe27d7c63d5ebe92ac", "score": "0.5176692", "text": "function availableVersions() {\n return initNPM()\n .then(function() {\n return Q.nfcall(npm.commands.view, [\"gitbook@*\", \"version\", \"dist-tags\"], true);\n })\n .then(function(versions) {\n versions = _.filter(versions, function(v) {\n return checkVersion(v.version);\n });\n if (versions.length == 0) throw \"No valid version on the NPM registry\";\n\n return {\n versions: _.chain(versions)\n .pluck(\"version\")\n .sort(sortVersion)\n .value(),\n tags: _.chain(versions)\n .pluck(\"dist-tags\")\n .first()\n .omit(function(tagVersion, tagName) {\n return !checkVersion(tagVersion);\n })\n .value()\n };\n });\n}", "title": "" }, { "docid": "57e8c8fc1f96bba025c7a188476190a4", "score": "0.5173983", "text": "function checkInstall(checkSclang, checkScsynth) {\n if (checkSclang === void 0) { checkSclang = true; }\n if (checkScsynth === void 0) { checkScsynth = true; }\n console.log(\"Checking supercollider.js install...\");\n server_1.resolveOptions()\n .then(function (options) {\n console.log(\"Default options:\");\n console.log(JSON.stringify(options, null, 2));\n function check(binName) {\n return new Promise(function (resolve, reject) {\n var binPath = options[binName];\n fs_1.default.stat(binPath, function (err) {\n err ? reject(err) : resolve(binPath);\n });\n });\n }\n var checks = [];\n if (checkSclang) {\n checks.push(check(\"sclang\"));\n }\n if (checkScsynth) {\n checks.push(check(\"scsynth\"));\n }\n // TODO Promise.all short-circuits on failure\n return Promise.all(checks).then(function (paths) {\n console.log(\"Paths OK: \" + paths.join(\", \"));\n }, function (error) {\n console.error(\"\\nExecutable not found: \" + error.path);\n console.error(error);\n console.log(\"\\nInstall SuperCollider if needed: http://supercollider.github.io/download\\n\" +\n \"If you already have it installed but it is in a non-standard location then edit\\n\" +\n (options.sclang_conf + \"\\n\") +\n \"and specify the paths to sclang and scsynth there.\\n\" +\n \"Then run this test again:\\n\" +\n \"npm run check-install\\n\");\n });\n })\n .catch(console.error);\n}", "title": "" }, { "docid": "87bda07240141943ae4c247984093fd2", "score": "0.51307756", "text": "function checkUpdate () {\n let proxy = process.env.PROXY || process.env.http_proxy || null\n request({ url: 'https://registry.npmjs.org/appversion/latest', proxy: proxy }, (err, res, body) => {\n if (err && err.code === 'ENOTFOUND') return\n if (err) console.log(err)\n try {\n let latest = JSON.parse(body).version\n if (semver.gt(latest, apvVersion)) console.log(chalk.yellow(`\\n${chalk.bold('AppVersion:')} New apv version available, run ${chalk.bold('\\'npm install appversion -g\\'')} to update!\\n`))\n } catch (e) {\n console.log(e)\n }\n })\n}", "title": "" }, { "docid": "d1320d6fdb31ae9e5920576dcc3a442f", "score": "0.5091697", "text": "_isRequired(pluginName) {\n // No dependencies, not required\n if (!this.dependencies.hasOwnProperty(pluginName)) {\n return false;\n }\n\n for (let dependingPlugin of this.dependencies[pluginName]) {\n if (this.room._pluginsDisabled.indexOf(dependingPlugin) === -1) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "37964020263c07ce188a390f76f01444", "score": "0.5068599", "text": "function testUpgrades()\n{\n\tfor (var i = 0; i < upgrades.length; i++)\n\t{\n\t\tupgrades[i].enableTest();\n\t}\n}", "title": "" }, { "docid": "ea053c7276db0540b7f6c417a57d5c21", "score": "0.50637525", "text": "function DoUpgrades() {\n var lastVersion = parseFloat(options.lastversion);\n var listPromise = [];\n var resultPromise = null;\n\n // update the last version to now\n if (options.lastversion != manifest.version) {\n options.lastversion = manifest.version;\n listPromise.push(store.setItem('options', options));\n }\n\n listPromise.push(store.getItem('feeds').then(function(data){\n if (data != null) {\n feeds = data;\n }\n }));\n listPromise.push(store.getItem('unreadinfo').then(function(data){\n if (data != null) {\n unreadInfo = data;\n }\n }));\n listPromise.push(store.getItem('readlater').then(function(data){\n if (data != null) {\n readlater = data;\n }\n }));\n resultPromise = Promise.allSettled(listPromise);\n return resultPromise;\n}", "title": "" }, { "docid": "9f411c861f415f640e6db5d0307ff0d9", "score": "0.50421405", "text": "function getUpgradeToSecureSupport () {\n let canUpgrade = false\n if (getBrowserName() !== 'moz') return canUpgrade\n\n if (browserInfo && browserInfo.version >= 59) {\n canUpgrade = true\n }\n\n return canUpgrade\n}", "title": "" }, { "docid": "0194f37340c17ec17f20c4daef74c63a", "score": "0.50367016", "text": "async _checkPluginAndLoadDependencies(pluginId, onLoadStack) {\n if (!this.pluginLoader._checkPluginLoaded(pluginId)\n || !this._checkPluginsCompatible()) {\n this._removePlugin(pluginId);\n onLoadStack.push(false);\n return onLoadStack;\n }\n\n onLoadStack.push(this.getPluginById(pluginId).onLoad || true);\n\n const pluginRoom = this.getPluginById(pluginId);\n\n const pluginSpec = pluginRoom.getPluginSpec();\n\n if (!pluginSpec.hasOwnProperty(`dependencies`)) {\n // TODO the plugin might yet be unloaded, still execute onload?\n // TODO build onLoad stack which is passed down and up again?\n return onLoadStack;\n }\n\n let dependencySuccess = true;\n let dependenciesAlreadyLoaded = [];\n for (let dependency of pluginSpec.dependencies) {\n this._addDependent(pluginId, dependency);\n\n if (this.room.hasPlugin(dependency)) {\n dependenciesAlreadyLoaded.push(dependency);\n continue;\n }\n\n onLoadStack = await this._addPlugin(dependency, undefined, onLoadStack);\n\n dependencySuccess = onLoadStack.indexOf(false) === -1\n && this._checkPluginsCompatible();\n\n if (!dependencySuccess) {\n break;\n }\n }\n\n // Remove plugin and its dependencies\n if (!dependencySuccess) {\n for (let dependency of pluginSpec.dependencies) {\n if (dependenciesAlreadyLoaded.indexOf(dependency) === -1) {\n this._removePlugin(this.getPluginId(dependency));\n }\n }\n\n this._removePlugin(pluginId);\n\n onLoadStack.push(false);\n }\n\n return onLoadStack;\n }", "title": "" }, { "docid": "06c249cff86146f4659d4a8515a5393a", "score": "0.50304776", "text": "_useDefaultCacheabilityPluginIfNeeded() {\n let e = null, t = 0;\n for (const [n, a] of this.plugins.entries())\n a !== p.copyRedirectedCacheableResponsesPlugin && (a === p.defaultPrecacheCacheabilityPlugin && (e = n), a.cacheWillUpdate && t++);\n t === 0 ? this.plugins.push(p.defaultPrecacheCacheabilityPlugin) : t > 1 && e !== null && this.plugins.splice(e, 1);\n }", "title": "" }, { "docid": "431864980043922b137dcd8dadaa443e", "score": "0.5016285", "text": "function checkNPMUpdates() {\n const path = process.argv[3] || 'package.json';\n\n ncu.run({\n // Always specify the path to the package file \n packageFile: path,\n // Any command-line option can be specified here. \n // These are set by default: \n silent: true,\n jsonUpgraded: true\n }).then((upgraded) => {\n log(warn('Dependencies to upgrade:'), upgraded);\n });\n}", "title": "" }, { "docid": "bd73fc188af811e91526946462567eee", "score": "0.50042564", "text": "function dependencyChecker() {\n try {\n let rawFile = fs.readFileSync('package.json');\n let parsedFile = JSON.parse(rawFile);\n let packages = Object.keys(parsedFile.dependencies)\n let missing = [];\n packages.forEach(package => {\n try {\n require.resolve(package);\n } catch (error) {\n missing.push(package);\n }\n });\n if(missing.length){\n console.log(`[txAdmin:PreCheck] Cannot start txAdmin due to missing dependencies.`);\n console.log(`[txAdmin:PreCheck] Make sure you executed 'npm i'.`);\n console.log(`[txAdmin:PreCheck] The following packages are missing: ` + missing.join(', '));\n if(!process.version.startsWith('v10.')){\n console.log(`[txAdmin:PreCheck] Note: txAdmin doesn't support NodeJS ${process.version}, please install NodeJS v10 LTS!`);\n }\n process.exit();\n }\n } catch (error) {\n console.log(`[txAdmin:PreCheck] Error reading or parsing package.json: ${error.message}`);\n process.exit();\n }\n}", "title": "" }, { "docid": "bc15d7be154016e483b80358198e1084", "score": "0.49998358", "text": "function oldIsPlugin (nodeModulePath) {\n // then check if the npm module is one plugin\n try {\n if (fs.statSync( path.resolve( nodeModulePath, 'plugin.js' ) )) {\n return true;\n } else {\n return false;\n }\n } catch (e) {\n return false;\n }\n }", "title": "" }, { "docid": "bc6c5fcf1bd08c2279d11e396e6e7eeb", "score": "0.49941945", "text": "function checkForUpdate() {\n executeRequest(\"https://brodaleegitlabplugin.herokuapp.com/?version=last\")\n .then(res => {\n if (res.last_version) {\n if (manifest.version < res.last_version) {\n navigator.getFromStore('lastupdatedate', function (res) {\n if (!res.lastupdatedate) {\n navigator.sendNotification(MESSAGES.notifications.update.title, MESSAGES.notifications.update.message)\n navigator.store({lastupdatedate: Date.now()})\n } else {\n let date = new Date(res.lastupdatedate)\n let now = new Date(Date.now())\n if ((now.getHours() - date.getHours()) > 1) {\n navigator.sendNotification(MESSAGES.notifications.update.title, MESSAGES.notifications.update.message)\n navigator.store({lastupdatedate: Date.now()})\n }\n }\n })\n }\n }\n })\n}", "title": "" }, { "docid": "5a928a6fcbfbfcfd12fc8d0720ceecbd", "score": "0.49915737", "text": "function isRolesPreVersion(){\r\n if(roles.version === undefined){\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "38b290be047db7878c13d7975663f17e", "score": "0.49531588", "text": "function load_plugins() {\n if (dm4c.LOG_PLUGIN_LOADING) dm4c.log(\"Loading \" + plugin_sources.length + \" plugins:\")\n for (var i = 0, plugin_source; plugin_source = plugin_sources[i]; i++) {\n if (dm4c.LOG_PLUGIN_LOADING) dm4c.log(\"..... \" + plugin_source)\n dm4c.load_script(plugin_source, function() {}) // load plugin asynchronously\n }\n }", "title": "" }, { "docid": "95e2a3ef65338402e1da96265887c76d", "score": "0.4928076", "text": "function reconcilePackages({ quiet = false, upgradeRemote = false }) {\n const fetchable = [];\n const local = [];\n const upgradable = [];\n\n if (!quiet) {\n console.log();\n console.log(' +local (l) packages in your project');\n console.log(' +external (e) packages are external');\n console.log(' +outofdate (oe) packages are external but are out of date');\n console.log(' +missing (m) packages are not found');\n console.log();\n }\n\n for (let i in plugins) {\n let section = iteratePlugins(plugins[i]);\n\n for (let j in section) {\n let { name, version } = section[j];\n\n let namespaced = name.charAt(0) === '@';\n let dep = name\n .split('/')\n .slice(0, namespaced ? 2 : 1)\n .join('/');\n\n // Ignore relative modules, which aren't installed by NPM\n if (!dep.match(EXTERNAL) && !namespaced) {\n return;\n }\n\n if (isInternal(dep)) {\n if (!quiet) {\n console.log(` l ${name}`);\n }\n\n local.push({ name, version });\n continue;\n }\n\n if (!existsInNodeModules(dep)) {\n if (!quiet) {\n console.log(` m ${name}`);\n }\n fetchable.push({ name, version });\n } else if (!versionMatch(dep, version)) {\n // A plugin was found, yet the current version does not match the\n // current version installed. We should warn if upgradeRemote is\n // not enabled that it is currently not supported.\n if (!upgradeRemote) {\n if (!quiet) {\n console.warn(` oe ${name} (package upgrade may be required)`.bgRed);\n }\n\n continue;\n }\n\n console.log(` oe ${name} (package upgrade may be required)`);\n\n upgradable.push({ name, version });\n } else {\n if (!quiet) {\n console.log(` e ${name}`);\n }\n\n if (upgradeRemote) {\n upgradable.push({ name, version });\n }\n }\n }\n }\n\n if (!quiet) {\n console.log();\n }\n\n return { local, fetchable, upgradable };\n}", "title": "" }, { "docid": "a688b38653b383e0c76556b713637522", "score": "0.49190894", "text": "function isPluginLoaded(pluginName) {\n\t\treturn client.execute(function(name) {\n\t\t\treturn Plugins[name].isLoading();\n\t\t}, pluginName).then(function(isLoading) {\n\t\t\treturn isLoading;\n\t\t});\n\t}", "title": "" }, { "docid": "2dc77c766f6b268f318b1b201b7b3259", "score": "0.49155417", "text": "function main() { \n\t\tif (plugin) {\n\t\t\ttestPlayerVersion();\n\t\t}\n\t\telse {\n\t\t\tmatchVersions();\n\t\t}\n\t}", "title": "" }, { "docid": "099659e6e51defcbd274ad6d319628c4", "score": "0.49032715", "text": "function checkOnlineVersion() {\n rest(properties)\n .then((response) => {\n try {\n runUpdateIfNecessary(JSON.parse(response.entity));\n } catch(e) {\n sendError(response.entity);\n }\n })\n .catch((err) => {\n sendError(err);\n });\n}", "title": "" }, { "docid": "5beca8923c368d6dbf7187d0a01d52db", "score": "0.48931193", "text": "function applicablePlugins(repoSel, repoPlugins) {\n if (repoSel == \"\") {\n var all = repoPlugins[\"\"];\n if (all) {\n return all.sort();\n }\n return [];\n }\n var parts = repoSel.split(\"/\")\n var plugins = [];\n var byOrg = repoPlugins[parts[0]];\n if (byOrg && byOrg != []) {\n plugins = plugins.concat(byOrg);\n }\n var byRepo = repoPlugins[repoSel];\n if (byRepo) {\n for (var i = 0; i < byRepo.length; i ++) {\n if (!plugins.includes(byRepo[i])) {\n plugins.push(byRepo[i]);\n }\n }\n }\n return plugins.sort()\n}", "title": "" }, { "docid": "79976b37f7628034e2ceee49c27b833a", "score": "0.48711827", "text": "shouldConvertPackages(targetVer, previousVer) {\n let targetVerNumbers = targetVer.id.split('.')\n let targetVersion = Number(targetVerNumbers[0] + '.' + targetVerNumbers[1])\n let prevVerNumbers = previousVer.split('-')[1].split('.')\n let previousVersion = Number(prevVerNumbers[0] + '.' + prevVerNumbers[1])\n return (previousVersion >= 2.16 || targetVersion >= 2.16)\n }", "title": "" }, { "docid": "6a431b9d642b7fab6ce8e464054502a2", "score": "0.48650882", "text": "function updateScriptRX6Page() {\r\n try {\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: metadata + '?' + Math.random(),\r\n onload: function(resp) {\r\n if (resp.status != 200) return;\r\n if (!resp.responseText.match(/@version\\s+(\\d+).(\\d+).(\\d+)/)) return;\r\n var googleVersion = RegExp.$1+'.'+RegExp.$2+'.'+RegExp.$3;\r\n var runningVersion = script_version;\r\n if (googleVersion != runningVersion) {\r\n if (window.confirm('Version ' + googleVersion + ' is available!\\n\\n' + 'Do you want to install this version?' + '\\n')) {\r\n window.location.href = update_url;\r\n }\r\n } else {\r\n alert('You already have the latest version: '+ googleVersion);\r\n return;\r\n }\r\n }\r\n });\r\n } catch (ex) {\r\n DEBUG('BUG DETECTED (updateScript): ' + ex);\r\n }\r\n}", "title": "" }, { "docid": "aae114b488cfe3967c1142369b971875", "score": "0.48637", "text": "function installTools(missing, goVersion) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!missing) {\n return;\n }\n gopStatus_1.outputChannel.show();\n gopStatus_1.outputChannel.clear();\n const envForTools = goEnv_1.toolInstallationEnvironment();\n const toolsGopath = envForTools['GOPATH'];\n let envMsg = `Tools environment: GOPATH=${toolsGopath}`;\n if (envForTools['GOBIN']) {\n envMsg += `, GOBIN=${envForTools['GOBIN']}`;\n }\n gopStatus_1.outputChannel.appendLine(envMsg);\n let installingMsg = `Installing ${missing.length} ${missing.length > 1 ? 'tools' : 'tool'} at `;\n if (envForTools['GOBIN']) {\n installingMsg += `the configured GOBIN: ${envForTools['GOBIN']}`;\n }\n else {\n installingMsg += `${toolsGopath}${path.sep}bin`;\n }\n // If the user is on Go >= 1.11, tools should be installed with modules enabled.\n // This ensures that users get the latest tagged version, rather than master,\n // which may be unstable.\n let modulesOff = true;\n // if (goVersion.lt('1.11')) {\n // \tmodulesOff = true;\n // } else {\n // \tinstallingMsg += ' in module mode.';\n // }\n gopStatus_1.outputChannel.appendLine(installingMsg);\n missing.forEach((missingTool) => {\n let toolName = missingTool.name;\n if (missingTool.version) {\n toolName += '@' + missingTool.version;\n }\n gopStatus_1.outputChannel.appendLine(' ' + toolName);\n });\n gopStatus_1.outputChannel.appendLine(''); // Blank line for spacing.\n const toInstall = [];\n for (const tool of missing) {\n // Disable modules for tools which are installed with the \"...\" wildcard.\n const modulesOffForTool = modulesOff || goTools_1.disableModulesForWildcard(tool, goVersion);\n const reason = installTool(tool, goVersion, envForTools, !modulesOffForTool);\n toInstall.push(Promise.resolve({ tool, reason: yield reason }));\n }\n const results = yield Promise.all(toInstall);\n const failures = [];\n for (const result of results) {\n if (result.reason != \"\") {\n failures.push(result);\n }\n }\n // Report detailed information about any failures.\n gopStatus_1.outputChannel.appendLine(''); // blank line for spacing\n if (failures.length === 0) {\n gopStatus_1.outputChannel.appendLine('All tools successfully installed. You are ready to Go :).');\n }\n else {\n gopStatus_1.outputChannel.appendLine(failures.length + ' tools failed to install.\\n');\n for (const failure of failures) {\n gopStatus_1.outputChannel.appendLine(`${failure.tool.name}: ${failure.reason} `);\n }\n }\n });\n}", "title": "" }, { "docid": "e52d8a72ee812bbbf9fe0f767ca8e90b", "score": "0.4848326", "text": "function _checkPackageManagerVersion() {\n _checkPackageManagerVersion = _asyncToGenerator(function* (ora) {\n return _core.utils.yarnOrNpmSpawn(['--version']).then(version => {\n const versionString = version.toString();\n\n if (_core.utils.hasYarn()) {\n warnIfPackageManagerIsntAKnownGoodVersion('Yarn', versionString, YARN_WHITELISTED_VERSIONS, ora);\n } else {\n warnIfPackageManagerIsntAKnownGoodVersion('NPM', versionString, NPM_WHITELISTED_VERSIONS, ora);\n }\n\n return true;\n });\n });\n return _checkPackageManagerVersion.apply(this, arguments);\n}", "title": "" }, { "docid": "ff85f20de0fbcdd34d77a2e39a87343e", "score": "0.48452342", "text": "checkNpmHandlers() {\n lodash.forEach(this.npmHandlers, (npmHandler) => npmHandler.check());\n }", "title": "" }, { "docid": "d2a9ccea52eaaf65bc9db2e202ea8b7a", "score": "0.4839136", "text": "function nodeVersieControle() {\n try {\n const nodeversie = Number(process.versions.node.split('.')[0]);\n if (nodeversie < 13) {\n throw new Error(`node versie te laag. is: ${nodeversie}`);\n }\n }\n catch (error) {\n console.error(error);\n process.exit();\n }\n }", "title": "" }, { "docid": "10463ff03d182fe5954849dae2e87fcf", "score": "0.48320934", "text": "function checkIfMovesIsInstalled(){\n\n\t\trestClient.get(SERVER_URL+MOVES_CONNECTED_CHECK_URL, function(data, textStatus, response) {\n\t\t\tif(data.success===false){\n\t\t\t\tif(MOVES_INSTSTALLED){\n\t\t\t\t\t//moves is installed but not connected yet.\n\t\t\t\t\t//show connect-to-moves-message on homepage\n\t\t\t\t\t$('#movesNotConnected').show();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//moves not installed yet\n\t\t\t\t\t//have to be installed before connecting\n\t\t\t\t\t//show install-moves-message on homepage\n\t\t\t\t\t$('#movesNotInstalled').show();\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//user is connected to moves\n\t\t\t\t//ensure connect-to-moves-message on homepage is hidden\n\t\t\t\t$('#movesNotConnected').hide();\n\t\t\t}\n\n\t\t},function(request, textStatus, error) {});\n\t}", "title": "" }, { "docid": "14d55fd5612d6a3c2b78790dccb6c298", "score": "0.4819941", "text": "function browserSucks()\r\n{\r\n\t// IE <= 8\r\n\tif($.browser.msie && parseInt($.browser.version) <= 8)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// Opera <= 11\r\n\tif($.browser.opera && ($.browser.version *10) <= 110)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\r\n\t// Firefox <= 4\r\n\tif($.browser.mozilla && parseInt($.browser.version) <= 1)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// WebKit <= 530\r\n\tif($.browser.webkit && ($.browser.version *10) <= 5300)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "title": "" }, { "docid": "b7dedcbb6532d57cc388c183c8aeb516", "score": "0.4819471", "text": "function hasPlayerVersion(rv) {\n\t\tvar pv = ua.pv, v = rv.split(\".\");\n\t\tv[0] = parseInt(v[0], 10);\n\t\tv[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n\t\tv[2] = parseInt(v[2], 10) || 0;\n\t\treturn (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;\n\t}", "title": "" }, { "docid": "b7dedcbb6532d57cc388c183c8aeb516", "score": "0.4819471", "text": "function hasPlayerVersion(rv) {\n\t\tvar pv = ua.pv, v = rv.split(\".\");\n\t\tv[0] = parseInt(v[0], 10);\n\t\tv[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n\t\tv[2] = parseInt(v[2], 10) || 0;\n\t\treturn (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;\n\t}", "title": "" }, { "docid": "b7dedcbb6532d57cc388c183c8aeb516", "score": "0.4819471", "text": "function hasPlayerVersion(rv) {\n\t\tvar pv = ua.pv, v = rv.split(\".\");\n\t\tv[0] = parseInt(v[0], 10);\n\t\tv[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n\t\tv[2] = parseInt(v[2], 10) || 0;\n\t\treturn (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;\n\t}", "title": "" }, { "docid": "b7dedcbb6532d57cc388c183c8aeb516", "score": "0.4819471", "text": "function hasPlayerVersion(rv) {\n\t\tvar pv = ua.pv, v = rv.split(\".\");\n\t\tv[0] = parseInt(v[0], 10);\n\t\tv[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n\t\tv[2] = parseInt(v[2], 10) || 0;\n\t\treturn (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;\n\t}", "title": "" }, { "docid": "c4b2ca3eb2c743655cb323ce85294c56", "score": "0.47951642", "text": "function checkCliDependency(ctx) {\n var result = spawnSync('cordova-hcp', [], { cwd: './plugins/' + ctx.opts.plugin.id });\n if (!result.error) {\n return;\n }\n\n suggestCliInstallation();\n}", "title": "" }, { "docid": "711f71d211f6719cae3cfc11b6a9d218", "score": "0.47929177", "text": "RaisePluginsLoaded() {\n for (const p of this.plugins) {\n p.OnLoaded();\n }\n }", "title": "" }, { "docid": "af6163dbf2905f916a3303dd11a2b548", "score": "0.4792041", "text": "function doUpdateCheck() {\r\n var version_scriptNum = 37350;\r\n var version_timestamp = 1280902767875;\r\n function updateCheck(forced) {if((forced)||(parseInt(GM_getValue(\"lastUpdate\", \"0\")) + 86400000 <= (new Date().getTime()))) {try {GM_xmlhttpRequest({method: \"GET\",url: \"http://userscripts.org/scripts/review/\" + version_scriptNum + \"?\" + new Date().getTime(),headers: {'Cache-Control': 'no-cache'},onload: function(xhrResponse) {GM_setValue(\"lastUpdate\", new Date().getTime() + \"\"); var rt = xhrResponse.responseText.replace(/&nbsp;?/gm, \" \").replace(/&#x000A;/g,\"\\n\").replace(/<li>/gm, \"\\n\").replace(/<[^>]*>/gm, \"\"); var scriptName = (/@name\\s*(.*?)\\s*$/m.exec(rt))[1]; GM_setValue(\"targetScriptName\", scriptName); if (parseInt(/version_timestamp\\s*=\\s*([0-9]+)/.exec(rt)[1]) > version_timestamp) {if (confirm(\"There is an update available for the Greasemonkey script \\\"\" + scriptName + \".\\\"\\nWould you like to go to the install page now?\")) {GM_openInTab(\"http://userscripts.org/scripts/show/\" + version_scriptNum);}} else if (forced) {alert(\"No update is available for \\\"\" + scriptName + \".\\\"\");}}});} catch (err) {if (forced) {alert(\"An error occurred while checking for updates:\\n\" + err);}}}} GM_registerMenuCommand(GM_getValue(\"targetScriptName\", \"???\") + \" - Manual Update Check\", function() {updateCheck(true);}); updateCheck(false);\r\n}", "title": "" }, { "docid": "41c5c6c739d0867c897f1a36dd628e9d", "score": "0.47920394", "text": "function isFirefox() {\n return typeof window.InstallTrigger !== \"undefined\";\n}", "title": "" }, { "docid": "c79f9895981e5694fc8bb9b40db59fa9", "score": "0.4785902", "text": "validateVersionInfo () {\n\t\t// we don't expect any version info\n\t}", "title": "" }, { "docid": "e8c99f4fc11985b8eeaf3921536cd899", "score": "0.47841182", "text": "function hasPlayerVersion(rv) {\n\t\t\tvar pv = ua.pv,\n\t\t\t\tv = rv.split(\".\");\n\t\t\tv[0] = parseInt(v[0], 10);\n\t\t\tv[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n\t\t\tv[2] = parseInt(v[2], 10) || 0;\n\t\t\treturn (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;\n\t\t}", "title": "" }, { "docid": "8f3c5c6efc10d709c8f6400a2ea06c9d", "score": "0.47755122", "text": "isConfigured() {\n let t =\n this.selectedOption == 'install'\n || this.selectedOption == 'detected' && this.hasOption('detected') && this.option['detected'].valid\n || this.selectedOption == 'detected' && !this.hasOption('detected') && Platform.OS === 'win32';\n return t;\n }", "title": "" }, { "docid": "924a3704c99a872716d3553e896a38b6", "score": "0.4769745", "text": "function isVendorSupported() {\n if (vendorSupport != null) {\n return Promise.resolve(vendorSupport);\n }\n return getGoVersion().then(version => {\n if (!version) {\n return process.env['GO15VENDOREXPERIMENT'] === '0' ? false : true;\n }\n switch (version.major) {\n case 0:\n vendorSupport = false;\n break;\n case 1:\n vendorSupport = (version.minor > 6 || ((version.minor === 5 || version.minor === 6) && process.env['GO15VENDOREXPERIMENT'] === '1')) ? true : false;\n break;\n default:\n vendorSupport = true;\n break;\n }\n return vendorSupport;\n });\n}", "title": "" }, { "docid": "73f406ee99d88272d5df1de1f3a783f3", "score": "0.4766495", "text": "function hasPlayerVersion(rv) {\n rv += \"\"; //Coerce number to string, if needed.\n var pv = ua.pv, v = rv.split(\".\");\n v[0] = toInt(v[0]);\n v[1] = toInt(v[1]) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n v[2] = toInt(v[2]) || 0;\n return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;\n }", "title": "" }, { "docid": "83c5756df49d15fc9149cdcf4839505d", "score": "0.47614142", "text": "function versionsCheck(versions) {\n /* Shell Commands\n OSX VERSION\n sw_vers | grep \"ProductVersion\" | awk '{print $2}'\n NODE\n node --version\n RUBY\n ruby --version | awk '{print $2}'\n XCODE\n xcodebuild -version | grep 'Xcode' | awk '{print $2}'\n YARN\n yarn --version\n NPM\n npm --version\n */\n\n function programSwitch(program) {\n switch (program) {\n case 'macOS':\n return shell\n .exec('sw_vers')\n .exec('grep ProductVersion')\n .stdout.replace('ProductVersion:\\t', '')\n .replace('\\n', '');\n case 'node':\n return shell.exec('node --version').stdout.replace('\\n', '');\n case 'ruby':\n return shell.exec('ruby --version').split(' ')[1];\n case 'xcode':\n return shell\n .exec('xcodebuild -version')\n .exec('grep Xcode')\n .stdout.replace('Xcode ', '')\n .replace('\\n', '');\n case 'yarn':\n return shell.exec('yarn --version').stdout.replace('\\n', '');\n case 'npm':\n return shell.exec('npm --version').stdout.replace('\\n', '');\n default:\n throw Error(`Version check command does not exist for program ${program}.`);\n }\n }\n\n const programs = Object.keys(versions);\n const out = [];\n\n programs.forEach(program => {\n const actual = programSwitch(program);\n if (actual !== versions[program]) {\n out.push(`${program} version mismatch. Expected: ${versions[program]} | Actual: ${actual}`);\n }\n });\n return out.length ? out : true;\n}", "title": "" }, { "docid": "a75cd1dce5fc698e47b54bd2de2a9598", "score": "0.47606528", "text": "function checkForUpdates(isForce, Fn) {\n\tvar day, temp = Cfg['scrUpdIntrv'];\n\tif(!isForce) {\n\t\tday = 2 * 1000 * 60 * 60 * 24;\n\t\tswitch(temp) {\n\t\tcase 0: temp = day; break;\n\t\tcase 1: temp = day * 2; break;\n\t\tcase 2: temp = day * 7; break;\n\t\tcase 3: temp = day * 14; break;\n\t\tdefault: temp = day * 30;\n\t\t}\n\t\tif(Date.now() - +comCfg['lastUpd'] < temp) {\n\t\t\treturn;\n\t\t}\n\t}\n\tGM_xmlhttpRequest({\n\t\t'method': 'GET',\n\t\t'url': 'https://raw.github.com/SthephanShinkufag/Dollchan-Extension-Tools/' +\n\t\t\t'master/Dollchan_Extension_Tools.meta.js',\n\t\t'headers': {'Content-Type': 'text/plain'},\n\t\t'onreadystatechange': function(xhr) {\n\t\t\tif(xhr.readyState !== 4) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(xhr.status === 200) {\n\t\t\t\tvar dVer = xhr.responseText.match(/@version\\s+([0-9.]+)/)[1].split('.'),\n\t\t\t\t\tcVer = version.split('.'),\n\t\t\t\t\tlen = cVer.length > dVer.length ? cVer.length : dVer.length,\n\t\t\t\t\ti = 0,\n\t\t\t\t\tisUpd = false;\n\t\t\t\tif(!dVer) {\n\t\t\t\t\tif(isForce) {\n\t\t\t\t\t\tFn('<div style=\"color: red; font-weigth: bold;\">' + Lng.noConnect[lang] + '</div>');\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsaveComCfg('lastUpd', Date.now());\n\t\t\t\twhile(i < len) {\n\t\t\t\t\tif((+dVer[i] || 0) > (+cVer[i] || 0)) {\n\t\t\t\t\t\tisUpd = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if((+dVer[i] || 0) < (+cVer[i] || 0)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(isUpd) {\n\t\t\t\t\tFn('<a style=\"color: blue; font-weight: bold;\" href=\"' +\n\t\t\t\t\t\t'https://raw.github.com/SthephanShinkufag/Dollchan-Extension-Tools/master/' +\n\t\t\t\t\t\t'Dollchan_Extension_Tools.user.js\">' + Lng.updAvail[lang] + '</a>');\n\t\t\t\t} else if(isForce) {\n\t\t\t\t\tFn(Lng.haveLatest[lang]);\n\t\t\t\t}\n\t\t\t} else if(isForce) {\n\t\t\t\tFn('<div style=\"color: red; font-weigth: bold;\">' + Lng.noConnect[lang] + '</div>');\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "30f2aa8b39ea6c74ce78740c14213849", "score": "0.47598436", "text": "function continousDetect() {\n if (isPluginInstalled()) {\n pluginSuccess();\n return;\n }\n\n // use faster checkInstall method for non-chrome\n setTimeout(function() {\n gcprinter.checkInstall(gcprinter.init, continousDetect);\n return;\n }, 2000);\n }", "title": "" }, { "docid": "a716db0d395fe69bdf2ef3a51557800f", "score": "0.47541925", "text": "loadPlugins(config) {\n const pluginsPaths = [\n require.resolve('./plugins/filter-non-pull-request'),\n ...(config.plugins || ['npm'])\n ];\n pluginsPaths\n .map(plugin => \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof plugin === 'string' ? [plugin, {}] : plugin)\n .map(plugin => load_plugins_1.default(plugin, this.logger))\n .filter((plugin) => Boolean(plugin))\n .forEach(plugin => {\n this.logger.verbose.info(`Using ${plugin.name} Plugin...`);\n plugin.apply(this);\n });\n }", "title": "" }, { "docid": "f48fb8cda842057d869b807446d176a3", "score": "0.47480974", "text": "isAvailableIn(version) {\n if (this.isRemovedIn(version)) {\n return false;\n }\n if (!this.introduced || this.introduced.isBeforeOrEqual(version)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "98af7870662504cfa6e8d62af287902a", "score": "0.47377223", "text": "function main() {\n\t\t\tif (plugin) {\n\t\t\t\ttestPlayerVersion();\n\t\t\t} else {\n\t\t\t\tmatchVersions();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a0f5ab5cd04647df3c245d80d0dd2e3e", "score": "0.47281942", "text": "function shouldAutoInstallUpdate() {\n return !didLaunchWindow && assistantConfig.autoDownloadUpdates && updater._isDownloadCached;\n}", "title": "" }, { "docid": "9f48f76e764a9c70ce5558c08838bab9", "score": "0.47278172", "text": "function hasPlayerVersion(rv) {\n rv += \"\"; //Coerce number to string, if needed.\n var pv = ua.pv,\n v = rv.split(\".\");\n v[0] = toInt(v[0]);\n v[1] = toInt(v[1]) || 0; // supports short notation, e.g. \"9\" instead of \"9.0.0\"\n v[2] = toInt(v[2]) || 0;\n return pv[0] > v[0] || pv[0] == v[0] && pv[1] > v[1] || pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2] ? true : false;\n }", "title": "" }, { "docid": "681e4a4c8af8cec4b9f0f3d7393e8a48", "score": "0.47265163", "text": "function autoUpdateFromUserscriptsDotOrg(SCRIPT) {\r\n try {\r\n if (!utils.getValue) return; // Older version of Greasemonkey. Can't run.\r\n \r\n // avoid a flood of dialogs e.g. when opening a browser with multiple tabs set to homepage\r\n // and a script with * includes or opening a tabgrop\r\n var DoS_PREVENTION_TIME = 2 * 60 * 1000;\r\n var isSomeoneChecking = utils.getValue('izh-CHECKING', null);\r\n var now = new Date().getTime();\r\n utils.setValue('izh-CHECKING', now.toString());\r\n \r\n if (!SCRIPT.forceUpdate && isSomeoneChecking && (now - isSomeoneChecking) < DoS_PREVENTION_TIME) return;\r\n \r\n // check daily\r\n var ONE_DAY = 24 * 60 * 60 * 1000;\r\n //var ONE_WEEK = 7 * ONE_DAY;\r\n //var TWO_WEEKS = 2 * ONE_WEEK;\r\n var lastChecked = utils.getValue('izh-LAST_CHECKED', null);\r\n if (!SCRIPT.forceUpdate && lastChecked && (now - lastChecked) < ONE_DAY) return;\r\n \r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: SCRIPT.url.replace('.user.','.meta.') + '?'+new Date().getTime(), // don't increase the 'installed' count just for update checks\r\n headers: {'Cache-Control': 'no-cache'},\r\n onload: function(result) {\r\n if (!result.responseText.match(/@version\\s+([\\d.]+)/)) return; // did not find a suitable version header\r\n \r\n var theOtherVersion = RegExp.$1;\r\n var verList1 = RegExp.$1.split('.');\r\n var verList2 = SCRIPT.version.split('.');\r\n var isOldVersion = false;\r\n for(var i=0;i<verList1.length;i++){\r\n if(i<verList2.length){\r\n var v1=parseInt(verList1[i])\r\n , v2=parseInt(verList2[i])\r\n if(v1!=v2){\r\n isOldVersion = v1>v2;\r\n break;\r\n }\r\n }else{\r\n break;\r\n }\r\n }\r\n if (!isOldVersion)\r\n {\r\n // no updates or older version on userscripts.orge site\r\n if(SCRIPT.forceUpdate)\r\n {\r\n alert(\"您当前所安装的 v\" + SCRIPT.version + \" 是最新版本,无需更新。\")\r\n }\r\n return;\r\n }\r\n //find the name of the script\r\n result.responseText.match(/@name\\s+(.+)/);\r\n var scriptName = RegExp.$1;\r\n result.responseText.match(/@updateinfo\\s+(.+)/);\r\n var updateInfo = RegExp.$1;\r\n updateInfo = updateInfo.replace(/\\|/g,'<br>');\r\n _ShowUpdate(scriptName,SCRIPT.version,theOtherVersion,updateInfo,SCRIPT.web,SCRIPT.url);\r\n }\r\n });\r\n utils.setValue('izh-LAST_CHECKED', now.toString());\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }", "title": "" }, { "docid": "5b2100cf26a277e09ff92ca6e797af06", "score": "0.47198907", "text": "function autoUpgrade() {\n let myPs = df.getAllOwnedPlanets().filter(p => p.owner === df.account)\n let upgradeablePs = myPs.filter(p => df.planetHelper.planetCanUpgrade(p))\n terminal._events.Print(`Upgrade bot checking ${myPs.length} planets...${upgradeablePs.length === 0 ? ' no luck\\n' : '\\n'}`)\n for (let p of upgradeablePs) {\n terminal._events.Print(`Upgrading L${p.planetLevel} ${p.locationId}\\n`, 'Green')\n const branch = p.upgradeState.lastIndexOf(Math.min(...p.upgradeState))\n df.upgrade(p.locationId, branch)\n }\n }", "title": "" }, { "docid": "e304a1ada16c24c99bc7a819f6884366", "score": "0.47127408", "text": "function installedPlugins(craftPluginFolder) {\n fs.ensureDirSync(craftPluginFolder);\n return fs.readdirSync(craftPluginFolder).filter(file => fs.lstatSync(path.join(craftPluginFolder, file)).isDirectory());\n}", "title": "" }, { "docid": "c919837e16f98e67172efc3e889a39c2", "score": "0.47109643", "text": "async function usesOldExpoUpdatesAsync(projectRoot) {\n const pkgPath = _path().default.join(projectRoot, 'package.json');\n\n const pkgExists = _fs().default.existsSync(pkgPath);\n\n if (!pkgExists) {\n return false;\n }\n\n const dependencies = await _jsonFile().default.getAsync(pkgPath, 'dependencies', {});\n\n if (!dependencies['expo-updates']) {\n return false;\n }\n\n const version = dependencies['expo-updates'];\n\n const coercedVersion = _semver().default.coerce(version);\n\n if (coercedVersion && _semver().default.satisfies(coercedVersion, '~0.1.0')) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "cadf11a800facd5fca32bfc4193c7ffe", "score": "0.47044194", "text": "wheel(e)\n {\n let result = false;\n\n for (const plugin of this.list)\n {\n if (plugin.wheel(e))\n {\n result = true;\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "122e692ef852fc396cb8b52e5aeea158", "score": "0.47019437", "text": "CheckDependencies() {\n return true;\n }", "title": "" }, { "docid": "65b6137ebdbc08c7ea1a5d1df57aec59", "score": "0.46965232", "text": "function checkForStartupErrors(){\n\t\t\n\t\t//protection agains old jquery version\n\t\ttry{\n\t\t\tugCheckForMinJQueryVersion();\n\t\t}catch(e){\n\t\t\tthrowErrorShowMessage(e.message);\n\t\t}\n\t\t\n\t\t//protection against some jquery ui function change\n\t if(typeof g_objWrapper.outerWidth() == \"object\")\n\t \t throwErrorShowMessage(\"You have some buggy script. most chances jquery-ui.js that destroy jquery outerWidth, outerHeight functions. The gallery can't run. Please update jquery-ui.js to latest version.\");\n\t \n\t //check for late jquery include\n\t setTimeout(function(){ugCheckForErrors(g_galleryID, \"cms\")} , 5000);\n\t \n\t}", "title": "" }, { "docid": "167052d34ff1b3f96a2e35ceaa46f24d", "score": "0.469079", "text": "function available(obj, version) {\n\tif (!obj) throw new Error('object cannot be null');\n\tvar availability = obj.availability;\n\tif (availability && (availability.message==='Unavailable' || availability.platform!=='ios')) {\n\t\treturn false;\n\t}\n\tif (obj.unavailable) {\n\t\treturn false;\n\t}\n\tif (availability && satisfies(availability.deprecated,version)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "a81ed80c7ac3a323c8a9db5b18b1d1b6", "score": "0.46826166", "text": "function processVersionUpgrade(oldVersion)\n{\n debugLog('processVersionUpgrade:', oldVersion);\n\n // Make backup of synced data before proceeding\n makeEmergencyBackup(function()\n {\n var upgradeNotes = []; // Upgrade version notes\n\n switch (oldVersion)\n {\n case '1.1.6':\n case '1.1.5':\n case '1.1.4':\n case '1.1.3':\n case '1.1.2':\n case '1.1.1':\n case '1.1.0':\n case '1.0.9':\n case '1.0.8':\n case '1.0.6':\n case '1.0.5':\n case '1.0.3':\n case '1.0.0':\n upgradeShortcutsToV120([\n upgradeShortcutsToV170,\n upgradeShortcutsToV171,\n upgradeShortcutsToLatest\n ]);\n break;\n\n case '1.6.1':\n case '1.6.0':\n case '1.5.1':\n case '1.5.0':\n case '1.4.0':\n case '1.3.5':\n case '1.3.2':\n case '1.3.1':\n case '1.3.0':\n case '1.2.6':\n case '1.2.5':\n case '1.2.2':\n case '1.2.0':\n upgradeShortcutsToV170([\n upgradeShortcutsToV171,\n upgradeShortcutsToLatest\n ]);\n break;\n\n case '1.7.0':\n upgradeShortcutsToV171([\n upgradeShortcutsToLatest\n ]);\n break;\n\n case '1.8.0':\n upgradeNotes.push({ title:\"-\", message:\"Added support for Google Inbox\" });\n upgradeNotes.push({ title:\"-\", message:\"Added support for Google Translate\" });\n upgradeNotes.push({ title:\"-\", message:\"Added support for MailChimp\" });\n upgradeNotes.push({ title:\"-\", message:\"Added support for Confluence\" });\n\n case '1.8.1':\n upgradeNotes.push({ title:\"-\", message:\"Fix for Salesforce support\" });\n upgradeNotes.push({ title:\"-\", message:\"Add new Textarea for demoing\" });\n upgradeNotes.push({ title:\"-\", message:\"Slight optimizations\" });\n\n case '1.8.2':\n case '1.8.3':\n upgradeNotes.push({ title:\"-\", message:\"Change sync error popups to banners\" });\n upgradeNotes.push({ title:\"-\", message:\"Fix handling of trailing spaces\" });\n upgradeNotes.push({ title:\"-\", message:\"Add auto-capitalization/-all-caps\" });\n upgradeNotes.push({ title:\"-\", message:\"Updating banners to be dismissable\" });\n\n case '1.8.4':\n upgradeNotes.push({ title:\"-\", message:\"Fix Inbox support\" });\n upgradeNotes.push({ title:\"-\", message:\"Raise shortcut detection limit to 10s\" });\n upgradeNotes.push({ title:\"-\", message:\"Fix for @ shortcut prefix issue\" });\n\n case '1.8.5':\n upgradeNotes.push({ title:\"-\", message:\"Add omnibox (url bar!) support\" });\n upgradeNotes.push({ title:\"-\", message:\"Allow consecutive shortcuts to fire\" });\n upgradeNotes.push({ title:\"-\", message:\"Add support for O365 OWA\" });\n upgradeNotes.push({ title:\"-\", message:\"Add support for G+ communities\" });\n\n case '1.9.0':\n upgradeNotes.push({ title:\"-\", message:\"Fix for O365 OWA\" });\n\n case '1.9.1':\n upgradeNotes.push({ title:\"-\", message:\"Fix for Zendesk Inbox\" });\n\n case '1.9.2':\n upgradeNotes.push({ title:\"-\", message:\"Fix for Zendesk.com\" });\n\n // Upgrade database to latest version and supply version notes\n upgradeShortcutsToLatest(upgradeNotes);\n break;\n\n default: break;\n }\n });\n}", "title": "" }, { "docid": "4a362864e20d4e8eb8b617f1500343b7", "score": "0.46816093", "text": "async function checkNodeVersions() {\n\n const allVersions = await allNodeVersions();\n const releasedVersions = allVersions.versions;\n\n await new CiVersionCheck({\n packageName: 'Node.js',\n packageSupportUrl: 'https://github.com/nodejs/node/blob/master/CHANGELOG.md',\n yamlFilePath: './.github/workflows/ci.yml',\n ciEnvironmentsKeyPath: 'jobs.check-build.strategy.matrix.include',\n ciVersionKey: 'NODE_VERSION',\n releasedVersions,\n latestComponent: CiVersionCheck.versionComponents.minor,\n ignoreReleasedVersions: [\n '<14.0.0', // These versions have reached their end-of-life support date\n '>=15.0.0 <16.0.0', // These versions have reached their end-of-life support date\n '>=17.0.0 <18.0.0', // These versions have reached their end-of-life support date\n ],\n }).check();\n}", "title": "" }, { "docid": "6bfc9394f74cacd9b1b228a5e7fb0ef9", "score": "0.46788236", "text": "function isCorrectVersion() {\n\tif (parseInt(version, 10) >= 9) {\n\t\treturn true;\n\t}\n\telse {\n\t\talert('This script requires Adobe Photoshop CS2 or higher.', 'Wrong Version', false);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "ef8f63b8755a8f5152223262d6df6fab", "score": "0.467549", "text": "function installPluginsOnInst(app){\n\tpluginsHelper.plugins.map(function(plugin){\n\t\tif(plugin.realtime && plugin.realtime.onAppInstance){\n\t\t\tplugin.realtime.onAppInstance(app);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "64e3cf5577633fbd558bbd21e2800737", "score": "0.4672077", "text": "function loadOldPlugins(pluginsNode, pluginsWeb, tracerProvider) {\n const allPlugins = mergePlugins(exports.DEFAULT_INSTRUMENTATION_PLUGINS, pluginsNode);\n const pluginLoader = new PluginLoader_1.PluginLoader(tracerProvider);\n pluginLoader.load(allPlugins);\n return () => {\n pluginLoader.unload();\n };\n}", "title": "" }, { "docid": "cf3a6157823d28bac65afd96de8ca6c6", "score": "0.4670871", "text": "function gate(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Check readiness of plugins and databases when they're loading simultaneously \n\tif (N && M && T) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// when everything is loaded, proceed further\n\t\tN=M=T=false;\n\t\tmain();\n\t};\n}", "title": "" }, { "docid": "0081dbf5dfd4de1aa797fae8b3174559", "score": "0.46700457", "text": "function is_facter_version() {\n if (doc.version != null) {\n if (doc.version[\"ims-facter\"] != null) {\n op_str.push(\"+latest\");\n }\n else {\n op_str.push(\"-latest\");\n }\n }\n else {\n op_str.push(\"-latest\");\n }\n }", "title": "" }, { "docid": "f96aab1699cbae44186e143a24aeb002", "score": "0.466785", "text": "async updateDeps(cwd = process.cwd()) {\n const sourcePath = `${cwd}/${this.sourceDir}`;\n let needUpdate = false;\n this.info(`Upgrading dependencies in package.json`);\n // 1. update package.json\n const ncuOptions = {\n upgrade: true,\n jsonUpgraded: true,\n silent: true,\n cwd: sourcePath,\n filter: this.depsFilter,\n packageFile: `${sourcePath}/package.json`,\n };\n const upgraded = await ncu.run(ncuOptions);\n if (Object.keys(upgraded).length > 0) {\n needUpdate = true;\n const updateItems = Object.entries(upgraded).map(([name, version]) => `${name}@${version}`);\n const updateStr = updateItems.join(',');\n // 2. npm install latest deps\n this.info(`Updating dependencies: ${updateStr}`);\n this.info(`Installing latest dependencies...`);\n spawnSync('npm', ['install'], { cwd: sourcePath });\n } else {\n this.info(`No dependencies need to upgrade in package.json`);\n }\n\n return needUpdate;\n }", "title": "" }, { "docid": "15ffd4f1f00c6ff82f82127b9767dc3c", "score": "0.46435416", "text": "function $core_SYSREQ_isValidFlashPlayer()\n{\n\t\t// If this check isn't required skip it\n\tif (!$m_arrSysReqs[FLASH].m_bRequired)\n\t\treturn true;\n\n\t\t// Get the flash version\n\tif ($m_arrClientSys[BROWSER].m_nID != IE)\n\t{\n\t\tvar objPlugin = (navigator.mimeTypes &&\n\t\t\t\t\t\tnavigator.mimeTypes[\"application/x-shockwave-flash\"] &&\n\t\t\t\t\t\tnavigator.mimeTypes[\"application/x-shockwave-flash\"].enabledPlugin) ?\n\t\t\t\t\t\tnavigator.mimeTypes[\"application/x-shockwave-flash\"].enabledPlugin : 0;\n\t\tif (objPlugin)\n\t\t{\n\t\t\tvar nDot\t = objPlugin.description.indexOf(\".\");\n\t\t\tvar nMajorVer = parseInt(objPlugin.description.substring(nDot - 2));\n\t\t\tvar nMinorVer = parseInt(objPlugin.description.substring(nDot + 1));\n\t\t\t\n\t\t\t$m_arrClientSys[FLASH].m_nVer = nMajorVer;\n\t\t\tif ((nMinorVer) && (!isNaN(nMinorVer)))\n\t\t\t\t$m_arrClientSys[FLASH].m_nVer += (nMinorVer / 10);\n\t\t}\n\t}\n\telse\n\t{\n\t\t\t// This script will test up to the following version.\n\t\tvar nMaxVersions = 20;\n\n\t\t\t// Check ActiveX-style plug-ins\n\t\tif (window.ActiveXObject)\n\t\t{\n\t\t\tvar nVersion = null;\n\t\t\tvar nMinorVersion = null;\n\n\t\t\ttry{\n\t\t\t\tvar objFlash = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\");\n\t\t\t\tif (objFlash)\n\t\t\t\t{\n\t\t\t\t\tvar strVer = objFlash.GetVariable(\"$version\").replace(/\\D+/g, \",\").match(/^,?(.+),?$/)[1];\n\t\t\t\t\tnVersion = parseInt(strVer.split(',').shift());\n\t\t\t\t\tnMinorVersion = parseInt(strVer.split(',')[1]);\n\t\t\t\t\tif ((nMinorVersion) && (!isNaN(nMinorVersion)))\n\t\t\t\t\t\tnVersion += (nMinorVersion / 10);\n\t\t\t\t\tif ((nVersion) && (nVersion > 2))\n\t\t\t\t\t\t$m_arrClientSys[FLASH].m_nVer = nVersion;\n\t\t\t\t\telse\n\t\t\t\t\t\tnVersion = null;\n\t\t\t\t}\n\t\t\t}catch(e){\tnVersion = null;\t}\n\n\t\t\tif (!nVersion)\n\t\t\t{\n\t\t\t\tfor (inVer = 20; inVer >= 3; inVer--)\n\t\t\t\t{\n\t\t\t\t\ttry{\n\t\t\t\t\t\tvar objFlash = eval(\"new ActiveXObject('ShockwaveFlash.ShockwaveFlash.\" + inVer + \"');\");\n\t\t\t\t\t\tif (objFlash)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$m_arrClientSys[FLASH].m_nVer = inVer;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e){}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (($m_arrClientSys[FLASH].m_nVer) && ($m_arrClientSys[FLASH].m_nVer > 1))\n\t\t$m_arrClientSys[FLASH].m_strVer = \"\" + $m_arrClientSys[FLASH].m_nVer;\n\n\t\t// Validate the Flash Player requirements\n\tif (($m_arrClientSys[FLASH].m_nVer >= $m_arrSysReqs[FLASH].m_nMinVer) && \n\t($m_arrSysReqs[FLASH].m_nMaxVer == null || $m_arrClientSys[FLASH].m_nVer <= $m_arrSysReqs[FLASH].m_nMaxVer))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "8b2235e09e199541f6b6878a6effd37c", "score": "0.4637456", "text": "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n} // webpack disallows updates in other states.", "title": "" }, { "docid": "8b2235e09e199541f6b6878a6effd37c", "score": "0.4637456", "text": "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n} // webpack disallows updates in other states.", "title": "" }, { "docid": "1525a325f898ebb0ea503efbdc8de013", "score": "0.46346098", "text": "function isCorrectVersion() {\r\n if (parseInt(version, 10) >= 9) {\r\n return true;\r\n }\r\n else {\r\n alert('This script requires Adobe Photoshop CS2 or higher.', 'Wrong Version', false);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "925c58d53bf2ca7f1faebc018e412187", "score": "0.46321556", "text": "function testInstall() {\n var mpInst=false;\n if (is.ie && !is.mac) {\n // note: this is wrapped in an eval because Netscape doesn't support events\n eval (' try { var ActiveX = new ActiveXObject(\"MathPlayer.Factory.1\"); mpInst = (ActiveX!=null); ActiveX=null;} catch (e) { mpInst=false; }');\n }\n return mpInst;\n}", "title": "" }, { "docid": "b34ae38de5c0c88d099154c896c1c94d", "score": "0.4629048", "text": "function addConditionalDependencies(packages) {\n function isPreview() {\n return packagesUtil.getParameterByName('isEdited') === 'true';\n }\n\n function isQaAutomation() {\n return packagesUtil.getParameterByName('isqa') === 'true';\n }\n\n function isTpaIntegration() {\n return packagesUtil.getParameterByName('isTpaIntegration') === 'true';\n }\n\n function isWixSites() {\n return isWixDomain() || packagesUtil.getParameterByName('iswixsite') === 'true';\n }\n\n function isWixDomain() {\n return location.hostname === 'www.wix.com';\n }\n\n if (isPreview()) {\n packages.push('editingServices');\n packages.push('immutable');\n }\n if (isQaAutomation()) {\n packages.push('qaAutomation');\n }\n if (isWixSites()) {\n packages.push('wixSites');\n }\n if (isTpaIntegration()) {\n packages.push('Q');\n packages.push('jasminetpa');\n packages.push('tpaIntegration');\n }\n }", "title": "" }, { "docid": "87bda2058b735a37cfe030c38cf25fb2", "score": "0.46253204", "text": "function enrichMetadata() {\n var semver = require('semver');\n\n for (var pluginID in _plugins) {\n fetchPluginMetaData(_plugins[pluginID].name, pluginID, function(metadata, cpluginID) {\n _plugins[cpluginID][\"description\"] = \"n/a\";\n _plugins[cpluginID][\"author\"] = \"n/a\";\n _plugins[cpluginID][\"homepage\"] = \"n/a\";\n _plugins[cpluginID][\"homebridgeMinVersion\"] = \"n/a\";\n _plugins[cpluginID][\"latestVersion\"] = \"n/a\";\n _plugins[cpluginID][\"isLatestVersion\"] = \"n/a\";\n if (metadata[\"collected\"].hasOwnProperty(\"metadata\")) {\n _plugins[cpluginID][\"description\"] = metadata[\"collected\"][\"metadata\"].hasOwnProperty(\"description\") ? metadata[\"collected\"][\"metadata\"][\"description\"] : \"n/a\";\n\n _plugins[cpluginID][\"author\"] = \"n/a\";\n if (metadata[\"collected\"][\"metadata\"].hasOwnProperty(\"publisher\")) {\n _plugins[cpluginID][\"author\"] = metadata[\"collected\"][\"metadata\"][\"publisher\"].hasOwnProperty(\"username\") ? metadata[\"collected\"][\"metadata\"][\"publisher\"][\"username\"] : \"n/a\";\n }\n\n _plugins[cpluginID][\"homepage\"] = \"n/a\";\n if (metadata[\"collected\"][\"metadata\"].hasOwnProperty(\"links\")) {\n _plugins[cpluginID][\"homepage\"] = metadata[\"collected\"][\"metadata\"][\"links\"].hasOwnProperty(\"homepage\") ? metadata[\"collected\"][\"metadata\"][\"links\"][\"homepage\"] : \"n/a\";\n }\n\n _plugins[cpluginID][\"homebridgeMinVersion\"] = \"n/a\";\n if (metadata[\"collected\"][\"metadata\"].hasOwnProperty(\"dependencies\")) {\n _plugins[cpluginID][\"homebridgeMinVersion\"] = metadata[\"collected\"][\"metadata\"][\"dependencies\"].hasOwnProperty(\"homebridge\") ? metadata[\"collected\"][\"metadata\"][\"dependencies\"][\"homebridge\"] : \"n/a\";\n }\n\n var latestVersion = metadata[\"collected\"][\"metadata\"].hasOwnProperty(\"version\") ? metadata[\"collected\"][\"metadata\"][\"version\"] : \"n/a\";\n _plugins[cpluginID][\"latestVersion\"] = latestVersion;\n if (semver.lt(_plugins[cpluginID][\"version\"], latestVersion)) {\n _plugins[cpluginID][\"isLatestVersion\"] = \"0\";\n } else {\n _plugins[cpluginID][\"isLatestVersion\"] = \"1\";\n }\n }\n });\n }\n}", "title": "" }, { "docid": "dde07c82609f87cb8b0f9b377e97891d", "score": "0.4618856", "text": "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "title": "" }, { "docid": "2dda34cc0e52c82a38db6c849563f065", "score": "0.46154982", "text": "_setupOutdated(packages) {\n if (!packages) {\n this.props.setPackagesOutdated([]);\n return;\n }\n let outdatedData = JSON.parse(packages);\n this.props.setPackagesOutdated(outdatedData);\n }", "title": "" } ]
1b463ed5865a980b0e92713229d30972
Function for liking/unliking genres
[ { "docid": "91c43021dff4bdf84f424d5d2fd41b97", "score": "0.6196855", "text": "async function handleGenreClick(e) {\n let target = Array.from(e.target.classList)\n //like genre\n if (this.dataset.liked === 'false' && target.includes(\"like-btn\")) {\n let res = await Genre.likeGenre(this.dataset.id)\n if (res.status === 201) {\n this.dataset.liked = 'true'\n genreIds.push(Number(this.dataset.id))\n checkGetStartedToggle()\n e.target.innerHTML = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> Unlike'\n return res\n }\n else if (res.data.message === \"no logged in user\") {\n loginModal.style.display = \"block\";\n }\n }\n //unlike genre\n else if (this.dataset.liked === 'true' && target.includes('like-btn')) {\n let res = await Genre.unLikeGenre(this.dataset.id)\n if (res.status === 200) {\n let index = genreIds.indexOf(Number(this.dataset.id))\n if (index > -1) { genreIds.splice(index, 1) }\n checkGetStartedToggle()\n this.dataset.liked = 'false'\n e.target.innerHTML = '<i class=\"fa fa-star-o\" aria-hidden=\"true\"></i> Like'\n }\n }\n}", "title": "" } ]
[ { "docid": "de428a6d87daf2f858c63e9d51789fdb", "score": "0.6162079", "text": "function like(liked){\n //pic.liked recibe si e strue o false\n pic.liked=liked;\n //condicion if en una linea donde recibe el parametro like\n //si es verdadero se aumenta 1 si no (:) se resta 1\n pic.likes+= liked ? 1 : -1;\n //la variable newElement recibe todo de la funcion render pic\n var newElement=render(pic);\n //se actualizara la vista del antiguo elemento al nuevo elemento\n yo.update(el,newElement);\n //regresara falso para volver a entrar en la condicion\n return false;\n }", "title": "" }, { "docid": "8448063c2e652bf587247551c3f368db", "score": "0.6054219", "text": "function liked(){\n\tvar l_button = document.getElementById(\"like_button\");\n\tif(l_button.flag == '1'){\n\t\tl_button.style.backgroundColor = \"transparent\";\n\t\tl_button.flag = '0';\n\n\t\t// sending the server request to tweak the playlist for liking the song\n\t\tvar xmlhttp = new XMLHttpRequest();\n \t\n \txmlhttp.onreadystatechange = function() {\n \tif (this.readyState == 4 && this.status == 200) {\n \tconsole.log(\"liked info sent\")\n \tassign_signature();\n\n }\n else{\n \tconsole.log(\"liked info not sent\")\n }\n };\n \n\t xmlhttp.open(\"POST\", \"api/like/id?id=\" + cur_song_id, true);\n\t \txmlhttp.send();\n\n\t}\n\telse{\n\t\tl_button.style.backgroundColor = \"#e6005c\";\n\t\tl_button.flag = '1';\n\n\n\t\t// sending the server request to tweak the playlist for disliking the song\n\t\tvar xmlhttp = new XMLHttpRequest();\n \t\n \txmlhttp.onreadystatechange = function() {\n \tif (this.readyState == 4 && this.status == 200) {\n \tconsole.log(\"liked info sent\")\n \tassign_signature();\n\n }\n else{\n \tconsole.log(\"liked info not sent\")\n }\n };\n \n\t xmlhttp.open(\"POST\", \"api/unlike/id?id=\" +cur_song_id, true);\n\t \txmlhttp.send();\n\t}\n\n\n}", "title": "" }, { "docid": "280645de66712b09ce1fd6a1e511cc0c", "score": "0.5981882", "text": "function likeDislikeCommon(){\n\t\n\tplaying = 0;\n\tstopSeq();\n\tseqCounter = 0;\n\ttotalCount += 1;\n\t$(\"#pauseButton\").hide();\n\t$(\"#playButton\").show();\n\t$(\"#likeButton\").hide();\n\t$(\"#dislikeButton\").hide();\n\tvar generationOld = generation;\n\tgeneration = Math.floor(totalCount/8);\n\tif (generationOld !== generation){\n\t\t// console.log(\"NEW GEN!\");\n\t\tnewGeneration();\n\t}\n\tlikeDislikeButtonClicked();\n\ttransformCircles();\n\n}", "title": "" }, { "docid": "fb38b078df2224512919732133b251b7", "score": "0.5968388", "text": "function onLike(like, id, name, image) {\n handlerFavorite(id, name, like, image); //marco like a ese character\n }", "title": "" }, { "docid": "b51296f311ed805179e28a7781b51cd5", "score": "0.595072", "text": "function likes(names) {\n if (typeof names == \"undefined\" || names.length == 0) {\n return \"no one likes this\";\n }\n if (names.length == 1) {\n return names[0] + \" likes this\";\n }\n if (names.length == 2) {\n return names[0] + \" and \" + names[1] + \" likes this\";\n }\n if (names.lentgh == 3) {\n return names[0] + \", \" + names[1] + \" and \" + names[2] + \" like this\";\n }\n}", "title": "" }, { "docid": "a016e59c895ec8c14f6abe1a99193d3d", "score": "0.5938106", "text": "function like(){\n likeTweets.likeTweets();\n}", "title": "" }, { "docid": "7f4eee9cb87da03331d10be8be626dea", "score": "0.58838886", "text": "function toggleLike(elem, idxMovie) {\n\n i = idxMovie; star = elem;\n\n\n\n // TODO: IMPLEMENT STATUS TOGGLE OF LIKE ICON\n\n // TODO: IMPLEMENT UPDATE TO IN-MEMORY ARRAY staticMovies WITH LIKE STATUS\n\n // Updates UI\n refreshLikedMovies();\n}", "title": "" }, { "docid": "9cfe9843ec145f981f6f18016d876e36", "score": "0.58585733", "text": "function subLike(elem) {\n $(elem).data('liked', false)\n $(elem).prop('src', '/img/svg/like-white.svg')\n let span = $(elem).next()\n span.html(parseInt(span.html()) - 1)\n }", "title": "" }, { "docid": "e5647d3014075c45a61fb0cae65b13d0", "score": "0.5826506", "text": "function likes(names) {\n if(names.length === 0) {\n return 'no one likes this'\n }\n if(names.length === 1) {\n return `${names[0]} likes this`\n }\n if(names.length === 2) {\n return `${names[0]} and ${names[1]} like this`\n }\n if(names.length === 3) {\n return `${names[0]}, ${names[1]} and ${names[2]} like this`\n }\n if(names.length >= 4) {\n return `${names[0]}, ${names[1]} and ${names.length - 2} others like this`\n }\n}", "title": "" }, { "docid": "aaea85704a8e5a41248ab13f8aae64b9", "score": "0.58246815", "text": "function sup_likes() {\n\tinit();\n\tsuppression_likes(environnement.clef);\n}", "title": "" }, { "docid": "ea5364283e16cc9a25ee231ff72a6860", "score": "0.58023465", "text": "function likes2(names) {\n names = names || [];\n switch(names.length){\n case 0: return 'no one likes this';\n case 1: return names[0] + ' likes this';\n case 2: return names[0] + ' and ' + names[1] + ' like this';\n case 3: return names[0] + ', ' + names[1] + ' and ' + names[2] + ' like this';\n default: return names[0] + ', ' + names[1] + ' and ' + (names.length - 2) + ' others like this';\n }\n}", "title": "" }, { "docid": "45eedeaae84e4671eef6f9cb38136754", "score": "0.57700604", "text": "function likes(names) {\n if (typeof names === \"object\"){\n if (names.length === 0){\n return \"no one likes this\";\n }\n else if (names.length === 1){\n return `${names[0]} likes this`\n }\n else if (names.length === 2){\n return `${names[0]} and ${names[1]} like this`\n }\n else if (names.length === 3){\n return `${names[0]}, ${names[1]} and ${names[2]} like this`\n }\n else if (names.length >= 4){\n return `${names[0]}, ${names[1]} and ${names.length - 2} others like this`\n }\n }\n else {\n return \"Sorry, arrays only!\"\n }\n }", "title": "" }, { "docid": "4b542d3faa58fc300c0e6e949dd22a02", "score": "0.57626265", "text": "function likes(names) {\n if(names.length == 0){\n return 'no one likes this'\n }\n for (var i = 0; i < names.length; i++) {\n if(names.length == 1){\n return names[0] + ' likes this'\n }\n else if(names.length == 2){\n return names[0] + ' and ' +names[1] + ' like this'\n }\n else if(names.length == 3 ) {\n return names[0] + ', ' +names[1] + ' and ' + names[2] + ' like this'\n }\n else {\n count = names.length - 2\n return names[0] + ', ' +names[1] + ' and ' + count + ' others like this'\n }\n }\n}", "title": "" }, { "docid": "2c816ca0a5188f5a91bf0f579dfe371b", "score": "0.57277155", "text": "function addStudentLikes(mentors) {\n}", "title": "" }, { "docid": "6c05f3a659ee42d7725cd16e767ba039", "score": "0.5700886", "text": "function likes(names) {\n if( names.length == 1 ) {\n return names + ' ' + 'likes this'\n } else if ( names.length == 2) {\n return names[0] + ' and ' + names[1] + ' like this' \n } else if ( names.length == 3) {\n return names[0] + ', ' + names[1] + ' and ' + names[2] + ' like this' \n } else if ( names.length > 3) {\n return names[0] + ', ' + names[1] + ' and ' + (names.length - 2) + ' others like this' \n } else {\n return 'no one likes this'\n }\n}", "title": "" }, { "docid": "f299b4372b75def6841fcb985f62d5fb", "score": "0.5687453", "text": "function Liked() {\n if (vm.List.length <= vm.Index) return;\n vm.LikedMovies[LikedIndex] = vm.List[vm.Index];\n var nota = vm.LikedMovies[vm.IndexLikesCoracao].vote_average;\n var EvaluationIndex = vm.IndexLikesCoracao;\n\n //Calcula os corações que foram inserindos juntos do objeto do filme\n if (nota <= 2) {\n vm.LikedMovies[EvaluationIndex].Coracoes.push([\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite_.png\" },\n { link: \"../assets/favorite_.png\" },\n { link: \"../assets/favorite_.png\" },\n { link: \"../assets/favorite_.png\" }\n ]);\n\n vm.EvaluationsCount = vm.List[EvaluationIndex].vote_count;\n }\n\n if (nota <= 4 && nota > 2) {\n vm.LikedMovies[EvaluationIndex].Coracoes.push([\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite_.png\" },\n { link: \"../assets/favorite_.png\" },\n { link: \"../assets/favorite_.png\" }\n ]);\n\n vm.EvaluationsCount = vm.List[EvaluationIndex].vote_count;\n }\n\n if (nota <= 6 && nota > 4) {\n vm.LikedMovies[EvaluationIndex].Coracoes.push([\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite_.png\" },\n { link: \"../assets/favorite_.png\" }\n ]);\n\n vm.EvaluationsCount = vm.List[EvaluationIndex].vote_count;\n }\n\n if (nota <= 8 && nota > 6) {\n vm.LikedMovies[EvaluationIndex].Coracoes.push([\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite_.png\" }\n ]);\n\n vm.EvaluationsCount = vm.List[EvaluationIndex].vote_count;\n }\n\n if (nota <= 10 && nota > 8) {\n vm.LikedMovies[EvaluationIndex].Coracoes.push([\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" },\n { link: \"../assets/favorite.png\" }\n ]);\n\n vm.EvaluationsCount = vm.List[EvaluationIndex].vote_count;\n }\n\n vm.Index++;\n vm.IndexLikesCoracao++;\n LikedIndex++;\n UpdateMovie();\n }", "title": "" }, { "docid": "40a744fe7149fd5d6e18095d2c01e708", "score": "0.56691134", "text": "like_limit(likes){\n \n \n\n }", "title": "" }, { "docid": "10d0e092ae6d50ebe18b6dac56fc4194", "score": "0.5655696", "text": "function addLike(elem) {\n $(elem).data('liked', true);\n $(elem).prop('src', '/img/svg/like-red.svg');\n let span = $(elem).next();\n span.html(parseInt(span.html()) + 1);\n }", "title": "" }, { "docid": "cf7f9f40f6116b0c679de16e014739af", "score": "0.5628831", "text": "function likes(names) {\n if (names.length === 0) {\n return \"no one likes this\";\n } else if (names.length === 1) {\n return names[0] + \" likes this\";\n } else if (names.length === 2) {\n return names[0] + \" and \" + names[1] + \" like this\";\n } else if (names.length === 3) {\n return names[0] + \", \" + names[1] + \" and \" + names[2] + \" like this\";\n } else if (names.length >= 4) {\n return (\n names[0] +\n \", \" +\n names[1] +\n \" and \" +\n (names.length - 2) +\n \" others like this\"\n );\n }\n}", "title": "" }, { "docid": "59934da79d2a149865a22a8edc4ecb96", "score": "0.5588339", "text": "function like(evt) {\n\n\t// if not logged in, redirect\n\tif (!logged_in) {\n\t\twindow.location.href = base_url + '/login/vine';\n\t\treturn false;\n\t}\n\n\t// get right target\n\tif ($(evt.target).hasClass('icon-heart'))\n\t{\n\t\ttarget = $(evt.target).parent();\n\t}\n\telse\n\t{\n\t\ttarget = $(evt.target);\n\t}\n\n\t// get some elements\n\ticon = target.children().first();\n\tcount = target.next('.like-count');\n\n\t// if already liked; do dislike\n\tif (icon.hasClass('liked')) return dislike(evt);\n\n\t// get vine id out of dom\n\tvine_id = '' + target.closest('.vine-element').attr('data-id');\n\n\t// build url\n\turl = base_url + '/api/vine/' + vine_id + '/like';\n\n\t// make post\n\t$.post(url, function(data) \n\t{\n\t\tif (data.success) \n\t\t{\n\t\t\ticon.addClass('liked');\n\n\t\t\t// update likes count\n\t\t\tcurrent = parseInt(count.html(), 10);\n\t\t\tcount.html(current + 1);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2066d639423d182938f5b4bb5c87f97d", "score": "0.558791", "text": "function likee(id,x,liker)\r\n{\r\n $(x).toggleClass('like-active');\r\n $(x).next().toggleClass('hidden'); \r\n\r\n\t\t\tif (window.XMLHttpRequest)\r\n \t\t\t\t{// code for IE7+, Firefox, Chrome, Opera, Safari\r\n \t\t\t\t\tvar xmlhttp=new XMLHttpRequest();\r\n \t\t\t\t}\r\n\t\t\telse\r\n \t\t\t\t{// code for IE6, IE5\r\n \t\t\t\tvar xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \t\t\t\t}\r\n\t\t\r\n\t\t\txmlhttp.open(\"GET\",\"like.php?id=\"+id+\"&liker=\"+liker,true);\r\n\t\t\txmlhttp.send();\r\n\t\t}", "title": "" }, { "docid": "2066d639423d182938f5b4bb5c87f97d", "score": "0.558791", "text": "function likee(id,x,liker)\r\n{\r\n $(x).toggleClass('like-active');\r\n $(x).next().toggleClass('hidden'); \r\n\r\n\t\t\tif (window.XMLHttpRequest)\r\n \t\t\t\t{// code for IE7+, Firefox, Chrome, Opera, Safari\r\n \t\t\t\t\tvar xmlhttp=new XMLHttpRequest();\r\n \t\t\t\t}\r\n\t\t\telse\r\n \t\t\t\t{// code for IE6, IE5\r\n \t\t\t\tvar xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \t\t\t\t}\r\n\t\t\r\n\t\t\txmlhttp.open(\"GET\",\"like.php?id=\"+id+\"&liker=\"+liker,true);\r\n\t\t\txmlhttp.send();\r\n\t\t}", "title": "" }, { "docid": "f61e7f60263bc7d3f7bbcbe920e8c156", "score": "0.55803984", "text": "function likeArticle()\n{\n if (likedArticles.includes(\"like\" + articleid))\n {\n likedArticles.splice(likedArticles.indexOf(`like${articleid}`));\n newWebRequest(\"https://ilan-not-elon.com/Covid-Kids/handleLikes.php?requestType=unlikeArticle&article=\" + \"like\" + articleid);\n }\n else\n {\n likedArticles.push(\"like\" + articleid);\n newWebRequest(\"https://ilan-not-elon.com/Covid-Kids/handleLikes.php?requestType=likeArticle&article=\" + \"like\" + articleid);\n }\n localStorage.setItem(\"likedArticles\", JSON.stringify(likedArticles));\n setIcons();\n}", "title": "" }, { "docid": "210c100ff4b9274f7b992d1f9a87607f", "score": "0.5576745", "text": "function CheckIfIliked ( likes, user_id ){\n\t$.each( likes, function(key, like){\n\t\tif ( like.user_id == user_id ){\n\t\t\t$(\"#status-id_\"+like.post_id+\" #like\").html(\"Unlike\").removeClass(\"like\").addClass(\"unlike\");\n\t\t\t$(\"<img src='pics/like_n.png' class='my-like'>\").appendTo( $(\"#status-id_\"+like.post_id+\" #the-likes\") )\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "93beca93e746651253c0900b7de87f3f", "score": "0.55627155", "text": "function likes(names){\n var msg = \"\";\n switch (names.length){\n case 0: msg = 'no one likes this'; break;\n case 1: msg = names[0] + \" likes this\"; break;\n case 2: msg = names[0] + \" and \" + names[1] + \" like this\"; break;\n case 3: msg = names[0] + \", \" + names[1] + \" and \" + names[2] + \" like this\"; break;\n default: msg = names[0] + \", \" + names[1] + \" and \" + (names.length - 2) + \" others like this\"; break;\n }\n \n return msg;\n}", "title": "" }, { "docid": "ee33143d42ff858e7540bf13ec24b9a1", "score": "0.5556618", "text": "function likes(arr) {\n if (arr.length === 0) { return `no one likes this`; };\n if (arr.length === 1) { return `${arr[0]} likes this`; };\n if (arr.length === 2) { return `${arr[0]} and ${arr[1]} like this`; };\n if (arr.length === 3) { return `${arr[0]}, ${arr[1]} and ${arr[2]} like this`; };\n return `${arr[0]}, ${arr[1]} and ${arr.length - 2} others like this`;\n}", "title": "" }, { "docid": "be21d7deff13297c86cba7432fe50813", "score": "0.55498135", "text": "function likeTweep(tweep) {\n tweep.like = true\n}", "title": "" }, { "docid": "0acf2327300a70dff51d8d2f44056819", "score": "0.55492836", "text": "function handleLike(comment_id) {\n setLiked(liked ? false : true);\n setLikesQnt(liked ? likeQnt - 1 : likeQnt + 1);\n }", "title": "" }, { "docid": "e0f1e4d67c43d4a0fbe8d843dc417222", "score": "0.5532982", "text": "function likes(names) {\n const namesLenght = names.length; \n let nameList = '';\n let postfix = '';\n let result = '';\n \n if (namesLenght > 0) {\n //make postfix\n if (namesLenght === 1){\n postfix = 'likes this';\n } else {\n postfix = 'like this';\n }\n //make line of names\n if (namesLenght === 1){\n nameList = names[0];\n } else if (namesLenght === 2) {\n nameList = names[0] + ' and ' + names[1];\n } else if (namesLenght === 3) {\n nameList = names[0] + ', '+ names[1] + ' and ' + names[2];\n } else {\n const otherNames = namesLenght - 2;\n nameList = names[0] + ', '+ names[1] + ' and ' + otherNames + ' others';\n }\n \n result = nameList + ' ' + postfix;\n } \n // if no one likes\n else {\n result = 'no one likes this';\n }\n \n \n return result;\n}", "title": "" }, { "docid": "f7991701b3dbef9998b39246474c92d7", "score": "0.5526058", "text": "function like(e, likes_count) {\n if (e.find('.fa').hasClass('fa')) {\n e.find('span').text(likes_count);\n\n e.find('.fa').toggleClass('fa-heart-o fa-heart');\n } else {\n e.text(likes_count);\n\n e.toggleClass('liked');\n }\n}", "title": "" }, { "docid": "95bfbdbc7ec46e88eeaaafe4e5b2f1d0", "score": "0.551623", "text": "onLikeClicked(e) {\n e.preventDefault();\n const previousClick = this.state.isClicked;\n const countAdjust = previousClick\n ? this.state.count - 1\n : this.state.count + 1;\n this.setState({ isClicked: !previousClick, count: countAdjust });\n if (previousClick) {\n this.processUnlike();\n } else {\n this.processLike();\n }\n }", "title": "" }, { "docid": "31fb1ee7a33f91c1fa804188dc6a9e0c", "score": "0.5510954", "text": "function genreClickHandler(genreChosen) {\n //console.log(genreChosen);\n movieData = movieDictionary[genreChosen];\n msg = \"Here are our recommendations!\";\n setGenre(movieData);\n setMsg(msg);\n }", "title": "" }, { "docid": "2eb6652a6d5f12bf1980b46f22f5837b", "score": "0.54754215", "text": "function recommend() {\n if (flag === true) {\n id(\"random-song\").innerHTML = \"\";\n }\n flag = true;\n id(\"gen\").removeEventListener(\"click\", recommend);\n let count = 2;\n let time = setInterval(function() {\n if (count < 0) {\n clearInterval(time);\n id(\"gen\").addEventListener(\"click\", recommend);\n randomSong();\n } else {\n id(\"loading\").textContent = PHRASES[count];\n count--;\n }\n }, 1000);\n\n }", "title": "" }, { "docid": "fefcc8752e26b0455efde7997e208a16", "score": "0.5429762", "text": "function compareLikes(a,b)\n {\n return b.likes-a.likes\n }", "title": "" }, { "docid": "61e04a53a50a7977a2667d0b759d8d03", "score": "0.5424615", "text": "function checkLikes(postID)\n{\n $.ajax\n ({\n type: \"POST\",\n url: \"requests.php\",\n data: {\"getLikes\": postID},\n success: function(response)\n {\n response = JSON.parse(response);\n if(response['result'][0].length > 0)\n {\n $('#' + postID + '> .like > p').text(response['result'][0].length);\n for(var i = 0; i < response['result'][0].length; i++)\n {\n if(response['result'][0][i][\"likeID\"] == profileID)\n {\n $('#' + postID + '> .like > img').attr(\"src\", \"../images/like.png\");\n $('#' + postID + '> .like').attr(\"onclick\", \"dislike(\" + postID + \")\");\n }\n }\n }\n else\n {\n $('#' + postID + '> .like > img').attr(\"src\", \"../images/dislike.png\");\n $('#' + postID + '> .like > p').text(\"0\");\n $('#' + postID + '> .like').attr(\"onclick\", \"like(\" + postID + \")\");\n }\n }\n })\n}", "title": "" }, { "docid": "2f4a4e53a5453b785a57d49445d6e735", "score": "0.5404327", "text": "function toggleLikeIcon(elem) {\n if($(elem).data('liked')) {\n subLike(elem)\n }\n else {\n addLike(elem)\n }\n }", "title": "" }, { "docid": "0858a6a3f44f87587483f171938b8570", "score": "0.5395188", "text": "updateWhetherViewerLikedTheSpin()\n {\n if(this.state.likeList.includes(this.userToView))\n {\n this.setState({showLike : false});\n }\n else\n {\n this.setState({showLike : true});\n }\n }", "title": "" }, { "docid": "57c6bab8194f1ce914e05fa985d8040d", "score": "0.5390956", "text": "function Movie({id, movieImage, isLiked}) {\n const [triggerLikeByClicked] = useMutation(triggerLike, {variables: {id: Number(id)}})\n return (\n <div>\n <Container>\n <Link to={`/${id}`}>\n <Poster bg={movieImage} />\n </Link>\n <button onClick={triggerLikeByClicked}>{isLiked? \"UNLIKE\" : \"LIKE\"}</button>\n </Container>\n </div>\n )\n}", "title": "" }, { "docid": "611d559f71ca31b48280b391177798bf", "score": "0.5388623", "text": "function likes(names) {\n // TODO\n if (names.length === 0) return 'no one likes this'\n if (names.length === 1) return `${names[0]} likes this`\n if (names.length === 2) {\n return names.join(\" and \") + ' like this'\n }\n if (names.length === 3) {\n let last = names.pop()\n return names.join(\", \") + ' and ' + last + ' like this'\n }\n if (names.length > 3) return `${names[0]}, ${names[1]} and ${names.length-2} others like this`\n}", "title": "" }, { "docid": "98ce8d80aee1ee1262958775bf8cde6d", "score": "0.53849494", "text": "function likeOrDislike(arr) {\n let like = false;\n let dislike = false;\n arr.forEach((vote) => {\n if (vote === \"Like\") {\n like = !like;\n dislike = false;\n } else {\n dislike = !dislike;\n like = false;\n }\n });\n return like ? \"Like\" : dislike ? \"Dislike\" : \"Nothing\";\n}", "title": "" }, { "docid": "69f38755bb7f377f33e8ec2c90406daf", "score": "0.53673506", "text": "function toggleLike($like) {\r\n\r\n if($like.data('clicked')) {\r\n $like.data('clicked', false);\r\n $like.attr(\"src\", \"img/like.png\");\r\n }\r\n\r\n else {\r\n $like.data('clicked', true);\r\n $like.attr(\"src\", \"img/liked.png\");\r\n }\r\n }", "title": "" }, { "docid": "fcba662c714e47fbd408e11edb6267af", "score": "0.5351604", "text": "liked() {\n\t\treturn this.props.place.liked !== undefined ? this.props.place.liked : false\n\t}", "title": "" }, { "docid": "d8dea5243c7aa2373dd4027e59bfce4f", "score": "0.53497976", "text": "function addLikeDislikeEvents() {\n $('.dislikeArticle').on('click', function () {\n var articleId = $(this).parent().attr('id');\n articleDislike(articleId);\n });\n $('.likeArticle').on('click', function () {\n var articleId = $(this).parent().attr('id');\n articleLike(articleId);\n });\n $('.dislikeBrand').on('click', function () {\n var brandId = $(this).parent().attr('id');\n brandDislike(brandId);\n });\n $('.likeBrand').on('click', function () {\n var brandId = $(this).parent().attr('id');\n brandLike(brandId);\n });\n}", "title": "" }, { "docid": "80167b07d080577fa113b418a680c3f9", "score": "0.53441966", "text": "function like() {\n const heart = parseInt(document.getElementById('heart'))\n heart.addEventListener('click', () => {\n const counternumber = parseInt(document.getElementById('counter').innerText)\n let thingy = document.getElementById(counterNumber)\n if (!thingy) { // if thingy exists\n const li = document.createElement('li')\n li.id = counterNumber\n li.innerText = `1 likes for ${counterNumber}`\n likesUl.appendChild(li)\n }\n else {\n let numLikes = parseInt(thingy.innerText)\n numLikes++\n thingy.innerText = `${numLikes} of likes for ${counterNumber}`\n }\n })\n}", "title": "" }, { "docid": "7a1c0e7fc733a9f760879c610959540e", "score": "0.53431267", "text": "function liked() {\n\tvar x = document.getElementById(\"thumb\");\n console.log(x.src);\n var name = document.getElementById(\"profilename\").innerHTML;\n var likedArray = JSON.parse(localStorage.getItem(\"likes\"));\n if( likedArray == null ) likedArray = [];\n\tif ( x.src != \"https://mguanzon.github.io/RMR-project/blankthumb.jpg\") {\n\t\tdocument.getElementById(\"thumb\").src = \"blankthumb.jpg\";\n localStorage.removeItem(\"profileName\");\n confirm(\"Candidate has been removed from your favorites.\")\n localStorage.setItem(name+\"liked\", \"no\" );\n for( var i = 0; i < likedArray.length; i++) {\n if( likedArray[i].candidate == localStorage.getItem(\"name\") ) {\n likedArray.splice(i, 1);\n }\n }\n localStorage.setItem(\"likes\", JSON.stringify(likedArray));\n }\n // What to do when person has been liked\n\telse {\n document.getElementById(\"thumb\").src = \"filledthumb.jpg\";\n localStorage.setItem(\"profileName\",name); \n confirm(\"Candidate has been added to your favorites.\")\n localStorage.setItem(name+\"liked\", \"yes\");\n var newLike = {\n \"positionName\": localStorage.getItem(\"currentPos\"),\n \"candidate\": localStorage.getItem(\"name\")\n };\n likedArray.push(newLike);\n localStorage.setItem(\"likes\", JSON.stringify(likedArray));\n\t}\n}", "title": "" }, { "docid": "e17fa5477052c0ea767b754ce0481600", "score": "0.53398347", "text": "function clickLike() {\n\t$(\"#PhotoContainer .content-wrap img\").each( function() {\t\n\t\tvar photo_id = $(this).parent().parent().prev(\".post-thumbnail\").children(\"img\");\n\t\t$(this).bind(\"click\", function() {\n\t\t\tlikeBack(photo_id.attr(\"alt\"));\n\t\t\tif_like = true;\n\t\t\tsetTimeout(function(){ //delat for avoid double-click\n\t\t\t\tif_like = false;\n\t\t\t}, 100);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "c0f3559e6345f5cc993c76c4ee5dfddb", "score": "0.53072304", "text": "likeDisplay(photo) {\n let likedState = false;\n for (let i = 0; i < photo.userLikes.length; i++) { //Check if liked or not by curr user\n if (photo.userLikes[i] === this.state.loggedUser) {\n likedState = true;\n }\n }\n return (\n <div className=\"like-container\">\n <div className=\"like-component\">\n {\n likedState ?\n <Button variant=\"contained\" color=\"secondary\" onClick = {() => { this.handleUnlike(photo._id); }}>\n Unlike\n </Button>\n :\n <Button variant=\"contained\" color=\"secondary\" onClick = {() => { this.handleLike(photo._id); }}>\n Like\n </Button>\n }\n </div>\n <div className=\"like-component\">\n <Button variant=\"contained\" color=\"primary\">\n {photo.likes} like(s)\n </Button>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "8e75e50d3010d351c404f0b516c920cd", "score": "0.5299103", "text": "function handleLikeClick (){\n setCountLike(countLike + 1)\n }", "title": "" }, { "docid": "46b7a94e81b9c474fd87abe0cc09032a", "score": "0.52937114", "text": "function onClickLike(event) {\n \n // stay on the same page by canceling the default operation\n \n event.preventDefault(); \n \n // we get the url of the link (this = the element that triggers the event(a)\n const url = this.href;\n const spanCount= this.querySelector('span.likes-js');\n const fontIcone=this.querySelector('i');\n \n // have used axios for managing promises (then)\n axios.get(url).then(function(response){\n \n // we retrieve the data data (console.log (response)) in json format \n const likes = response.data.nb_likes;\n \n // we get the number of likes \n spanCount.textContent = likes;\n \n // logic for the management of icons font awsom by acting on the class \n if (fontIcone.classList.contains('fas')){\n fontIcone.classList.replace('fas', 'far');\n }\n else{\n fontIcone.classList.replace('far','fas');\n }\n }).catch(function(error) {\n if(error.response.status === 403) {\n alert('connecté vous pour pouvoir liker');\n }\n });\n }", "title": "" }, { "docid": "fbe0e0819068805130dcd74aeac9d315", "score": "0.5265092", "text": "function addLikeListeners() {\n\t\t\t$(\"a.likeButton\").on(\"click\", function(e){// e staat voor event\n\t\t\t\t//ge ga ni meer naar boven in de pagina springen \n\t\t\t\te.preventDefault();\n\t\t\t\t//op welke post is er geklikt?\n\t\t\t\tvar photoId = $(this).data('id');\n\t\t\t\t//ist om te liken of te unliken?\n\t\t\t\tvar isLiked = $(this).data('liked');\n\t\t\t\t//aantal likes krijge\n\t\t\t\tvar elLikes = $(this).parent().find(\".likeCount\");\n\t\t\t\tvar likes = $(elLikes).html();\n\t\t\t\tvar likeButton = $(this).parent().find(\".likeButton\");\n\n\t\t\t\t$.ajax({\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\turl: \"ajax/like.php\", \n\t\t\t\t\tdata: { \n\t\t\t\t\t\tphotoId: photoId,\n\t\t\t\t\t\tisLiked: isLiked\n\t\t\t\t\t},\n\t\t\t\t\t\tdataType: \"JSON\" \n\t\t\t\t\t}).done(function(res) {\n\t\t\t\t\t\tif( res.status == \"success\" ) {\n\t\t\t\t\t\t\t//er is nog niet geliked\n\t\t\t\t\t\t\tif(isLiked == 0) {\n\t\t\t\t\t\t\t\tlikes++;\n\t\t\t\t\t\t\t\telLikes.html(likes);\n\t\t\t\t\t\t\t\tlikeButton.html(\"Unlike\");\n\t\t\t\t\t\t\t\tlikeButton.data('liked', 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else if(isLiked == 1) {\n\t\t\t\t\t\t\t\tlikes--;\n\t\t\t\t\t\t\t\telLikes.html(likes);\n\t\t\t\t\t\t\t\tlikeButton.html(\"Like\");\n\t\t\t\t\t\t\t\tlikeButton.data('liked', 0);\n\t\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": "46ec2c103e4a4b8a22692558ca5dfb0e", "score": "0.5261027", "text": "function forLike(dataforLike){\n\t\t$('body').on('click', '.plus_like:visible', function () {\n\t\t\tvar valPlus = $(this).find(\".\" + dataforLike),\n valPlusText = parseInt(valPlus.text());\n valPlusText += 1;\n\t\t\tvalPlus.text(valPlusText);\n\t\t\t$(\".\" + dataforLike).text(valPlusText);\n\t\t\t$('body').off('click', '.plus_like:visible');\n\t\t\t$('body').off('click', '.minus_like:visible');\n\t\t\toneOpenOneLike = 0;\n\t\t});\n\t}", "title": "" }, { "docid": "ae4938cba304c89694bcfdb5524bdc86", "score": "0.5252014", "text": "function process_like(url, splat_id, inner_html, classnames, data_method, to_like){\n\tlet data = {\n\t\t\"splat_id\" : splat_id,\n\t\t\"to_like\" : to_like\n\t}\n\tsetData(url, data, data_method)\n\n\t\t//like or unlike - async wait for success response before proceeding\n\t\t.then((re_returned_data) => {\n\n\t\t\tif(re_returned_data.success){\n\t\t\t\t//Get the button and change appearance and state\n\t\t\t\tlet like_set = document.querySelector(\"[data-splat-id='\"+splat_id+\"']\");\n\t\t\t\tlike_set.innerHTML = inner_html;\n\t\t\t\tlike_set.className = classnames;\n\t\t\t}\n\t\t});\n\n}", "title": "" }, { "docid": "0fc42514cb2bb07a31d26ffae499b527", "score": "0.52505344", "text": "function showlikes(id,like){\n const idlike = id;\n if(like.style.display =='none'){\n like.style.display = 'inherit';}\n else{\n like.style.display = 'none';\n }\n}", "title": "" }, { "docid": "e34bcd61d1f261bc7f809ef27d719450", "score": "0.5227982", "text": "function refine(refineGenre){\n\treset()\n\tfor(var i= 0; i <= document.getElementsByClassName(\"bookView\").length; i++){\n\t if (!document.getElementsByClassName(\"bookView\")[i].classList.contains(refineGenre)){\n\t\tdocument.getElementsByClassName(\"bookView\")[i].style.display = \"none\";\n\t }\n\t}\n}", "title": "" }, { "docid": "81f1b515cd54a6d0ba0743a47c0802c9", "score": "0.5226653", "text": "function like_unlike(id) {\n console.log(id);\n let action = document.querySelector(`#like${id}`).innerText;\n fetch(`like/${id}`, {\n method: 'POST',\n body: JSON.stringify({\n post: id,\n action: action\n })\n })\n .then(response => response.json())\n .then(result => {\n console.log(result);\n page = document.querySelector('#heading');\n page = page.getAttribute('name');\n load_page(page, 1)\n // Maybe change this to grab the action and value of likes then change based on those\n // ex. if action is like, should change text to unlike and +1 to likes\n })\n}", "title": "" }, { "docid": "5007a8ed8f5a12ea49530e93a71156c0", "score": "0.5222545", "text": "function renderUserLikes(book) {\n // console.log(book.users)\n return book.users.map(renderUser).join('')\n // console.log('likes test', likesTest)\n}", "title": "" }, { "docid": "51db3472684d7de85b490caf0ba8107a", "score": "0.5217256", "text": "function like (n) {\n window.location.href = \"includes/likes.inc.php?a=\"+n;\n}", "title": "" }, { "docid": "b66ec830f1fc8e2e3d163599aabb3f74", "score": "0.52157325", "text": "function doWork() { \n var context = new SP.ClientContext.get_current();\n var listID = _spPageContextInfo.pageListId;\n var itemId = _spPageContextInfo.pageItemId;\n var lLiked = $('#Liked').val();\n\n if ($('#Liked').val()=='true')\n { \n Microsoft.Office.Server.ReputationModel.Reputation.setLike(context, listID, itemId, false);\n $('#LikeLink').text('Like');\n $('#Liked').val(false);\n $('#LikedCount').val(parseInt($('LikedCount')) - 1);\n }\n else\n {\n Microsoft.Office.Server.ReputationModel.Reputation.setLike(context, listID, itemId, true);\n $('#LikeLink').text('Unlike');\n $('#Liked').val(true);\n $('#LikedCount').val(parseInt($('LikedCount')) + 1);\n }\n\n //Like or Unlike the page\n context.executeQueryAsync(function () { }, function () { console.log('Failed to like page.') });\n }", "title": "" }, { "docid": "77c5d608fb071f9e30610942bd2b97d8", "score": "0.5212489", "text": "function likeFunction(likeButton) {\n\n document.getElementById(likeButton).innerHTML = 'Liked';\n const updatedCount = count++;\n document.getElementById('likeText').innerHTML = updatedCount + ' person likes this!';\n}", "title": "" }, { "docid": "0c32180eee83765ca413050f74e61be8", "score": "0.51968855", "text": "function likeRandom()\r\n {\r\n var randomItem = $( \"#fortuneSpot\" ).text()\r\n \r\n //checks to see if there is a fortune or jokeor not\r\n if (randomItem != 'Click on a button to Get Random!')\r\n //adds to list ok liked items\r\n $(\"#favList\").append(\"<li>\" + randomItem + \"</li>\");\r\n }", "title": "" }, { "docid": "cab3213cc167c7370a4e3839930efa40", "score": "0.51824677", "text": "function likeKey(e) {\n if (e.keyCode === 76) {\n goLike();\n }\n}", "title": "" }, { "docid": "4d8515c7bd999459671806f4f06e7e72", "score": "0.5174641", "text": "renderLikes() {\n\t\tif (!this.props.userLikesUnfiltered.length)\n\t\t\treturn <NoLikesComponent />\n\t\telse {\n\t\t\t// // sort by uploaded time\n\t\t\tconst songs = this.props.userLikes\n\n\t\t\tvar songList = songs.map((song) => {\n\t\t\t\treturn <LikesItem\n\t\t\t\t\t\tkey={ song.MASAS_songInfo.pk }\n\t\t\t\t\t\tMASAS_songPk={ song.MASAS_songInfo.pk }\n\t\t\t\t\t\tSCinfo={ song.SC_songInfo }\n\t\t\t\t\t\tMASASinfo={ song.MASAS_songInfo.song }\n\t\t\t\t\t\tartistInfo={ song.artistInfo }\n\t\t\t\t\t\tisShowingArtistInfo={ song.showProfile } />\n\t\t\t})\n\n\t\t\t// songList = this.filterLikes(songList)\n\t\t\tif(this.shouldFilterLikes()) {\n\t\t\t\tconst totalNumArtworkShown = this.props.numRowLikesShown * this.numArtworkPerLine\n\t\t\t\tsongList = songList.slice(0, totalNumArtworkShown)\n\t\t\t}\n\n\t\t\treturn songList\n\t\t}\n\t}", "title": "" }, { "docid": "446ab8117382d3db3d454f8d010dc027", "score": "0.51736444", "text": "function whatIDontLike(dislike) {\n console.log(\"I don't like \" + dislike);\n}", "title": "" }, { "docid": "78b1ce866ff9a22c23208598beefe837", "score": "0.5155279", "text": "function isLiked(likes, idUser){\r\n for (let i = 0; i < likes.length; i++){\r\n if (likes[i] === idUser){\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "0a04905ac3ffe3ae3c5ac561fd40776b", "score": "0.514724", "text": "function likeButton() {\n alert(\"Ninja was liked\");\n}", "title": "" }, { "docid": "4ab5d861c76853ef59c89a4bc6132718", "score": "0.51411766", "text": "function toggleLike($like){\n $like.toggleClass(\"like-active\");\n let id = $like.data(\"mongo-id\");\n $.post(`/tweets/${id}/like`, \"\");\n }", "title": "" }, { "docid": "0768ca38c0c1148b1257eb016d042125", "score": "0.51394665", "text": "function handleLikeClick() {\n props.onCardLike(props.card);\n }", "title": "" }, { "docid": "50659ae4f813b58172b3dba2c11382dd", "score": "0.5138305", "text": "attemptLike() {\n\t\tthis.btns.like.click();\n\t}", "title": "" }, { "docid": "c81b70e3123d95f3a9b03dba289f1ad6", "score": "0.5135598", "text": "function unlikeVideo() {\n\t\tif (videosource.title=='example0'){\n\t\t\tvar str='unlike';\n\t\t}\n\t\tif (videosource.title=='example1'){\n\t\t\tvar str='unlike1';\n\t\t}\n\t\tif (videosource.title=='example2'){\n\t\t\tvar str='unlike2';\n\t\t}\n\t\tif (videosource.title=='example3'){\n\t\t\tvar str='unlike3';\n\t\t}\n\t\tif (videosource.title=='example4'){\n\t\t\tvar str='unlike4';\n\t\t}\t\n\t\tvar c_number = localStorage.getItem(str);\n\t\tlocalStorage.setItem(str, parseInt(c_number)+1)\n\t\tunlike.innerText = localStorage.getItem(str);\n\t}", "title": "" }, { "docid": "ad4ce27082939eb288ced934b525e0ef", "score": "0.513259", "text": "like(context, data) {\n context.commit('setLike', data)\n }", "title": "" }, { "docid": "7c30abb338807cab8d13edc884c3b923", "score": "0.5129425", "text": "function highlight_books_of_spell(spell){\n //Booklabel class: .bookLabel\n //Booklabel ids: #HP_0x\n\n var bookTags = get_books(spell);\n var bookLabels = document.querySelectorAll(\".bookLabel\");\n\n if(bookClicked == \"0\"){\n bookLabels.forEach(function(e){\n e.style.opacity = 0.3;\n if(bookTags.includes(e.id.replace(\"HP_0\", \"Book \"))){\n e.style.opacity = 1.0;\n e.style.fontWeight = \"bold\";\n }\n });\n }else{\n bookLabels.forEach(function(e){\n e.style.opacity = 0.3;\n });\n var label = document.querySelector(\"#\" + bookClicked.replace(\"Book \", \"HP_0\"));\n label.style.opacity = 1.0;\n label.style.fontWeight = \"bold\";\n }\n}", "title": "" }, { "docid": "93ec37aff6d298845c319f0344c9f3db", "score": "0.51241595", "text": "function likePost(pid, likes){\r\n var name = 'like' + pid;\r\n document.getElementById(name).innerHTML = (likes + 1) + \" Like(s)\";\r\n document.getElementById(name).style.color = \"rgb(0, 192, 0)\"; \r\n $('#hidden').append($('<div>').load('like.php?pid=' + pid)); \r\n document.getElementById(name).onclick = function(){unlikePost(pid, likes + 1)};\r\n}", "title": "" }, { "docid": "e951505f5556caeb82e16e3bfb4e3b8f", "score": "0.5122423", "text": "function btnLikeOnClick(obj){\n\t// creating ajax object\n\tvar xhttp;\n\tvar idNumber = obj.id.substring((\"LikeBtn_\").length);\n\tvar artist;\n\tvar immg;\n\tif((window.location.href).indexOf(\"viewArtwork.php\")!== -1){\n\t\tartist = document.querySelector('[id=\"description-comments\"] [name=\"nameArtist\"]').value;\n\t\timmg = document.querySelector('[id=\"description-comments\"] [name=\"nameImage\"]').value;\n\t}else{\n\t\tartist = document.querySelector('[id=\"figureWrapper_'+idNumber+'\"] [name=\"nameArtist\"]').value;\n\t\timmg = document.querySelector('[id=\"figureWrapper_'+idNumber+'\"] [name=\"nameImage\"]').value;\n\t}\n\tif (window.XMLHttpRequest) {\n // code for modern browsers\n xhttp = new XMLHttpRequest();\n } else {\n // code for IE6, IE5\n xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n //calback function for the request\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\t\t\t//if status is ok\n\t\t\tvar arrRes = JSON.parse(this.responseText);\n if(arrRes['Result']==0){//finestra di login\n\t\t\t\topenModal('LoginModal');\n }else if(arrRes['Result'] == 1){//like inserito\n obj.classList.add(\"like-btn-added\");\n }else if(arrRes['Result'] == 2){//like rimosso\n obj.classList.remove(\"like-btn-added\");\n }else{//errore\n alert(\"Errore\");\n\t\t\t}\n\t\t\tif((window.location.href).indexOf(\"likedItems.php\")!== -1){\n\t\t\t\tlocation.reload();\n\t\t\t}else if(arrRes['Result'] == 1 || arrRes['Result'] == 2){\n\t\t\t\tupdateLikeCounter(idNumber,artist,immg);\n\t\t\t}\n\t\t\tcloseModal('imgLoader');\n }\n\t};\n\topenModal('imgLoader');\n\t//doing th ajax request\n\txhttp.open(\"POST\", \"giveLike.php\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(\"art=\"+artist+\"&nomeImg=\"+immg);\n}", "title": "" }, { "docid": "f6da5a8e7dcecfba0f47a9aaff3f1c16", "score": "0.5112351", "text": "function buttonEventHandler(e){\n const index = e.target.dataset.index;\n let likeDisplay = document.getElementById(`numb-${index}`)\n let post = filteredPosts[index];\n\n\n let currentLikes = likeDisplay.textContent;\n currentLikes = parseInt(currentLikes, 10)\n const ogLikes = post.likes;\n const addedLikes = ogLikes+1;\n \n if(currentLikes === ogLikes){\n currentLikes++\n likeDisplay.textContent = currentLikes;\n } else if(currentLikes === addedLikes){\n currentLikes--\n likeDisplay.textContent = currentLikes;\n }\n }", "title": "" }, { "docid": "dfcd394c3de336deda81cb32907682a8", "score": "0.51039755", "text": "photographersMedias(data) {\n let media = data.media;\n const id = window.location.search.split(\"id=\")[1];\n let photographer = data.photographers.filter((photographer) => photographer.id == id);\n let galery = new GalleryFactory().builder(media, photographer[0].name);\n this.photoLikes(galery.totalLike, data.photographers);\n new Likes();\n }", "title": "" }, { "docid": "855e6b52aaf41b5f05a263fb02ba6aec", "score": "0.5100956", "text": "onClickTriPopularite() {\n this.sortByLikes()\n trier.prepend(popularite)\n this.initMedia() \n }", "title": "" }, { "docid": "fbcf19d11258f0fafae006bf4295d735", "score": "0.5100906", "text": "function userLike(req, res){\r\n\r\n\tvar userId = req.user.sub;\r\n\t//var publicationId = req.params.id;\r\n\t\r\n\t// res.status(200).send({update:update});\r\n\t \t var query = Like.find({user: userId}).select('publication -_id ');\r\n\r\n query.exec(function (err, UserFind) {\r\n if(err) return res.status(500).send({message: 'Error en la petición'});\r\n if(!UserFind) return res.status(200).send({message: 'No tienes like a '+ publicationId});\r\n return res.status(200).send({encontrado: UserFind});\r\n });\r\n\t\t\r\n\r\n}", "title": "" }, { "docid": "fbdc8ec00d1fcdf2e49614c858101a6d", "score": "0.51005775", "text": "liked(user) {\n this.username = user;\n this.likes = true;\n\n return this;\n }", "title": "" }, { "docid": "4dcd86fb25c55001eaf36a7f4ec34994", "score": "0.5097736", "text": "function ajax(searchItem){\n $.ajax({\n url: queryURL + \"&q=\" + searchItem,\n method: \"GET\"\n }).then(function(response){\n for(i=responseIndex; i<responseIndex+10; i++){\n var divTitleButton = $(\"<div>\")\n var divImgRating = $(\"<div>\")\n var img = $(\"<img>\")\n var rating = $(\"<p>\")\n var title = $(\"<p>\")\n var titleText = response.data[i].title.split(\"GIF\")[0].trim()\n var stillURL = response.data[i].images.fixed_height_still.url\n var animatedURL = response.data[i].images.fixed_height.url\n var ratingText = response.data[i].rating.toUpperCase()\n img.attr(\"still-image\", stillURL)\n img.attr(\"animated-image\", animatedURL)\n img.attr(\"src\", img.attr(\"still-image\"))\n img.attr(\"state\", \"still\")\n img.attr(\"rating\", ratingText)\n\n if(titleText == \"\"){\n titleText=\"untitled\"\n }\n \n img.attr(\"title\", titleText)\n title.html(titleText)\n var button = $(\"<button class='like' title='\" + titleText + \"' rating=\" + ratingText + \" still-image=\" + stillURL + \" animated-image=\" + animatedURL + \" state='still'>&#10084</button>\")\n\n for(j=0; j<likes.length; j++){\n if(likes[j][0] == button.attr(\"still-image\")){\n button.css(\"background\", \"#007BFF\")\n }\n }\n\n title.addClass(\"title\")\n rating.text(\"Rating: \" + ratingText)\n divTitleButton.append(title)\n divTitleButton.append(button)\n divImgRating.append(img)\n divImgRating.append(rating)\n divTitleButton.append(divImgRating)\n $(\"#gifs\").prepend(divTitleButton)\n }\n\n imgClickEvent()\n\t\n $(\".like\").on(\"click\", function(){\n $(this).css(\"background\", \"#007BFF\")\n var likeImages = []\n var img = $(this).attr(\"still-image\")\n \n if(!likesArrayIndexChecker(likes, img)){ //checks if gif is already stored in likes array\n likeImages[0] = $(this).attr(\"still-image\")\n likeImages[1] = $(this).attr(\"animated-image\")\n likeImages[2] = $(this).attr(\"title\")\n likeImages[3] = $(this).attr(\"rating\")\n likes.push(likeImages)\n localStorage.setItem(\"still-image\" + likeCount, likeImages[0])\n localStorage.setItem(\"animated-image\" + likeCount, likeImages[1])\n localStorage.setItem(\"title\" + likeCount, likeImages[2])\n localStorage.setItem(\"rating\" + likeCount, likeImages[3])\n likeCount++\n localStorage.setItem(\"likeCount\", likeCount)\n }\n })\n })\n}", "title": "" }, { "docid": "057024dd5b2b1a170fdb625315e46c3e", "score": "0.5095603", "text": "seeSuggestionNotRefuted({suggestion, player, asker})\n {\n }", "title": "" }, { "docid": "3f1ca83e3386ab72decea5139d7f9201", "score": "0.5090841", "text": "function addLikes(){\n let likeLink = document.getElementsByClassName(\"like-link\");\n\n for (let i = 0; i < likeLink.length; i++) {\n likeLink[i].addEventListener(\"click\", function () {\n likeIncrement(i)\n })\n };\n}", "title": "" }, { "docid": "8f958fb0aa488def8056d191b82d3bd8", "score": "0.5084739", "text": "function likeChecker(){\n // if condition, if the user has liked this then set keyswitch=1, if not then leave it has default keyswitch=0\n let strLikes = sessionStorage.getItem(\"userLikes\");\n let checker = strLikes.includes(city.name);\n if(checker == true){\n keyswitch = 1\n imgHeart.src = \"../misc/Images/favorite-heart-button-click.png\";\n\n }\n\n}", "title": "" }, { "docid": "9a3824858f3c76ffe89b67c4d5ea3b35", "score": "0.508023", "text": "function generatePlaylistLikes() {\n userMode = false;\n playlistMode = true;\n // playlist = [];\n var proxy = 'https://cors-anywhere.herokuapp.com/';\n var userURL = 'https://api-v2.soundcloud.com/users/' + source.id + '/likes?client_id=eiY2lrXv0r5RR6UXfyjrfdwxzmgKqreK&limit=20&offset=0&linked_partitioning=1&app_version=1528191385&app_locale=en';\n var fullURL = proxy + userURL;\n $.get(fullURL, function(data, status) {\n for (var x = 0; x < data.collection.length; x++) {\n if (data.collection[x].playlist) {\n continue;\n }\n var trackID = data.collection[x].track.id;\n if (!(trackID === null)) {\n\n var trackObject = {\n track_id: data.collection[x].track.id.toString(),\n node_id: data.collection[x].track.user.permalink\n };\n playlist.push(trackObject);\n }\n }\n playPlaylist();\n\n });\n}", "title": "" }, { "docid": "0ccb6b1ed371c6a5360d44004775db1f", "score": "0.50755894", "text": "function changePostLikes(){\n\t// This varialbe get the number of likes for the parent Post\n\tvar postLikes = parseInt((document.getElementsByClassName(\"post__info\")[0].childNodes[1].innerText).split(\" \")[0])\n\tconsole.log(window.event)\n\tif (this.innerHTML == \"Like\") {\n\t this.innerText = \"Unlike\";\n\t document.getElementsByClassName(\"post__info\")[0].childNodes[1].innerText = (postLikes + 1) + \" likes\"\n\t} else {\n\t\tthis.innerText = \"Like\";\n\t\tdocument.getElementsByClassName(\"post__info\")[0].childNodes[1].innerText = (postLikes - 1) + \" likes\"\n\t}\n}", "title": "" }, { "docid": "3fae22eeb7d6354c798188ec9dfcc71a", "score": "0.50753844", "text": "get likedImageIDs() {\n return this._likedImageIDs;\n }", "title": "" }, { "docid": "f82d32934a5e5b3606915461981f28f3", "score": "0.5071288", "text": "function addLikeEvent(i) {\n\t\tlikes[i].addEventListener('click', function(){\n\t\t\tif (likes[i].innerHTML == 'Like') {\n\t\t\t\tcounts[i].innerHTML = parseInt(counts[i].innerHTML) + 1;\n\t\t\t\tlikes[i].innerHTML = 'Unlike';\n\t\t\t}\n\t\t\telse if (likes[i].innerHTML == 'Unlike') {\n\t\t\t\tcounts[i].innerHTML = parseInt(counts[i].innerHTML) - 1;\n\t\t\t\tlikes[i].innerHTML = 'Like';\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "70d8de953df9aa7a758904afb1e5ed13", "score": "0.5067837", "text": "addLike(paragraphNumberOfLikes, fullHeart) { \n let numberOfLikes = paragraphNumberOfLikes.textContent; \n let paragraphNumberOfLikeBottom = document.getElementById(\"numberOfLikesBottomCard\");\n let numberOfLikesCardBottom = document.getElementById(\"numberOfLikesBottomCard\").textContent;\n let numberOfLikeCardToNumber = Number(numberOfLikesCardBottom);\n let numberLikeToNumber = Number(numberOfLikes);\n \n if (fullHeart.classList.contains('liked')) {\n fullHeart.classList.remove('liked');\n fullHeart.parentNode.setAttribute(\"aria-label\", \"like\");\n\n let removeLike = numberLikeToNumber - 1;\n let removeLikeBottom = numberOfLikeCardToNumber - 1;\n \n paragraphNumberOfLikeBottom.innerHTML = removeLikeBottom;\n paragraphNumberOfLikes.innerHTML = removeLike;\n }\n else {\n fullHeart.classList.add('liked');\n fullHeart.parentNode.setAttribute(\"aria-label\", \"dislike\");\n let addLike = numberLikeToNumber + 1;\n let addLikeBottom = numberOfLikeCardToNumber + 1;\n\n paragraphNumberOfLikeBottom.innerHTML = addLikeBottom;\n paragraphNumberOfLikes.innerHTML = addLike;\n }\n }", "title": "" }, { "docid": "7b5930933aa1e5883a818e4ec3926b9b", "score": "0.50606036", "text": "function checkLike(str){\n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n } else {\n // code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n //document.getElementById(\"likeImg\").innerHTML = (this.responseText);\n document.getElementById(\"likeImg\").src=(this.responseText.indexOf(\"yes\")> -1 ? \"https://png.icons8.com/color/50//like.png\" : \"https://png.icons8.com/ios/50//like.png\");\n }\n };\n xmlhttp.open(\"GET\",\"/BonziBlog/checkLike?blog=\"+str,true);\n xmlhttp.send();\n getLikes(str);\n}", "title": "" }, { "docid": "11716f57320174dc095b951054669b87", "score": "0.50603956", "text": "function votedLikeSuggestion(id) {\n return {\n type: actions.LIKE_SUGGESTION,\n id\n }\n}", "title": "" }, { "docid": "3120cd3479aca3e3c3caa02e5e7e8e1a", "score": "0.5053942", "text": "function displayTags() {\n const tagList = document.querySelector(\".tag-list\");\n\n photographerList.getAllTags().forEach((tag) => {\n const a = document.createElement(\"a\");\n a.innerHTML = `#<span id=\"portrait href=\"#\" aria-labelledby=\"${tag}\">${tag}</span>`;\n a.classList.add(\"tags-link\");\n a.href = \"#\";\n a.setAttribute(\"aria-labelledby\", `${tag}`);\n tagList.append(a);\n\n //ajoute la classe tag--selected si le tag est selectionner par l'uttilisateur\n a.addEventListener(\"click\", (e) => {\n e.preventDefault();\n a.classList.toggle(\"tag--selected\");\n displayPhotographers();\n });\n });\n}", "title": "" }, { "docid": "9daea079d87b51ffe8efa62c642029a8", "score": "0.5053016", "text": "function increaseLikes(recipeName, callback) {\n console.log(\"increasing likes\");\n\tgetRecipe(recipeName, function(doc) {\n if (doc.status) {\n var query = doc.data.update({$inc: {likes: 1}});\n query.exec(function(err) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(\"failed incrementing the 'like' of recipe\");\n\t\t\t} else {\n\t\t\t\tconsole.log(\"likes updated\");\n\t\t\t}\n callback();\n });\n } else {\n callback();\n }\n\n\t});\n}", "title": "" }, { "docid": "b7a61c14910241682cdb355977cf1d28", "score": "0.5051168", "text": "function postLike(clicked_id,is_liked) {\n const params = new URLSearchParams();\n params.append('id', clicked_id);\n params.append('is_liked', is_liked);\n fetch('/like', {\n method: 'POST',\n body: params\n });\n}", "title": "" }, { "docid": "3de96ac638eaf17ad3b3fb75af3622a3", "score": "0.504389", "text": "function bufferLikers(){\r\n\t\tif(that.mode ===\"findWhoLikedMe\")\r\n\t\t\tlikesBuff = likesBuff+10;\r\n\t\tfor(var i = 0; i< that.likers.length; i++){\r\n\t\t\tif(i > likesBuff )\r\n\t\t\t\treturn;\r\n\t\t\tif(that.likers[i].refs === undefined){\r\n\t\t\t\tthat.likers[i].refs = null;\r\n\t\t\t\tR.request('getVideoRefs',{FromFbId:that.likers[i].FbId,Type:\"findWhoLikedMe\"});\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "07a67018a1a1b185dfb0a96606876997", "score": "0.50336015", "text": "function doClickLike() {\n\tif ( $('div[tabindex=\"0\"] g[id*=\"Icon---Like---Filled\"]').length) {\n\t\tconsole.log('Photo already liked. Skipping…');\n\t} else {\n\t\tconsole.log('Like the photo…');\n\t\t$('div[tabindex=\"0\"]').click(); \n\t}\n}", "title": "" }, { "docid": "1ddac20ce4c842ed1c70ce6ec41ff8e0", "score": "0.50297254", "text": "seeSuggestionRefuted({suggestion, player, asker})\n {\n }", "title": "" }, { "docid": "08987f1b22f429824891b2a69cb983f6", "score": "0.50245863", "text": "function show_male_stars() {\n\n // YOUR CODE GOES HERE\n\n}", "title": "" }, { "docid": "f703c5364dcbd23a76079b6bce0d04b7", "score": "0.5022805", "text": "onLikeClick(newsId, userId, isNewsLiked, likeId) {\n if (!isNewsLiked) {\n this.props.addLike(newsId, userId);\n } else {\n this.props.removeLike(newsId, likeId);\n }\n }", "title": "" }, { "docid": "055cc9d1fea7c6bcd2b7cf03b6542b21", "score": "0.5014352", "text": "function bufferMyLikes(){\r\n\t\tif(that.mode ===\"findWhoILike\")\r\n\t\t\tlikesBuff = likesBuff+10;\r\n\t\tfor(var i = 0; i< that.myLikes.length; i++){\r\n\t\t\tif(i > likesBuff )\r\n\t\t\t\treturn;\r\n\t\t\tif(that.myLikes[i].refs === undefined){\r\n\t\t\t\tthat.myLikes[i].refs = null;\r\n\t\t\t\tR.request('getVideoRefs',{FromFbId:that.myLikes[i].FbId,Type:\"findWhoILike\"});\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "2b03dc5c0cea414228d9e10303268475", "score": "0.5007383", "text": "function decreaseLikes(recipeName, callback) {\n\tgetRecipe(recipeName, function(doc) {\n if (doc.data) {\n if (doc.data.likes == 0) {\n callback();\n return;\n }\n var query = doc.data.update({$inc: {likes: -1}});\n query.exec(function(err) {\n if (err) {\n console.log(\"failed decrementing the 'like' of recipe\");\n } else {\n console.log(\"likes decremented\");\n }\n callback();\n });\n } else {\n callback();\n }\n\t});\n}", "title": "" }, { "docid": "bb3b24ed5af7bb7e4776a455f00a0547", "score": "0.49949902", "text": "function hate() {\n this.timesLiked--;\n}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "cf31bfb59e388d54f98be84a6b29c324", "score": "0.0", "text": "function t(e,t,n,r){var a={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?a[n][0]:a[n][1]}", "title": "" } ]
[ { "docid": "d8460bf77dfc9523fd479119f87673fb", "score": "0.81861687", "text": "function b(e,t,n){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}//! moment.js locale configuration", "title": "" }, { "docid": "5ff7aeb025d12d929a891e2b4ed47883", "score": "0.8174944", "text": "function Et(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": "14df87e37e72aaa9a3cad75b77785f57", "score": "0.7834773", "text": "initMoment () {\n if (!window.g_locale) {\n console.warn('window.g_locale must be set to use moment')\n window.g_locale = 'pt-br'\n }\n\n moment.locale(window.g_locale)\n }", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548552", "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.7548552", "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.7548552", "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": "c90316409017a609d767bb60f1ce89ab", "score": "0.7203879", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.7203879", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198865", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198865", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71706426", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71706426", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71706426", "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": "d11d49c1c0d4ff5684649e17cdef56d0", "score": "0.71330065", "text": "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "title": "" }, { "docid": "624274bb49bbbf84b221d4e36a2c0cf7", "score": "0.7066888", "text": "setLocaleForMoment() {\n if (\n moment.locale() !== window.navigator.language.toLowerCase()\n ) {\n moment.locale(window.navigator.language.toLowerCase());\n }\n }", "title": "" }, { "docid": "f619fe7c32d9997fd0720a00170897bc", "score": "0.6982518", "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": "f1307362c66d5698b7eabf78c9623281", "score": "0.6914485", "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": "c477ab3af3288e1e6e890689a64eb33e", "score": "0.68943167", "text": "extend(config /** ctx */) {\n // Убираем неиспользуемые локали\n config.plugins.push(new MomentLocalesPlugin())\n config.plugins.push(\n new MomentLocalesPlugin({\n localesToKeep: ['ru', 'en-gb']\n })\n )\n }", "title": "" }, { "docid": "55c88c24b6b105b827074d9323684d09", "score": "0.6725686", "text": "function localize() {\n // localize event types\n $q($alpbros.MTBEventTypes).ForEach(function (x) { return $.extend(x.Value, $alpbros.$res.eventTypes[x.Key]); });\n // localize moment\n moment.locale($cfg.lang);\n }", "title": "" }, { "docid": "600ee32f0b98d33d4addc0f0662160a5", "score": "0.6351852", "text": "static set locale(value) { _locale = value; }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.63343", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "19be4983393cdcd650db1481b06eb5ce", "score": "0.62888443", "text": "setLocale(momentInstance) {\n if (this.props.locale) {\n momentInstance.locale(this.props.locale.name);\n }\n return momentInstance;\n }", "title": "" }, { "docid": "f52054b9222ff6c9bba09e5d32cf86eb", "score": "0.6284092", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62760717", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "6109562cd0fa822fae3eca1dc1761287", "score": "0.62530357", "text": "function currentDateFormats() {\n return languageMap['en-us'];\n }", "title": "" }, { "docid": "adcc913e630b32d664a1d57f2dbf099f", "score": "0.6218408", "text": "async Language() {\n await getSettings()\n .then((settings) => {\n // // console.log('Settings', settings)\n if (settings) {\n if (settings.language) {\n setI18nConfig(\"ar\");\n moment.locale(\"ar\", momentConf.config);\n this.forceUpdate();\n } else {\n setI18nConfig(\"en\");\n moment.locale(\"en\", anLocale);\n this.forceUpdate();\n }\n } else {\n const deviceLanguage =\n Platform.OS === \"ios\"\n ? NativeModules.SettingsManager.settings.AppleLocale ||\n NativeModules.SettingsManager.settings.AppleLanguages[0] //iOS 13\n : NativeModules.I18nManager.localeIdentifier;\n\n console.log(\n \"deviceLanguage\",\n deviceLanguage.toString().split(\"_\")[0]\n );\n\n if (\n deviceLanguage\n .toString()\n .split(\"-\")[0]\n .toString()\n .trim() === \"ar\"\n ) {\n console.log(\"deviceLanguage\", \"ar\");\n moment.locale(\"ar\", momentConf.config);\n moment.locale(\n deviceLanguage.toString().split(\"_\")[0],\n momentConf.config\n );\n setI18nConfig(deviceLanguage.toString().split(\"_\")[0]);\n } else {\n console.log(\"deviceLanguage\", \"en\");\n moment.locale(\"en\", anLocale);\n moment.locale(deviceLanguage.toString().split(\"_\")[0], anLocale);\n setI18nConfig(deviceLanguage.toString().split(\"_\")[0]);\n }\n\n this.forceUpdate();\n }\n })\n .catch((error) => {\n const deviceLanguage =\n Platform.OS === \"ios\"\n ? NativeModules.SettingsManager.settings.AppleLocale ||\n NativeModules.SettingsManager.settings.AppleLanguages[0] //iOS 13\n : NativeModules.I18nManager.localeIdentifier;\n\n console.log(\"Error deviceLanguage\", error);\n\n setI18nConfig(\"en\");\n moment.locale(\"en\", anLocale);\n this.forceUpdate();\n });\n }", "title": "" }, { "docid": "3ea6c186e6b8d07daba84558e0f880f7", "score": "0.6191513", "text": "function getSetGlobalLocale(key, values) {\r\n var data\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key)\r\n } else {\r\n data = defineLocale(key, values)\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data\r\n } else {\r\n if (typeof console !== 'undefined' && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn(\r\n 'Locale ' + key + ' not found. Did you forget to load it?'\r\n )\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr\r\n }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.618254", "text": "function ApexLocale() { }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.618254", "text": "function ApexLocale() { }", "title": "" }, { "docid": "891d84bf152f46a4f6b025a202995018", "score": "0.61708194", "text": "function addLocales() {\n datepicker.regional[\"de\"] = {\n closeText: \"Schließen\",\n prevText: \"&#x3C;Zurück\",\n nextText: \"Vor&#x3E;\",\n currentText: \"Heute\",\n monthNames: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\",\n \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\n monthNamesShort: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\",\n \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\n dayNames: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"],\n dayNamesShort: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\n dayNamesMin: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\n weekHeader: \"KW\",\n dateFormat: \"dd.mm.yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"en\"] = {\n closeText: \"Done\",\n prevText: \"Prev\",\n nextText: \"Next\",\n currentText: \"Today\",\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n weekHeader: \"Wk\",\n dateFormat: \"dd/mm/yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"es\"] = {\n closeText: \"Cerrar\",\n prevText: \"&#x3C;Ant\",\n nextText: \"Sig&#x3E;\",\n currentText: \"Hoy\",\n monthNames: [\"enero\", \"febrero\", \"marzo\", \"abril\", \"mayo\", \"junio\",\n \"julio\", \"agosto\", \"septiembre\", \"octubre\", \"noviembre\", \"diciembre\"],\n monthNamesShort: [\"ene\", \"feb\", \"mar\", \"abr\", \"may\", \"jun\",\n \"jul\", \"ago\", \"sep\", \"oct\", \"nov\", \"dic\"],\n dayNames: [\"domingo\", \"lunes\", \"martes\", \"miércoles\", \"jueves\", \"viernes\", \"sábado\"],\n dayNamesShort: [\"dom\", \"lun\", \"mar\", \"mié\", \"jue\", \"vie\", \"sáb\"],\n dayNamesMin: [\"D\", \"L\", \"M\", \"X\", \"J\", \"V\", \"S\"],\n weekHeader: \"Sm\",\n dateFormat: \"dd/mm/yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"fr\"] = {\n closeText: \"Fermer\",\n prevText: \"Précédent\",\n nextText: \"Suivant\",\n currentText: \"Aujourd’hui\",\n monthNames: [\"janvier\", \"février\", \"mars\", \"avril\", \"mai\", \"juin\",\n \"juillet\", \"août\", \"septembre\", \"octobre\", \"novembre\", \"décembre\"],\n monthNamesShort: [\"janv.\", \"févr.\", \"mars\", \"avr.\", \"mai\", \"juin\",\n \"juil.\", \"août\", \"sept.\", \"oct.\", \"nov.\", \"déc.\"],\n dayNames: [\"dimanche\", \"lundi\", \"mardi\", \"mercredi\", \"jeudi\", \"vendredi\", \"samedi\"],\n dayNamesShort: [\"dim.\", \"lun.\", \"mar.\", \"mer.\", \"jeu.\", \"ven.\", \"sam.\"],\n dayNamesMin: [\"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\"],\n weekHeader: \"Sem.\",\n dateFormat: \"dd/mm/yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"it\"] = {\n closeText: \"Chiudi\",\n prevText: \"&#x3C;Prec\",\n nextText: \"Succ&#x3E;\",\n currentText: \"Oggi\",\n monthNames: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\",\n \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\n monthNamesShort: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\",\n \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\n dayNames: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\n dayNamesShort: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"],\n dayNamesMin: [\"Do\", \"Lu\", \"Ma\", \"Me\", \"Gi\", \"Ve\", \"Sa\"],\n weekHeader: \"Sm\",\n dateFormat: \"dd/mm/yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"ja\"] = {\n closeText: \"閉じる\",\n prevText: \"&#x3C;前\",\n nextText: \"次&#x3E;\",\n currentText: \"今日\",\n monthNames: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\",\n \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\n monthNamesShort: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\",\n \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\n dayNames: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\n dayNamesShort: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"],\n dayNamesMin: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"],\n weekHeader: \"週\",\n dateFormat: \"yy/mm/dd\",\n firstDay: 0,\n isRTL: false,\n showMonthAfterYear: true,\n yearSuffix: \"年\"\n };\n datepicker.regional[\"ko\"] = {\n closeText: \"닫기\",\n prevText: \"이전달\",\n nextText: \"다음달\",\n currentText: \"오늘\",\n monthNames: [\"1월\", \"2월\", \"3월\", \"4월\", \"5월\", \"6월\",\n \"7월\", \"8월\", \"9월\", \"10월\", \"11월\", \"12월\"],\n monthNamesShort: [\"1월\", \"2월\", \"3월\", \"4월\", \"5월\", \"6월\",\n \"7월\", \"8월\", \"9월\", \"10월\", \"11월\", \"12월\"],\n dayNames: [\"일요일\", \"월요일\", \"화요일\", \"수요일\", \"목요일\", \"금요일\", \"토요일\"],\n dayNamesShort: [\"일\", \"월\", \"화\", \"수\", \"목\", \"금\", \"토\"],\n dayNamesMin: [\"일\", \"월\", \"화\", \"수\", \"목\", \"금\", \"토\"],\n weekHeader: \"주\",\n dateFormat: \"yy. m. d.\",\n firstDay: 0,\n isRTL: false,\n showMonthAfterYear: true,\n yearSuffix: \"년\"\n };\n datepicker.regional[\"nl\"] = {\n closeText: \"Sluiten\",\n prevText: \"←\",\n nextText: \"→\",\n currentText: \"Vandaag\",\n monthNames: [\"januari\", \"februari\", \"maart\", \"april\", \"mei\", \"juni\",\n \"juli\", \"augustus\", \"september\", \"oktober\", \"november\", \"december\"],\n monthNamesShort: [\"jan\", \"feb\", \"mrt\", \"apr\", \"mei\", \"jun\",\n \"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"dec\"],\n dayNames: [\"zondag\", \"maandag\", \"dinsdag\", \"woensdag\", \"donderdag\", \"vrijdag\", \"zaterdag\"],\n dayNamesShort: [\"zon\", \"maa\", \"din\", \"woe\", \"don\", \"vri\", \"zat\"],\n dayNamesMin: [\"zo\", \"ma\", \"di\", \"wo\", \"do\", \"vr\", \"za\"],\n weekHeader: \"Wk\",\n dateFormat: \"dd-mm-yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"pt\"] = {\n closeText: \"Fechar\",\n prevText: \"Anterior\",\n nextText: \"Seguinte\",\n currentText: \"Hoje\",\n monthNames: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\",\n \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\n monthNamesShort: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\",\n \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\n dayNames: [\"Domingo\", \"Segunda-feira\", \"Terça-feira\", \"Quarta-feira\", \"Quinta-feira\", \"Sexta-feira\", \"Sábado\"],\n dayNamesShort: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sáb\"],\n dayNamesMin: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sáb\"],\n weekHeader: \"Sem\",\n dateFormat: \"dd/mm/yy\",\n firstDay: 0,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"ru\"] = {\n closeText: \"Закрыть\",\n prevText: \"&#x3C;Пред\",\n nextText: \"След&#x3E;\",\n currentText: \"Сегодня\",\n monthNames: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\",\n \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"],\n monthNamesShort: [\"Янв\", \"Фев\", \"Мар\", \"Апр\", \"Май\", \"Июн\",\n \"Июл\", \"Авг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\n dayNames: [\"воскресенье\", \"понедельник\", \"вторник\", \"среда\", \"четверг\", \"пятница\", \"суббота\"],\n dayNamesShort: [\"вск\", \"пнд\", \"втр\", \"срд\", \"чтв\", \"птн\", \"сбт\"],\n dayNamesMin: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"],\n weekHeader: \"Нед\",\n dateFormat: \"dd.mm.yy\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.regional[\"zh\"] = {\n closeText: \"关闭\",\n prevText: \"&#x3C;上月\",\n nextText: \"下月&#x3E;\",\n currentText: \"今天\",\n monthNames: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\",\n \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\n monthNamesShort: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\",\n \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\n dayNames: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\n dayNamesShort: [\"周日\", \"周一\", \"周二\", \"周三\", \"周四\", \"周五\", \"周六\"],\n dayNamesMin: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"],\n weekHeader: \"周\",\n dateFormat: \"yy-mm-dd\",\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: true,\n yearSuffix: \"年\"\n };\n }", "title": "" }, { "docid": "b4a1c6e02ac350abb861b02c1aa3660d", "score": "0.61469436", "text": "function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(Array.isArray(e)?e:[e]).forEach(function(e){e&&e.locale&&(i.a.__addLocaleData(e),s.a.__addLocaleData(e))})}", "title": "" }, { "docid": "e04dea0cc73f3d75bb227bca82bffdb3", "score": "0.61434174", "text": "function getSetGlobalLocale(key, values) {\n var data\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key)\n } else {\n data = defineLocale(key, values)\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data\n } else {\n if (\n typeof console !== 'undefined' &&\n console.warn\n ) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' +\n key +\n ' not found. Did you forget to load it?',\n )\n }\n }\n }\n\n return globalLocale._abbr\n }", "title": "" }, { "docid": "8771185141d2f06aecf4373685d2a0a7", "score": "0.6119424", "text": "static get isLocale() {return true;}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60918134", "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.60918134", "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.60918134", "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.60918134", "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": "a494f3e2696319451ee3811435fd71a2", "score": "0.60840297", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "8f2dec80f30de9b816173933f5b8e1ea", "score": "0.608021", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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": "b3683845d413bb1d4d26c70b7e1f3259", "score": "0.6079904", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n\t data = getLocale(key);\n } else {\n\t data = defineLocale(key, values);\n }\n \n if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n } 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(\n\t 'Locale ' + key + ' not found. Did you forget to load it?'\n\t );\n\t }\n }\n }\n \n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\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": "" } ]
6191aac083bb67950abf9bb03920e97b
r = gcd(b1,b2) BigNat > BigNat > BigNat
[ { "docid": "dc5092efe9536dd95615d7e8c7e85c65", "score": "0.772072", "text": "function h$ghcjsbn_gcd_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"gcd_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"gcd_bb b2\");\n var r;\n if(h$ghcjsbn_cmp_bb(b1, b2) === 2) {\n r = b1;\n b1 = b2;\n b2 = r;\n }\n while(b1[0] > 0) {\n r = h$ghcjsbn_rem_bb(b2, b1);\n b2 = b1;\n b1 = r;\n }\n h$ghcjsbn_assertValid_b(b2, \"gcd_bb result\");\n return b2;\n}", "title": "" } ]
[ { "docid": "526cf3ba6c3e93a087d81f95fd76f985", "score": "0.77312136", "text": "function gcd(a, b) {\n var R;\n var e = 0.1;\n while ((a % b) > e) {\n R = a % b;\n a = b;\n b = R;\n }\n return b;\n}", "title": "" }, { "docid": "0c34b9b93e007e71677acf2094d6585a", "score": "0.762339", "text": "function gcd(a, b){\n return !b ? a : gcd( b, a%b );\n}", "title": "" }, { "docid": "e2795b60626067a741eb959a68d5dac1", "score": "0.759221", "text": "function gcd(a, b) \n { \n if (b === 0) { \n return a;\n }\n return gcd(b, a % b); \n }", "title": "" }, { "docid": "c0e94bc9181c0cd180fad473ee7f92a6", "score": "0.7574892", "text": "function gcd(a, b) {\n\t return !b ? a : gcd(b, a % b);\n\t}", "title": "" }, { "docid": "09ecfb788e677cbed788fa72cd7996a3", "score": "0.7542414", "text": "function gcd(a, b) {\n return b ? gcd(b, a % b) : a;\n}", "title": "" }, { "docid": "6aecfbdd8fc24e6fedf6aa005aab1897", "score": "0.7540406", "text": "function gcd( a, b)\n{\n // 令 a 比 b 大,比較容易思考。\n if (b == 0)\n return a;\n else\n return gcd(b, a % b);\n}", "title": "" }, { "docid": "9c47c5fdd71f98a55166f4f90addb7a9", "score": "0.75374633", "text": "function gcd(a, b) {\n //this returns the result.\n if(b === 0) {\n return a;\n } else {\n //this emulates the algorithm\n return gcd(b, a % b);\n }\n}", "title": "" }, { "docid": "5e02b6eaf1b3082937d32d58d81f68cb", "score": "0.749984", "text": "function gcd(a, b) {\n if (b === 0) {\n return a;\n }\n return gcd(b, a % b);\n}", "title": "" }, { "docid": "f6f86b9c6f493a4170672bed2aa38bfe", "score": "0.74967176", "text": "function gcd(a, b) {\n if (a < 0) a = -a;\n if (b < 0) b = -b;\n\n if (b > a) {\n ;\n var _ref = [b, a];\n a = _ref[0];\n b = _ref[1];\n }\n\n while (true) {\n if (b === 0) return a;\n a %= b;\n if (a === 0) return b;\n b %= a;\n }\n}", "title": "" }, { "docid": "85f4e7e7704ab27c9d0e8c401abfed7e", "score": "0.74895674", "text": "function gcd(a, b) {\n console.log(`gcd(${a}, ${b})`)\n while (a !== b && a !== 0 && b !== 0) {\n if (a > b) { a -= ~~(a/b) * b }\n if (b > a) { b -= ~~(b/a) * a }\n }\n\n console.log(`= ${Math.max(a,b)}`)\n return Math.max(a,b)\n}", "title": "" }, { "docid": "a3e1faa5e3a1a9f8b948bba2c3f2b19f", "score": "0.7479459", "text": "function gcd(a, b) {\n if (b === 0)\n return a;\n return gcd(b, a % b);\n}", "title": "" }, { "docid": "50cd92cb6fb64b695f0fd34c6dead375", "score": "0.74226433", "text": "function gcd(a, b) {\n if (a < b) {\n return gcd(b, a);\n } else if (b === 0) {\n return a;\n } else {\n return gcd(b, a % b);\n }\n}", "title": "" }, { "docid": "e62221e1105903b50a9daddbe91a9de9", "score": "0.7394896", "text": "function gcd(a, b) {\n if (a === 0) {\n return b;\n } else if (b === 0) {\n return a;\n } else {\n remainder = a % b;\n a = b;\n b = remainder;\n return gcd(a, b);\n }\n}", "title": "" }, { "docid": "4ee89e53327908346f95aa8320a25f86", "score": "0.7391208", "text": "function gcd(a, b) {\n while (b != 0) {\n let c = b;\n b = a % b;\n a = c;\n }\n return a;\n}", "title": "" }, { "docid": "47446d882d6c8082927aa60425dedc09", "score": "0.738883", "text": "function gcd(a, b) {\n if (b == 0)\n return a;\n else\n return gcd(b, (a % b));\n}", "title": "" }, { "docid": "c4c714a186f3672c43d0c5264fe349b0", "score": "0.73691374", "text": "function gcd(a, b) {\n if (a % b != 0)\n return gcd(b, a % b);\n else\n return b;\n}", "title": "" }, { "docid": "464d1e8abb20bce80e9c6328639615b1", "score": "0.73397684", "text": "function gcd(a, b){\r\n\t\t\tif(a>b){ \t\t\t\t\t\t\t\t\t\t//Assumed in gcd that a has the small value and b has the bigger value so swap to meet that condition.\r\n\t\t\t\tvar temp; \r\n\t\t\t\ttemp = a;\r\n\t\t\t\ta = b;\r\n\t\t\t\tb = temp;\r\n\t\t\t}\r\n\t\t\twhile(a!=0){\t\t\t\t\t\t\t\t\t/*euler states*/\r\n\t\t\t\tvar c = b%a\r\n\t\t\t\tb = a;\r\n\t\t\t\ta = c;\r\n\t\t\t}\r\n\t\t\t\treturn b;\r\n\t\t\t}", "title": "" }, { "docid": "10ef33370b5e52d8f755e9f41c8d87d8", "score": "0.73283434", "text": "function gcd(a,b) { // Type checking for a and b has been omitted\n var t; // Temporary variable for swapping values\n if (a < b) t=b, b=a, a=t; // Ensure that a >= b\n while(b != 0) t=b, b = a%b, a=t; // This is Euclid's algorithm for GCD\n return a;\n}", "title": "" }, { "docid": "61cd774edaebf06e0a28531a98cc156b", "score": "0.7244126", "text": "function gcd(a, b) {\n while (b != 0) {\n save = b\n b = a % b\n a = save\n }\n return a\n}", "title": "" }, { "docid": "a8c024c43c3ba2c00781b4efaec3d90e", "score": "0.72168803", "text": "function gcd(a, b) {\n // uses Euclid's algorithm (https://en.wikipedia.org/wiki/Greatest_common_divisor)\n if (!b) {\n return a;\n }\n\n return gcd(b, a % b);\n}", "title": "" }, { "docid": "d5f28039a73f5113e50183a6cf57213a", "score": "0.718669", "text": "static gcd(a, b) {\n return (b === 0) ? a : MathUtil.gcd(b, a % b);\n }", "title": "" }, { "docid": "e570fa6f44784e6647e579d33361b612", "score": "0.718108", "text": "function gcd(num1, num2) {\n var min = Math.min(num1, num2);\n var max = Math.max(num1, num2);\n if (max % min === 0) return min;\n else return gcd(min, max % min);\n}", "title": "" }, { "docid": "6cea1f7b9ba04ef7868ab59aca274a15", "score": "0.71782804", "text": "function gcd(a, b) {\n // Type checking for a and b has been omitted\n if (a < b) {\n // Ensure that a >= b when we start\n [a, b] = [b, a]; // Destructuring assignment to swap variables\n }\n while (b !== 0) {\n // This is Euclid's algorithm for GCD\n [a, b] = [b, a % b];\n }\n return a;\n}", "title": "" }, { "docid": "39bd1be802c4c046d372e9cfb950f41d", "score": "0.7045537", "text": "function _gcd(a, b) {\n if (b == 0)\n return a;\n return _gcd(b, a % b);\n}", "title": "" }, { "docid": "da10093324cf27ec79786bb9a8e481b2", "score": "0.703772", "text": "function gcd(a, b) {\n if (!b) {\n return a;\n }\n if (gcd(b, a % b) !== undefined) {\n console.log(gcd(b, a % b));\n }\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "755f5cfc1df715eda14b341303fda8d9", "score": "0.7004438", "text": "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "title": "" }, { "docid": "3282b3f8fdccc6684f83e476c67965e5", "score": "0.70039743", "text": "static extgcd(a,b) { \n if (b === 0) {\n let x = 1;\n let y = 0;\n return {a,x,y};\n }\n const ext = this.extgcd(b, a % b);\n return {\n a: ext.a,\n x: ext.y,\n y: ext.x - (a / b)|0 * ext.y\n };\n }", "title": "" }, { "docid": "0fa29fb88a51549eaa5418aecfca44b7", "score": "0.7001365", "text": "function gcd(small, big) { //iterative\n if (small === 0) {\n return big;\n } else {\n const remainder = big % small;\n return gcd(remainder, small);\n }\n}", "title": "" }, { "docid": "b282a1318c292b6af389a75e2035bd45", "score": "0.6979374", "text": "function gcd_more_than_two_numbers(input) { \n var len, a, b;\n len = input.length;\n if ( !len ) {\n return null;\n }\n a = input[ 0 ];\n for ( var i = 1; i < len; i++ ) {\n b = input[ i ];\n a = gcd_two_numbers( a, b );\n }\n \n return a;\n }", "title": "" }, { "docid": "33f03cb4c0194ffd05b5977342de5290", "score": "0.69698036", "text": "function gcd(num1, num2) {\n if (num2 === 0) {\n return num1\n }\n return gcd(num2, num1 % num2)\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "ad7890a3601d46fef90e566fbc279d3b", "score": "0.6949335", "text": "function h$ghcjsbn_gcd_ww(w1, w2) {\n h$ghcjsbn_assertValid_w(w1, \"gcd_ww w1\");\n h$ghcjsbn_assertValid_w(w2, \"gcd_ww w2\");\n var a, b, r;\n a = w1 < 0 ? (w1 + 4294967296) : w1;\n b = w2 < 0 ? (w2 + 4294967296) : w2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n b = b|0;\n h$ghcjsbn_assertValid_w(b, \"gcd_ww result\");\n return b;\n}", "title": "" }, { "docid": "0c41113a1be2099e4d0efc5e225d65fa", "score": "0.6943261", "text": "function gcd(firstNum, secondNum){\n\n if(!secondNum){\n return firstNum\n }\n\n return gcd(secondNum, firstNum%secondNum)\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "27dc1c62ee04c953345eaea0f1adc397", "score": "0.6923434", "text": "function bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}", "title": "" }, { "docid": "d59f3e2424cbe8bb11e8975cc8fbfa53", "score": "0.6901932", "text": "function gcd(x, y) {\n while (y != 0) {\n var z = x % y;\n x = y;\n y = z;\n }\n return x;\n}", "title": "" }, { "docid": "17b151da816fb4678034b04f94cfb193", "score": "0.688136", "text": "function GCD (a,b){\r\n var rest=0;\r\n while (a%b!=0){\r\n rest= a%b;\r\n a=b;\r\n b=rest;\r\n }\r\n return b;\r\n}", "title": "" }, { "docid": "f2198916440663f73addc16aab02cd32", "score": "0.6871242", "text": "function gcd(arr){\n if(arr.length != 2){\n throw new TypeError('arr length expect 2');\n }\n const x = arr[0];\n const y = arr[1];\n if( typeof x !== 'number' || typeof y !== 'number'){\n throw new TypeError('arr expect number');\n }\n\n return _gcd(x,y);\n}", "title": "" }, { "docid": "ed5c7315f1b084a0afcf3873ddcd8a8d", "score": "0.6863376", "text": "function gcd(firstNumber, secondNumber) {\n var hasil = 0;\n for (var i = 1; i < firstNumber; i++) {\n if (firstNumber % i === 0 && secondNumber % i === 0) {\n hasil = i;\n }\n }\n return hasil;\n}", "title": "" }, { "docid": "3d03083062154e7009d0b95df32e4026", "score": "0.6852981", "text": "function gcd (x, y) {\n while (y !== 0) {\n let z = x % y;\n x = y;\n y = z;\n }\n return x;\n}", "title": "" }, { "docid": "db8903efa8aef46139c4313269b61dff", "score": "0.6832958", "text": "function gcd(num1,num2) {\n if(num2 === 0){\n return num1;\n }else{\n let remainder = num1%num2\n return gcd(num2,remainder)\n }\n }", "title": "" }, { "docid": "a54d5ba0f46026084d324799b7274ea6", "score": "0.6824702", "text": "function greatestCD(a , b){\n var divisor =2;\n var gcd = 1;\n\n //smallest gcd is 1\n if ( a < 2 || b < 2){\n return 1;\n }\n while(a >= divisor && b >= divisor){\n if(a % divisor == 0 && b % divisor == 0){\n gcd = divisor;\n }\n divisor++;\n }\n return gcd;\n}", "title": "" }, { "docid": "0422fc39b172ae8d08a04c80aeb2795b", "score": "0.68226737", "text": "function GCD(a, b) {\n if (a === 0) {\n return b\n } else if (b === 0) {\n return a\n }\n\n for(var i = Math.min(a,b); ; i--) {\n if (a % i === 0 && b % i === 0) {\n return i\n }\n }\n}", "title": "" }, { "docid": "6cd122b41aaeec5a6c957866ef2dd925", "score": "0.6796521", "text": "function GCD(a, b){\n if (b === 0) {\n return a;\n } else {\n return GCD(b, a % b);\n }\n}", "title": "" }, { "docid": "73cce53cddd5e8bd0bf78dd91a4bac3a", "score": "0.6788215", "text": "function gcd(num1,num2) {\n\tif (num1=num2) {\n\t\treturn num1;\n\t}\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "ab8a943d900c7e788bbb5fe51429a68e", "score": "0.67662644", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone()\n var y = (a.s < 0) ? a.negate() : a.clone()\n if (x.compareTo(y) < 0) {\n var t = x\n x = y\n y = t\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit()\n if (g < 0) return x\n if (i < g) g = i\n if (g > 0) {\n x.rShiftTo(g, x)\n y.rShiftTo(g, y)\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x)\n x.rShiftTo(1, x)\n } else {\n y.subTo(x, y)\n y.rShiftTo(1, y)\n }\n }\n if (g > 0) y.lShiftTo(g, y)\n return y\n}", "title": "" }, { "docid": "c900bb073fa85281cd4be14abf5456fb", "score": "0.67550325", "text": "function rGCF(num1,num2)\n{\n if(num1 === num2)\n {\n return num1\n }\n if(num1 > num2)\n {\n if(num1 % num2 === 0)\n {\n return num2\n }\n return rGCF((num1 % num2),num2)\n }\n if(num2 > num1)\n {\n if(num2 % num1 === 0)\n {\n return num1\n }\n return rGCF(num1,(num2 % num1))\n }\n}", "title": "" }, { "docid": "4a3979fa91d16f2c03862632476bd616", "score": "0.6750059", "text": "function gcd(x,y){\n if (y==0){\n return x;\n }\n else{\n return gcd(y, (x%y));\n } \n }", "title": "" }, { "docid": "0fdf7e4de38efbe3f24c91f204b317a4", "score": "0.6743992", "text": "function gcd(x, y) {\r\n if (y === 0)\r\n return x;\r\n else\r\n return gcd(y, x%y);\r\n }", "title": "" }, { "docid": "3cfb938d60f8a3f02688e5aa55a5cbf3", "score": "0.6741825", "text": "function bnGCD(a) {\r\n var x = (this.s<0)?this.negate():this.clone();\r\n var y = (a.s<0)?a.negate():a.clone();\r\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\r\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\r\n if(g < 0) return x;\r\n if(i < g) g = i;\r\n if(g > 0) {\r\n x.rShiftTo(g,x);\r\n y.rShiftTo(g,y);\r\n }\r\n while(x.signum() > 0) {\r\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\r\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\r\n if(x.compareTo(y) >= 0) {\r\n x.subTo(y,x);\r\n x.rShiftTo(1,x);\r\n }\r\n else {\r\n y.subTo(x,y);\r\n y.rShiftTo(1,y);\r\n }\r\n }\r\n if(g > 0) y.lShiftTo(g,y);\r\n return y;\r\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "3690ddefd8abdebdcb4b7354b07e6810", "score": "0.67416304", "text": "function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n}", "title": "" }, { "docid": "051746714135d6fd8fbd51797c9b72de", "score": "0.6721932", "text": "function bnGCD(a) {\n var x = (this.s < 0) ? this.negate() : this.clone();\n var y = (a.s < 0) ? a.negate() : a.clone();\n if (x.compareTo(y) < 0) {\n var t = x;\n x = y;\n y = t;\n }\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit();\n if (g < 0) return x\n if (i < g) g = i;\n if (g > 0) {\n x.rShiftTo(g, x);\n y.rShiftTo(g, y);\n }\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x);\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y);\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x);\n x.rShiftTo(1, x);\n } else {\n y.subTo(x, y);\n y.rShiftTo(1, y);\n }\n }\n if (g > 0) y.lShiftTo(g, y);\n return y\n}", "title": "" } ]
d3b9224a6c05bae7be74c53073402a3b
Remove words from the sentence if it contains one exclamation mark. Words are separated by spaces in the sentence. Please remember, one. Examples: remove("Hi!") === "" remove("Hi! Hi!") === "" remove("Hi! Hi! Hi!") === "" remove("Hi Hi! Hi!") === "Hi" remove("Hi! !Hi Hi!") === "" remove("Hi! Hi!! Hi!") === "Hi!!" remove("Hi! !Hi! Hi!") === "!Hi!"
[ { "docid": "49ddb840fd882062c2102c2aa7e587fc", "score": "0.72430944", "text": "function remove(s) {\n var sSplit = s.split(' ');\n var output = [];\n var bangCount = 0;\n for (var i=0; i<sSplit.length; i++) {\n for (var a=0; a<sSplit[i].length; a++) {\n if (sSplit[i][a] === '!') {\n bangCount++;\n }\n }\n if (bangCount === 0 || bangCount > 1) {\n bangCount = 0;\n output.push(sSplit[i]);\n } else if (bangCount === 1) {\n bangCount = 0;\n }\n }\n return output.join(' ');\n}", "title": "" } ]
[ { "docid": "2e657119ee259f826ba3584a0db41d60", "score": "0.7178903", "text": "function removeExclamation(s) {\n return s.replace(/\\b!+/g, '');\n}", "title": "" }, { "docid": "8eadbad5450225370ba1a69f2095a274", "score": "0.7144812", "text": "function removeExclamationMarks(s) {\n // check if it includes \"!\" \n \n if(s.includes('!')){\n // if it is true remove '!'\n s = s.replace(/!/g, '')\n } \n return s\n \n \n}", "title": "" }, { "docid": "1092f9de85a533ae67739457e0705d2d", "score": "0.70103484", "text": "function nicer(sentence){\n //Convert a string input to an array.\n var sentenceArray = sentence.split(\" \");\n for(var i=0; i < sentenceArray.length; i++){\n var currentWord = sentenceArray[i];\n if (currentWord === \"heck\" || currentWord === \"darn\" || currentWord === \"crappy\" || currentWord === \"dang\"){\n //remove from my array currentWord\n sentenceArray.splice(i, 1);\n }\n }\n var cleanSentance = sentenceArray.join(\" \");\n return cleanSentance;\n //The input sentence needs certain keywords removed.\n}", "title": "" }, { "docid": "5e33ffa9263150fe88dabdc498e7c580", "score": "0.6914934", "text": "function nicer (theSentence){\n var sentenceArray = theSentence.split(' ');\n var censorWords = ['heck','darn', 'dang', 'crappy'];\n\n for (i=0; i < censorWords.length; i++) {\n if (sentenceArray.includes(censorWords[i])) {\n var wordIndex= sentenceArray.indexOf(censorWords[i]);\n sentenceArray.splice(wordIndex, 1);\n }\n }\n theSentence = sentenceArray.join(' ')\n return theSentence\n}", "title": "" }, { "docid": "69c97de8d45f13eb569cf5bbc8d09dbe", "score": "0.68636507", "text": "function removeExclamationMarks(s) {\n s = s.split('');\n for (let i = 0; i < s.length; i++) {\n if (s[i] === '!') {\n s[i] = '';\n }\n }\n return s.join('');\n}", "title": "" }, { "docid": "53775170e1b38fe14ff5db5836478152", "score": "0.6823431", "text": "function remove(s) {\n let arr = s.split(\"\");\n\n for (char of arr) {\n if (arr[arr.length - 1] === \"!\") {\n arr.pop();\n }\n }\n return arr.join(\"\");\n}", "title": "" }, { "docid": "40b512e97ad8debe6998e1bf3100136f", "score": "0.6694498", "text": "function nicer(sentence){\n let sentenceArr = sentence.split(' ');\n let cleanSentenceArr = [];\n let forbidden = ['heck', 'darn', 'dang', 'crappy']\n sentenceArr.forEach(function(word, idx){\n if (!(forbidden.includes(word))){\n cleanSentenceArr.push(word)\n } \n })\n return cleanSentenceArr.join(' '); \n}", "title": "" }, { "docid": "8d11ef2d40d1ae2b393fec3cf12c5a1f", "score": "0.6570835", "text": "function removeExclamationMarks(s) {\n const result = Array.from(s).filter((element) => {\n return element !== '!';\n });\n return result.join('');\n}", "title": "" }, { "docid": "39a9385a216b951a47a95ba6202666a8", "score": "0.6559056", "text": "function remove(s, n) {\n let removed = 0;\n let stringArr = s.split(\"\");\n\n for (let i = 0; removed < n; i++) {\n if (i > stringArr.length) {\n break;\n }\n if (stringArr[i] === \"!\") {\n stringArr.splice(i, 1);\n i--;\n removed++;\n }\n continue;\n }\n return stringArr.join(\"\");\n}", "title": "" }, { "docid": "b98ccdc23527abca8528052591ac11ab", "score": "0.6508575", "text": "function wordYeller(sentence) {\n var result = [];\n var words = sentence.split(\" \"); // [\"St,p\", \"i!\", \"now\"...]\n var puncs = \". , ! ? ; :\";\n\n for (var i = 0; i < words.length; i++) {\n var word = words[i]; //\"Stop\"\n\n if (puncs.indexOf(word[word.length - 1]) > -1) {\n result.push(word);\n } else {\n result.push(word + \"!\");\n }\n }\n\n return result.join(\" \");\n}", "title": "" }, { "docid": "6aa0a96f7a2ffde84c1f1657f2286ede", "score": "0.6493069", "text": "function checkExtraWhiteSpce(sentence) {\n return sentence.replace(/\\s+/g, \" \").trim();\n}", "title": "" }, { "docid": "9903222d02a72c3ad3c1bc71f87efedb", "score": "0.6453784", "text": "function clearIgnores(input) {\n let ignoring = false;\n return input.split('').reduce((acc, char) => {\n if (ignoring) ignoring = false; \n else if (char == '!') ignoring = true;\n else acc.push(char);\n return acc;\n }, []).join('');\n}", "title": "" }, { "docid": "f48b9be990cc8af86fd49a7bfeea081b", "score": "0.64326555", "text": "function remove(s){\nreturn s = s.replace(/!+$/gm, '');\n}", "title": "" }, { "docid": "2f8efe2dd6150ea663eaa88de20eb40e", "score": "0.641799", "text": "function nicer (sentence) {\n const forbiddenWords = ['heck', 'darn', 'dang', 'crappy']\n const sentenceArr = sentence.split(' ')\n var newSentenceArr = sentenceArr\n var newSentence = ''\n forbiddenWords.forEach(function (currForbWord) {\n newSentenceArr = newSentenceArr.filter(function (currTestWord) {\n if (currTestWord !== currForbWord) {\n return currTestWord\n }\n })\n })\n newSentence = newSentenceArr.join(' ')\n return newSentence\n}", "title": "" }, { "docid": "849a4a1d09b8487da32ba39f4ed811bb", "score": "0.63623375", "text": "function remove(s,n){\n return s.split('').reduce((r, e, i)=>{\n if(e !== \"!\"){\n r.push(e)\n }else if(e=== \"!\" && n > 0){\n n--\n }else{\n r.push(e)\n }\n return r\n }, []).join('')\n }", "title": "" }, { "docid": "fa6dba33fb43108f59fa3bc905f35645", "score": "0.62023777", "text": "function removeTwo(s){\r\n // let res = '';\r\n // let newS = s.replace(/!/g, '');\r\n // console.log(newS);\r\n // res = newS + '!';\r\n // return res;\r\n\r\n return s.replace(/!/g, '') + '!';\r\n}", "title": "" }, { "docid": "023a97a003c712f50325c185914bd998", "score": "0.6195758", "text": "function remove(s){\r\n //coding and coding....\r\n let newStr = '';\r\n let excl = '';\r\n let res = '';\r\n for(let i = 0; i < s.length; i++) {\r\n if(s[i] === '!') {\r\n // excl = s.slice(s[i], s[i+1]);\r\n // console.log(excl);\r\n // newStr += excl;\r\n // console.log(newStr);\r\n excl += s[i];\r\n //console.log(s[i]);\r\n s = s.replace(s[i], '');\r\n\r\n }\r\n\r\n }\r\n console.log(excl);\r\n console.log(s);\r\n res = s.concat(excl);\r\n return res;\r\n}", "title": "" }, { "docid": "6ca86523c6c499f0626daedf171e1ab4", "score": "0.61140394", "text": "function remove(s){\n return `${s.replace(/\\!/g, \"\")}!`\n}", "title": "" }, { "docid": "11c6bff3d57a682c101d4e1cab090751", "score": "0.61127174", "text": "function properWordToRemoveForSentence(word)\r\n{\r\n //this function should contain a list of hebrew linking/connection words\r\n //if (word.length > 1 && !hebTools.isConntectionWord(word))\r\n if (word.length > 1)\r\n return true;\r\n return false;\r\n}", "title": "" }, { "docid": "14a5739fceaeb38dccca820620a9fa84", "score": "0.6006772", "text": "function remove(s,n){\n while(n) {\n s = s.replace(\"!\", \"\");\n n--;\n }\n return s;\n }", "title": "" }, { "docid": "461b5b9557f79bf7f0c8c9317c81775a", "score": "0.5978994", "text": "function censor(sentence, curseWords) {\n let arr = sentence.split(' ');\n let newArr = [];\n \n for (let i = 0; i < arr.length; i++) {\n let word = arr[i].toLowerCase();\n if (curseWords.includes(word)) {\n newArr.push(removeVowels(arr[i]));\n } else {\n newArr.push(arr[i]);\n }\n }\n return newArr.join(' ');\n}", "title": "" }, { "docid": "c354e53e1915c65de6310c4f4a15b242", "score": "0.5898411", "text": "function dropTheMike(str) {\n let newStr = \"\";\n let currentWord = \"\"\n let idx = str[0] === ' ' ? 1 : 0;\n let length = str[str.length - 1] === \" \" ? str.length - 1 : str.length;\n\n for (let i = idx; i < length; i++) {\n\n if (str[i - 1] === ' ') {\n newStr += str[i].toUpperCase();\n currentWord = str[i].toUpperCase();\n } else {\n newStr += str[i];\n currentWord += str[i];\n };\n\n if (currentWord === \"Mike\") {\n if(str[i + 1] === ' ' || str[i + 1] === undefined) {\n return \"stunned silence\";\n }\n };\n \n };\n\n return newStr;\n}", "title": "" }, { "docid": "b3e5ddf911b3d041543adabe1afc89df", "score": "0.58961433", "text": "function withoutSingleLetter(sentence) {\n var ArrwithoutSingleLetter = [];\n sentence.split(\" \").filter((x) => {\n if(x.length !== 1) {\n ArrwithoutSingleLetter.push(x);\n }\n });\n\n return ArrwithoutSingleLetter;\n}", "title": "" }, { "docid": "d6d57882b3d46e2270273ea816c82d2e", "score": "0.5817575", "text": "remove(word) {\n\n }", "title": "" }, { "docid": "49aa714a8d4a74e6dbbfdc9ca9590a25", "score": "0.58173203", "text": "function stripWords()\n {\n for(var i = 0; i < wordArray.length; i++)\n {\n wordArray[i] = wordArray[i].replace(/\\b[-.,;:()_&$#*!?\\[\\]{}\"']+\\B|\\B[-.,;:()_&$#*!?\\[\\]{}\"']+\\b/g, \"\").toLocaleLowerCase();\n }\n }", "title": "" }, { "docid": "b3fbb557f0cba09c21009dafaea3dd88", "score": "0.58150274", "text": "function removePunctuation(wordArray){\n var punctuationUndesired = [\".\", \",\", \"!\", \"?\"];\n for (let i=0; i<wordArray.length; i++){ // look through each word`\n for (let j=0; j<punctuationUndesired.length; j++){ // look for each punctuation\n wordArray[i] = wordArray[i].replace(punctuationUndesired[j],\"\");\n }\n // Replace _ with a space\n wordArray[i] = wordArray[i].replace(\"_\",\" \");\n /* // Get rid of double quotes (special case)\n wordArray[i] = wordArray[i].replace(/\\\"/g,\"\"); */ // only if quotes added later\n }\n // Remove any empty elements due to extra spaces around words\n wordArray = wordArray.filter(Boolean);\n return wordArray;\n}", "title": "" }, { "docid": "871d21761b9d3b87a5c97b2cd0261110", "score": "0.57764125", "text": "function removeWord(){\n\n}", "title": "" }, { "docid": "ef23433d68bdbd7282477ed3c9ab872f", "score": "0.57758284", "text": "function Remove(name) {\n return name.replace(/^(a |the |an )/i, '').trim();\n}", "title": "" }, { "docid": "75962745c870f1cc8016d9ffadb3044f", "score": "0.5759747", "text": "function onlyOneWord(arr){\nvar result= arr.filter(word=>!(word.includes(\" \")))\n\n\nreturn result;\n}", "title": "" }, { "docid": "fedc39ac78275fe77cd4bb17c77ad537", "score": "0.5744603", "text": "function cleanText(sentence) {\n return sentence.replace(/[^a-zA-Z. ]/g, \"\")\n}", "title": "" }, { "docid": "f9831f4c0eb55ba26d3b2d422a4a2690", "score": "0.57311887", "text": "function removePunctuation(message){\n\t//',;.?!:'\n\tmessage = message.replace(\",\",\"\");\n\tmessage = message.replace(\";\",\"\");\n\tmessage = message.replace(\".\",\"\");\n\tmessage = message.replace(\"?\",\"\");\n\tmessage = message.replace(\"!\",\"\");\n\tmessage = message.replace(\":\",\"\");\n\t\n\t\n\treturn message;\n}", "title": "" }, { "docid": "b8c7738b9a20a23e9563ad6e7a7bfc21", "score": "0.5700446", "text": "function censorPalindrome(text) {\n text = text.split(\" \")\n\n for (let i = 0; i < text.length; i++) {\n if (isPalendrome(text[i])) {\n let word = text[i]\n text.splice(text.indexOf(word), 1, word.charAt(0) + \"*\".repeat(word.length-2) + word.charAt(word.length-1))\n }\n }\n return text.join(\" \")\n}", "title": "" }, { "docid": "3a3db526d7271367a4c6d35fef033561", "score": "0.56988156", "text": "function nicer(sentence) {\n // made a var to hold the nonBadwordsSentence return until was built\n var nonBadwordsSentence = \"\"\n // seperate the sentence string into an array\n var sentenceArray = sentence.split(\" \")\n // make an array of the bad words\n var badWordsArray = [\"heck\", \"darn\", \"crappy\", \"dang\"]\n // loop over array to find bad words\n for (var i = 0; i < sentenceArray.length; i++) {\n // set var currentWord to hold the check in the loop of sentenceArray\n var currentWord = sentenceArray[i]\n // indexOf to check if current word is in the badWordsArray\n if (badWordsArray.indexOf(currentWord) === -1) {\n // set 'if' if current iternation equals the end of sentenceArray array to NOT add a space to the last iteration.\n if (i === sentenceArray.length-1) {\n nonBadwordsSentence += currentWord;\n // added the ELSE to take all the other iterations and add a \" \" between them.\n }else {\n nonBadwordsSentence += currentWord + \" \"\n }\n }\n // return nonBadwordsSentence should log the NON bad words concatenated with spaces EXCEPT for the last word without one.\n }return nonBadwordsSentence\n}", "title": "" }, { "docid": "6f4fcde7d0b975ce1a84982803dc6a5a", "score": "0.56907433", "text": "function remove(s, n) {\n for (var i = 0; i < n; i++) {\n s = s.replace(\"!\", \"\");\n }\n console.log(s);\n return s;\n}", "title": "" }, { "docid": "999f0251cadd9e7be4b0ca2be1a91cf5", "score": "0.5688358", "text": "remove(chunk, text) {\n return text.replace(new RegExp(chunk, \"g\"), \"\");\n }", "title": "" }, { "docid": "a28f33aaecab09740dc9f87b6ce408f5", "score": "0.5653429", "text": "function remove(s,n){\n // initialize loop with for and add condition (i<n)\n // and replace string value \"!\" with \"empty string\"\n // that many times \n // This assumes the operation will be done from \n // left to right \n for (var i=0;i<n;i++) s=s.replace(\"!\",\"\");\n return s;\n }", "title": "" }, { "docid": "ba903ad375d05fa10085bac3503092bf", "score": "0.5652418", "text": "function noVowels(words){\n var newArr = []\n var letters = words.split(\"\")\n for (let i = 0; i < letters.length; i++) {\n if (letters[i] !== \"a\" && letters[i] !== \"e\" && letters[i] !== \"i\" && letters[i] !== \"o\" && letters[i] !== \"u\") {\n newArr.push(letters[i])\n }var sentence = newArr.join(\"\")\n\n }return sentence\n }", "title": "" }, { "docid": "76689c061fb8f7416625d8c9386fec38", "score": "0.56440276", "text": "function keepOnlyLetters(sentence){\n\t return sentence.replace(/[^a-z]/gi, ' ');\n\t}", "title": "" }, { "docid": "dc794155497c038e39fa484173a9354f", "score": "0.5638243", "text": "function clean(tweet){\n\n var cleantweet='';\n var words = tweet.split(\" \");\n\n for (var i = 0; i < words.length - 1; i++) {\n if(words[i]!='RT'&&!words[i].startsWith('http')&&!words[i].startsWith('@')){\n cleantweet = cleantweet.concat(words[i]+' ');\n }\n }\n\n return cleantweet;\n}", "title": "" }, { "docid": "c9c4b46abe7fd69c25164d84a0fbd694", "score": "0.5602203", "text": "function removeFromStr(str, arr){\n\n //arr will be an array of words\n arr.forEach(element => {\n str = str.replace(element, '')\n });\n \n return str;\n\n}", "title": "" }, { "docid": "5a046d6571e38df793487e246c631374", "score": "0.560219", "text": "function removeStopWords(str,stopWords) {\n for (var i = 0; i < str.length; i++) {\n for (var j = 0; j < stopWords.length; j++) {\n if (str[i] == stopWords[j]) {\n str.splice(i,1);\n }\n }\n }\n return str;\n}", "title": "" }, { "docid": "eedfb84875ba9090fdc9d1199fd1f18e", "score": "0.5598387", "text": "function punctuationless(stringToStrip) {\n return stringToStrip.replace(/[^A-z0-9_]/g,\"\");\n}", "title": "" }, { "docid": "42070c6b9f0ab7aaedd10a1fdb94e0cf", "score": "0.55786693", "text": "function moderateSwearwords(message) {\n return badWordsFilter.clean(message);\n}", "title": "" }, { "docid": "2683c84eb916da92f35e81225e767a86", "score": "0.55698055", "text": "function stopShouting(message) {\nreturn capitalizeSentence(message.toLowerCase()).replace(/!+/g, '.');\n}", "title": "" }, { "docid": "79a285f334750ae90268067693113c00", "score": "0.55673003", "text": "function containsSwearwords(message) {\nreturn message !== filter.clean(message);\n}", "title": "" }, { "docid": "726db4230e7cd8baded8b268dc71ed36", "score": "0.55622435", "text": "function matchAllWords (input) {\n let replaced = input.split(' ').filter(w => w !== '').join('|');\n // let replaced = input.split(/\\W+/g).filter(Boolean).join('|');\n\n console.log(replaced);\n}", "title": "" }, { "docid": "1e313b3ef68e57348757061075b8fa1a", "score": "0.5554535", "text": "function hideString(foodString, array) {\n let finalWord = \"\"\n for (let i = 0; i < foodString.length; i++) {\n if (array.includes(foodString[i])) {\n finalWord += foodString[i]\n } else if (foodString[i] === \" \") {\n finalWord += \" \"\n } else {\n finalWord += \"_\"\n }\n }\n return finalWord\n}", "title": "" }, { "docid": "cf5ce44a4ccacadcb54a70e32829c9d0", "score": "0.5543982", "text": "function removeDuplicateWords(s){\n let newString = s.split(\" \");\n const onlyUnique = (value, index, self) => { \n return self.indexOf(value) === index;\n };\n return newString.filter(onlyUnique).join(\" \");\n}", "title": "" }, { "docid": "f6fa625f47b972cde187ad56721474bc", "score": "0.55310315", "text": "function stopShouting(message) {\n return capitalizeSentence(message.toLowerCase()).replace(/!+/g, '.');\n}", "title": "" }, { "docid": "203537c4530f1be06346c43192efc044", "score": "0.55232483", "text": "function filterWords(phrase) {\n return phrase.replace(/(bad|mean|ugly|horrible|hideous)/ig, 'awesome');\n }", "title": "" }, { "docid": "8235dccf29dca02126ff64d628e03c94", "score": "0.55099267", "text": "function remove_before_word(input_string) {\r\n var words = ['from', 'containing', 'contains', 'contain'];\r\n for (var i = 0; i < words.length; i++) {\r\n if (input_string.toLowerCase().includes(words[i].toLowerCase())) {\r\n return input_string.substring(input_string.toLowerCase().indexOf(words[i].toLowerCase()) + words[i].length);\r\n }\r\n }\r\n return input_string;\r\n}", "title": "" }, { "docid": "546cd6c6f30c28e56ad69764b571c9ca", "score": "0.5500685", "text": "function forbiddenWords(userText) {\n userArray = userText.split(\" \");\n for (let i = 0; i < userArray.length; i++) {\n const textWord = userArray[i];\n if (textWord === \"sunt\" || textWord === \"enim\") {\n counter += 1;\n userArray[i] = \"Beep\";\n }\n }\n // User Output\n userArray = (userArray.toString(), userArray.join(\" \"));\n console.log(`Number of changed words = ${counter}`);\n return userArray;\n}", "title": "" }, { "docid": "1ef30b76aa6e54b2c3969f283afbcb90", "score": "0.5475374", "text": "function removeIncludedLetters(requiredLetters, word) {\n\tword.split('').forEach((l)=> {\n\t\tif(requiredLetters.includes(l)){\n\t\t\trequiredLetters.splice(requiredLetters.indexOf(l),1);\n\t\t\t// console.log('removal: '+ word+ ' ' + l + ' '+ requiredLetters);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7775a0a63ae261de2b9fb419241f00ae", "score": "0.5472983", "text": "function removesSpaces (phrase) {\n\twhile (stringContains(phrase, ' ')){\n\t\tphrase = phrase.replace(' ', '';)\n\t}\n\n\treturn phrase;\n}", "title": "" }, { "docid": "e013a8409e2716868680b28e4064ea34", "score": "0.5470309", "text": "function moderateSwearwords(message) {\n return badWordsFilter.clean(message);\n}", "title": "" }, { "docid": "ca6dbdadc2be17de3f9e8b7ab45e8001", "score": "0.5431966", "text": "function hideWord() {\n for (var i = 0; i < wordToBeGuessed.length; i++) {\n hiddenWord.push(\"_\");\n }\n}", "title": "" }, { "docid": "a61a620f138373a9247a026ce5a24364", "score": "0.54305923", "text": "function stopShouting(message) {\n return capitalizeSentence(message.toLowerCase()).replace(/!+/g, \".\");\n}", "title": "" }, { "docid": "6f426c4d92c760e2719492d6775bfa57", "score": "0.541819", "text": "function cleanItUp(str) {\n let filteredArr = str\n .toLowerCase()\n .split(\"\")\n .filter(char => true)\n .filter(char => char.charCodeAt(0) >= 97 && char.charCodeAt(0) <= 122);\n\n let splitArr = [];\n let tempWord = \"\";\n\n for (let i = 0; i < filteredArr.length; i++) {\n tempWord += filteredArr[i];\n if ((i + 1) % 5 === 0) {\n splitArr.push(tempWord);\n tempWord = \"\";\n }\n }\n return splitArr.map(word => word.toUpperCase()[0] + word.slice(1)).join(\" \");\n}", "title": "" }, { "docid": "0d9ca0a6ba46ca2b8c324d152a94cc52", "score": "0.54033357", "text": "function RemoveVocal(MyString) {\nconvertToString=MyString.split ('')\nvar vocal = ['a','i','u','e','o']\n if (MyString.index\n )\nreturn MyString.splice(vocal)\n\n}", "title": "" }, { "docid": "de5221cfa8f7115adb7be68f8839ef1b", "score": "0.5400381", "text": "performWordRemoval(wordText) {\r\n for (let i = 0; i < this.words.length; i++) {\r\n if (this.words[i].text === wordText) {\r\n this.words.splice(i, 1);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "b2c532f55e0da4b9c0ddc1ed457a8d7f", "score": "0.5398574", "text": "function removeStopWords(string){\n\tvar words = clean(string).split(\" \");\n\tvar result = [];\n\tfor( var i=0; i<words.length; i++){\n\t\tif(stopWords.indexOf(words[i])==-1) result.push(words[i]);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "6cd3a9f298fddced5fcc0ba82a1e34b6", "score": "0.5398329", "text": "function censor(text) {\n naughtyWords.forEach(function(w) {\n //I feel like there is a 1 line solution for these next five lines\n text = text.replace(new RegExp(w, 'ig'), function(match) {\n var censored = \"\";\n for (var i = 0; i < match.length; i++) censored += \"*\";\n return censored;\n });\n //----------------------------------------------------------------\n });\n return text;\n}", "title": "" }, { "docid": "33dbf47b96058248020a197803e0df86", "score": "0.5391564", "text": "function hide(email){\n\tvar ind = email.indexOf(\"_\");\n\tvar ind2 = email.indexOf(\"@\");\n\tvar dif = ind2 - ind;\n\tvar remove = email.substr(ind, dif);\n\tvar result = email.replace(remove, \"...\");\n\tconsole.log(result);\n}", "title": "" }, { "docid": "f52d54d50cd591042d5ff4f83aae4d48", "score": "0.5377768", "text": "function filterBadwords(){\n\tvar input = document.getElementById('msginput'),\n\t\toutput = document.getElementById('msginput'),\n\t\tbadwords = /\\b(ass|arse|assface|assfuck|asshole|bastard|bitch|cock|cum|dick|dickhead|dumbfuck|fag|faggot|fuck|gay|handjob|hoe|motherfucker|nigger|nigga|penis|pussy|shit|tit|twat|whore|kpkb|nabei|nabu|yao siu|pu bor gia|cb|hong gan|kan)\\b/g;\n\n\tinput.onkeyup = function () {\n\t\toutput.value = this.value.replace(badwords, function (fullmatch, badword) {\n\t\t\treturn new Array(badword.length + 1).join('*');\n\t\t});\n\t};\n}", "title": "" }, { "docid": "d23f0b48027e789d92cb72a8ce6ebc0e", "score": "0.535224", "text": "function removeSpaces (phrase){\n\nwhile (phrase.indexOf(' ') !== -1) {\n\n\tphrase = phrase.replace(' ','');\n\t//remove the space\n\t}\n\n\treturn phrase;\n}", "title": "" }, { "docid": "c6511a272f82deefb1c6e338fed07053", "score": "0.5347158", "text": "function usernameCheckBadword(username) {\n \tvar usernameBadListObj = usernameBadList.split(',');\n for (word in usernameBadListObj) {\n username = username.split(removeWhitespace(usernameBadListObj[word])).join('depp');\n }\n return username;\n }", "title": "" }, { "docid": "17622017639198d0bf43523c4a2393fd", "score": "0.53247577", "text": "function withoutString(base, remove){\n let result;\n const removeIndex = base.toLowerCase().search(remove.toLowerCase());\n if(removeIndex == -1){\n result = base;\n}\n else{\n result = base.substr(0,removeIndex) +\n withoutString(base.substr(removeIndex +\n remove.length), remove);\n }\n return simplifySpaces(result);\n //return result;\n}", "title": "" }, { "docid": "f2344331a8b8daad80024ff41a5bf889", "score": "0.5310684", "text": "function remove(str, vowels) {\n let newStr = ''\n let newVowels = []\n for(let j=0; j<vowels.length; j++){\n newVowels.push(vowels[j])\n }\n console.log(newVowels)\n for(let i=0; i<str.length; i++){\n if(!newVowels.includes(str[i])) {\n newStr += str[i]\n }\n }\n return newStr\n}", "title": "" }, { "docid": "c4ba1d4e3f2f8398223c44d703eade3c", "score": "0.530272", "text": "function trim(str) {\n var input = str.replace(/\\s\\s+/g, ' ').trim();\n\n var words = input.split(' ');\n if (_.contains(LANG_WORDS, _.first(words))) {\n return words.slice(1).join(' ');\n }\n return input;\n}", "title": "" }, { "docid": "9cc9d9dd99bb86c973afe22e13faae2f", "score": "0.5298242", "text": "function eliminarEspacios() {\n let eliminarEspacios = \"Hola clase\";\n \n console.log(eliminarEspacios.replace(/ /g, \"\"));\n}", "title": "" }, { "docid": "8e84ed4d3606432bdcf688e745ad3b94", "score": "0.5297421", "text": "function removeContraction(str) {\n // Irregular\n str = str.replace(/ain't/g, \"am not\");\n str = str.replace(/can't/g, \"can not\");\n str = str.replace(/won't/g, \"will not\");\n str = str.replace(/shan't/g, \"shall not\");\n str = str.replace(/where'd/g, \"where did\");\n str = str.replace(/n't/g, \" not\");\n str = str.replace(/'twas/g, \"it was\");\n str = str.replace(/ma'am/g, \"madam\");\n\n // Regular\n str = str.replace(/'d/g, ' would');\n str = str.replace(/'m/g, ' am');\n str = str.replace(/'ll/g, ' will');\n str = str.replace(/'re/g, \" are\");\n str = str.replace(/'s/g, ''); // No \"is\" to prevent confusion w/ possessive.\n str = str.replace(/'ve/g, \" have\");\n str = str.replace(/y'/g, \"you \");\n\n // Removes all remaining apostrophes\n str = str.replace(/'/g, '');\n\n return str;\n}", "title": "" }, { "docid": "1b7435cc772702150be4b69ae2dd9a8e", "score": "0.5293032", "text": "function hideWord() {\n for (i = 0; i < letterArray.length; i++){\n if (letterArray[i] !== \"\"){\n var underscores = letterArray[i].replace(/[A-Z]|[a-z]/g, \"_\");\n hiddenWord.push(underscores);\n }\n else {\n hiddenWord.push(\"\");\n }\n }\n}", "title": "" }, { "docid": "27aa34fc665e01dcb5eda1652c7a553c", "score": "0.5291004", "text": "function exCharRemoval(stringy) {\n\tfor (var n = 0; n < 2; n++) {\n\t\tstringy = stringy.replace(/([~\\`\\^\\*\\[\\]\\\\';,\\/{}|\\\\\":<>])/g, \"\");\n\t\tstringy = stringy.replace(/(\\r\\n|\\n|\\r|\\s+)/gi, \" \").trim();\t\n\t}\n\treturn stringy;\n}", "title": "" }, { "docid": "2dd3e1d22e65652eaaa22681b1650de4", "score": "0.5285408", "text": "function truncate(str, no_words) {\n return str.split(\" \").splice(0, no_words).join(\" \");\n}", "title": "" }, { "docid": "729a5a8b4f4a98b5593760f263e24726", "score": "0.52624625", "text": "function containsSwearwords(message) {\n return message !== badWordsFilter.clean(message);\n}", "title": "" }, { "docid": "6838aa72848e8046981348e2cf9a9455", "score": "0.52622974", "text": "function remove(s, n) {\n return s.replace(/!/g, c => n-- > 0 ? \"\" : c)\n }", "title": "" }, { "docid": "ab1f083543257ef0014046d5e621df35", "score": "0.52522564", "text": "function removeVowelsInArray(word){\n let newArray = []\n for (let i = 0; i < newMessage.length; i++){\n if(newMessage[i] !== 'i' && newMessage[i] !== 'a' && newMessage[i] !== 'e' && newMessage[i] !== 'u' && newMessage[i] !== 'o' && typeof '' === 'string'){\n newArray.push(word[i])\n }\n} return newArray\n}", "title": "" }, { "docid": "45264fadfb95b18a461b9cbe4d6de7f1", "score": "0.5243777", "text": "function word() {\n return message.content.toLowerCase().split(' ').slice(0);\n }", "title": "" }, { "docid": "90cab6009983a64ad147ee07edd1cebf", "score": "0.5242536", "text": "function censorText(input) {\n let text = input.shift();\n for (let censoredPhrase of input) {\n let replacedPhrase = '-'.repeat(censoredPhrase.length)\n while (text.indexOf(censoredPhrase) != -1) {\n text = text.replace(censoredPhrase, replacedPhrase);\n }\n }\n return text;\n}", "title": "" }, { "docid": "b42d52c1579d39d4a2954cb5ef66f551", "score": "0.5234001", "text": "function removesSpaces (phrase){\n\twhile (hasASpace(phrase)){\n\t\tphrase = phrase.replace (\" \", \"\");\n\n\t}\n\treturn phrase;\n}", "title": "" }, { "docid": "f24d88e9d05206eb44117ab6e36a4a52", "score": "0.52323437", "text": "function noSpace(x){\n return x.split('').filter((el)=>{ return el !== \" \" }).join('');\n // return x.replace(/\\s/g,'') // other option shorter\n}", "title": "" }, { "docid": "6def4d26fa1d29c639e2b417763b4bda", "score": "0.5230475", "text": "function removeDuplicateWords (s) {\n return [...new Set(s.split(' '))].join(' ')\n}", "title": "" }, { "docid": "e80a3a1c389639f4b340e8cd7f81dab5", "score": "0.5220224", "text": "function msgCheckBadword(msgText) {\n \tvar msgBadListObj = msgBadList.split(',');\n for (word in msgBadListObj) { \n \tmsgText = msgText.split(removeWhitespace(msgBadListObj[word])).join('*****'); \n }\n return msgText;\n }", "title": "" }, { "docid": "894639813e66080f8f088e46c7e70322", "score": "0.521807", "text": "function checkWords(_call) {\n for(let i = 0; i < wordList.length; i++) {\n if (wordList[i] !== '') {\n wordList[i] = wordList[i].toLowerCase();\n let englishWord = searchBinary(wordList[i], englishWords, true);\n if (englishWord !== wordList[i]) {\n wordList.splice(i, 1);\n }\n } else {\n wordList.splice(i, 1);\n }\n }\n return _call();\n}", "title": "" }, { "docid": "bd096feea4f7be684c74036b9613493d", "score": "0.5193617", "text": "function pigIt(str) {\n\n if (str.includes('!') || str.includes('?')) {\n let ponctuation = str.slice(-1);\n return str.split(' ')\n .filter((value) => !value.includes('!'))\n .filter((value) => !value.includes('?'))\n .map((word) => word.slice(1) + word.slice(0, 1) + \"ay\")\n .join(' ') + ' ' + ponctuation;\n } else {\n return str = str.split(' ')\n .map((word) => word.slice(1) + word.slice(0, 1) + \"ay\")\n .join(' ');\n }\n}", "title": "" }, { "docid": "044c69754b679f17dc9c0e7fcddf4ee4", "score": "0.5190022", "text": "function disemvowel(str) {\n var strArray= str.split('')\n let removeA = strArray.filter(char => {\n return char !== \"a\"\n })\n let removeE = removeA.filter(char => {\n return char !== \"e\"\n })\n let removeI = removeE.filter(char => {\n return char !== \"i\"\n })\n let removeO = removeI.filter(char => {\n return char !== \"o\"\n })\n let removeU = removeO.filter(char => {\n return char !== \"u\"\n })\n let removeCapA = removeU.filter(char => {\n return char !== \"A\"\n })\n let removeCapE = removeCapA.filter(char => {\n return char !== \"E\"\n })\n let removeCapI = removeCapE.filter(char => {\n return char !== \"I\"\n })\n let removeCapO = removeCapI.filter(char => {\n return char !== \"O\"\n })\n let removeCapU = removeCapO.filter(char => {\n return char !== \"U\"\n })\n \n return removeCapU.join(\"\")\n }", "title": "" }, { "docid": "61246a4f69738c8a75a41fcc05d0d6fe", "score": "0.5189611", "text": "function removePunctuationMarks(text) {\n\tvar cleanText = text.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-`~()]/g, \" \").replace(/\\s+/g, \" \");\n\treturn cleanText.trim();\n}", "title": "" }, { "docid": "812f528dd100084f90d91a6db6da92b6", "score": "0.51877", "text": "function rmStopWords(originalText){\n\t\tvar my_corpus = new tm.Corpus([originalText.replace(/[.,\"\\/#!$%\\^&\\*;:{}=\\-_`~()?]/g,\"\")]);\n\t\tmy_corpus.removeWords([\"\\'s\",\"ain\\'t\",\"aren\\'t\",\"can\\'t\",\"couldn\\’t\",\"didn\\'t\",\"doesn't\",\"don't\",\"hasn't\",\"haven't\",\"he's\",\"here's\",\"i'd\",\"i'll\",\"i'm\",\"i've\",\"isn't\",\"it'd\",\"it'll\",\"it's\",\"let's\",\"shouldn't\",\"that's\",\"they'd\",\"they'll\",\"they're\",\"they've\",\"wasn't\",\"we'd\",\"we'll\",\"we're\",\"we've\",\"weren't\",\"what's\",\"where's\",\"who's\",\"won't\",\"wouldn't\",\"you'd\",\"you'll\",\"you're\",\"you've\"]);\n\t\tmy_corpus.removeWords([\"uh\",\"yeah\",\"yep\",\"um\",\"mmhmm\",\"pe\",\"ah\",\"hmm\",\"mm\",\"\"]);\n\t\tmy_corpus.removeWords(tm.STOPWORDS.EN);\n\t\tmy_corpus.removeNewlines();\n\t\tmy_corpus.removeInvalidCharacters();\n\t\tmy_corpus.clean();\n\t\tvar result = my_corpus.documents[0].replace(/ ' /g,\" \");\n\t\treturn result;\n\t}", "title": "" }, { "docid": "6311e9fb38dabd60ae729482d457faa0", "score": "0.51730615", "text": "function removeMascaraCep(texto){\n let aux = \"\";\n aux = texto.replace(/\\./g,\"\").replace(/\\-/g,\"\");\n return aux;\n}", "title": "" }, { "docid": "549e51e1460c9df68658ac07b3644459", "score": "0.51550055", "text": "function censorWords(wordList, text) {\n\n for (let i = 0; i < wordList.length; i++) {\n let search = wordList[i]\n let searchRegExp = new RegExp(search, 'gi')\n let index = text.search(searchRegExp)\n let replaceWith = \"*\"\n if (wordList[i].length > 2) {\n replaceWith = text.charAt(index) + \"*\".repeat(wordList[i].length-2) + text.charAt(index + (wordList[i].length - 1))\n }\n text = text.replace(searchRegExp, replaceWith)\n }\nreturn text\n}", "title": "" }, { "docid": "45d9fdfc3922d9590daac327803fe2d1", "score": "0.51489717", "text": "function dropWord() {\n actualTweet = actualTweet.replace(/\\b(\\w+)\\W*$/, '');\n console.log(\"Dropping last word randomly\");\n console.log(\"New tweet: \" + actualTweet);\n return actualTweet;\n }", "title": "" }, { "docid": "b94df5666e01c9aad508cd9f604b655e", "score": "0.5145036", "text": "function getWordsFromText(stringToStrip, isCode){\n //remove all html from text that isn't highlighted code\n //the highlighted code html might be something somebody wants to search for\n if (!isCode){ \n stringToStrip = stringToStrip.replace(/(<([^>]+)>)/gi, \"\");\n }\n const retVal = [...new Set(stringToStrip.replace(/[^a-zA-Z ]/g, \" \").split(/[\\s ]+/))]\n if (retVal.indexOf(\"\") !== -1){\n retVal.splice(retVal.indexOf(\"\"), 1)\n }\n return retVal;\n}", "title": "" }, { "docid": "fefa78f61472e563fb9f3baa1adeefcb", "score": "0.513849", "text": "function filterPalindromes(words) {\n let i = 0, word;\n while (i < words.length) {\n word = words[i].split(' ').join('').toLowerCase();\n if (word !== word.split('').reverse().join('')) {\n words.splice(i, 1);\n } else {\n i++;\n }\n }\n return words;\n}", "title": "" }, { "docid": "4c0f32ee0dfacda86302e44b2aba085b", "score": "0.512584", "text": "function trimIt(x) {\n return x.replace(/^\\s+|\\s+$/gm, \"\");\n}", "title": "" }, { "docid": "24016e3672fd970511d187ab3a9069c2", "score": "0.5116796", "text": "function extractWords(textString){\n //to array first\n var text = textString.toLowerCase().split(/\\W+/); \n var textArray = text.filter(function(removeOne) { \n //then remove all the words that have one letter or fewer\n return removeOne.length > 1; \n });\n return textArray;\n}", "title": "" }, { "docid": "fab1b74ee13849dd79ec7c929de58872", "score": "0.5111713", "text": "function containsSwearwords(message) {\n return message !== badWordsFilter.clean(message);\n}", "title": "" }, { "docid": "4e180616a3ef716d272aad4270923319", "score": "0.51103467", "text": "function extract_words(text_input)\n{\n\nvar sm_text=text_input.toLowerCase();\nvar words = sm_text.split(/\\W+/);\n\n\nvar array_cleaned = words.filter(function(x) {\n return (x.length) > 1;\n});\n\n\nreturn array_cleaned;\n \n}", "title": "" }, { "docid": "5288d11cf632c757e317b4d056bc243e", "score": "0.5096787", "text": "function lowerCaseRemoveSpace (word) {\n return word.split(\" \").join('').toLowerCase();\n}", "title": "" }, { "docid": "8fd7ab00cb5ebb499b9b7e44353402ef", "score": "0.50929797", "text": "function stem(word) {\n return word.replace(/\\'s$/, '');\n}", "title": "" }, { "docid": "5d54507a411e68f6dd69f97c93daed3d", "score": "0.5080381", "text": "function stem(word) {\n return word.replace(/\\'s$/, '');\n}", "title": "" } ]
4cae002d21b28c2ade04f7321f7be363
Constructor de Nodo para estructura del CST
[ { "docid": "daf39ce90e18ab22e481eef2c60a962b", "score": "0.0", "text": "function Nodo(id, name, list, content) {\r\n this.node_id = id;\r\n this.node_name = name;\r\n this.node_content = (content != undefined) ? content : '';\r\n this.node_list = (list != undefined) ? list : [];\r\n }", "title": "" } ]
[ { "docid": "f22cb981733d75c2bc34bdb791b93657", "score": "0.7061665", "text": "Constructor(){}", "title": "" }, { "docid": "de4ae0d9ba162d2e6b26ee3e79159735", "score": "0.70607257", "text": "constructor(n,c) {\n this.nome = n;\n this.codigo = c;\n }", "title": "" }, { "docid": "9e42bd1429e280d0d6d2525088ab599f", "score": "0.6959008", "text": "constructor() {\n // Invocamos al constructor de la clase pokémon\n super(\"Blaistoise\", \"Agua\");\n }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.6772809", "text": "function Ctor() {\n }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.6772809", "text": "function Ctor() {\n }", "title": "" }, { "docid": "ff4624ad49e408f0b287de26bec0455a", "score": "0.6743527", "text": "function Ctor() {\r\n }", "title": "" }, { "docid": "459ed10474a7ecc249e12a7d5000eb7c", "score": "0.6731849", "text": "constructor() {\n // Invocamos al constructor de la clase pokémon\n super(\"Charizar\", \"Fuego\");\n }", "title": "" }, { "docid": "e7f9245fb860b55c330e752823771ca2", "score": "0.6721792", "text": "constructor()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6706128", "text": "function Ctor() {}", "title": "" }, { "docid": "10c65e0ece5f783f608e39c406d0a581", "score": "0.66821253", "text": "Ou() {}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.6653773", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.6653773", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "964cb8b3d9b177a97b2b1bf40e48466d", "score": "0.6650059", "text": "function constructor () {\r\n\t\t\t// body...\r\n\t\t}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.6643914", "text": "constructor(){}", "title": "" }, { "docid": "9083c5d08dbc33ed5c1b92778420fc09", "score": "0.6641452", "text": "constructor() {\n // Invocamos al constructor de la clase pokémon\n super(\"Charmander\", \"Fuego\");\n }", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.6625554", "text": "function Constructor() {}", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.6625554", "text": "function Constructor() {}", "title": "" }, { "docid": "edac8f447d20aeb6c831ed1b69641e8e", "score": "0.6599998", "text": "constructor() {\n super('constructor');\n /* *\n *\n * Properties\n *\n * */\n /**\n * Kind of declaration\n */\n this.kind = 'constructor';\n }", "title": "" }, { "docid": "6501de2f8854027c7a789270548a6917", "score": "0.65614647", "text": "construct() {}", "title": "" }, { "docid": "fcfce9c92734be717836020710a860ec", "score": "0.64637303", "text": "constructor(nome, cor, modelo){\n\n //Super() é a classe pai e dentro dela coloca os métodos que queremos utilizar da classe pai\n super(nome);\n //Adicionando outros parâmetros->\n this.cor = cor;\n this.modelo = modelo;\n\n }", "title": "" }, { "docid": "3e6ae5c3b73c6851e36dc25b0a0772ee", "score": "0.6446134", "text": "constructor() {\n super(\"main\"); //definimos un constructor, es decir, un nombre amigable para la escena, el cual usaremos para referenciarla dentro del código.\n }", "title": "" }, { "docid": "eb08c411f3c29c136ce9d20db94767a8", "score": "0.6440784", "text": "constructor(nome, duracao) {\n this.Nome = nome;\n this.Duracao = duracao;\n }", "title": "" }, { "docid": "8266625b8da962d5d2b7d4ef878fc05d", "score": "0.6436775", "text": "constructor(nombre,tipo,vida,poder,agilidad,nivel){\n //aca adentro del constructor vamos a construir el objeto\n //this va a hacer referencia al objeto que en ese momento se está trabajando\n this.Nombre = nombre\n this.Tipo = tipo\n this.Vida = vida\n this.Poder = poder\n this.Agilidad = agilidad\n this.Nivel = nivel\n \n console.log(\"Construyendo...\")\n }", "title": "" }, { "docid": "25dda23fd44588a3454739df19f798b2", "score": "0.6426365", "text": "function DinoConstructor (name,weight,height,diet,location,timeframe,fact)\n{\n this.name = name;\n this.weight = weight;\n this.height = height;\n this.diet = diet;\n this.where = this.name + \" were located in \" + location;\n this.when = this.name + \" lived during the \" + timeframe;\n this.fact = fact; \n}", "title": "" }, { "docid": "de57ac4720cb6cf3d1e45a1b87b3727b", "score": "0.6420502", "text": "constructor(nombre, edad, raza, genero, esterilizado){\n //atributos\n this.nombre = nombre;\n this.edad = edad;\n this.raza = raza;\n this.genero = genero;\n this.esterilizado = esterilizado;\n }", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.639644", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.639644", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "f21f884d56e7f083529551ca5381a7f8", "score": "0.638571", "text": "constructor (nombre,organizacion,movil,campos) {\n this.nombre = nombre;\n this.organizacion = organizacion;\n this.movil = movil;\n this.campos = campos;\n }", "title": "" }, { "docid": "d00d3b6e6dce6e6a2c2a75f9c53aec8f", "score": "0.6363424", "text": "constructor(c) {\r\n this.class = c;\r\n var d = new Date();\r\n this.diaSemana = this.dias[d.getDay()];\r\n this.dia = d.getDate();\r\n this.mes = d.getMonth() + 1;\r\n this.ano = d.getFullYear();\r\n }", "title": "" }, { "docid": "fd65e04e030d694a4dde70744000d8a5", "score": "0.6350595", "text": "function construct() {}", "title": "" }, { "docid": "c74037bf630af54bbeb868464daf5617", "score": "0.63425", "text": "constructor(n, x, y, z){\n super(x, y, z);\n this.name = n;\n }", "title": "" }, { "docid": "adb1044bda6d22902fa1e29bd74e0891", "score": "0.6333835", "text": "constructor(){\n super()\n\n this.build() //A CLASSE CHAMA BUILD E JA EXECUTA\n\n }", "title": "" }, { "docid": "9beb5859e217dc6bcae6e4c1ce4a0f0f", "score": "0.63333356", "text": "constructor(argName, argAge, argGender, argWorkingStatus) {\n // dazniausiai konstruktoriuje inicijuojam pradines reiksmes ar veiksmus\n this.name = argName;\n this.age = argAge;\n this.gender = argGender;\n this.working = argWorkingStatus;\n }", "title": "" }, { "docid": "dfec98e7849242fe6aa3e879b64c0bdd", "score": "0.6328043", "text": "constructor(comp_id, comp_fecha){\n //algo que si requiero al inicio que se contruya es el comp_id, comp_fecha\n this.comp_id = comp_id;\n this.comp_fecha = comp_fecha;\n }", "title": "" }, { "docid": "45b7d2d2fcdc2ca53e92949178cb74e6", "score": "0.6298799", "text": "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc7025931;\n this.SUBCLASS_OF_ID = 0xa5940726;\n\n this.location = args.location;\n this.offset = args.offset;\n }", "title": "" }, { "docid": "1d442180705d7ef4ba42ed3b3e0747e0", "score": "0.6285341", "text": "constructor(){\n super() // o super é necessario para terminar a ligção entre as classes\n this.peso = 20\n }", "title": "" }, { "docid": "152b0c2a322ef021d16ac4059cdf1785", "score": "0.62688583", "text": "function localCtor () { }", "title": "" }, { "docid": "0ccf4c87742d2dfc11ea31d4d307d0dd", "score": "0.62675697", "text": "constructor(_nX, _nO, _type) {\n this._nX = _nX;\n this._nO = _nO;\n this._type = _type;\n }", "title": "" }, { "docid": "5343aae8448554ba40840bc3c394e54c", "score": "0.62602794", "text": "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8c05f1c9;\n this.SUBCLASS_OF_ID = 0x7f50b7c2;\n\n this.name = args.name;\n }", "title": "" }, { "docid": "bbeb67a3b20b929334123a6cb076b935", "score": "0.6257605", "text": "constructor(nome, cor, modelo) {\n super(nome); // propriedades herdadas\n\n this.cor = cor;\n this.modelo = modelo;\n }", "title": "" }, { "docid": "916ce9dec446bc5371326786ed6854ca", "score": "0.62566155", "text": "constructor(nombre, genero) {\r\n //Atributos\r\n this.nombre = nombre\r\n this.genero = genero\r\n }", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.62538487", "text": "constructor () {}", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.62538487", "text": "constructor () {}", "title": "" }, { "docid": "95481aac5af547150883081598fd582b", "score": "0.6253814", "text": "constructor(dia, mes, 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": "ff8a653fc05e3f7a5c0388a584858d2b", "score": "0.62532884", "text": "constructor(n1, n2, n3, n4, n5) {\r\n //se crea el costructor con sus respectivos atributos\r\n this.n1 = n1; //atributo\r\n this.n2 = n2; //atributo\r\n this.n3 = n3; //atributo\r\n this.n4 = n4; //atributo\r\n this.n5 = n5; //atributo\r\n }", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.6230745", "text": "constructor() {}", "title": "" }, { "docid": "7d1f4c9ec99833a5068225e5fd087ba7", "score": "0.62147915", "text": "constructor(name){ \n super(); // atake dewa mane parent er constructor k call kore dewa.\n this.name=name;\n }", "title": "" }, { "docid": "df9698a8e0a794d797f03bd70d28d664", "score": "0.62013036", "text": "constructor(){\n this.titulo = '';\n this.ano = 1984;\n this.genero = '';\n this.diretor = '';\n this.elenco = [];\n this.duracao = 0;\n }", "title": "" }, { "docid": "6d99ee9dbfa1d25101751b5782dff8e4", "score": "0.61874413", "text": "constructor() {\n // nothing to do\n }", "title": "" }, { "docid": "6d99ee9dbfa1d25101751b5782dff8e4", "score": "0.61874413", "text": "constructor() {\n // nothing to do\n }", "title": "" }, { "docid": "cf40d3b7d4fa7a0bfd6e9839868d1e00", "score": "0.6184711", "text": "constructor(tipo, numero) {\r\n this.Tipo = tipo;\r\n this.Numero = numero;\r\n }", "title": "" }, { "docid": "b7ffbcbd9e1d92b0192d89878f1348b0", "score": "0.61844146", "text": "constructor(day, month, year) {\n\n // If so, initialize with \"this\"\n this._day = day;\n this._month = month;\n this._year = year;\n }", "title": "" }, { "docid": "faa21726fbbc15216623fac4732a41a4", "score": "0.6183238", "text": "constructor()\n {\n }", "title": "" }, { "docid": "faa21726fbbc15216623fac4732a41a4", "score": "0.6183238", "text": "constructor()\n {\n }", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.6166293", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.6166293", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.6166293", "text": "constructor() {\n\t}", "title": "" }, { "docid": "963610d58b9652a67e6b581c167077d6", "score": "0.615843", "text": "function TempCtor() {\n }", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.6149165", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "fe0a0e8a625429e434ef16b6308a726b", "score": "0.61326134", "text": "constructor() {\n\t\tsuper(4, null);\n\t}", "title": "" }, { "docid": "15eda15c1dc6d35c360e04f1a977c022", "score": "0.61318105", "text": "constructor(name, year) {\n //@name = name\n this.name = name;\n this.year = year;\n }", "title": "" }, { "docid": "ca7e10cb0ed43f7e9108973545d36c63", "score": "0.61096984", "text": "constructor(n,p1,p2,c2) {\n this.nome = n;\n this.parametro1 = p1;\n this.parametro2 = p2;\n this.codigo = c2;\n }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.61089766", "text": "constructor() { }", "title": "" }, { "docid": "02f0393a65493fb153c08356ca5048c9", "score": "0.61025554", "text": "function InternalConstructor() {}", "title": "" } ]
2c959b0a7c86ad6a9c676c9caa57666e
funzione da linkare al onchange del select
[ { "docid": "f32bfc258e30406a210c3d513c2e96b3", "score": "0.0", "text": "function order_select_handler(index){\r\n\tvar type = index.id;\r\n\tconsole.log(\"reorder_mysql called with order = \"+type);\r\n\tclear_childs(document.querySelector(\".content\"));\r\n\toffset = 0;\r\n\tord = type;\r\n\tloading = true; //trigger to allow ajax request \r\n\tload_more_ads(); // function to fetch ads\r\n}", "title": "" } ]
[ { "docid": "e7f190c284994920c0443016b12ffe3c", "score": "0.7420202", "text": "changeSelect(event){\n\t\tApi.getEquipos({id_servicio:this._id_servicio.value});\n\t}", "title": "" }, { "docid": "18ff1d8e67d6beb686cafa5ed161cbb9", "score": "0.7350391", "text": "function onselectchange(o)\n{\n\to.parentNode.firstChild.value=o.options[o.selectedIndex].value;\n}", "title": "" }, { "docid": "900339f4a87580d5e44f16c1eecf4a6c", "score": "0.7321397", "text": "_onchange() {}", "title": "" }, { "docid": "900339f4a87580d5e44f16c1eecf4a6c", "score": "0.7321397", "text": "_onchange() {}", "title": "" }, { "docid": "2c7d7865fe8be44c80c5d912bf71b832", "score": "0.6909371", "text": "function optionChanged(select) {\r\n metaData(select);\r\n bar(select);\r\n bubble(select);\r\n}", "title": "" }, { "docid": "a97eb5fc05257479795b7e6ff37e1466", "score": "0.68530655", "text": "set onchange(func) {\n this._onchange = func;\n }", "title": "" }, { "docid": "8e7250799b2fa002bf34721b14fe2cf2", "score": "0.6688334", "text": "function on_select_change(type) {\n\treturn function(ev) {\n\t\ttry { \n\t\t\tif (type == 'events') {\n\t\t\t\t$('resources').selectedIndex = -1;\n\t\t\t} else {\n\t\t\t\t$('events').selectedIndex = -1;\n\t\t\t}\n\t\t\tvar index = ev.target.value;\n\t\t\tif (index == \"new\") {\n\t\t\t\tvar item = create_new[type]()\n\t\t\t\tindex = project[type].length;\n\t\t\t\tproject[type].push( item );\n\t\t\t\tev.target.selectedIndex = add_option(type)(item);\n\t\t\t}\n\t\t\t$('display-area').style.display = 'none';\n\t\t\t$('display-area').innerHTML = '';\n\t\t\tdisplay[type](project[type][index]);\n\t\t\t$('display-area').style.display = 'block';\n\t\t} catch (e) {\n\t\t\talert(\"problem changing selection : \" + e);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "f329e27c4023359869da35b104002d27", "score": "0.6683428", "text": "function onchange() {\n\t\t// removes the last potted graph\n\t\td3.selectAll(\"svg\").remove()\n\t\t\n\t\t// draws a new graph with the new option value\n\t\tselectValue = d3.select('select').property('value')\n\t\tdraw(selectValue)\n\t}", "title": "" }, { "docid": "f329e27c4023359869da35b104002d27", "score": "0.6683428", "text": "function onchange() {\n\t\t// removes the last potted graph\n\t\td3.selectAll(\"svg\").remove()\n\t\t\n\t\t// draws a new graph with the new option value\n\t\tselectValue = d3.select('select').property('value')\n\t\tdraw(selectValue)\n\t}", "title": "" }, { "docid": "1821ba86c9667d0ad4becf82e05b1f43", "score": "0.6679246", "text": "function optionChanged(select) {\n metaData(select);\n bar(select);\n bubble(select);\n gauge(select);\n}", "title": "" }, { "docid": "72bb16f2aff49fbdaa74dad01aea5b3d", "score": "0.6659288", "text": "function EstadoChange() {\n loadCiudadbyEstados($(\"#cmbEstado\").val());\n }", "title": "" }, { "docid": "c537052649804ad80c0334f96cd95659", "score": "0.6639303", "text": "onchange() {\n this.update();\n }", "title": "" }, { "docid": "d49f47b01e87e9e46581836c72b1ad9c", "score": "0.6635136", "text": "function onChangeTipoCita(){\r\n\tvar valueSelect = $(\"#tipoCita\").val();\r\n}", "title": "" }, { "docid": "129dd737eb0d60d5fcf4892f7a42d0be", "score": "0.65737516", "text": "function Select_Change_function(event) {\n if (event.data.params) {\n Collect_Params(this.id, \"change\", event.data.send_token, event.data.preloader);\n }\n else {\n Collect_Param_Element($(this), \"change\", event.data.send_token, event.data.preloader);\n }\n\n // Verifica background-image de SaveButton, if \"Grey\" change to \"Green\"\n SaveButton_Image_Check()\n}", "title": "" }, { "docid": "dd80f1221a4b34154dadb630d7df54a0", "score": "0.6572865", "text": "function onChangeTestamentSelect() {\n manipulator.populateBookSelect();\n}", "title": "" }, { "docid": "3f6eec7266b1902b31715e0240e71563", "score": "0.6525191", "text": "function checkvalue(event){\n if($(this).val() != ''){\n // Recuperer tout les niveau existant pour cet program\n var allNiveau = callAxios('/admission/niveau',{id: parseInt($(program).val())});\n \n allNiveau.then(function (data) {\n let selectNiveau = '<option value=\"\">Start in...</option>'\n data.map(function (niv) {\n selectNiveau += \"<option value='\" + niv.id + \"'>\" + niv.libele + \"</option>\"\n })\n // Remplir les option du select diplome\n // Afficher le select diplome\n $(niveau).html(selectNiveau);\n $(niveau).parent().show();\n })\n }else{\n // Reinitialiser les valeur des autres select\n $(this).prop('selectedIndex',0);\n\n // Cacher tout les autres selects\n // $(diplome).parent().hide();\n $(niveau).parent().hide();\n $(filiere).parent().hide();\n }\n\n\n }", "title": "" }, { "docid": "f785e512237fbcdc16fa140e65c3e816", "score": "0.65184146", "text": "function checkvalueniveau (event) {\n if($(this).val() != ''){\n var allFiliere = callAxios('/admission/filiere',{id: parseInt($(program).val())});\n \n allFiliere.then(function (data) {\n let selectFiliere = '<option value=\"\">select your sector...</option>'\n data.map(function (fil) {\n selectFiliere += \"<option value='\" + fil.id + \"'>\" + fil.libele + \"</option>\"\n })\n // Remplir les option du select diplome\n // Afficher le select diplome\n $(filiere).html(selectFiliere);\n $(filiere).parent().show();\n })\n \n \n }else{\n // Reinitialiser les valeur des autres select\n $(this).prop('selectedIndex',0);\n\n // Cacher tout les autres selects\n $(filiere).parent().hide();\n }\n }", "title": "" }, { "docid": "8e62eccec9b66815c670888fdd497d6b", "score": "0.65154034", "text": "onSelectChange(value) {\n if (value && this.options && this.options.length) {\n const optionFound = this.findOptionValue(value);\n if (optionFound) {\n this.updateModel(optionFound);\n this.setScrollPosition(optionFound.value);\n }\n }\n }", "title": "" }, { "docid": "8c5af2f59944b49810f69d61ee7258fb", "score": "0.65150875", "text": "function optionChanged(dropdown_value)\n{\n DrawCharts(dropdown_value);\n DisplayMetadata(dropdown_value);\n}", "title": "" }, { "docid": "63c080c38650c450dbe587b65cdf405a", "score": "0.649165", "text": "function PaisChange() {\n loadEstadosbyPais($(\"#MainContent_cmbPais\").val());\n }", "title": "" }, { "docid": "6c4bac7a24ebecc5c07c09c58d9fc701", "score": "0.648997", "text": "function valorTVehiculo(select_TVehiculo){\r\n\tvar select_TVehiculo = document.getElementById(select_TVehiculo).value;\r\n\tdocument.getElementById(\"t_vehiculo\").value = select_TVehiculo;\r\n}", "title": "" }, { "docid": "25a179960c7dfe5d9d25842c0c75bfcb", "score": "0.6478064", "text": "function enablePlaceDropdownChangeEvent() {\n $(Tag.SELECTPLACE).on(\"change\", function () {\n //change the value of plae dorpdown to name\n var selectedPlace = $(this).children(\"option:selected\").val();\n setSuburbDropdown(selectedPlace);\n });\n}", "title": "" }, { "docid": "356d797332eb0a9c49016f095309903b", "score": "0.6461551", "text": "function valorTSeguro(select_TSeguro){\r\n\tvar select_TSeguro = document.getElementById(select_TSeguro).value;\r\n\tdocument.getElementById(\"t_seguro\").value = select_TSeguro;\r\n}", "title": "" }, { "docid": "7d586d187572d76f5b0f2d9cc8766cee", "score": "0.6446566", "text": "function evento_cambiarObjSelect()\n{\n\tif(document.getElementById('selectobj0').value == 'Taza')\n\t{\n\t\tsetPrimeroTaza();\n\t}\n\telse if(document.getElementById('selectobj0').value == 'Cafetera')\n\t{\n\t\tsetPrimeroCafetera();\n\t}\n\tdocument.getElementById('selectobj1').value=\"No\";\n\tdocument.getElementById('selectobj3').value=\"No\";\n\tdocument.getElementById('selectobj4').value=\"No\";\n\tactSliders();\n}", "title": "" }, { "docid": "5c756f2f5a7aa703399ddcd819bb18ef", "score": "0.64386696", "text": "function naujasLygis(select) {\r\n lygis = select.options[select.selectedIndex].getAttribute(\"value\");\r\n zaidimas();\r\n}", "title": "" }, { "docid": "bbe8775ae8a7ba745bc45e406e4f895b", "score": "0.6434413", "text": "function actualizaCve(){\n document.getElementById(\"cve_expediente_sel\").selectedIndex = document.getElementById(\"expediente_sel\").selectedIndex; \n cve_exp = document.getElementById(\"cve_expediente_sel\").options[document.getElementById(\"cve_expediente_sel\").selectedIndex].label;\n document.getElementById(\"cve_expediente\").value = cve_exp; \n //alert(\"Sale\");\n}", "title": "" }, { "docid": "bff6419bae79b3ce927d9734737b3969", "score": "0.6422662", "text": "onVillageSelectionChange(event) {\n var selectedVillageKey = $(event.target).val();\n this.showGirviListForVillage(selectedVillageKey);\n }", "title": "" }, { "docid": "a1101edcd588f2c7caa17dec2b9cb465", "score": "0.6420111", "text": "function selectOnChange1(obj){\n\tvar value = obj.options[obj.selectedIndex].value;\n\tshowMaps(\"tmi1\",\"hottest\",value);\n}", "title": "" }, { "docid": "08e37cc884728d837a7ab2d6a25e02cf", "score": "0.64121765", "text": "registerOnChange(fn) {\n this.onChange = (_) => {\n const selected = [];\n if (_.selectedOptions !== undefined) {\n const options = _.selectedOptions;\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n // Degrade on IE\n else {\n const options = _.options;\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n this.value = selected;\n fn(selected);\n };\n }", "title": "" }, { "docid": "08e37cc884728d837a7ab2d6a25e02cf", "score": "0.64121765", "text": "registerOnChange(fn) {\n this.onChange = (_) => {\n const selected = [];\n if (_.selectedOptions !== undefined) {\n const options = _.selectedOptions;\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n // Degrade on IE\n else {\n const options = _.options;\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n this.value = selected;\n fn(selected);\n };\n }", "title": "" }, { "docid": "08e37cc884728d837a7ab2d6a25e02cf", "score": "0.64121765", "text": "registerOnChange(fn) {\n this.onChange = (_) => {\n const selected = [];\n if (_.selectedOptions !== undefined) {\n const options = _.selectedOptions;\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n // Degrade on IE\n else {\n const options = _.options;\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n this.value = selected;\n fn(selected);\n };\n }", "title": "" }, { "docid": "d99219aff42ea2e08ab67dece9e3fd19", "score": "0.64100695", "text": "registerOnChange(fn) {\n this.onChange = _ => {\n const selected = [];\n\n if (_.selectedOptions !== undefined) {\n const options = _.selectedOptions;\n\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n\n const val = this._getOptionValue(opt.value);\n\n selected.push(val);\n }\n } // Degrade on IE\n else {\n const options = _.options;\n\n for (let i = 0; i < options.length; i++) {\n const opt = options.item(i);\n\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n\n selected.push(val);\n }\n }\n }\n\n this.value = selected;\n fn(selected);\n };\n }", "title": "" }, { "docid": "3e5aeebaf3cf1b033ea45cf0bb3ae394", "score": "0.6402016", "text": "function onChangeCity(i) {\n // load district\n loadDistrict(i);\n var selectDistrict = document.getElementsByClassName('ward-district-city')[i].getElementsByClassName('district')[0].getElementsByTagName('select')[0];\n selectDistrict.onchange();\n}", "title": "" }, { "docid": "a169524e840aefe4195344f7974813e4", "score": "0.6368815", "text": "function optionChanged(selectedPatientID) {\r\n console.log(selectedPatientID);\r\n buildCharts(selectedPatientID);\r\n populateDemographicInfo(selectedPatientID);\r\n}", "title": "" }, { "docid": "26ac3d5c06e482b57bb0f448345b58b9", "score": "0.6367286", "text": "function changeFiltre(e){\n // console.log(\"jfjsnjf\");\n if(e.target.value === \"tous\" || e.target.value ===\"0\")\n setSelected(\"tous\");\n else if(e.target.value === \"titre\"){\n setSelected(\"titre\");\n }\n else if(e.target.value === \"prix\"){\n setSelected(\"prix\");\n }\n else if(e.target.value === \"localite\"){\n setSelected(\"localite\");\n }\n else if(e.target.value === \"participation\"){\n setSelected(\"participation\");\n }\n else if(e.target.value === \"jour\"){\n setSelected(\"jours restant\");\n }\n \n }", "title": "" }, { "docid": "7cfed17e36ea277263bd0843bf4558d8", "score": "0.6365004", "text": "registerOnChange(fn) {\n this.onChange = valueString => {\n this.value = this._getOptionValue(valueString);\n fn(this.value);\n };\n }", "title": "" }, { "docid": "c9c4a4c47fa78fdb1b1afad4d0b6870f", "score": "0.63568705", "text": "optionSelected(e) {\n // Must click <option> with value set.\n if (!e.target.value) return;\n this.closeDatalist();\n this.associatedInput.value = e.target.innerText;\n this._value = e.target.value;\n if (this.callback) this.callback();\n }", "title": "" }, { "docid": "57bb10c465617523e2a22b0cb0b03ea9", "score": "0.6356347", "text": "function change() {\n var year = document.getElementById(\"dropdown\").value;\n loadData(year);\n}", "title": "" }, { "docid": "4edd20c0b796b77f5047fd4d779c3dcc", "score": "0.6354025", "text": "registerOnChange(fn) {\n this.onChange = valueString => {\n this.value = this._getOptionValue(valueString);\n fn(this.value);\n };\n }", "title": "" }, { "docid": "daab4a60bb6a9a6dc9ee0c58ae4ffd1b", "score": "0.6353067", "text": "function setTeamSelect(){\n $(\"#team\").change(function(e){\n reload();\n })\n}", "title": "" }, { "docid": "d0b445e8266d63fcca26d676c22761d9", "score": "0.6344496", "text": "function onchangeNumeroOperaciones(objEvento) {\n\n reiniciarGrilla(objEvento);\n\n}", "title": "" }, { "docid": "7220e7e59f757ed05a6676e53af23d94", "score": "0.63402355", "text": "function MenuWidget_selectChange(e) {\n\n // Cross-browser discovery of the event target\n // By Stuart Landridge in \"DHTML Utopia ...\"\n var target;\n if (window.event && window.event.srcElement) {\n target = window.event.srcElement;\n } else if (e && e.target) {\n target = e.target;\n } else {\n alert('MenuWidget ERROR:\\n> selectChange: This browser does not support standard javascript events.');\n return;\n }\n\n if (target.nodeName.toLowerCase() != 'select') {\n alert('MenuWidget ERROR:\\n> selectChange: event target [' + target.nodeName.toLowerCase() + '] should instead be [select]');\n return;\n }\n// NOTE: I believe that this function is evaluated outside the context of the MenuWidget.\n// NOTE: Hence the need to extract the Widget from the Select object.\n var MW = target.widget;\n\n if (MW.callback) {\n MW.callback(MW);\n }\n}", "title": "" }, { "docid": "d52e4e994fb9253d2c00c97b4fe03c07", "score": "0.6330737", "text": "function optionChanged(selectedPatientID) {\r\n // console.log(selectedPatientID);\r\n buildCharts(selectedPatientID);\r\n populateDemographicInfo(selectedPatientID);\r\n}", "title": "" }, { "docid": "0bab1e39e4ab3a779c4ca531eeeb018c", "score": "0.6327193", "text": "function onSelectChange(){\n var value = this.value;\n lineGDPTPESCO2('#gdpTPESCO2', value, xWidth, yHeight);\n lineGDPTPESCO2CAPITA('#gdpTPESCO2', value, xWidth, yHeight);\n}", "title": "" }, { "docid": "7a7141f0f0353230b61ce11a8b4a9589", "score": "0.6326104", "text": "function onchangeRangoMatriz(objEvento) {\n\n reiniciarGrilla(objEvento);\n\n}", "title": "" }, { "docid": "c1ee9d8c6f063ffbc22a7a1247b3ce19", "score": "0.6287298", "text": "function initRobotSelect() {\n var robotSelect = document.getElementById('robotSelect');\n robotSelect.addEventListener('change', (e)=>{\n console.log(e.target.value);\n switchToRobot(e.target.value);\n });\n}", "title": "" }, { "docid": "b4e34c4741ad5f28cb7d6c0b2fb6f603", "score": "0.6283787", "text": "function SelectionChange() { }", "title": "" }, { "docid": "b4e34c4741ad5f28cb7d6c0b2fb6f603", "score": "0.6283787", "text": "function SelectionChange() { }", "title": "" }, { "docid": "13317993b14d914104609005742bd94e", "score": "0.62818223", "text": "function cmbsgrupo_cliente_codigo__change(){\n $(\"#cmbsgrupo_cliente_codigo\").change(function(){\n $(\"#cmbsremite_cliente_codigo\").html('');\n $('#cmbsremite_cliente_codigo').selectpicker('refresh');\n $(\"#cmbsgrupo_cliente_codigo option:selected\").each(function () {\n lsgrupo_cliente_codigo = $(this).val();\n $.post(\"../../controller/servicio.php?op=ctrl_apr_web_remitente_select\", {psgrupo_cliente_codigo : lsgrupo_cliente_codigo}, function(data, status){\n $(\"#cmbsremite_cliente_codigo\").html(data);\n $('#cmbsremite_cliente_codigo').selectpicker('refresh');\n });\n });\n });\n }", "title": "" }, { "docid": "9685eff7a13a824ea05283885c67da9b", "score": "0.6279922", "text": "_handleChange(e){this.value=e.detail.value;if(this.__ready!==void 0)this.dispatchEvent(new CustomEvent(\"change\",{bubbles:!0,detail:this}))}", "title": "" }, { "docid": "179334b2e65fad32cbe30d144d591ebc", "score": "0.6278543", "text": "function changeAjaxListener(select_name) {\n $('#' + select_name).bind('change', function(e) { \n url_param = getParamsUrl();\n \n //on remet a zéro les choix des contacts\n if(url_param['item'] === 'maison') {\n cleanSelectsContact(); \n }\n \n //on regarde si on a choisi un élement ou l'option d'ajout\n if($('#select_id').val() === '') {\n //on change le text du bouton submit\n $(\"#btnsubmit\").val(\"Ajouter\");\n \n //On retire le bouton de suppression\n $(\"#deleting\").remove();\n \n //on nettoye le formulaire\n cleanForm(url_param['item']);\n \n //et on vide les listes adresses\n $(\"#select_pays\").change(); \n }\n else {\n //on change le text du bouton submit\n $(\"#btnsubmit\").val(\"Editer\");\n \n //ajout du bouton de suppression\n if(!$(\"#deleting\").length) {\n $(\"#btnsubmit\").parent().after('<div id=\"deleting\" class=\"cell\"/>');\n $(\"#deleting\").append('<button id=\"btn_delete\" class=\"submit\">Supprimer</button>');\n addDeleteListener();\n }\n \n //on remplie le formulaire avec les informations de l'élement\n feedForm();\n }\n $(\"#select_etat\").change();\n });\n}", "title": "" }, { "docid": "b7610c97f0a17db68bc5a15cf5862843", "score": "0.627644", "text": "registerOnChange(fn) {\n this.onChange = (element) => {\n const selected = [];\n const selectedOptions = element.selectedOptions;\n if (selectedOptions !== undefined) {\n const options = selectedOptions;\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n // Degrade to use `options` when `selectedOptions` property is not available.\n // Note: the `selectedOptions` is available in all supported browsers, but the Domino lib\n // doesn't have it currently, see https://github.com/fgnass/domino/issues/177.\n else {\n const options = element.options;\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n this.value = selected;\n fn(selected);\n };\n }", "title": "" }, { "docid": "8f0b6c5269f5a9fef7f0d8243d3a22d3", "score": "0.6272553", "text": "onChange(e) {\n if (this.dropDownListObject.value === this.pagerModule.getLocalizedLabel('All')) {\n this.pagerModule.pageSize = this.pagerModule.totalRecordsCount;\n this.refresh();\n e.value = this.pagerModule.pageSize;\n if (document.getElementsByClassName('e-popup-open e-alldrop').length) {\n document.getElementsByClassName('e-popup-open e-alldrop')[0].style.display = 'none';\n }\n }\n else {\n this.pagerModule.pageSize = parseInt(this.dropDownListObject.value, 10);\n if (this.pagerCons.innerHTML !== this.pagerModule.getLocalizedLabel('pagerDropDown')) {\n this.refresh();\n }\n }\n this.pagerModule.dataBind();\n this.pagerModule.trigger('dropDownChanged', { pageSize: parseInt(this.dropDownListObject.value, 10) });\n }", "title": "" }, { "docid": "362e13202c564e5469dd1fbf81d0a487", "score": "0.6270401", "text": "function onSelect(event) {\r\n refresh(JSON.parse(event.data));\r\n}", "title": "" }, { "docid": "dab526fcaf75bb0a3fdf1d66d98b4e4c", "score": "0.62626284", "text": "changeOption(event) {\n const info = event.target.id.split(\";\");\n const dmLei = info[0];\n const geneId = info[1];\n const genes = this.state.currentGenePanel;\n\n // Checks if it is disease mode or last exon important that should be changed\n if (dmLei === \"dm\") {\n genes[geneId].disease_mode = event.target.value;\n } else {\n genes[geneId].last_exon_important = event.target.value;\n }\n\n // updates the value\n this.setState({\n currentGenePanel: genes\n }, function() {\n this.createGeneComponents();\n });\n }", "title": "" }, { "docid": "87ad50af2c45903af22d7184542bd649", "score": "0.6262563", "text": "selectChange(e){\n this.setState({\n filter: e.target.value,\n });\n this.getTODO();\n }", "title": "" }, { "docid": "061715dd40c3646aa0154680479ad261", "score": "0.62519896", "text": "registerOnChange(fn) {\n this.onChange = (valueString) => {\n this.value = this._getOptionValue(valueString);\n fn(this.value);\n };\n }", "title": "" }, { "docid": "061715dd40c3646aa0154680479ad261", "score": "0.62519896", "text": "registerOnChange(fn) {\n this.onChange = (valueString) => {\n this.value = this._getOptionValue(valueString);\n fn(this.value);\n };\n }", "title": "" }, { "docid": "061715dd40c3646aa0154680479ad261", "score": "0.62519896", "text": "registerOnChange(fn) {\n this.onChange = (valueString) => {\n this.value = this._getOptionValue(valueString);\n fn(this.value);\n };\n }", "title": "" }, { "docid": "5b314e6be533dc657938fbb3d3cb3f69", "score": "0.6251027", "text": "function seleccion(){\n\t\tvar seleccion = document.getElementById(\"cliente\");\n\t\tvar idCliente = seleccion.options[seleccion.selectedIndex].value;\n\t\tdocument.getElementById(\"idCliente\").value = idCliente;\n\t}", "title": "" }, { "docid": "2decd1016604da4e6c0a4c14b9e2fb59", "score": "0.6247075", "text": "function optionChanged(selected){\n console.log(selected);\n buildBar(selected);\n buildTable(selected);\n}", "title": "" }, { "docid": "34e4ae97e8244d74f993dd30573a633f", "score": "0.6240385", "text": "function dynamicSelectChanged( val, ds ) {\n // update the corresponding element with the selected value\n $('#' + ds.id + '_display').text( ds.selectedText() );\n }", "title": "" }, { "docid": "f53f53edd115b82d535229d9f91de42a", "score": "0.62302184", "text": "function handleSelect(event) {\n event.preventDefault();\n let fam = event.target.value;\n setFamily(fam);\n }", "title": "" }, { "docid": "c7e8e50494b0497b98c7fe048127f096", "score": "0.62247944", "text": "function MuniCombo(select){\n //MENSAJE\n //alert(select);\n municipio = document.getElementById(\"municipio\");//obtiene el elemento\n\tmunicipio.innerHTML = select ;//A partir de DOM le da un texto\n\n\tcolonia = document.getElementById(\"colonia\");//obtiene el elemento\n\tcolonia.innerHTML = \"<OPTION >Colonia</OPTION>\" ;//A partir de DOM le da un texto\n\tcp = document.getElementById(\"cp\");//obtiene el elemento\n\tcp.innerHTML = \"<OPTION >Codigo Postal</OPTION>\" ;//A partir de DOM le da un texto\n\t}//end limpiar", "title": "" }, { "docid": "bcfdd2c47bcad97971c34fc941722a09", "score": "0.6222663", "text": "onChange () {}", "title": "" }, { "docid": "12d2bcffca4881a87e66bd51a510193f", "score": "0.6215513", "text": "onSelectPickListValueChange(event) {\n this.selectPickListValue = event.target.value;\n }", "title": "" }, { "docid": "10938b4c9bd858eb0370bc72744cb3d2", "score": "0.6207258", "text": "function llenarComboGrados()\n{\n\n idDocente=$(\"#selDocentes\").val();\n //si el id esta vacio no hace nada\n if(idDocente == \"\")\n {\n //si docente tiene ningun nombre seleccionado se vacia el combo de grado y se pone ese html\n $(\"#selGrado\").html(\"<option value=''>Seleccione...<\\/option>\");\n return false;\n }\n\n //consulta los niveles que tiene asociado ese docente\n $.get( \"index.php?r=calificaciones/niveles-docente&idDocente=\"+idDocente,\n function( data )\n {\n $(\"#selGrado\").html(data);\n },\n \"json\");\n\n}", "title": "" }, { "docid": "1271d12d68358cb952b2743414b41452", "score": "0.620136", "text": "function loadSelect (tool, value) {\n\n\t\tvar toolOptions = tool.options;\n\n\t\tfor (var i = 0, length = toolOptions.length; i < length; i++) {\n\n\t\t\tif (toolOptions[i].value === value) {\n\t\t\t\ttool.selectedIndex = i;\n\t\t\t\tvar changeEvent = document.createEvent(\"HTMLEvents\");\n\t\t\t\tchangeEvent.initEvent(\"change\", false, true);\n\t\t\t\ttool.dispatchEvent(changeEvent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "9d6878f59bb55fbe4f260cc8f038b896", "score": "0.6200529", "text": "registerOnChange(fn) {\n this.onChange = element => {\n const selected = [];\n const selectedOptions = element.selectedOptions;\n if (selectedOptions !== undefined) {\n const options = selectedOptions;\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n // Degrade to use `options` when `selectedOptions` property is not available.\n // Note: the `selectedOptions` is available in all supported browsers, but the Domino lib\n // doesn't have it currently, see https://github.com/fgnass/domino/issues/177.\n else {\n const options = element.options;\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n this.value = selected;\n fn(selected);\n };\n }", "title": "" }, { "docid": "8f7e77bbb2b34323ad45212bbb7b3104", "score": "0.6197473", "text": "function LatitudeWidget_selectChange(e) {\n\n // Cross-browser discovery of the event target\n // By Stuart Landridge in \"DHTML Utopia ...\"\n var target;\n if (window.event && window.event.srcElement) {\n target = window.event.srcElement;\n } else if (e && e.target) {\n target = e.target;\n } else {\n alert('LatitudeWidget ERROR:\\n> selectChange: This browser does not support standard javascript events.');\n return;\n }\n\n if (target.nodeName.toLowerCase() != 'select') {\n alert('LatitudeWidget ERROR:\\n> selectChange: event target [' + target.nodeName.toLowerCase() + '] should instead be [select]');\n return;\n }\n// NOTE: I believe that this function is evaluated outside the context of the LatitudeWidget.\n// NOTE: Hence the need to extract the Widget from the Select object.\n var MW = target.widget;\n\n if (MW.callback) {\n MW.callback(MW);\n }\n}", "title": "" }, { "docid": "bf615b56cdd1dcd108214a9dc5fc9d1c", "score": "0.6194473", "text": "function convertToSelectHonourag(id, field ,link, agdate, agtime) {\n\t$('#' + field +\"_\"+ id).html(\"<select class='left' onBlur='saveNewValueHonourag(\\\"\" + id + \"\\\",\\\"\" + field + \"\\\", this.value,\\\"\" + agdate + \"\\\",\\\"\" + agtime + \"\\\");'><option value='National'>National</option><option value='International'>International</option></select>\");\n}", "title": "" }, { "docid": "a55864bebd09850504085ef12bc121ea", "score": "0.6193476", "text": "onChange() {\n\n\t}", "title": "" }, { "docid": "9609a2fe9097a2f2907ca8df7316a45e", "score": "0.61920494", "text": "selectChange(e) {\n \n this.setState({ currentSeminarId: e.target.value });\n\t e.preventDefault();\n }", "title": "" }, { "docid": "b78b5a1477611159bc292ff088368abd", "score": "0.61846745", "text": "onChange(e) {\n // Send object\n const selectedObj = this.props.options.find((option) => option.value === e.currentTarget.dataset.value);\n this.props.onChange(selectedObj);\n }", "title": "" }, { "docid": "f21e088ee130264856ebeb556cec00d2", "score": "0.6183644", "text": "function display_onchange() {\n selectValue = d3.select('#primary_id').property('value')\n switch (display_options.indexOf(selectValue)) {\n case 0:\n d3.select(\"#secondary_id_weekday\").remove();\n d3.select(\"#course_checkbox\").style('opacity', '0');\n drawDropdown(\"#secondary_dropdown\", \"secondary_id_month\", months, month_onchange);\n drawDropdown(\"#secondary_dropdown\", \"secondary_id_yearday\", fillDayArray(days_of_months[0]), yearday_onchange);\n drawDropdown(\"#secondary_dropdown\", \"secondary_id_year\", years, year_onchange);\n break;\n case 1:\n d3.select(\"#course_checkbox\").style('opacity', '1');\n d3.select(\"#secondary_id_month\").remove();\n d3.select(\"#secondary_id_yearday\").remove();\n d3.select(\"#secondary_id_year\").remove();\n drawDropdown(\"#secondary_dropdown\", \"secondary_id_weekday\", days, weekday_onchange);\n break;\n }\n }", "title": "" }, { "docid": "e80c307938920a116642a7e00da5956d", "score": "0.61811966", "text": "function select(){\nsel=document.getElementById(\"demo\");\nselval=sel.options[sel.selectedIndex].value;\nwindow.location=selval;\n}", "title": "" }, { "docid": "3a7fecf2520f5476e460e099c5abdb12", "score": "0.61727625", "text": "function optionChanged(id) {\n getData(id);\n fetchDemoInfo(id);\n}", "title": "" }, { "docid": "65698ee5f147bb063307b733f67743f5", "score": "0.6167593", "text": "function bind_event_with_dropdown(obj, channel_id){\r\n\tobj.addEventListener('change', function(event){\r\n\t\t// console.log(event.target.selectedIndex, event.target.selectedOptions[0].value);\r\n\t\tif(confirm(\"The associated messages for this key have been lost. Do you want to change the associated key for this channel?\")){\r\n\t\t\t// This function is used to change default key for this channel_id with new key\r\n\t\t\tchange_default_key_for_channel('channel', channel_id, event.target.selectedOptions[0].value)\r\n\t\t}else{\r\n\t\t\tvar options = obj.querySelectorAll('option');\r\n\t\t\tfor(var i=0;i<options.length;i++){\r\n\t\t\t\tif(options[i].value == default_key)\r\n\t\t\t\t\toptions[i].setAttribute('selected', true);\r\n\t\t\t\telse\r\n\t\t\t\t\toptions[i].removeAttribute('selected');\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "d1ebaecb1acf9bc13757945e75ac3f22", "score": "0.61556405", "text": "function onChangeBookSelect() {\n manipulator.populateChapterSelect();\n}", "title": "" }, { "docid": "118af32211ca5d16e0b1e648c0b1d444", "score": "0.61523163", "text": "function change_filter(){\n if ($(\"#select_aquifer\").find('option:selected').val()!=9999){\n change_aquifer();\n }\n}", "title": "" }, { "docid": "c535bb950ae4a9abb294f0403effb293", "score": "0.61513233", "text": "handleSelectField(event) {\n this.selectedField = event.detail.value;\n this.handleGetFieldType(event.detail.value);\n this.validForSave(); \n }", "title": "" }, { "docid": "417b28b8e1f0bbfc905e2557f932545f", "score": "0.6141255", "text": "selectedIndexChanged(prev, next) {\n super.selectedIndexChanged(prev, next);\n this.updateValue();\n }", "title": "" }, { "docid": "82a8f149b6c1bdb5358d45b3c1f8863d", "score": "0.6128926", "text": "onSelect(e) {\n if( e.params && e.params.data ) {\n let data = e.params.data.id;\n if( this.multiple === true && typeof data === 'string' ) {\n let val = data;\n data = (this.value) ? _.clone(this.value) : [];\n data.push(val);\n this.value = _.uniq(data); // prevent duplicates\n } else if ( this.valueType === 'Number') {\n this.value = data ? Number.parseInt(data) : -1;\n } else {\n this.value = data;\n }\n this.element.dispatchEvent(new Event(\"change\"));\n }\n }", "title": "" }, { "docid": "704a0ea457411b644b7333654ecdb3f9", "score": "0.6123648", "text": "function Select_toUnidad(val, form) {\n //alert(\"ingreso: \"+val+form);\n var select = document.getElementById(\"unidad\");\n select.options.length = 0;\n //document.form.txtf_mun.value=val;\n if (val == 'COATLAN DEL RIO') {\n var select = document.getElementById(\"unidad\");\n select.options[select.options.length] = new Option('-- ESCOJA UNIDAD DE SALUD --', '-- ESCOJA UNIDAD DE SALUD --');\n select.options[select.options.length] = new Option('APANZINGO', 'APANZINGO');\n\n }\n\n if (val == 'JOJUTLA DE JUAREZ') {\n var select = document.getElementById(\"unidad\");\n select.options[select.options.length] = new Option('-- ESCOJA UNIDAD DE SALUD --', '-- ESCOJA UNIDAD DE SALUD --');\n select.options[select.options.length] = new Option('HOSPITAL GENERAL DE JOJUTLA', 'HOSPITAL GENERAL DE JOJUTLA');\n }\n if (val == 'PUENTE DE IXTLA') {\n var select = document.getElementById(\"unidad\");\n select.options[select.options.length] = new Option('-- ESCOJA UNIDAD DE SALUD --', '-- ESCOJA UNIDAD DE SALUD --');\n select.options[select.options.length] = new Option('HOSPITAL GENERAL DE PUENTE DE IXTLA', 'HOSPITAL GENERAL DE PUENTE DE IXTLA');\n }\n if (val == 'ATLATLAHUCAN') {\n var select = document.getElementById(\"unidad\");\n select.options[select.options.length] = new Option('-- ESCOJA UNIDAD DE SALUD --', '-- ESCOJA UNIDAD DE SALUD --');\n select.options[select.options.length] = new Option('ATLATLAHUCAN', 'ATLATLAHUCAN');\n }\n\n\n}", "title": "" }, { "docid": "7488fbf5129fe9645a8e07eb5103192a", "score": "0.61156625", "text": "handleSelect(event) {\r\n this.selectedValue = event.target.value;\r\n }", "title": "" }, { "docid": "b9dd62cf9efc9fe275c8a9edf1080dff", "score": "0.609462", "text": "function OnChangeSelect2(e)\n {\n var getId = $(this).attr(\"id\");\n var getValue = $(this).val();\n console.log('getId', getId, 'value', $(this).val())\n\n if (getId.indexOf('zone') !== -1)\n {\n $scope.itemChange_detailcommande($(this).val(), 'zone');\n }\n else if (getId.indexOf('client_commande') !== -1)\n {\n $scope.itemChange_detailcommande($(this).val(), 'client');\n //$scope.client_commande = getValue;\n\n if (!($(\"#modal_addcommande\").data('bs.modal') || {})._isShown)\n {\n $scope.clientSelected = null;\n }\n $.each($scope.clients, function (keyItem, valueItem)\n {\n if (getValue == valueItem.id)\n {\n $scope.clientSelected = valueItem;\n\n return false;\n }\n });\n }\n else if (getId.indexOf('tier_depense') !== -1)\n {\n //$scope.tier_depense = getValue;\n if (!($(\"#modal_adddepense\").data('bs.modal') || {})._isShown)\n {\n $scope.tierSelected = null;\n }\n $.each($scope.tiers, function (keyItem, valueItem)\n {\n if (getValue == valueItem.id)\n {\n $scope.tierSelected = valueItem;\n console.log('item détecté ici');\n return false;\n }\n });\n }\n else if (getId.indexOf('categorie_depense_depense') !== -1)\n {\n var currentTypeDepense = null;\n $.each($scope.categoriedepenses, function (keyItem, valueItem)\n {\n if (getValue == valueItem.id && valueItem.type_depense)\n {\n currentTypeDepense = valueItem.type_depense.id;\n return false;\n }\n });\n\n $('#type_depense_depense').val(currentTypeDepense);\n\n }\n\n\n if(!$scope.$$phase)\n {\n $scope.$apply();\n }\n }", "title": "" }, { "docid": "ee2565984ff901a1dd3bb3baa5bef817", "score": "0.6094608", "text": "function onChange(e) {\n var val = e.target.value;\n setValue(val);\n }", "title": "" }, { "docid": "44e882ca3abd28a6708944ff96db1d27", "score": "0.6092203", "text": "function selectChange() {\n g_id = d3.select(\"#selected-station\").property(\"value\");\n selectSite(sitelist, g_id);\n}", "title": "" }, { "docid": "94f3af8ecca8f78a1a45dd23e6d3e052", "score": "0.60913813", "text": "_handle_change() {\n let index = Array.prototype.map\n .call(this.listbox.selectedOptions || [], function(option: HTMLOptionElement) {\n return option.index;\n });\n this.model.set('index', index, {updated_view: this});\n this.touch();\n }", "title": "" }, { "docid": "9480578b26d51ab0a06866972ad7c0c4", "score": "0.60910285", "text": "function changeTeam() {\n let select = document.getElementById(\"teamList\")\n let selected = select.options[select.selectedIndex].value;\n getTeamInfo(selected)\n}", "title": "" }, { "docid": "15f9cd11149af6777106591737a31bc2", "score": "0.60881394", "text": "function parameterChange() {\n parameter = document.getElementById(parameterName + \"-select\").value;\n update_map_data();\n updateColorAxis();\n highlightCountry();\n }", "title": "" }, { "docid": "c4222c71a64359c21ee5fe0770f0be2d", "score": "0.6086648", "text": "_getSelectedValue(e) {\n if (e.detail.value !== null) {\n this.value = e.detail.value.getAttribute(\"value\");\n this._setSelectedValues();\n this.dispatchEvent(\n new CustomEvent(\"change\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: { value: this.value }\n })\n ); //support for old version\n this.dispatchEvent(\n new CustomEvent(\"dropdown-select-changed\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this\n })\n );\n }\n }", "title": "" }, { "docid": "3caddf3e6a1a82aff7027d618758d22f", "score": "0.60765", "text": "function C_nameChange(selectObj)\n{\n var id = selectObj.id;\n var c_val = $('#WO_customer>option:selected').val();\n val = id + \"-\" + c_val;\n $.get(\"/app/Customer/get_Values\",{\"value\":val});\n $(\"#WO_loc option:gt(0)\").remove();\n if(c_val != \"-1\")\n {\n var c_name = $('#WO_customer>option:selected').text();\n $.get(\"/app/Customer/get_Locations\",{\"C_Name\":c_name},function(data) {\n data =JSON.parse(data);\n var loc = \"\"; \n var html = \"\";\n for(var i=0;i<data.length;i++)\n {\n loc = data[i].split(\":\");\n html = html + \"<option value='\"+ loc[0] +\"'>\"+ loc[1] + \", \" + loc[2] +\"</option>\";\n }\n $(\"#WO_loc\").append(html);\n });\n }\n $(\"#WO_loc\").selectmenu('refresh');\n \n}", "title": "" }, { "docid": "7d96e8dfed6457ba3f108fd6a4d78b46", "score": "0.6075236", "text": "function onChangeCentroDistribucion(){\n if(get('formulario.cbCentroDistribucion') != ''){\n accion('formulario.cbMapaCentroDistribucion', '.disabled=false');\n recargaCombo('formulario.cbMapaCentroDistribucion', 'APEObtenerMapasCDPorCD', \n 'es.indra.sicc.util.DTOOID', [['oid', get('formulario.cbCentroDistribucion')], ['oidIdioma', get('formulario.hIdioma')]]);\n } else {\n set_combo('formulario.cbMapaCentroDistribucion', arrayVacio());\n accion('formulario.cbMapaCentroDistribucion', '.disabled=true');\n set_combo('formulario.cbLineaArmado', arrayVacio());\n accion('formulario.cbLineaArmado', '.disabled=true');\n \n comboSubLineaVacio();\n }\n \n}", "title": "" }, { "docid": "152c82008acc66e8f01bac40835f952f", "score": "0.6065148", "text": "function updateChoice() {\n selObj = document.getElementById(\"year\");\n selValue = selObj.options[selObj.selectedIndex].value;\n}", "title": "" }, { "docid": "8884e175076c1419143f6fa2944bcf8a", "score": "0.60644203", "text": "handleChangeFromNativeSelect() {\n // this.selected = this.element.value;\n this.selected = $(this.element).val();\n }", "title": "" }, { "docid": "49819861e53acf341df672eb0342ba88", "score": "0.6064391", "text": "function onSelect() {\n // copy values from tempSelected* to selected*Obj\n vm.fo.selectedOriginObj = vm.tempSelectedOrigin;\n vm.fo.selectedMediaObj = vm.tempSelectedMedia;\n\n // dates\n vm.fo.releaseDateFrom = vm.tempReleaseDateFrom;\n vm.fo.releaseDateTo = vm.tempReleaseDateTo;\n\n $timeout(function () {\n vm.updateMethod();\n });\n\n toggleFilters(); // close filters after applying\n }", "title": "" }, { "docid": "5c4b5ea4747b3a9a85e0bd6a3d809f11", "score": "0.60611606", "text": "function selectEndTypeChange() {\n $('#selectEndTypes').change(function () {\n var city = $('#selectCity').val();\n var type = $(this).val();\n populateEndMarkersDropdown(type, city);\n });\n}", "title": "" }, { "docid": "0b251f91cf39ccbfa325cdc5bc7d5bc4", "score": "0.6056054", "text": "function listarSelect(ctrl, fn, element, add, selected) {\n $.ajax({\n url: $.PATH + ctrl +\"?function=\"+fn,\n //data: {function: fn},\n dataType: \"json\",\n cache: false,\n type: \"get\",\n success: function(response) {\n var html = \"<option value='X'>Selecciona</option>\";\n if (response.data != null) {\n \tvar response = response.data;\n \tvar val = \"\";\n for (var i = 0; i < response.length; i++) {\n \tif (selected == response[i].nombre || response.length == 1) {\n \thtml += \"<option value='\"+response[i].id+\"' selected>\"+response[i].nombre+\"</option>\";\n \tval = response[i].id;\n } else {\n \thtml += \"<option value='\"+response[i].id+\"'>\"+response[i].nombre+\"</option>\";\n }\n }\n } else {\n html = \"<option value='X' disabled>No disponible</option>\";\n }\n if (add == true) {\n \thtml += \"<option value='O'>Otro</option>\";\n }\n $(element).html(html);\n $(element).val(val).trigger(\"change\"); // cambiar opcion select2\n },\n error: function(response) {\n console.log(response);\n }\n });\n }", "title": "" }, { "docid": "f8463602fe7b5151963a0170f85f30a4", "score": "0.60493195", "text": "function optionChanged(country_name){\n filterdata(country_name);\n}", "title": "" }, { "docid": "3f64221955b0fc2c9d4d175263171846", "score": "0.60486495", "text": "function optionChanged(selected){\r\n makeBar(selected);\r\n makeBubble(selected);\r\n makeTable(selected);\r\n makeGauge(selected); \r\n}", "title": "" } ]
e3c9691fe2c7f451a783485659ffb65c
daca lasam asa functioneaza in schimb daca schimbam var catName in let catName ne da eroare COMPARE SCOPES >o diferenta majora intre var si let este ca atunci cand declarati o variabila cu VAR este declarat global sau local daca este declarat in interiorul unei functii; LETdomeniul de aplicare al lui LET este limitat la declaratia sau expresia bloc in care a fost declarata
[ { "docid": "6dc560e8c089ba49f7a7b0e8e263e116", "score": "0.0", "text": "function checkScope() {\n \"use strict\";\n var i = \"function scope\";\n if (true) {\n i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" } ]
[ { "docid": "f5fd5a45b0c5d80f81347127dc602455", "score": "0.6855026", "text": "function fn3() {\n // myName poate fi accesata oriunde \n // chiar daca este declarata in if,for,while\n let vizibilaInToataFunctia = 10;\n if (true) {\n let myName = 'test'; // doar local in if\n console.log(vizibilaInToataFunctia)\n // in acest bloc oriunde mai jos\n }\n console.log(myName) // nu putem accesa myName aici\n}", "title": "" }, { "docid": "5f441233443cd5fa0d301674ca5e3760", "score": "0.61324507", "text": "function funcionScope(){\n var a = 'A';\n let b = 'B';\n const c = 'C';\n console.log('Funcion: '+a,b,c);\n}", "title": "" }, { "docid": "0919845b04d5467629a7bd9cd6d532ba", "score": "0.5998596", "text": "function fn1() {\n // nu poate fi accesata inafara functie fn1\n var myName = 'test';\n}", "title": "" }, { "docid": "88bf0112898d7313bd4385b06a335804", "score": "0.5889366", "text": "function myFunctionn1() {\n var carNamee = \"Volvo\"; // Function Scope\n\n console.log(carNamee);\n}", "title": "" }, { "docid": "84c642e1993afc5d2caff3c060135d8a", "score": "0.5852482", "text": "function init(){\n // local variable\n let nama = \"neldo\"; \n let umur = 26;\n // inner function (closure)\n function cetakNama(){\n // akses ke parent variable\n console.log(`hai ${nama}`);\n console.log(umur);\n }\n // untuk mengecek closure\n // console.dir(cetakNama);\n cetakNama();\n}", "title": "" }, { "docid": "1eca0047e0346f503599d240d1db21e5", "score": "0.58276314", "text": "function david() {\n var tika;\n var x = 'lolos';\n function zorba() {\n tika = x;\n };\n zorba();\n console.log('sdsd',tika === 'lolos');\n}", "title": "" }, { "docid": "92ae14ea491eb32e0ebbdc53d5a0a482", "score": "0.580685", "text": "function ScopeTest() {\r\n if (true) {\r\n var foo = \"use anywhere\"; //var usamos para variables globales\r\n var bar = ' use in this block'; //let usamos para varaibles de bloques \r\n }\r\n console.log(foo);\r\n //console.log(bar);\r\n}", "title": "" }, { "docid": "09f6342362a566535c12f5eb1a8c1550", "score": "0.58058906", "text": "function letsLearnScope() {\n console.log('c,d',c, d); // JavaScript 10, accessible\n if (true) {\n let c = 'Python';\n let d = 100;\n console.log('c,d',c, d); // Python 100\n }\n console.log('c,d',c, d);\n}", "title": "" }, { "docid": "61bac4f7d6891d319b4272ab3aeb2f60", "score": "0.57705486", "text": "function laFuncionDeIrAlVar() {\n var variableLocal =\"lcoal\";\n variableGlobal =\"declarada sin querer\"\n for(var i=0;i<10;i++){\n console.log(\"i es igual a = \" + i );\n }\n //se guarda el ambito de la variable i\n console.log(\"i es igual a = \" + i );\n \n}", "title": "" }, { "docid": "a2a42550716b8c4e50be9a618b6fc8db", "score": "0.5706262", "text": "function varLearnScope() {\n console.log('a,b',a, b);\n if (true) {\n console.log('a,b',a, b);\n }\n}", "title": "" }, { "docid": "203ca2a5c2cd8dc24cf30c6a2d38c1fb", "score": "0.5680792", "text": "function init2() {\n if(true){\n let nombre3 = \"Enrique\";\n console.log(nombre3);\n }\n\n // console.log(nombre3);\n\n /* Al utilizar LET aquí mostrará un mensaje de error mencionando que \n nombre3 no está definida, esto es debido a que se ha definido la \n variable dentro del bloque condicional IF y estamos tratando de\n acceder a ella desde fuera del condicional*/\n /* En caso de utilizar VAR, si podremos acceder al nombre, esto debido\n a que VAR no toma en cuenta sí está dentro de un bloque o no, solo\n toma en cuenta sí está dentro de una función o no, sí está dentro de\n una función, las variables declaradas con VAR las puedes utilizar\n dentro de cualquier lugar de la función en la cual se declaro la\n variable (en éste caso la funcion es init) */\n /* Por otro lado LET no es function scoping sino block scoping, es\n decir a LET si le importa estar dentro de un bloque como lo puede\n ser un IF, un FOR o un WHILE, en éste caso el LET declarado está\n dentro de un bloque IF, por lo cual solo podremos utilizarlo en ese\n mismo bloque IF */\n}", "title": "" }, { "docid": "d61522c4a906157c0d2e5c1a60838583", "score": "0.56670266", "text": "function checkScope() {\n \"use strict\";\n var i = \"function scope\"; // var i = block, block\n let j = \"function scope\"; // let j = block, function\n if (true) {\n i = \"block scope\";\n let j = \"block scope\";\n // console.log(\"block i is: \", i);\n // console.log(\"block j is: \", j);\n }\n // console.log(\"funct i is: \", i);\n // console.log(\"funct j is: \", j);\n}", "title": "" }, { "docid": "986f22d6b6556ca8dda8155e0c28a89c", "score": "0.5635059", "text": "function ex1b() {\n document.getElementById(\"questionWindow\").innerHTML = \"What are the differences between let and var?\";\n let result = \"var có phạm vi toàn cục(globally scoped) và phạm vi chức năng(function scoped), còn let có phạm vi khối(block scoped).<br><br>\"\n result += \"Trong phạm vi sử dụng, dùng var: các biến có thể cập nhật và khai báo lại, còn dùng let: các biến có thể cập nhật nhưng không được khai báo lại.<br><br>\";\n result += \"var có cơ chế hoisting, còn let thì không có.\";\n document.getElementById(\"resultWindow\").innerHTML = result;\n}", "title": "" }, { "docid": "4ad65aa9293a3bb1134d9853041749de", "score": "0.5596853", "text": "function showVarUsage(name)\n{\n\tif(name === \"Rahul\")\n\t{\n\t\tvar lastName = \"Salunkhe\";\n\t}\n\telse\n\t{\n\t\tvar lastName = \"Patil\"\n\t}\n\tconsole.log(\"The first name of user is \" +name + \" and the last name is \" +lastName); /*This console shows that the variable declared with VAR is for whole function scope\n\tand not block scope */\n}", "title": "" }, { "docid": "70204afc23ff32a90c23f8b4577d8ba2", "score": "0.5585299", "text": "function variable1()\r\n {\r\n var c='10'; // Exist in function scope\r\n {\r\n var x = '1'; // Exist in function scope\r\n const y = '2';// Exist in block scope\r\n }\r\n console.log(x);\r\n console.log(y);\r\n console.log(c);\r\n console.log(a+3);\r\n}", "title": "" }, { "docid": "7893a6cafde47c81e954d220b6a3ca68", "score": "0.55831397", "text": "function fn8() {\n // Cannot access 'myName' before initialization\n // Pentru nu se aplica hosting\n console.log(myName)\n myName = 1;\n console.log(myName)\n\n let myName;\n\n // putem accesa myName doar dupa ce am declarat\n}", "title": "" }, { "docid": "4d83a8e5489a49661bc6d0b569391abd", "score": "0.5565873", "text": "function crayCrayScope(){\n var name = 'bob marley';\n (function(){\n var name = 'dan iwao';\n })();\n console.log('this is where we see that the reference for this variable => name is not found in the IFFE, thus => ' + name);\n}", "title": "" }, { "docid": "2a11f80d9b6fe9f32b55684a9d74c7c8", "score": "0.55449957", "text": "function scope(){\r\n\t{\r\n\t\tconst one = true;\r\n\t\tvar two = one;\r\n\t\tlet three = two;\r\n\t\t\r\n\t}\r\n\t\r\n\t//console.log(one);\r\n\tconsole.log(two);\r\n\tconsole.log(three);\r\n\t\r\n\tone // doesn't exists\r\n\ttwo // does exists\r\n\tthree // doesn't exists\r\n}", "title": "" }, { "docid": "c3e5d83eb8d7aeb39692a0ab1502c2b2", "score": "0.5512558", "text": "function myfunction()\r\n{\r\n var name=\"volo\"; //can be called a local declaration of variable using var keyword\r\n}", "title": "" }, { "docid": "420b8d70ca416d86969838e1f8624ee9", "score": "0.55030334", "text": "function hoistLetAndConst() {\n // console.log(cat);\n let cat = 'cat';\n}", "title": "" }, { "docid": "02984ea227bd0bda6a573e4062a8e58d", "score": "0.54744893", "text": "function myFunction1() {\n var carName = \"Volvo\"; // Function Scope\n}", "title": "" }, { "docid": "813dcf7021ea11a247f94d19e571ebbc", "score": "0.54337037", "text": "function constBlockScoped() {\n const test = 'upper scope';\n //let test = \"whoops\";\n //test = \"whoops\";\n if (true) {\n const test = 'lower scope';\n console.log(test);\n }\n console.log(test);\n}", "title": "" }, { "docid": "dcb844fddef7dcb5590f831bafb88386", "score": "0.54312456", "text": "function localDog() {\n const dog = 'winfield' //dog is local to the whatHappened fn\n}", "title": "" }, { "docid": "0c584aa89533589fb57f22c61ca33db0", "score": "0.53971994", "text": "function jsVariable(){\n\t\t// Variables created without a declaration keyword (var, let, or const) are always global, even if they are created inside a function.\n\t\tbasic()\n\t\t// usingVar()\n\t\t// usingLet()\n\t\t// usingConst()\n\t\tfunction basic(){\n\t\t\tlet a = 10;\t\t\t\t\t\t\tconsole.log(a, typeof a);\t//\tjs is weak type language since we won't define the type of a\n\t\t\ta = \"string\";\t\t\t\t\t\tconsole.log(a, typeof a); //\twe can change the type of data type at runtime \n\t\t\ta = {name: 'dheeraj'};\tconsole.log(a, typeof a);\t\t\t\n\t\t}\n\t\tfunction usingVar(){\n\t\t\t// declaration\n\t\t\t\tvar a = 'var a'\n\t\t\t\tconsole.log('Var declaration: ',a)\n\n\t\t\t//\tvar is redeclare and updated\n\t\t\t\tvar _a = 'var _a';\tvar $a = 'var $a';\t\t// ';' semicoln ar optional but use when we write in js code in single line\n\t\t\t\tconsole.log('Different way of var declaration: ',_a, $a)\n\n\t\t\t// defination of 'var b' moved to when interpreter do it task but intialiation remain at that line\n\t\t\t\tconsole.log('Var support hoisting: ', b)\t\n\t\t\t\tvar b = 'var b'\n\n\t\t\t//\tIf we knowingly update var c then is fine other it will create lots of bugs, that why we need let and const\n\t\t\t\tvar c = 'var c'\t\n\t\t\t\tif(true)\t\t\t\t\t\n\t\t\t\t\tvar c = 'var c updated'\t \t\t\t\t\t\t//\tbother if we used a similar name for a variable before as a variable etc if yes and we dont know about it then it surely change value of prev variable \n\t\t\t\tconsole.log('Problem with var: ', c)\n\t\t}\n\t\tfunction usingLet(){\n\t\t\t// declaration\n\t\t\t\tlet a = 'let a'\n\t\t\t\tconsole.log('Let declaration: ', a)\n\n\t\t\t// let is update \n\t\t\t\tlet b = 'let b is global'\n\t\t\t\tif(true){\n\t\t\t\t\tb = 'let b updated to global'\n\t\t\t\t}\n\t\t\t\tconsole.log('Let b: ', b)\n\n\t\t\t// not re-declaration : let b [SYNTAX_ERROR: IDENTIFIER 'a' HAS BEEN DECLARED ]\n\n\t\t\t// let re-delcare in different scope \t\n\t\t\t\tlet c = 'let c declare globally'\n\t\t\t\t{\n\t\t\t\t\tlet c = 'let c declare locally'\n\t\t\t\t}\n\t\t\t\tconsole.log('Checking re-declaretion: ', c)\n\n\t\t\t// scope checking \n\t\t\t\t{\n\t\t\t\t\tlet d = 'let c inside local'\n\t\t\t\t}\n\t\t\t\t// console.log('Checking scope: ', d) REFERENCE_ERROR: C IS NOT DEFINED \n\t\t\t\n\t\t\t// let not provide hoisting \n\t\t\t\t// console.log('Checking hoisting: ', e)\t\tREFERENCE_ERROR: CANNOT ACCESS 'e' BEFORE INITIALIZATION\n\t\t\t\t// let e = 'let e'\t\t\n\t\t}\n\t\tfunction usingConst(){\n\t\t\t// declaration\n\t\t\t\tconst a = 'const a'\n\t\t\t\t// const a;\tnot allow\n\t\t\t//\tnot update \n\t\t\t//\tnot re-declare \n\t\t\t//\tnot hoisting\t\n\t\t}\n\t\tfunction usingNothing(){\n\t\t\ta = [\"ram\", 21]\n\t\t\tb = 100\n\t\t\tconsole.log(a, typeof a)\n\t\t\tconsole.log(b, typeof b)\n\t\t}\n\t}", "title": "" }, { "docid": "ec63b728c158381968530a5e0469e6e2", "score": "0.53733253", "text": "function myFunction2() {\n var autoName2 = 'Volvoin';\n console.log(autoName2); // code here CAN use carName\n}", "title": "" }, { "docid": "19f6bfdfc5c7d75f077a225231eb2465", "score": "0.53664076", "text": "function fn1() {\n var name = 'Jake';\n}", "title": "" }, { "docid": "22813d70da2804b238e1e1e60a84ad7f", "score": "0.53660417", "text": "function escopovar (letra2){\n var letra2 = \"b\"\n}", "title": "" }, { "docid": "3599f3d4a9a4c59a50ed6a5cf30734b4", "score": "0.5365448", "text": "function checking(){\n let a = \"Function Scope\";\n if (true) {\n let a = \"Block Scope\";\n console.log(\"Block Scope a is : \" +a);\n }\n console.log(\"Function Scope a is : \" +a);\n}", "title": "" }, { "docid": "d4c8e0fffe9f1917f590a5ce74781f09", "score": "0.5359721", "text": "function showletUsage(name) //This function will give out an error.\n{\n\tif(name === \"Rahul\")\n\t{\n\t\tlet lastName = \"Salunkhe\";\n\t}\n\telse\n\t{\n\t\tlet lastName = \"Patil\"\n\t}\n\tconsole.log(\"The first name of user is \" +name + \" and the last name is \" +lastName); /* This console shows that the variable declared with LET is for block scope and \n\tnot for whole function scope */ \n}", "title": "" }, { "docid": "771bd73f0a0c9188749fe949939a74b7", "score": "0.53566384", "text": "function checkScope3() {\n \"use strict\";\n //let i = \"function scope\";\n if (true) {\n var i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "d4502f24f75455ca3ecbd7264cbc63f4", "score": "0.5345114", "text": "function checkScope4() {\n \"use strict\";\n //let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "cfc449eac883ea3c78ae8e9a87714022", "score": "0.5341702", "text": "function scope() {\n let hello = \"hello\";\n}", "title": "" }, { "docid": "5c652c377c03ce3c511456d1d1e28f3f", "score": "0.53073835", "text": "function tes(){\n//name conflict\nvar a = 2;\nconsole.log(a);\n}", "title": "" }, { "docid": "ccb13f3ef8b49e9d1fe808b6a34b01ec", "score": "0.5301168", "text": "function closure() {\n \n function muestraName() {\n alert(name);\n }\n return muestraName;\n } // fin Funcion closure solicitado por nombre", "title": "" }, { "docid": "f8c6b4351f4a41b6895356b5dcc41379", "score": "0.529057", "text": "function myFunc() {\n //variable inside \"parent\" function scope\n var name = \"C'era\";\n //\"child\" function (inside \"parent\" function)\n function coderName() {\n //inside body of \"child\" function scope, use parent scope variable\n console.log(name);\n }\n //return \"child\" function inside \"parent\" function\n return coderName;\n}", "title": "" }, { "docid": "98b8d7030b48edff411e93fa32262953", "score": "0.5285408", "text": "function checkScope() {\n 'use strict';\n let i = 'function scope';\n if (true) {\n let i = 'block scope';\n console.log('Block scope i is: ', i);\n }\n console.log('Function scope i is: ', i);\n return i;\n }", "title": "" }, { "docid": "fc52aef6296d619f7d7911a1715234b5", "score": "0.52825576", "text": "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i; \n}", "title": "" }, { "docid": "f1254a860abf153085107e6eb924b8c3", "score": "0.5281079", "text": "function checkScope() \n{\n let i = 'function scope';\n if (true) {\n let i =\"block scope\";\n console.log('Block scope i is: ', i);\n }\n console.log('Function scope i is: ', i);\n return i;\n}", "title": "" }, { "docid": "553cc25bcb34472f65046fbb3edc47a5", "score": "0.52588874", "text": "function varLet(){\n let job = \"Function SDET\"; //var declared globally, and if this one was var, and then job variable inside of the block\n if(true){ //was job = \"new value\", then it would change value globally \n //where if both declared with let - the one inside of IF block would only change there, but not for the function\n let job = \"Block Boss\";\n console.log(job);\n }\n console.log(job);\n}", "title": "" }, { "docid": "1ecc345ab1267d790173b50d727b46ee", "score": "0.52553725", "text": "function checkScope() {\r\n \"use strict\";\r\n let i = \"function scope\";\r\n if (true) {\r\n let i = \"block scope\";\r\n console.log(\"Block scope i is: \", i);\r\n }\r\n console.log(\"Function scope i is: \", i);\r\n return i;\r\n \r\n }", "title": "" }, { "docid": "112b9d9ec73d998893831405fb5b3b83", "score": "0.52355146", "text": "function someFunction() {\n var name = 'Susan';\n}", "title": "" }, { "docid": "4290ecbbb94fa17565bbb4f3b452bb5a", "score": "0.5224027", "text": "function printAge() {\n //finds name from global scope\n let output = `${firstName}, You are ${age}, born in ${birthYear}`\n// console.log(output);\n //scope reaches out and finds parameter or outer function just like variable\n \n if(birthYear >= 1981 && birthYear <= 1996) {\n var millenial = true;\n const firstName = 'Steven';\n //different variable\n //can have different functions with same parameter they're only in that scope\n //javascript engine will find variable and not have look up in scope chain\n //outside block firstName is Nez\n const str = `You're a millenial, ${firstName}`;\n console.log(str);\n \n function add(a, b) {\n return a + b;\n //this function is block scoped\n }\n //redefine variable inside child scope (inner)\n \n output = 'New output'\n //manipulateing variable from inner scope\n //if created a new one with same name name it would print original output\n }\n// console.log(str);\n //block scoped so cannot access string outside\n// console.log(millenial);\n //millenial variable function scoped so can access it within entire function even if it's declated in block\n// add(2,3);\n //function block scoped in strict mode can't use it always use strict mode\n console.log(output)\n }", "title": "" }, { "docid": "61319816c48f936368bc15b588898b27", "score": "0.5223861", "text": "function varScope() {\n console.log(\"line 126: \" + greeting); // prints undefined...\n\n if (true) {\n var greeting = \"hello\"; // scoped to the function itself\n console.log(\"line 130: \" + greeting); // prints \"hello\"\n }\n\n console.log(\"line 133: \" + greeting); // prints \"hello\"\n\n}", "title": "" }, { "docid": "ca99327946b8987297d96862af525574", "score": "0.52181196", "text": "function checkScope() {\n\"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "c287350be2c342e9d3886061480ff4dc", "score": "0.52082956", "text": "function checkScope() {\n \"use strict\";\n\n let i = \"function scope\";\n if(true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "a1ce1ee7a399685d4c2672b08031b1d6", "score": "0.52078825", "text": "function constTest() {\n const scope = 1;\n if (true) {\n const scope = 2;\n console.log(scope);\n }\n console.log(scope);\n if (true) {\n const scope = 3;\n console.log(scope);\n }\n console.log(scope);\n }", "title": "" }, { "docid": "0eac82ea487d03fde5ec36399cc8894b", "score": "0.52071494", "text": "function c() {\n\tfunction d() {\n\t\tconsole.log(\"myVar2 = \" + myVar2);\n\t}\n\t\n\tvar myVar2 = \"c\";\n\tconsole.log(\"myVar2 = \" + myVar2);\n d();\n}", "title": "" }, { "docid": "8b7bcf5392f04b57c85434db6accb0b0", "score": "0.5203601", "text": "function display(){\n if(true){\n var name = \"Dhaval\" ;\n let city = \"Boston\"; // Block Scoped\n const state = \"MA\" // Block Scoped\n \n console.log(name)\n console.log(city)\n console.log(state)\n }\n \n // console.log(name)\n // console.log(city)\n // console.log(state)\n}", "title": "" }, { "docid": "c763885f392a73e6561db39e44af7a1c", "score": "0.52006423", "text": "function checkScope2() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "45de62dbf3971be38079003de5fa925b", "score": "0.5197278", "text": "function showScope(testlocal){\n\t//local variable only to this function\n\tvar functLocal = 5;\n\t\n\t\n\tconsole.log(testlocal); //test local is passed from another function but is still a local variable, just not in this function\n\t\n\tglobe = globe/2;\t//divides it by 2\n\n\n\n}", "title": "" }, { "docid": "fee8eb3d24ec3738857a7975ed19106d", "score": "0.5196432", "text": "function functionScope() {\n let functionScopeVariable = \"Matt\";\n if (true) {\n let blockScopeVariable = \"Rachelle\";\n greeting(functionScopeVariable);\n greeting(blockScopeVariable);\n }\n greeting(functionScopeVariable);\n //greeting(blockScopeVariable); - not available here\n}", "title": "" }, { "docid": "5bc6c6859d538615c73bff63381288ab", "score": "0.5194119", "text": "function myFunction() {\n var carName = \"Volvo\";\n // code here CAN use carName\n}", "title": "" }, { "docid": "5bc6c6859d538615c73bff63381288ab", "score": "0.5194119", "text": "function myFunction() {\n var carName = \"Volvo\";\n // code here CAN use carName\n}", "title": "" }, { "docid": "5452efa1ce5f4332b8270dda9e859a88", "score": "0.5182776", "text": "function strict(){\n \"use strict\";\n\n catName=\"Oliver\";\n //quote=catName+\" Say Hello\";\n}", "title": "" }, { "docid": "13b0e9aeeffab2b1f4761bdb70a3380a", "score": "0.5177996", "text": "function myFunction() {\n var carName = \"Volvo\";\n \n // code here CAN use carName\n \n}", "title": "" }, { "docid": "5a03a546f66ecc6adfb01187d9696d9e", "score": "0.5176918", "text": "function blockScope(){\n let c = \"cat\";\n\n var m = \"mary\"; // this variable declared inside of a function can NOT be accessed outside of the scope (even though it's var)\n\n if (true) {\n let d = \"dog\";\n //console.log(d) // the variable is only accessible within this scope\n }\n\n console.log(d); // we cannot access d \"dog\" because it is confined to the lexical/block\n console.log(c) // c is fine because it's in the same scope\n}", "title": "" }, { "docid": "1093607ad10dd058a97deadf206f87e5", "score": "0.51751983", "text": "function teachFunctionScope() {\n var myVar = 'Still a terrible variable name'\n\n console.log(myVar)\n}", "title": "" }, { "docid": "c6c755775c001a7e97467a603ed407aa", "score": "0.51702356", "text": "function friendsOfCustomer(name){\n //CODE BELOW HERE\nvar friendsOfCustomer(laila)\n\n\n //CODE ABOVE HERE\n}", "title": "" }, { "docid": "3c66941f59292b9bf52018fa68f13bf6", "score": "0.5161512", "text": "function scopeTest() {\n var a = 10;\n var a = 20;\n return a;\n}", "title": "" }, { "docid": "20b5814a8c3209e2ac0ce401b8ecf5e3", "score": "0.5157818", "text": "function test_rule_8() {\n var sameName = 'outer';\n var fn = function() {\n var sameName = 'inner';\n }\n fn();\n v4 = sameName;\n console.log(`v4 = ${v4}`);\n}", "title": "" }, { "docid": "e2c7b36d19ea32dc261ac67653ca65fa", "score": "0.5153856", "text": "function baz(foo) {\n\t// in the scope of 'baz'(in the declaration)\n\tfoo = \"bam\";\n\t// no bam in local scope, then go to upper scope - global\n\t// Global scope, says: I've just created it(not in strict mode)\n\tbam = \"yay\";\n}", "title": "" }, { "docid": "6cd9bade50019ad0d1dc5dfb8393ab8d", "score": "0.51517344", "text": "function fun1() {\n oopsGlobal = 5; // oopsGlobal is Global because var is not used.\n}", "title": "" }, { "docid": "14e29d1d9b4eee19720d42fffadca083", "score": "0.5148054", "text": "function jobArrived( s : Switch, job : Job )\n{\n\t// Variables are not hoisted within function scope\n\tif(typeof function_1_scope_variable == 'undefined') // true\n\n\t// Declaring variables within a top level function scope is fine\n\tvar function_1_scope_variable = \"function_1_scope_variable\";\n\n\t// Declaring variables within a function scope's block is fine\n\tif(true){\n\t\tvar function_1_block_scope_variable = \"function_1_block_scope_variable\";\n\t}\n\n\t// Anonymous function, level 2\n\tfunction(){\n\n\t\t// Declaring variables within secondary level function scope is fine\n\t\tvar function_2_scope_variable = \"function_2_scope_variable\";\n\n\t\tif(true){\n\t\t\t// Declaring variables within a secondary level function scope's block causes a crash\n\t\t\t// var function_2_block_scope_variable = \"function_3_block_scope_variable\"; // ***CRASH***\n\n\t\t\t// Instead, assign the non-declared variable\n\t\t\tfunction_2_block_scope_variable = \"function_2_block_scope_variable\";\n\n\t\t\t// All but the first function's block scope variables are available here\n\t\t\ts.log(\n\t\t\t\t\t-1,\n\t\t\t\t\t(\n\t\t\t\t\t\ttypeof(global_variable) + \" \" +\t// string\n\t\t\t\t\t\ttypeof(function_1_scope_variable) + \" \" + // string\n\t\t\t\t\t\ttypeof(function_1_block_scope_variable) + \" \" + // undefined\n\t\t\t\t\t\ttypeof(function_2_scope_variable) + \" \" + // string\n\t\t\t\t\t\ttypeof(function_2_block_scope_variable) // string\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\t}();\n\n\n\t/* Declaring block variables in any top level function scope is fine \t\t\t\t*/\n\n\tif(true){ // Block 1\n\t\tvar x = 1;\n\t\tif(true){ // Block 2\n\t\t\tvar x = 2;\n\t\t\tif(true){ // Block 3\n\t\t\t\tvar x = 3;\n\t\t\t\tif(true){ // Block 4\n\t\t\t\t\tvar x = 4;\n\t\t\t\t\tif(true){ // Block 5\n\t\t\t\t\t\tvar x = 5;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Declaring variables in any function scope, outside of blocks, is fine \t*/\n\n\tfunction(){ // Scope level 2\n\t\tvar x = 1;\n\t\tfunction(){ // Scope level 3\n\t\t\tvar x = 2;\n\t\t\tfunction(){ // Scope level 4\n\t\t\t\tvar x = 3;\n\t\t\t\tfunction(){ // Scope level 5\n\t\t\t\t\tvar x = 4;\n\t\t\t\t\tfunction(){ // Scope level 6\n\t\t\t\t\t\tvar x = 5;\n\t\t\t\t\t}();\n\t\t\t\t}();\n\t\t\t}();\n\t\t}();\n\t}();\n\n\n\t/* Declaring variables in any function scope, outside of blocks, is fine.\n\t\tYou can even use if/else without declaring a block {}.\t\t\t\t\t*/\n\n\tfunction(){ // Scope level 2\n\t\tif(true) var x = 1; // Ok\n\t\t/*\n\t\tif(true){\n\t\t\tvar x = 1; // ***CRASH***\n\t\t}\n\t\t*/\n\t\tfunction(){ // Scope level 3\n\t\t\tif(true) var x = 2; // Ok\n\t\t\t/*\n\t\t\tif(true){\n\t\t\t\tvar x = 2; // ***CRASH***\n\t\t\t}\n\t\t\t*/\n\t\t\tfunction(){ // Scope level 4\n\t\t\t\tif(true) var x = 3; // Ok\n\t\t\t\t/*\n\t\t\t\tif(true){\n\t\t\t\t\tvar x = 3; // ***CRASH***\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tfunction(){ // Scope level 5\n\t\t\t\t\tif(true) var x = 4; // Ok\n\t\t\t\t\t/*\n\t\t\t\t\tif(true){\n\t\t\t\t\t\tvar x = 4; // ***CRASH***\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\tfunction(){ // Scope level 6\n\t\t\t\t\t\tif(true) var x = 5; // Ok\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tif(true){\n\t\t\t\t\t\t\tvar x = 5; // ***CRASH***\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t}();\n\t\t\t\t}();\n\t\t\t}();\n\t\t}();\n\t}();\n\n\n\t/* Declaring variables */\n\n\t// Multiple variables can be declared in a single go\n\tvar a, b, c, d, e;\n\n\t// Multiple variables can be declared and assigned in a single go\n\tvar \ta = 1,\n\t\t\tb = 2,\n\t\t\tc = 3,\n\t\t\td = 4,\n\t\t\te = 5;\n\n}", "title": "" }, { "docid": "a30531e417ad137ddef5ae740eb09786", "score": "0.51454407", "text": "function scope(){\n var top = \"top\";\n console.log(top);\n console.log(top);\n}", "title": "" }, { "docid": "86908b39692d51be3084581a952f7867", "score": "0.5144123", "text": "function foo() {\n var name;\n}", "title": "" }, { "docid": "326651f8c68fd7766e40f662627c5d1e", "score": "0.51363313", "text": "function A() {\n\n a = 30;\n console.log(a);\n\n // The scope of variable declared in function, is limited to function only\n var b = 10;\n \n console.log(b);\n\n }", "title": "" }, { "docid": "683cfd267e73f296f6978f79f644eb4f", "score": "0.5130864", "text": "function initConst() { \n///// \n\tlet { assign, create } = Object \n\t\n\treturn { 이보게젊은이, 대략, 대충 } \n\n// .. functions .. \nvar 받아왔어요 \nfunction 이보게젊은이( 널널한공간, 받아적어, ... 거시기 ) { \n\tlet 남은값 = [] \n\tassign( \n\t\t 받아왔어요 = 받아왔어요 || {} \n\t\t, ... 널널한공간 .map( t => 범위로뽑기( t, 남은값 ) ) \n\t\t) \n\tlet [ 시작값 ] = 남은값 \n\t시작값 && assign( 받아왔어요, new class { \n\t\t[ 시작값 ] = 받아적어 \n\t\t} ) // remain original function \n\tassign( \n\t\t 받아왔어요 \n\t\t, ... 거시기 .map( ( v, i ) => new class { \n\t\t\t[ 남은값[ i + 1 ] ] = ForV( v ) // extract one time \n\t\t\t} ) \n\t\t) \n\t\n\treturn `${ ForV( \n\t\t 시작값 ? 받아왔어요[ 시작값 ] : 받아적어 \n\t\t, ... 거시기 \n\t\t) }` \n\t} // -- 이보게젊은이() \n\nfunction 대략( ... ar ) { \n\treturn { toString } \n\t\n\tfunction toString() { // lazy loader with fix value .. \n\t\treturn `${ assign( this, 글자로뽑기( `${ 대충( ... ar ) }` ) ) }` \n\t\t} // -- toString() < 대략() \n\t} // -- 대략() \n\nfunction 대충( raw, ... ar ) { \n\treturn { toString } \n\t\n\tfunction toString() { // lazy loader with fix value .. \n\t\tvar rawa = [], ara = [] \n\t\tfor ( let [ p, v ] of raw .entries() ) { \n\t\t\tlet [ ra, ... aa ] = ttoraw( \n\t\t\t\t v \n\t\t\t\t, /(?<꾸밈>[\\s\\S]*?)(?<치환곽>\\{\\s*(?<치환자>[\\s\\S]+?)\\s*\\}|$)/g \n\t\t\t\t, ( traw, tar ) => ( \n\t\t\t\t\t\t all, rawv, arv, arvv, origin, position \n\t\t\t\t\t\t, { 꾸밈, 치환곽, 치환자 } \n\t\t\t\t\t\t) => { \n\t\t\t\t\ttraw .push( 꾸밈 ) \n\t\t\t\t\ttar .push( \n\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\tlet arp = ar[ p ] \n\t\t\t\n\t\t\trawa .push( ... ra ) \n\t\t\tara .push( ... aa, '' ) // continue with next \n\t\t\tarp && ( \n\t\t\t\t rawa .push( '' ) \n\t\t\t\t, ara .push( arp ) \n\t\t\t\t) \n\t\t\t} \n\t\tara .pop() // cut about pack \n\t\trawa = assign( create( rawa ), new class { \n\t\t\traw = rawa \n\t\t\t} ) \n\t\t\n\t\treturn getsetToString( this, String .raw( rawa, ... ara ) ) \n\t\t} // -- toString() < 대충() \n\t} // -- 대충() \n\nfunction getsetToString( o, t ) { \n\tlet F = o .toString = q => t \n\treturn F( t ) \n\t} // -- getsetToString() \n\nfunction 있는대로만( { raw }, ... ar ) { \n\tlet printIndex = -1 \n\treturn new class { \n\t\ttoString = q => String .raw( { raw }, ( \n\t\t\t printIndex += 1 \n\t\t\t, ar .map( a => a ?.[ printIndex ] || '' ) \n\t\t\t) ) \n\t\tsourceFrom = [ raw, ... ar ] \n\t\t} \n\t} // -- 있는대로만() \n\nfunction ttoraw( t, regv, regF ) { \n\tlet raw = [] \n\tlet ar = [] \n\tlet rpop, apop \n\t\n\tt .replace( regv, regF( raw, ar ) ) \n\twhile ( \n\t\t\t[ rpop = raw .pop(), apop = ar .pop() ] \n\t\t\t\t.every( v => ! v ) \n\t\t\t&& raw .length \n\t\t\t) { \n\t\t} \n\t\n\t apop ? ( raw .push( rpop, '' ), ar .push ( apop ) ) \n\t: rpop && ( raw .push( rpop ), ar .push ( apop ) ) \n\t\n\traw .raw = raw \n\t raw .length ? ( ar .length = raw .length - 1 ) \n\t: raw .push( '' ) \n\t\n\treturn [ raw, ... ar ] \n\t} // -- ttoraw() \n\nfunction 글자로뽑기( t ) { \n\treturn 있는대로만( ... ttoraw( t \n\t\t, /(?<꾸밈>[^[]*)(?<돌돌이곽>\\[(?<돌돌이>[^\\]]*?)\\])?/g \n\t\t, ( raw, ar ) => ( \n\t\t\t\t all, rawv, arv, arvv, origin, position \n\t\t\t\t, { 꾸밈, 돌돌이곽, 돌돌이 } \n\t\t\t\t) => { \n\t\t\traw .push( 꾸밈 ) \n\t\t\tar .push( 돌돌이곽 && 돌돌이 .split( ',' ) ) \n\t\t\t} \n\t\t) ) \n\t} // -- 글자로뽑기() \n\nfunction 범위로뽑기( t, 남은값 ) { \n\tlet [ raw, ... ar ] = ttoraw( t \n\t\t, /\\s*(?<제목>[^{]*?)\\s*(?<내용칸>\\{\\s*(?<내용>[^}]*?)\\s*\\}|$)/g \n\t\t, ( raw, ar ) => ( \n\t\t\t\t all, rawv, arv, arvv, origin, position \n\t\t\t\t, { 제목, 내용칸, 내용 } \n\t\t\t\t) => { \n\t\t\traw .push( 제목 ) \n\t\t\tar .push( 내용칸 && 내용 ) \n\t\t\t} \n\t\t) \n\t남은값 .push( raw[ ar .length ] ) \n\treturn ar .length ? assign( ... ar .map( ( t, p ) => new class { \n\t\t\t[ raw[ p ] ] = 글자로뽑기( t ) \n\t\t\t} ) ) \n\t\t: {} \n\t} // -- 범위로뽑기() \n\nfunction ForV( o, ... ar ) { return o instanceof Function ? new class { \n\ttoString = q => `${ o( 받아왔어요, ... ar ) }` \n\t} : o } // -- ForV() \n\n///// \n} // -- initConst() ", "title": "" }, { "docid": "d448854f8ac0fa531a0316d5f89699da", "score": "0.5129515", "text": "function fa() {\n //a defined in t\n console.assert(a===33);\n\n //The encapulated ones not\n function faa() {\n var faav = 4;\n }\n //faav is not visible here\n}", "title": "" }, { "docid": "6e4fdfb6452dd228beef1e5a948b5c57", "score": "0.5127793", "text": "function checkScope() {\n\t\"use strict\";\n\tlet i = \"function scope\";\n\tif (true) {\n\t\tlet i = \"block scope\";\n\t\tconsole.log(\"Block scope i is: \", i);\n\t}\n\tconsole.log(\"Function scope i is: \", i);\n\treturn i;\n}", "title": "" }, { "docid": "0e478dce4a2f3d7622427f1a9e53ab4a", "score": "0.5126928", "text": "function checkScope () {\n \"use strict\";\n let i = \"function scope\"\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i); // \"Block scope i is: \" \"block scope\"\n }\n console.log(\"Function scope i is:\" , i); // \"Function scope i is:\" \"function scope\"\n return i;\n}", "title": "" }, { "docid": "4a1830f5732289ec074e8486cb31f8f6", "score": "0.51242", "text": "function hobbitHi() {\n var name = 'Pippin'; \n // name is a local variable in the Parent Scope\n function greetHobbits() { \n // greetHobbits() is the Closure in the hobbitHi\n console.log(\"Hello\" + \" \" + name + \"! \" + \"A bit dreary today innit?\"); \n // the name variable from the local scope is available here!\n }\n greetHobbits();\n //we call greetHobbits so it will start it's task\n }", "title": "" }, { "docid": "c149af51e34809104f73629f5fcf0fff", "score": "0.51227146", "text": "function varDemo(){\n\tvar myName=\"Shashi\";\n\tvar isName=true;\n\t\n\tif(isName){\n\t\tvar lastName=\"Giri\";\n\t\tmyName=\"Sekhar\";\n\t\tconsole.log(myName);\n\t};\n\tlastName=\"Sekhar\";\n\tconsole.log(lastName);\n}", "title": "" }, { "docid": "3d36bd74a76d99283230243c11f5bfee", "score": "0.5122037", "text": "function a() {\n let grandpa = 'grandpa'\n return function b() {\n let father = 'father' \n return function c() {\n let son ='son'\n return ` ${grandpa}>${father}>${son}`\n }\n }\n}", "title": "" }, { "docid": "0a8fcbe99b7b5638bfb9d19e492f79de", "score": "0.5121067", "text": "function checkScope() {\n\tlet i = 'function scope';\n\tif (true) {\n\t\ti = 'block scope';\n\t\tconsole.log('Block scope i is: ', i);\n\t}\n\ti = 'function scope';\n\tconsole.log('Function scope i is: ', i);\n\treturn i;\n}", "title": "" }, { "docid": "feb22888dfaa7cb412876e88a2ae504c", "score": "0.5114791", "text": "function utiliserLetEtConst(isOk) {\n if(isOk) {\n let uneVariable = 1;\n console.log(uneVariable);\n\n uneVariable = 3;\n\n const uneConstante = 8;\n //uneConstante = 9;\n }\n //console.log(uneVariable);\n}", "title": "" }, { "docid": "730d7250acf21576ab99930d4915ed4f", "score": "0.5114696", "text": "function fn2() {\n var name;\n name = 'Jake';\n}", "title": "" }, { "docid": "f828e3c69c418eb8d2dde78780b27adc", "score": "0.51128227", "text": "function heavens(){\n var vanish = \"Where did I go?\";\n survivor = \"I'm still here.\"; //assigned without declaring\n const trump = \"president\";\n let myPeople = \"go\";\n}", "title": "" }, { "docid": "7fbe9fdc14e8507bcb6abb4c894fb9de", "score": "0.5109005", "text": "function test(x){\n if(x %2 ==0) {\n var y = \"Paran\"; //var- function scope (promenljiva vazi unutra funkcije)\n }\n else {\n let z = \"Neparan\"; //let- block scope (promenljiva vazi unutar bloka, tj {})\n }\n\nconsole.log(x);\nconsole.log(y);\nconsole.log(z);\n}", "title": "" }, { "docid": "f674dbd8ba4b92fe08adce61762a2af9", "score": "0.510165", "text": "function greetHobbits() { \n // greetHobbits() is the Closure in the hobbitHi\n console.log(\"Hello\" + \" \" + name + \"! \" + \"A bit dreary today innit?\"); \n // the name variable from the local scope is available here!\n }", "title": "" }, { "docid": "bde1fba5df3194865aa40ccc56241182", "score": "0.51005167", "text": "function checkScope() {\n\"use strict\";\n let i = \"function scope\";\n if (false) {\n i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "21e33b6933fa99770a0f1f93785db081", "score": "0.50997436", "text": "function myFunction() {\n var carName = \"Volvo\";\n}", "title": "" }, { "docid": "866a7a100349f463971d86adbf44c9eb", "score": "0.5096901", "text": "function func2(){ //Inner Function\r\n\r\n var animal2 = \"Tiger\"; //exist in function scope\r\n console.log(animal1);\r\n console.log(animal2);\r\n\r\n }", "title": "" }, { "docid": "20a9da77296df0edd1f5a496e2ccf39d", "score": "0.50950676", "text": "function myfunction(){\r\n var name = \"momo\"\r\n // you can use name here \r\n}", "title": "" }, { "docid": "cbcba7bf6440b0115c472cb876f3b9b7", "score": "0.50892603", "text": "function baz(foo) {\n //EXECUTION foo is assigned \"bam\"\n foo = \"bam\";\n /*\n E: lHS reference to bam. Not found in baz -> not found in bar >\n not found in global -> non-strict creation of bam\n */\n bam = \"yay\";\n }", "title": "" }, { "docid": "ab8ed705ec51f4915267f502b4a01b92", "score": "0.5084153", "text": "function a() {\n let grandpa = 'grandpa'\n return\n\n}", "title": "" }, { "docid": "15725beb7dbd9377d61559ac114badda", "score": "0.5080606", "text": "function bar(){\t\t//compiler asks scope manager if it's heard of the lhs reference for bar()\n\tvar foo = \"baz\";//\n}", "title": "" }, { "docid": "57a39cf7142a96ef3a18add1013e7e21", "score": "0.5078543", "text": "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "title": "" }, { "docid": "57ee98ee27f43d90c0100cb843d5e860", "score": "0.5076126", "text": "function empire() {\n const king = \"Markus\";\n console.log(`Hello ${king} your are awesome.`);\n\n function village() {\n console.log(`${king} do you really use closures ?`);\n\n function house() {\n console.log(`Yeah ${king} is using closures !`);\n }\n house();\n }\n village();\n}", "title": "" }, { "docid": "ed0c68c66a2c9f58c0ad626dbf4a31cf", "score": "0.5071452", "text": "function first() {\n let name = 'I am the first function';\n console.log('This is from first function:', name);\n\n function second() {\n let sec = 'I am in the second function ';\n console.log(sec);\n\n function third() {\n let lastFunc = 'I am the last one...';\n console.log(lastFunc);\n }\n\n third();\n }\n\n second();\n}", "title": "" }, { "docid": "e375eda7de29b125a363dde1f3a00bef", "score": "0.50697577", "text": "function myfunc (name)\n{\n console.log(name)\n \n if(name=='abhishek')\n {\n greet='hello'\n console.log(greet +name)\n }\n else\n {\n greet='bye'\n console.log('bye'+''+greet)\n }\n var greet\n\n\n}", "title": "" }, { "docid": "b5f4def1e634b91c5988dd1f0517c07f", "score": "0.5068284", "text": "function hacerAlgo(){\n console.log(variableUno);\n console.log(variableDos);\n var variableUno;\n //let variableDos;\n}", "title": "" }, { "docid": "3166c353d5a9843b1b7aab2a6eb9285e", "score": "0.5066042", "text": "function prueba(){\n console.log(varl)\n}", "title": "" }, { "docid": "0797df6d79776d7e4f6f9f5008f333e3", "score": "0.5065509", "text": "function thisIsaTest()\n{\n let a= 10;\n let b = 20;\n let c=20;\n}", "title": "" }, { "docid": "6d2b60de313406de441b50040d624eea", "score": "0.50621814", "text": "function local() { \n var localVar = 'local'; // despite localVar being var, it is function scoped\n console.log(myVar, localVar);\n }", "title": "" }, { "docid": "e169536f4074ecad925489bacdfd5448", "score": "0.50473636", "text": "function displayName() { // displayName() is the inner function, a closure\n console.log(name); // use variable declared in the parent function \n }", "title": "" }, { "docid": "36cdbe2b4ebe8bd26b4a74a0ac42ba28", "score": "0.50467175", "text": "function i() {\n function j() {\n console.log(`myVar3: ${myVar3}`);\n }\n\n var myVar3 = 'defined in i()';\n j();\n}", "title": "" }, { "docid": "d6efeba0a1c6adabfeb4dea94b0e7ab1", "score": "0.50403184", "text": "function foo() {\n quux = 'global hello';\n var bar;\n function zip() {\n var quux;\n }\n}", "title": "" }, { "docid": "5e257e3b269c241cf108d5679cd8c159", "score": "0.5040088", "text": "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (false) {\n i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n }", "title": "" }, { "docid": "770bf11f8df3e88a637791509f4ab887", "score": "0.5039851", "text": "function myFunction() {\n const carName = \"Volvo\";\n // code here CAN use carName\n}", "title": "" }, { "docid": "06d98551e391b64397bdb9976f1f5ffe", "score": "0.5038862", "text": "function checkScope() {\r\n\t\r\n\tvar i = \"function scope\";\r\n\tif (true) {\r\n\t\tvar i = \"block scope\";\r\n\t\tconsole.log(\"Block scope i is : \",i);\r\n\t}\r\n\tconsole.log(\"Function scope i is : \",i);\r\n\treturn i;\r\n}", "title": "" }, { "docid": "41f5f879e76d672f5450e4d9a8958053", "score": "0.5033419", "text": "function main() {\n // const i = 2;\n // for ( a = 0; a < 5; a++) { // a constant variable cannot be redefined or redeclared\n // i=a;\n // console.log(i);\n \n // }\n // console.log(a);\n\n const name = 'iGurkul';\n name = 'teja';\n \n console.log(name);\n \n}", "title": "" } ]
58b4bd5e6e4bfd4b0d54c2fb691b7824
get every possible 3digit combination of every element in array
[ { "docid": "b01be719135dd77d7f3a892e2927e817", "score": "0.7128582", "text": "function getCombinations(chars) {\n let result = [];\n let f = function(prefix, chars) {\n for (let i = 0; i < chars.length; i++) {\n result.push(prefix + chars[i]);\n f(prefix + chars[i], chars.slice(i + 1)); //1st call is f('',[1,2,3,4]) 2nd is f('1', [2,3,4]) 4th is f('123', [4])\n }\n };\n f('', chars);\n filteredResult = result.filter(function(e) {\n return e.length == 3;\n }); //delete all array elements whose length is not 3.\n return filteredResult; //eg: [1,2,3,4] returns ['123', '124', '134', '234']\n }", "title": "" } ]
[ { "docid": "007a18524a26581a94bc12f7c8cd83a3", "score": "0.69721353", "text": "function createCombination() {\n for (let i = 0; i < 9; i++) {\n arr.forEach(function (char) {\n temp.push(temp[i] + char);\n });\n }\n temp.reverse(); // Comment if using record object, uncomment if using name attribute.\n delete arr;\n}", "title": "" }, { "docid": "d6fca20be5896d2a48603000e38f30d5", "score": "0.6961721", "text": "function generateCombinations(n) {\n var combs = [];\n var comb;\n var str;\n\n for (var i = 0; i < Math.pow(2, n); i++) {\n str = i.toString(2);\n comb = [];\n\n for (var j = 0; j < n; j++)\n comb.push(j < n - str.length ? 0 : +str[j - n + str.length]);\n\n combs.push(comb.slice(0));\n }\n\n return combs;\n }", "title": "" }, { "docid": "3037c158c5f2a72aa615098c6ed4a800", "score": "0.6801651", "text": "function combination() {\n var combinations = [];\n for (var i = 1; i < 9; i++) {\n for (var t = 0; t < letters.length; t++) {\n combinations[(i - 1) * 8 + t] = letters[t] + i;\n } \n } \n return combinations;\n }", "title": "" }, { "docid": "fcc949fa6622f4f5725cf96b60baae59", "score": "0.668325", "text": "function generateComb(input) {\n let strings = new Array();\n for (i = 0; i < input.length; i++) {\n for (j = i + 1; j < input.length + 1; j++) {\n strings.push(input.slice(i, j));\n }\n }\n return strings.toString();\n}", "title": "" }, { "docid": "3c321855472e9ace1ec9b365199b6fe8", "score": "0.6653592", "text": "function combinationgen(array){\n var combdict=[];\n function fork(i, t) {\n if (i === array.length) {\n result.push(t);\n return;\n }\n fork(i + 1, t.concat([array[i]]));\n fork(i + 1, t);\n }\n var result = [];\n fork(0, []);\n for(var i=0;i<result.length;i++){\n if(result[i].length>0){\n combdict.push(result[i])\n }\n }\n return combdict;\n }", "title": "" }, { "docid": "d11cf2a9858fe41d35e71b369b4fcd64", "score": "0.6580294", "text": "function getPermutations(arr) {}", "title": "" }, { "docid": "9b960119655601b674ff1f79f7188200", "score": "0.6569823", "text": "function twoUniques(arr) { \n const numbers = testCombinations(arr, convert(getXor(arr), 2, []));\n return numbers;\n\n function convert(val, base = 2, arr = []) {\n if (val === 0) return arr\n arr.unshift(val%base)\n return convert(Math.floor(val/2), base, arr)\n }\n\n function decimal(arr) { \n let sum = 0\n let i = 0\n while (i < arr.length) {\n sum += arr[i] * (2**(arr.length - i - 1))\n i++;\n }\n return sum\n }\n\n function standardizeLength(arr, length=10) {\n //Return new arr \n const newArr = [];\n let i = 0;\n while (newArr.length < arr.length) {\n newArr.push(arr[i])\n i++;\n }\n while (newArr.length < length) {\n newArr.unshift(0);\n }\n return newArr;\n }\n\n function getXor(arr, startingValue = 0) { \n return arr.reduce((acc, el) => acc ^ el, startingValue)\n }\n\n function testCombinations(arr, xor) {\n normalizedXor = standardizeLength(xor, 10);\n //Return combination that is correct. \n return permutations(arr, normalizedXor, normalizedXor.length)\n }\n\n function count(arr, val) { \n let count = 0 \n let i = 0\n while (i < arr.length) { \n if (arr[i] === val) { count ++; }\n i++;\n }\n return count;\n }\n\n function permutations(arr, xor, length=10) {\n const queue = [[0,0],[0,1],[1,0],[1,1]];\n let startingValue;\n let complement;\n while (queue[queue.length - 1].length <= length) {\n queue.unshift([1].concat(startingValue))\n queue.unshift([0].concat(startingValue))\n startingValue = queue.pop()\n if (startingValue.length > 2 && startingValue[0] === 0) continue;\n complement = decimal(startingValue) ^ decimal(xor)\n if (count(arr, complement) === 1) {\n return [decimal(startingValue), complement]\n } \n }\n return -1;\n }\n}", "title": "" }, { "docid": "e4eea43e95bfc6aea6f80de2fee5483a", "score": "0.6403035", "text": "function combination(values) {\n function* combinationRepeat(size, v) {\n if (size)\n for (var chr of values) {\n if (v.includes(chr)) continue\n yield* combinationRepeat(size - 1, [...v, chr]);\n }\n else yield v;\n }\n\n let arr = []\n for (let i = 1; i <= values.length; i++) {\n arr = arr.concat([...combinationRepeat(i, [])])\n }\n return arr\n }", "title": "" }, { "docid": "a209d413a1a74db5527b61bc394cbe3a", "score": "0.6303117", "text": "function powerSetPermutations(arr) {\n var arrLength = arr.length;\n if (arrLength === 0 || arrLength === 1) return arr;\n\n if (arrLength === 2) {\n // prettier-ignore\n return [arr[0], arr[1], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0])];\n }\n\n if (arrLength === 3) {\n return [arr[0], arr[1], arr[2], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0])];\n }\n\n if (arrLength >= 4) {\n // Currently does not support more than 4 extra\n // class names (after `.token` has been removed)\n return [arr[0], arr[1], arr[2], arr[3], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0])];\n }\n}", "title": "" }, { "docid": "a209d413a1a74db5527b61bc394cbe3a", "score": "0.6303117", "text": "function powerSetPermutations(arr) {\n var arrLength = arr.length;\n if (arrLength === 0 || arrLength === 1) return arr;\n\n if (arrLength === 2) {\n // prettier-ignore\n return [arr[0], arr[1], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0])];\n }\n\n if (arrLength === 3) {\n return [arr[0], arr[1], arr[2], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0])];\n }\n\n if (arrLength >= 4) {\n // Currently does not support more than 4 extra\n // class names (after `.token` has been removed)\n return [arr[0], arr[1], arr[2], arr[3], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0])];\n }\n}", "title": "" }, { "docid": "a209d413a1a74db5527b61bc394cbe3a", "score": "0.6303117", "text": "function powerSetPermutations(arr) {\n var arrLength = arr.length;\n if (arrLength === 0 || arrLength === 1) return arr;\n\n if (arrLength === 2) {\n // prettier-ignore\n return [arr[0], arr[1], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0])];\n }\n\n if (arrLength === 3) {\n return [arr[0], arr[1], arr[2], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0])];\n }\n\n if (arrLength >= 4) {\n // Currently does not support more than 4 extra\n // class names (after `.token` has been removed)\n return [arr[0], arr[1], arr[2], arr[3], \"\".concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[3], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[3]), \"\".concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[3], \".\").concat(arr[0]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[2], \".\").concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[1], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[0], \".\").concat(arr[2], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[0], \".\").concat(arr[2]), \"\".concat(arr[3], \".\").concat(arr[1], \".\").concat(arr[2], \".\").concat(arr[0]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[0], \".\").concat(arr[1]), \"\".concat(arr[3], \".\").concat(arr[2], \".\").concat(arr[1], \".\").concat(arr[0])];\n }\n}", "title": "" }, { "docid": "3f224c5a3346ffa24d8a1e61af4e2e1a", "score": "0.62272066", "text": "function possibleCombinations() {\n var count = 0;\n var result = \"\";\n var message;\n for (var i = 1; i <= 7; i++) {\n for (j = 1; j <= 7; j++) {\n if (i !== j) {\n result += \"(\" + i + \",\" + j + \")\\n\";\n count++;\n }\n }\n }\n message = result + count;\n return message;\n }", "title": "" }, { "docid": "7be0691b15602b87ecdd3ba317a22f3c", "score": "0.6110547", "text": "function possibleProducts(arr) {\n var result = [], left, right;\n for (var i = 1; i < arr.length; i++) {\n left = arr.slice(0, i).join('');\n right = arr.slice(i).join('');\n result.push(Number(left) * Number(right));\n }\n\n return result;\n}", "title": "" }, { "docid": "b6b5d53da4baf6364b1cd2c0b0104e1a", "score": "0.6105858", "text": "function getPermutations(arr) {\n \n }", "title": "" }, { "docid": "8e5e482ac6e04da3afd58148a23a12f6", "score": "0.6095594", "text": "function generateCombination (list) {\n for (let i = 0; i < list.length; i++) {\n for (let j = 0; j <= 9; j++) {\n list[i] = j\n console.log(list)\n }\n }\n}", "title": "" }, { "docid": "36888b0e924c9fc4d1533cb349ada4e7", "score": "0.6060809", "text": "function arrayCombinations(array) {\n var fn = function(active, rest, a) {\n if (active.length == 0 && rest.length == 0)\n return;\n if (rest.length == 0) {\n a.push(active);\n } else {\n fn(active, rest.slice(1), a);\n fn(rest[0] + (active != \"\" ? \"|\":\"\") + active, rest.slice(1), a);\n }\n return a;\n }\n return fn(\"\", array.reverse(), []);\n }", "title": "" }, { "docid": "4936f9cd111a1a9cf828bd02bfbd1b83", "score": "0.60585976", "text": "function combinations(str) { \n var fn = function(active, rest, a) {\n if (!active && !rest)\n return;\n if (!rest) {\n a.push(active);\n } else {\n fn(active + rest[0], rest.slice(1), a);\n fn(active, rest.slice(1), a);\n }\n return a;\n }\n return fn(\"\", str, []);\n}", "title": "" }, { "docid": "730270ba52ec86ddd4d956390f1fbbeb", "score": "0.60490525", "text": "function combinationLetters(input) {\n const startLetter = input[0];\n const endLetter = input[1];\n const combinationLetter = input[2];\n let counter = 0;\n let result = \"\";\n //97 do 122\n for (let i = startLetter.charCodeAt(0); i <= endLetter.charCodeAt(0); i++) {\n let letterOne = String.fromCharCode(i);\n for (let j = startLetter.charCodeAt(0); j <= endLetter.charCodeAt(0); j++) {\n let letterTwo = String.fromCharCode(j);\n for (\n let k = startLetter.charCodeAt(0);\n k <= endLetter.charCodeAt(0);\n k++\n ) {\n let letterThree = String.fromCharCode(k);\n if (\n letterOne === combinationLetter ||\n letterTwo === combinationLetter ||\n letterThree === combinationLetter\n ) {\n continue;\n } else {\n counter++;\n let genLetters = letterOne + letterTwo + letterThree + \" \";\n result += genLetters;\n }\n }\n }\n }\n console.log(`${result}${counter}`);\n}", "title": "" }, { "docid": "d66e729f2f4c2642ad969c0a3fb81035", "score": "0.6047338", "text": "function combinations(str) {\n var ansArr = [], ans, dr = [];\n ans = str.split(\"\");\n for (var i = 0; i < ans.length; i++){\n for (var j = i; j < ans.length; j++){\n dr = [...ans];\n dr.length = j+1;\n ansArr.push(dr.join(\"\")); \n }\n ans[i] = ''; \n }\n console.log(ansArr.join('\\n'));\n return (ansArr.join('\\n'));\n}", "title": "" }, { "docid": "ace0e81701fc1f76ae910dd8f6c11a1c", "score": "0.60359097", "text": "function arrayCombination(array) {\n var result = [];\n \n var innerFunction = function(combination, arr) {\n for (var i = 0; i < arr.length; i++) {\n result.push(combination.concat(arr[i]));\n innerFunction(combination.concat(arr[i]), arr.slice(i + 1));\n }\n };\n \n innerFunction([], array);\n return result;\n}", "title": "" }, { "docid": "fe2a9c5c41b39855a8d3d35b18353b72", "score": "0.6035145", "text": "function generate_abcs(sum){\n\tvar c,b,a;\n\tvar triplets = [];\n\tfor( c=0; c<sum; c+=1 ){\n\t\tfor( b=0; b<c; b+=1 ){\n\t\t\tfor( a=0; a<b; a+=1 ){\n\t\t\t\tif( a+b+c === sum ){\n\t\t\t\t\ttriplets.push([a,b,c]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn triplets;\n}", "title": "" }, { "docid": "4609c3bfffa487b5f334646a03ff9099", "score": "0.6033867", "text": "function printCombinations(phoneNumber) {\n var digitMap = {\n \"2\": \"abc\",\n \"3\": \"def\",\n \"4\": \"ghi\",\n \"5\": \"jkl\",\n \"6\": \"mno\",\n \"7\": \"pqrs\",\n \"8\": \"tuv\",\n \"9\": \"wxyz\"\n };\n var output = [\"\"];\n for(let i = 0; i < phoneNumber.length; i++) {\n let letters = digitMap[phoneNumber.charAt(i)];\n let partial = [];\n for(let j = 0; j < letters.length; j++) {\n for(let k = 0; k < output.length; k++) {\n partial.push(output[k] + letters[j]);\n }\n }\n // replace the output array with new combinations\n output = partial;\n }\n return output;\n}", "title": "" }, { "docid": "f07988bb8798d06322c4c581b98aa913", "score": "0.60334975", "text": "function tripler(nums){\r\nlet final = [];\r\nnums.forEach(function(num){\r\n let multipliedNum = num * 3;\r\n final.push(multipliedNum);\r\n });\r\n return final;\r\n}", "title": "" }, { "docid": "286c223829ed3ef5a4e9587fca8f3f96", "score": "0.6024507", "text": "function combination_k_n(k, n){\n\tvar arr = [];\n\tfor(var i = 1; i <= n; i++){\n\t\tarr.push(i);\n\t}\n\n\tcombination_helper(k, '', arr);\n\tconsole.log('end');\n}", "title": "" }, { "docid": "d657d57a820387d0eb07910d1e4d0d3e", "score": "0.6016594", "text": "function powerSet3(set) {\n let allSubsets = [];\n const max = 1 << set.length;\n\n for (let k = 0; k < max; k++) {\n const subset = convertNumToSet(k, set);\n allSubsets.push(subset);\n }\n return allSubsets;\n}", "title": "" }, { "docid": "b53c026234886d9cf2a07379e5503d0b", "score": "0.6010538", "text": "function combinations(n, k) {\n var result = [];\n\n function recurse(num, arr) {\n if (arr.length === k) {\n result.push(arr);\n return;\n }\n for (var i = num; i <= n; i++) {\n recurse(i+1, arr.concat([i]))\n }\n }\n recurse(1, []);\n return result;\n}", "title": "" }, { "docid": "656cad19a68c6c71ac93e792074a90bd", "score": "0.59767723", "text": "function triple_sequence(start, end) {\n var arr = [start];\n while (arr.length < end) {\n var num = 0;\n num = arr[arr.length - 1] * 3;\n arr.push(num);\n }\n return arr;\n}", "title": "" }, { "docid": "ae746399ba3de55c20edab72624d6d76", "score": "0.5896988", "text": "function tripleValues(arr){\n return arr.map(function(value){\n return value * 3;\n });\n}", "title": "" }, { "docid": "7b673855bc871661d98e57bd929b8b1a", "score": "0.5877909", "text": "function possibleCombinations (options) {\n // adapted from http://stackoverflow.com/questions/1636355/jquery-javascript-multiple-array-combinations\n\n var recursiveSearch;\n var possibilities = [];\n\n if (options.length == 0) {\n return possibilities;\n }\n\n recursiveSearch = function (arr, depth ) {\n arr = arr || [];\n\n depth = depth || 0;\n for ( var i = 0; i < options[depth].length; i++ )\n {\n // is there one more layer?\n if ( depth +1 < options.length ) {\n // yes: iterate the layer\n var a=new Array();\n $.merge(a,arr);\n a.push(options[depth][i]);\n recursiveSearch ( a , depth +1 );\n }\n else {\n // no: this is the last layer. we add the result to the array\n var a=new Array();\n $.merge(a,arr);\n a.push(options[depth][i]);\n possibilities.push ( a);\n }\n }\n };\n\n recursiveSearch();\n\n return possibilities;\n}", "title": "" }, { "docid": "5ed68e1f6ff29852296a62c71d352efc", "score": "0.5874826", "text": "function getSubsets(n = '') {\n const array = Array.from(n);\n const base = [''];\n\n const results = array.reduce((previous, element) => {\n const previousPlusElement = previous.map(el => {\n return `${el}${element}`;\n });\n return previous.concat(previousPlusElement);\n }, base);\n\n console.log(`getSubsets(${n} // ${results.slice(0, 15).join(', ')}... `);\n console.log(`n: ${array.length}, counter: ${results.length}`);\n return results;\n}", "title": "" }, { "docid": "350100ee0bc461ad9a3606b04c66f1ae", "score": "0.58729017", "text": "function substrings(str1)\r\n{\r\nvar array1 = [];\r\n for (var x = 0, y=1; x < str1.length; x++,y++)\r\n {\r\n array1[x]=str1.substring(x, y);\r\n }\r\nvar combi = [];\r\nvar temp= \"\";\r\nvar slent = Math.pow(2, array1.length);\r\n\r\nfor (var i = 0; i < slent ; i++)\r\n{\r\n temp= \"\";\r\n for (var j=0;j<array1.length;j++) {\r\n if ((i & Math.pow(2,j))){\r\n temp += array1[j];\r\n }\r\n }\r\n if (temp !== \"\")\r\n {\r\n combi.push(temp);\r\n }\r\n}\r\n console.log(combi.join(\"\\n\"));\r\n}", "title": "" }, { "docid": "dc6668d28ab80301bfeb6fae70be3097", "score": "0.58687645", "text": "function sequences(arr) {\n const variations = [arr.slice()];\n\n for (let i = 1; i < arr.length; i++) {\n const ai = arr.slice()\n for (let j = arr.length - 1; j > i; j--) {\n }\n }\n}", "title": "" }, { "docid": "3473c7c03732ef5b89683eb037eac086", "score": "0.58539957", "text": "function sumCombin(arr) {\n let k = 3;\n\n function combin(arr, k) {\n if(!arr.length || k < 0) return [];\n\n if(k == 1) {\n let newarr = [];\n\n for(let i=0, len=arr.length; i < len; i++)\n newarr.push([arr[i]]);\n return newarr;\n }\n\n let allCombin = [];\n\n for(let i=0; i< arr.length -k+1; i++) {\n let curr = arr[i];\n let rest = combin(arr.slice(i+1), k-1);\n\n for(let j = 0; j <rest.length; j++) {\n allCombin.push([curr].concat(rest[j]));\n }\n }\n return allCombin;\n }\n\n let allCombin = combin(arr, k);\n\n return allCombin.filter(function(comb) {\n return 0 === comb.reduce(function(a,b) {\n return a+b;\n });\n });\n}", "title": "" }, { "docid": "acfbe5b0c0ede7ecaae386e67c2b4ba8", "score": "0.58524776", "text": "function permutations(input) {\n let permutArr = input.split(\"\");\n let length = permutArr.length,\n result = [permutArr.slice().join(\"\")],\n c = new Array(length).fill(0),\n i = 1,\n k,\n p;\n\n while (i < length) {\n if (c[i] < i) {\n k = i % 2 && c[i];\n p = permutArr[i];\n permutArr[i] = permutArr[k];\n permutArr[k] = p;\n ++c[i];\n i = 1;\n result.push(permutArr.slice().join(\"\"));\n } else {\n c[i] = 0;\n ++i;\n }\n }\n let resSet = new Set(result);\n return [...resSet];\n}", "title": "" }, { "docid": "456d4527e6d2fd9078483f02662d1dad", "score": "0.5844425", "text": "findTriplets(number,arr)\n {\n var count=0;//initialize count\n var i,j,k;//declare indexes\n for(i=0;i<number-2;i++)//loop over the index till last third number\n {\n for(j=i+1;j<number-1;j++)//lopp over the index till last second number\n {\n for(k=j+1;k<number;k++)//loop over the index till last number\n {\n if((Number(arr[i])+Number(arr[j])+Number(arr[k]))==0)//check if the sum of numbers is equal to zero\n {\n count++;//increment tyhe count\n console.log(\"\"+arr[i]+\",\"+arr[j]+\",\"+arr[k]);//display the combination\n }\n }\n }\n }\n console.log(\"Number of triplets is \"+count);//display the number of triplets\n }", "title": "" }, { "docid": "e19161cd7029e8d825809a66f91788ad", "score": "0.58417135", "text": "function printCombination(arr, n, r)\n{\n // A temporary array to store all combination one by one\n var data = [];\n \n // Print all combination using temporary array 'data[]'\n combinationUtil(arr, n, r, 0, data, 0);\n}", "title": "" }, { "docid": "821d4e9bb429ee2df486a659b1a28375", "score": "0.5839454", "text": "function generatePairs(number) {\n let result = [];\n\n for (let i = 0; i <= number; i++) {\n\n for (let j = i; j <= number; j++) {\n\n result.push([i, j]);\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "cb8a94301fc8c01c23ea4cf6b8d4c67d", "score": "0.5836109", "text": "function generate(int) {\n if (int === 1) {\n // Make sure to join the characters as we create the permutation arrays\n permutations.push(arr.join(''));\n } else {\n for (var i = 0; i != int; ++i) {\n generate(int - 1);\n swap(int % 2 ? 0 : i, int - 1);\n }\n }\n }", "title": "" }, { "docid": "3fb1b04cecc6b39b569a17cfb6c6d820", "score": "0.57993954", "text": "function generate(int) {\r\n if (int === 1) {\r\n // Make sure to join the characters as we create the permutation arrays\r\n permutations.push(arr.join(''));\r\n } else {\r\n for (var i = 0; i != int; ++i) {\r\n generate(int - 1);\r\n swap(int % 2 ? 0 : i, int - 1);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "6fe0c7c828db1d7a44ba7f15e154b98f", "score": "0.57789874", "text": "function _combinations(array, k) {\n let returnArr = [];\n\n if (k === 1) {\n return array.map(element => [element]);\n }\n\n while (array.length) {\n let value = array.shift();\n\n let sub = combinations(array.slice(0), k - 1);\n\n for (let i = 0; i < sub.length; i++) {\n returnArr.push([value].concat(sub[i]));\n }\n }\n\n return returnArr;\n}", "title": "" }, { "docid": "19ce6e68c370370bfba62ef396b82fe6", "score": "0.57677096", "text": "function getNextDigitAry (ary, divisor) {\n\n let ret = []\n for (let n = 0; n < ary.length; n++) {\n for(let m = 0; m <= 9; m++) {\n let test = ary[n] + m\n let last = test.toString().slice(-3)\n \n if (isDivisbleWith(last, divisor) && isUnique(test.toString())) {\n ret.push(test)\n } \n }\n }\n return ret\n}", "title": "" }, { "docid": "b923bf9c668583ac9e5937bb4c47db84", "score": "0.57631415", "text": "function permute(arr) {\n if (arr.length < 2) {\n return [arr];\n }\n if (arr.length === 2) {\n return [\n [arr[0], arr[1]],\n [arr[1], arr[0]]\n ]\n }\n if (arr.length === 3) {\n return [\n [arr[0], arr[1], arr[2]],\n [arr[0], arr[2], arr[1]],\n [arr[1], arr[0], arr[2]],\n [arr[1], arr[2], arr[0]],\n [arr[2], arr[0], arr[1]],\n [arr[2], arr[1], arr[0]]\n ]\n }\n let res = [];\n let tmp = permute(arr.slice(1));\n for (let i = 0; i < tmp.length; i++) {\n let cur = tmp[i];\n for (let j = 0; j < cur.length; j++) {\n res.push(cur.slice(0, j).concat(arr[0], cur.slice(j)));\n }\n res.push(cur.concat(arr[0]));\n }\n return res;\n}", "title": "" }, { "docid": "919ea485d57372187935a54c6c6dfabb", "score": "0.57576644", "text": "function collatzSequence(n) {\n const sequence = [];\n sequence.push(n);\n while (n !== 1) {\n if (n % 2 === 0) {\n n = n / 2;\n sequence.push(n);\n } else {\n n = n * 3 + 1;\n sequence.push(n);\n }\n }\n return sequence;\n}", "title": "" }, { "docid": "8a29ad1bb4c1eaa3bf5fee633c739168", "score": "0.57505447", "text": "static forEachCombination(array, callback) {\n const stack = [];\n (function recurse(index) {\n if (index === array.length) {\n callback(stack);\n } else {\n recurse(index + 1);\n stack.push(array[index]);\n recurse(index + 1);\n stack.pop();\n }\n })(0);\n }", "title": "" }, { "docid": "57e3f13b74a23ccbd7a0b974cba858bc", "score": "0.5743253", "text": "function permuteUnique(nums) {\n function worker(arr) {\n if (arr.length === 1) {\n return [arr.join()];\n }\n let res = [];\n let tmp = worker(arr.slice(1));\n let i = 0;\n while (i < tmp.length) {\n let cur = tmp[i].split(',');\n let j = 0;\n while (j < cur.length + 1) {\n let candidate = (cur.slice(0, j).concat(arr[0], cur.slice(j))).join();\n if (!res.includes(candidate)) {\n res.push(candidate);\n }\n j++;\n }\n i++;\n }\n return res;\n }\n\n function mapToNumber(s) {\n let a = s.split(',');\n let list = new Array(a.length);\n for (let i = 0; i < a.length; i++) {\n list[i] = +a[i];\n }\n return list;\n }\n\n let res = worker(nums);\n return res.map(s => mapToNumber(s));\n}", "title": "" }, { "docid": "09c572066bfc34311a7757351549af83", "score": "0.5742369", "text": "function tobase3(n,ndig) {\n\tvar ret = 0;\n\tvar i;\n\tvar p = 1;\n\tfor (i=0;i<ndig;++i) {\n\t\tvar m = n%3;\n\t\tn = Math.floor(n/3);\n\t\tif (m == 1)\n\t\t\tret += p;\n\t\tp *= 2;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "96b2ad2830cd2efc961a369738d51473", "score": "0.5729045", "text": "function builtString(n){\r\n var arr=[1];\r\n var str='';\r\n var i=2;\r\nfor( var j =0; j < arr.length; j++){\r\n while(i<=n){\r\n arr.push((10*i)+i)\r\n i++\r\n } \r\n str=str+arr[j];\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "b585673d016a48af2d746cf19f333101", "score": "0.5722102", "text": "function getAllStringCombinations(word){\n\tvar inputToArray = word.split(\"\");\n\n}", "title": "" }, { "docid": "494d0e6625a2701af44b5389acd49a53", "score": "0.56929", "text": "*bruteForce1() {\n for(let a = 1; a <= 6; a++) {\n for(let b = 2; b <= 7; b++) {\n for(let c = 3; c <= 8; c++) {\n for(let d = 4; d <= 9; d++) {\n // if(any digits repeat) continue\n if(repeats(a, b, c, d)) continue;\n // each sequence\n let tick = new Tick('step');\n tick.start();\n\n let numPermutations = permute([a, b, c, d]);\n let targets = [];\n\n _.forEach(numPermutations, np => {\n _.forEach(operators, op1 => {\n _.forEach(operators, op2 => {\n _.forEach(operators, op3 => {\n targets.push(math.eval(`${np[0]} ${op1} ${np[1]} ${op2} ${np[2]} ${op3} ${np[3]}`));\n targets.push(math.eval(`(${np[0]} ${op1} ${np[1]}) ${op2} (${np[2]} ${op3} ${np[3]})`));\n targets.push(math.eval(`${np[0]} ${op1} (${np[1]} ${op2} ${np[2]} ${op3} ${np[3]})`));\n targets.push(math.eval(`${np[0]} ${op1} (${np[1]} ${op2} ${np[2]}) ${op3} ${np[3]}`));\n targets.push(math.eval(`${np[0]} ${op1} ${np[1]} ${op2} (${np[2]} ${op3} ${np[3]})`));\n });\n });\n });\n });\n\n // filter & sort\n targets = _.chain(targets)\n .filter(target => math.isInteger(target) && target > 0)\n .uniq()\n .thru(targets => targets.sort((a, b) => a - b))\n .value();\n\n let numConsecutive = 1;\n\n for(let i = 0; i < targets.length; i++) {\n if(targets[i] + 1 === targets[i + 1]) {\n numConsecutive++;\n } else {\n break;\n }\n }\n\n if(numConsecutive > this.solution.numConsecutive) {\n this.solution = {numConsecutive, a, b, c, d}\n }\n\n this.info(`[${a}, ${b}, ${c}, ${d}]: ${numConsecutive}`);\n\n yield numConsecutive;\n\n tick.stop();\n }\n }\n }\n }\n\n this.info(`Solution: [${a}, ${b}, ${c}, ${d}]: ${numConsecutive}`);\n\n return this.solution;\n }", "title": "" }, { "docid": "16245e90060905b551bc199e7260cac5", "score": "0.569107", "text": "function adjacentProduct(range) {\n var bigNum = \"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\"\n var bigNumArray = bigNum.split(\"\");\n var chunkThirteen = [];\n var count = 1;\n var highest = 0;\n var collection = [];\n var slice = range;\n\n for (var i = 0; i < bigNumArray.length-range; i++) {\n\n chunkThirteen = bigNumArray.slice(i, slice + i);\n\n for (var j = 0; j < chunkThirteen.length; j++) {\n count = count * chunkThirteen[j];\n }\n if (count >= highest) {\n highest = count;\n collection = chunkThirteen.join(\"\");\n }\n count = 1;\n }\n console.log(\"The product of these 13 digits --> \" + collection + \" equals... \" + highest);\n}", "title": "" }, { "docid": "c233df53c695d8a885abd97d201c2e3b", "score": "0.56899107", "text": "function multiplicate3Numbers(n1,n2,n3) {\n return (n1 * n2 * n3)\n}", "title": "" }, { "docid": "98e175dc170991a949370d7cea2a1a9d", "score": "0.5679764", "text": "function solve(input) {\n\n for (let i = 0; i < input; i++) {\n let res = '*'.repeat(input)\n console.log(res.split(\"\").join(\" \"));\n }\n}", "title": "" }, { "docid": "0ecc90276c84ad629753862c422c8e50", "score": "0.56792545", "text": "static combinations(size) {\n const combinations = [];\n const stack = [];\n (function recurse(index) {\n if (index === size) {\n combinations.push(new Combination(stack.slice()));\n } else {\n stack.push(false);\n recurse(index + 1);\n stack.pop();\n stack.push(true);\n recurse(index + 1);\n stack.pop();\n }\n })(0);\n return combinations;\n }", "title": "" }, { "docid": "63c13bfd04bd96dfb5bd7aa00179b552", "score": "0.5660611", "text": "function combinationUtil(arr, n, r, index, data, i)\n{\n // Current cobination is ready, print it\n if (index == r)\n {\n //check if current combination is set\n //if yes, increment setCount\n checkOracleSet(data);\n console.log(setCount);\n /*\n for (var j=0; j<r; j++)\n \tconsole.log(data[j]);\n //printf(\"%d \",data[j]);\n console.log(\"\\n\"); */\n //printf(\"\\n\");\n return;\n }\n \n // When no more elements are there to put in data[]\n if (i >= n)\n return;\n \n // current is included, put next at next location\n data[index] = arr[i];\n combinationUtil(arr, n, r, index+1, data, i+1);\n \n // current is excluded, replace it with next (Note that\n // i+1 is passed, but index is not changed)\n combinationUtil(arr, n, r, index, data, i+1);\n}", "title": "" }, { "docid": "aae2449f702b7347164f46eb2c57cfd4", "score": "0.56492454", "text": "function getAllCombinations(list) {\n\tconst result = [];\n\n\tfunction f(a, list) {\n\t\tlist.forEach((c, i) => {\n\t\t\tconst next = a.concat([c]);\n\n\t\t\tresult.push(next);\n\t\t\tf(next, list.slice(i + 1));\n\t\t});\n\t}\n\n\tf([], list);\n\n\treturn result;\n}", "title": "" }, { "docid": "aecb08565598cb41fae6b0f34cfad3c6", "score": "0.5643715", "text": "function spam3(n) {\n return Array(++n).join('hue');\n}", "title": "" }, { "docid": "21edcb7f6066d0b0abab0e07ef97d31e", "score": "0.56337225", "text": "function bcombos(L){\n var Res=[];\n var C =[];\n for(var i=0, Len=Math.pow(2,L.length); i<Len; ++i){ // calc Len only once\n C=[];\n for(var j=0;j<L.length;++j){\n C.push(i & Math.pow(2,j)? L[j] : [not,L[j]]);\n }\n Res.push(C);\n }\n return Res;\n}", "title": "" }, { "docid": "439dbf656bb6dcfc93652f268afe85d0", "score": "0.5633108", "text": "function permutations(n) {\n // get am ordered array of numbers\n let inpArr = [];\n for (let i = 0; i < n; i++) inpArr.push(i + 1);\n\n // iterative generator of permutations (hard-code length == 2 to get arrays)\n const permuteArr = (arr) => {\n if (arr.length == 1) {\n return arr;\n } else if (arr.length == 2) {\n return [[arr[0], arr[1]], [arr[1], arr[0]]];\n } else {\n let ret = [];\n for (let i = 0; i < arr.length; i++) {\n let lessArr = arr.filter((_, idx) => idx != i);\n let lessArrPerms = permuteArr(lessArr);\n lessArrPerms.map(n => n.unshift(arr[i]));\n ret = ret.concat(lessArrPerms);\n }\n return ret;\n }\n }\n\n // run inpArr through the perumteArr\n return permuteArr(inpArr);\n}", "title": "" }, { "docid": "0df8b4a27993672c24a4c994c469bec1", "score": "0.5615748", "text": "function permute(mixThis) {\n var length = mixThis.length,\n result = [mixThis.slice()], // include original order as first element of result\n controlArray = new Array(length).fill(0),\n i = 1,\n k,\n temp;\n\n while (i < length) {\n if (controlArray[i] < i) { /*\n 1st: 0 is less than 1. Swap mixthis 1 and 0.\n 2nd: 1 is not less than 1, set controlArray at 1 to 0, i is now 2,\n 3rd: 0 (controlArray[2]) is less than 2. Swap mixthis 2 and 0. i becomes 1.\n 4th: 1 is less than 2. Swap mixthis 2 and 1. i remains 1.\n 5th: controlArray at 2 becomes 2... set it to 0, i becomes 2.\n */\n k = i % 2 && controlArray[i]; // 'k' is 1 if i is odd and controlArray[i] contains 1, 0 if i is even\n temp = mixThis[i]; // store the element in question\n mixThis[i] = mixThis[k]; // replace the element in question with the first element of the array of interest, at first run, and nth element of array of interest if we've built up n strings so far\n mixThis[k] = temp; // complete the swap, where the element of interest moves to either the first or second place in the array of interest\n ++controlArray[i]; // controlArray at this index (1, to start with) is truthy now\n i = 1; // i is one? why would it ever not be 1?\n result.push(mixThis.slice()); // only add to result when controlArray is 0 at i\n } else {\n controlArray[i] = 0; // every other time through this controlArray[i] is 0\n ++i; // i gains in length, and is reset to 1 the first time at each element of interest (because controlArray begins at 0 and only becomes 1 once )\n }\n }\n return result;\n}", "title": "" }, { "docid": "e24a21010060a78d652653b359e51f88", "score": "0.5610714", "text": "function generatePossibleNumbers(n) {\n let temp_str = '';\n temp_str+='1';\n for(let i = 0; i < n-2; i++) {\n temp_str+='?';\n }\n temp_str+='1';\n //console.log(temp_str);\n\n let temp_que = new Array();\n let final_que = new Array();\n\n temp_que.push(temp_str);\n\n while(temp_que.length!==0) {\n let temp_var = temp_que.pop();\n let index = temp_var.indexOf('?');\n if(index!=-1) {\n temp_var = setCharAt(temp_var,index,'0');\n temp_que.push(temp_var);\n\n temp_var = setCharAt(temp_var,index,'1');\n temp_que.push(temp_var);\n }\n else {\n final_que.push(temp_var);\n }\n console.log('hi');\n//10000000000000000000000000000001\n }\n //console.log(final_que);\n return final_que;\n}", "title": "" }, { "docid": "847813bf8bf7c98858ff819ec2ad492b", "score": "0.56092614", "text": "function typenum5find() {\n let n = parseInt(document.getElementById(\"typenum6\").value)\n let arr = [];\n document.getElementById(\"typenum5ans\").innerHTML = \" \";\n findCombinationsUtil(arr, 0, n, n);\n}", "title": "" }, { "docid": "6a481e3163a0f9ab58a3724d7844d7d2", "score": "0.5607001", "text": "function getPermuations(...arr) {\n const output = new Set();\n\n function generatePermuations(str, acc) {\n if(!str.length) return output.add(acc);\n\n for(let i = 0; i< str.length; i++ ){\n const char = str[i];\n\n acc += char;\n //reduce\n generatePermuations(str.slice(0, i) + str.slice(i+1), acc);\n acc = acc.slice(0, acc.length-1);\n }\n }\n\n for(const str of arr){\n generatePermuations(str); //only for each loop \n }\n\n return [...output];\n}", "title": "" }, { "docid": "f5ed69fa297c90643391b5cf710ce07f", "score": "0.56055963", "text": "function allCombinations(num1, num2) {\n var result = [];\n var count = 0;\n if (num1 > num2) {\n [num1, num2] = [num2, num1]\n console.log(num1, num2);\n }\n for (i = 1; i <= num2; i++) {\n for (j = 1; j <= num2; j++) {\n if (i !== j) {\n count++;\n result[result.length] = [i, j];\n }\n }\n } return [result, \"Number of possible combinations is \" + count];\n}", "title": "" }, { "docid": "5415dc605b37de8943a06cf4e3aa55fb", "score": "0.55963975", "text": "function permute(input) {\n var i, ch;\n for (i = 0; i < input.length; i++) {\n ch = input.splice(i, 1)[0];\n usedChars.push(ch);\n if (input.length == 0) {\n permArr.push(usedChars.slice());\n }\n permute(input);\n input.splice(i, 0, ch);\n usedChars.pop();\n }\n return permArr\n }", "title": "" }, { "docid": "303f0abfbba5b2f7d5b464801fd44f4a", "score": "0.5594258", "text": "function threeSum(nums) {\n let triplets = [];\n if (nums.length < 3) return triplets;\n nums.sort((a, b) => a - b);\n\n for (let i = 0; i < nums.length - 2; i++) {\n if (nums[i] > 0) break;\n if (i > 0 && nums[i] === nums[i - 1]) continue;\n let left = i + 1;\n let right = nums.length - 1;\n // check for duplicate first number!\n while (left < right) {\n // check for duplicate triplets inside the loop\n // these two check prevents you from having duplicate triplets\n if (left - i > 1 && nums[left] === nums[left - 1]) {\n left++;\n continue;\n }\n\n let sum = nums[i] + nums[left] + nums[right];\n if (sum === 0) {\n triplets.push([nums[i], nums[left], nums[right]]);\n left++;\n right--;\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n }\n return triplets;\n}", "title": "" }, { "docid": "76846d82c3b0925d809e8c8f007fec7a", "score": "0.5583617", "text": "function permute(input) {\n var i, ch;\n for (i = 0; i < input.length; i++) {\n ch = input.splice(i, 1)[0];\n usedChars.push(ch);\n if (input.length == 0) {\n permArr.push(usedChars.slice());\n }\n permute(input);\n input.splice(i, 0, ch);\n usedChars.pop();\n }\n return permArr\n }", "title": "" }, { "docid": "7781fc1552b3cdf1320578caad0639e5", "score": "0.5583209", "text": "function Solution() {\n\n // target = 1,000,000\n let fac10 = 3628800; // 1 is too big; first digit is 0, [1,2,3,4,5,6,7,8,9]\n let fac9 = 362880; // 2 is 2nd digit 274,240 permutations left. 2, [1,3,4,5,6,7,8,9]\n let fac8 = 40320; // what index takes this not quite over 274,240: 7, [1,3,4,5,6,8,9], 32,320 remain\n let fac7 = 5040; // index 6 (number 8) consumes 30,240; 2080 permutations remain: 8, [1,3,4,5,6,9]\n let fac6 = 720; // index 2 (number 3) consumers 1440; 640 perms left: 3, [1,4,5,6,9]\n let fac5 = 120; // index 5 (number 9) consumers 5*120 = 600; 40 left: 9, [1,4,5,6]\n let fac4 = 24; // index 1 (number 1) consumes 24; 16 left: 1, [4,5,6]\n let fac3 = 6; // index 2 (number 5) consumes 12; 4 left: 5, [4,6]\n let fac2 = 2; // index 1 (number 4) consumes 2; 2 left: 4 [6]\n let fac1 = 1; // 6\n\n // Answer: 0278391546\n\n\n // called by index.js for this problem\n Solution.prototype.solve = function() {\n let numbers = [0,1,2];\n let perms = getPerms(0, numbers.slice(1));\n let permutation = 1;\n let perm = [];\n for(var i=0;i<numbers.length;i++) {\n perm = [];\n perm.push(i);\n for(var j=0;j<numbers.length;j++) {\n if(i==j) continue;\n perm.push(j);\n for(var k=0;k<numbers.length;k++) {\n if(i==k) continue;\n if(j==k) continue;\n perm.push(k);\n console.log(permutation++ + \":\" + perm.join(''));\n }\n }\n }\n \n return 0;\n };\n\n function getPerms(current, remaining) {\n\n }\n}", "title": "" }, { "docid": "3673f9bc37170de6029daf55aab2965c", "score": "0.55468404", "text": "function allCombinations(num1, num2) {\n var result = [];\n var count = 0;\n\n for (i = 1; i <= num2; i++) {\n for (j = 1; j <= num2; j++) {\n if (i !== j) {\n count++;\n result[result.length] = [i, j];\n }\n }\n } return [result, \"Number of possible combinations is \" + count];\n}", "title": "" }, { "docid": "b80bb5cdb032eb0cbb2f52b98a7de111", "score": "0.5540437", "text": "static combinationsWithRepetition(data, count = data.length) {\n /* o:async */ function* ret() {\n if (data.length <= 0 || count < 0) {\n return;\n }\n const indices = [];\n for (let i = 0; i < count; i++) {\n indices.push(0);\n }\n while (true) {\n yield indices.map((v) => data[v]);\n let i;\n for (i = 0; i < indices.length; i++) {\n if (indices[indices.length - i - 1] < data.length - 1) {\n indices[indices.length - i - 1]++;\n break;\n }\n }\n if (i === indices.length) {\n break;\n }\n i--;\n while (i >= 0) {\n indices[indices.length - i - 1] =\n indices[indices.length - i - 2];\n i--;\n }\n }\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "a46be3be38b8e38283948516ab32f853", "score": "0.5530576", "text": "function generate(n) {\n var val;\n var counter;\n if(n!==1) {\n for (var i = 0; i != n; ++i) {\n generate(n - 1);\n if((n % 2)===0){\n val = arr[i];\n arr[i] = arr[n-1];\n arr[n-1] = val;\n }\n else{\n val = arr[0];\n arr[0] = arr[n-1];\n arr[n-1] = val;\n }\n }\n }\n if(n === 1) {\n perms.push(arr.join(''));\n } \n }", "title": "" }, { "docid": "32f0e435e4ffd89c9f78efcad6fa872d", "score": "0.5519627", "text": "getPossibleValueCombinations(valuesOnly) {\n const combinations = [];\n\n if (valuesOnly.length === 1) {\n return valuesOnly;\n }\n else if (valuesOnly.length === 2) {\n combinations.push(valuesOnly[0] + valuesOnly[1]);\n }\n else if (valuesOnly.length === 3) {\n combinations.push(valuesOnly[0] + valuesOnly[1]);\n combinations.push(valuesOnly[0] + valuesOnly[2]);\n combinations.push(valuesOnly[1] + valuesOnly[2]);\n combinations.push(valuesOnly[0] + valuesOnly[1] + valuesOnly[2]);\n }\n\n return combinations;\n }", "title": "" }, { "docid": "1466f940b3b58f5301161b7ddfa52256", "score": "0.5513041", "text": "function fromPowerBases(cs) {\n if (cs[0].length === 4) {\n let [[a3, a2, a1, a0], [b3, b2, b1, b0]] = cs;\n return [\n [a0 + a1 + a2 + a3,\n b0 + b1 + b2 + b3],\n [a0 + 2 * a1 / 3 + a2 / 3,\n b0 + 2 * b1 / 3 + b2 / 3],\n [a0 + a1 / 3,\n b0 + b1 / 3],\n [a0,\n b0]\n ];\n }\n else if (cs.length === 3) {\n let [[a2, a1, a0], [b2, b1, b0]] = cs;\n return [\n [a0 + a1 + a2,\n b0 + b1 + b2,],\n [a0 + a1 / 2,\n b0 + b1 / 2],\n [a0,\n b0]\n ];\n }\n else if (cs.length === 2) {\n let [[a1, a0], [b1, b0]] = cs;\n return [\n [a0 + a1,\n b0 + b1],\n [a0,\n b0]\n ];\n }\n}", "title": "" }, { "docid": "4516d25adc91cbf962520ce7cfecbe5f", "score": "0.5508528", "text": "function combRep(arr, l) {\n if(l === void 0) l = arr.length; // Length of the combinations\n var data = Array(l), // Used to store state\n results = []; // Array of results\n (function f(pos, start) { // Recursive function\n if(pos === l) { // End reached\n results.push(data.slice()); // Add a copy of data to results\n return;\n }\n for(var i=start; i<arr.length; ++i) {\n data[pos] = arr[i]; // Update data\n f(pos+1, i); // Call f recursively\n }\n })(0, 0); // Start at index 0\n return results; // Return results\n }", "title": "" }, { "docid": "7007d976c5b494a4e92a19594835b491", "score": "0.55073375", "text": "function tribonacci(s, n) {\n let c = [...s];\n if (n == 0) { return s = []; }\n else if (n < 3) { return s.slice(0, n); }\n while (s.length < n && n >= 4) {\n let e = c.reduce((a, b) => a + b, 0);\n s.push(e); c.push(e); c.shift();\n }\n return s;\n}", "title": "" }, { "docid": "5c86a3e90a59fbccdf29d1f33cb557f1", "score": "0.55056036", "text": "function threeNumSum(array, target) {\n array.sort((a, b) => a - b);\n const triplets = [];\n for (let i = 0; i < array.length - 2; i++) {\n let left = i + 1;\n let right = array.length - 1;\n while (left < right) {\n const currentSum = array[i] + array[left] + array[right];\n if (currentSum === target) {\n triplets.push(array[i], array[left], array[right]);\n left++;\n right++;\n } else if (currentSum < target) {\n left++;\n } else if (currentSum > target) {\n right++;\n }\n }\n }\n return triplets;\n}", "title": "" }, { "docid": "a92587c8238dc44657f762b874f1ad7c", "score": "0.5498301", "text": "function generateProducts(input) {\n let product = 1;\n let result = [];\n let left = [];\n let right = [];\n\n left[0] = 1;\n for (let i=1; i<input.length; i++) {\n left[i] = input[i-1] * left[i-1];\n }\n\n right[input.length-1] = 1;\n for (let i=input.length-2; i>=0; i--) {\n right[i] = input[i+1] * right[i+1];\n }\n\n for (let i=0; i<input.length; i++) {\n result[i] = left[i] * right[i];\n }\n\n return result;\n}", "title": "" }, { "docid": "7865bc2fa699daad584a93440ad41906", "score": "0.5497238", "text": "function part2(input) {\n\treturn input.map(a => {\n\t\tvar res = 0;\n\t\twhile((a = (Math.floor(a/3) - 2)) > 0) {\n\t\t\tres += a;\n\t\t}\n\t\treturn res;\n\t}).reduce((a,c) => a+c, 0);\n}", "title": "" }, { "docid": "0dde94ab895a2e4539717adfb3501e2b", "score": "0.547615", "text": "function shortestArrang(n) {\n if (!(n % 2 === 0)) return [Math.floor(n / 2) + 1, Math.floor(n / 2)];\n const possibleNums = [];\n for (let i = 0; i <= Math.floor(n / 2); i++) {\n possibleNums.push(i);\n }\n console.log(possibleNums);\n for (let i = 0; i < possibleNums.length; i++) {\n if (possibleNums[i] + possibleNums[i + 1] + possibleNums[i + 2] === n) {\n return [possibleNums[i + 2], possibleNums[i + 1], possibleNums[i]];\n }\n }\n for (let i = 0; i < possibleNums.length; i++) {\n if (\n possibleNums[i] +\n possibleNums[i + 1] +\n possibleNums[i + 2] +\n possibleNums[i + 3] ===\n n\n ) {\n return [\n possibleNums[i + 3],\n possibleNums[i + 2],\n possibleNums[i + 1],\n possibleNums[i]\n ];\n }\n }\n for (let i = 0; i < possibleNums.length; i++) {\n if (\n possibleNums[i] +\n possibleNums[i + 1] +\n possibleNums[i + 2] +\n possibleNums[i + 3] +\n possibleNums[i + 4] ===\n n\n ) {\n return [\n possibleNums[i + 4],\n possibleNums[i + 3],\n possibleNums[i + 2],\n possibleNums[i + 1],\n possibleNums[i]\n ];\n }\n }\n for (let i = 0; i < possibleNums.length; i++) {\n if (\n possibleNums[i] +\n possibleNums[i + 1] +\n possibleNums[i + 2] +\n possibleNums[i + 3] +\n possibleNums[i + 4] +\n possibleNums[i + 5] ===\n n\n ) {\n return [\n possibleNums[i + 5],\n possibleNums[i + 4],\n possibleNums[i + 3],\n possibleNums[i + 2],\n possibleNums[i + 1],\n possibleNums[i]\n ];\n }\n }\n for (let i = 0; i < possibleNums.length; i++) {\n if (\n possibleNums[i] +\n possibleNums[i + 1] +\n possibleNums[i + 2] +\n possibleNums[i + 3] +\n possibleNums[i + 4] +\n possibleNums[i + 5] +\n possibleNums[i + 6] ===\n n\n ) {\n return [\n possibleNums[i + 6],\n possibleNums[i + 5],\n possibleNums[i + 4],\n possibleNums[i + 3],\n possibleNums[i + 2],\n possibleNums[i + 1],\n possibleNums[i]\n ];\n }\n }\n for (let i = 0; i < possibleNums.length; i++) {\n if (\n possibleNums[i] +\n possibleNums[i + 1] +\n possibleNums[i + 2] +\n possibleNums[i + 3] +\n possibleNums[i + 4] +\n possibleNums[i + 5] +\n possibleNums[i + 6] +\n possibleNums[i + 7] ===\n n\n ) {\n return [\n possibleNums[i + 7],\n possibleNums[i + 6],\n possibleNums[i + 5],\n possibleNums[i + 4],\n possibleNums[i + 3],\n possibleNums[i + 2],\n possibleNums[i + 1],\n possibleNums[i]\n ];\n }\n }\n return [-1];\n}", "title": "" }, { "docid": "0c9c661c9fa140df41553e5dcd2bf5dd", "score": "0.546916", "text": "function getAllSubsetsOfArr(array) {\n let res = new Array(1 << array.length).fill().map((e1, i) => array.filter((e2, j) => i & 1 << j));\n console.log(res);\n return res;\n}", "title": "" }, { "docid": "619942b31ec9fafcdc4ebfed08b7d755", "score": "0.54684025", "text": "function possibleStepCombos(n) {\n var stepsPerHop = [1, 2, 3];\n var comboCount = 0;\n\n function getCombos(hopsMade, n) {\n if (n === 0) {\n comboCount += 1;\n return;\n } else if (n < 0) {\n return;\n }\n stepsPerHop.forEach(function(numSteps) {\n getCombos(hopsMade.concat(numSteps), n - numSteps)\n });\n }\n\n getCombos([], n);\n return comboCount;\n}", "title": "" }, { "docid": "0d972adca24077774b0fbb57a09f2462", "score": "0.5467787", "text": "function solution(Str) {\n const S = Str.split('');\n const result = [];\n let fixedIdx = 0;\n\n while (fixedIdx < S.length) {\n for (let outer = 0; outer < S.length; outer++) {\n if (outer === fixedIdx) {\n continue;\n }\n\n for (let inner = 0; inner <= 9; inner++) {\n const copied = [...S];\n copied[outer] = inner;\n const joined = Number(copied.join(''));\n\n if (joined % 3 === 0) {\n const exist = result.find(value => value === joined);\n\n if (exist === undefined) {\n result.push(joined);\n }\n }\n }\n }\n fixedIdx++;\n }\n return result.legnth;\n}", "title": "" }, { "docid": "c52ae192bf7babf644cefecb5b5c2f74", "score": "0.5461316", "text": "function x(n) {\n var array = []\n var i = 0\n \n while (i < n) {\n var index = 0\n var a = []\n while(index < n) {\n a[index] = 0\n index++\n }\n \n array.push(a)\n i++\n }\n \n i = 0\n \n while (i < n) {\n var nestedIndex = 0\n while (nestedIndex < n) {\n if(i === nestedIndex) {\n array[i][nestedIndex] = 1\n }\n \n if (i + nestedIndex === n - 1) {\n array[i][nestedIndex]=1\n }\n \n nestedIndex++\n }\n \n i++\n }\n return array\n}", "title": "" }, { "docid": "fbee475208edf9ad49747adc5568e689", "score": "0.5449766", "text": "function permutation(numberofresults,string,numbers){\n\t\tif(numberofresults>0){\n\n\t\t\tfor(var i=1; i<=numbers; i++){\n\t\t\t\t\n\t\t\t\tpermutation(numberofresults-1,string+i,numbers);\n\n\t\t\t}\n\t\t}\n\n\t\telse{\n\t\t\n\t\t\tstring = string.split(\"\");\n\t\t\tfor(var i=0; i<string.length; i++){\n\t\t\t\tstring[i] = parseInt(string[i]);\n\t\t\t}\n\t\t\tpermutations.push(string);\n\t\t\treturn string;\n\t\t}}", "title": "" }, { "docid": "6f46c8b2deb8d6aaa96c93390ed9fe66", "score": "0.54461706", "text": "function binadd3 (...input) {\n return input.reduce(binadd)\n}", "title": "" }, { "docid": "cca452ef54c3d3e011556e63b75a32ac", "score": "0.54363036", "text": "function powerset(array) {\n // Write your code here.\n let solution = [[]];\n\n for (let i = 0; i < array.length; i++) {\n let el = array[i];\n for (let j = solution.length - 1; j >= 0; j--) {\n let current = solution[j];\n solution.push([...current, el]);\n }\n }\n return solution;\n}", "title": "" }, { "docid": "550fc3fee3c22d1814238b40b46a6c81", "score": "0.5436018", "text": "function solve(n=5){\r\n for (let i = 0; i < Number(n); i++) {\r\n let array = \"\";\r\n\r\n for (let j = 0; j < Number(n); j++) {\r\n array += \"* \"; \r\n }\r\n\r\n console.log(String(array));\r\n }\r\n}", "title": "" }, { "docid": "2118caa491fbfbf06304f85a02a49708", "score": "0.54357827", "text": "function createCombination() {\n const randomNumber = Math.floor((Math.random() * 4) + 1);\n combination.push(randomNumber);\n }", "title": "" }, { "docid": "bd557d6b08d2d20b163038028dd20d47", "score": "0.54346335", "text": "function permute(input)\n{\n\tvar i, ch\n for (i = 0; i < input.length; i++) \n\t{\n ch = input.splice(i, 1)[0];\n usedChars.push(ch);\n if (input.length == 0) \n\t\t{\n permArr.push(usedChars.slice());\n }\n permute(input);\n input.splice(i, 0, ch);\n usedChars.pop();\n }\n return permArr\n}", "title": "" }, { "docid": "1b7d660c14109fd1281ae905f83ae4e8", "score": "0.54332805", "text": "function runProgram(input){\n let input_arr = input.trim().split(\"\\n\")\n let no_participants = Number(input_arr[0])\n let [L, R] = input_arr[1].trim().split(\" \").map(Number)\n let count = 0\n\n let array = []\n for(let i = 1; i <= no_participants; i++){\n array.push(i)\n }\n combinations(array)\n console.log(count)\n \n function combinations(array){\n if(array.length === 0){\n return [[]]\n }\n let first_char = array[0]\n let rest_char = array.slice(1)\n\n let without_first = combinations(rest_char)\n let all_combinations = []\n\n without_first.forEach(item => {\n for(let i = 0; i <= item.length; i++){\n let with_first = [...item.slice(0,i), first_char, ...item.slice(i)]\n all_combinations.push(with_first)\n if(with_first.length == no_participants){\n let sum = 0\n for(let j = L; j <= R; j++){\n sum += with_first[j]\n }\n if(sum%2 != 0){\n // console.log(with_first)\n count++\n }\n }\n }\n })\n\n return all_combinations\n }\n}", "title": "" }, { "docid": "ca3bb1809d63b82364504c98c00502cf", "score": "0.5431756", "text": "function part1(input, allow_triples = true) {\n var count = 0;\n loop: for (var i = input[0]; i <= input[1]; i++) {\n var digits = (i + \"\").split(\"\");\n for (var j = 1; j < 6; j++) {\n if (digits[j] < digits[j - 1]) {\n var old = i;\n i += (10 ** (5 - j)) * (digits[j - 1] - digits[j]);\n for (var k = j + 1; k < 6; k++) {\n i -= (10 ** (5 - k)) * digits[k];\n }\n i -= 1;\n continue loop;\n }\n }\n for (var j = 1; j < 6; j++) {\n if (allow_triples && digits[j] == digits[j - 1]) {\n count++;\n continue loop;\n }\n if (!allow_triples) {\n if (j == 1) {\n if (digits[j] == digits[j - 1] && digits[j] != digits[j + 1]) {\n count++;\n continue loop;\n }\n } else if (j == 5) {\n if (digits[j] == digits[j - 1] && digits[j] != digits[j - 2]) {\n count++;\n continue loop;\n }\n } else if (digits[j] == digits[j - 1] && digits[j] != digits[j - 2] && digits[j] != digits[j + 1]) {\n count++;\n continue loop;\n }\n }\n }\n }\n return count;\n}", "title": "" }, { "docid": "593b70bbeee86f579da4a499435cd53c", "score": "0.54279506", "text": "function trib(n) {\n if (n < 3) {\n return [0, 0, 1][n]\n }\n return trib(n-1) + trib(n-2) + trib(n-3)\n}", "title": "" }, { "docid": "531d584a9f86e43c704748f60d299fc6", "score": "0.542783", "text": "function powerset(arr) {\n var ps = [[]];\n for (var i=0; i < arr.length; i++) {\n for (var j = 0, len = ps.length; j < len; j++) {\n ps.push(ps[j].concat(arr[i]));\n }\n }\n return ps;\n}", "title": "" }, { "docid": "c98aafad43717586d20c92b5c5d9e121", "score": "0.5426855", "text": "triplet(arr)\n {\n if(arr.length!=0)\n {\n for(var i=0;i<=arr.length-2;i++)\n {\n for(var j=i+1;j<=arr.length-1;j++)\n {\n for(var k=j+1;k<arr.length;k++)\n {\n \n if(parseInt(arr[i])+parseInt(arr[j])+parseInt(arr[k])==0)//if addition of three integer is equal to 0\n {\n console.log(\"Sum of three integer \"+arr[i]+\" \"+arr[j]+\" \"+arr[k]+\" \")\n }\n \n }\n }\n }\n\n \n }\n\n else\n {\n console.log(\"inavalide Data\")\n }\n }", "title": "" }, { "docid": "d2e3be7ea589cc523dec2da697f917a8", "score": "0.542615", "text": "function generateAutomorphicNumbers(input) {\n let arr = [];\n let numberString = input.toString(10);\n\n for (let power = 2n; power <= 10; power++) {\n let powerResult = (input ** power).toString(10);\n\n if (powerResult.endsWith(numberString)) {\n arr.push(powerResult);\n }\n }\n return arr;\n}", "title": "" }, { "docid": "e033bd77046e4df8f6f89dabc24207be", "score": "0.54209304", "text": "function xor_factor(input)\n{\n\tif (!input)\n\t\treturn [\"0\"];\n\tif (input.length == 1)\n\t\treturn input;\n\t// http://stackoverflow.com/questions/5667888/counting-occurences-of-javascript-array-elements\n\tvar counts = {};\n\tvar out = [];\n\t// counts the number of times an item shows up in the input\n\tfor(var i = 0; i< input.length; i++) {\n\t\tvar num = input[i];\n\t\tcounts[num] = counts[num] ? counts[num]+1 : 1;\n\t}\n\tfor (var i in counts)\n\t{\n\t\t// only shows up an odd number of times\n\t\tif (counts[i] & 0x01) \n\t\t\tout.push(i);\n\t}\n\t// if the input got reduced to nothing, make it \"0\"\n\tif (out.length < 1) \n\t\tout = [\"0\"];\n\treturn out;\n}", "title": "" }, { "docid": "74a89ebc09e228d710fd733b7fed4f35", "score": "0.54175985", "text": "function labelCombinations( list ){\n let set = [],\n listSize = list.length,\n combinationsCount = (1 << listSize);\n\n for (let i = 1; i < combinationsCount ; i++ ){\n\t \n\t let combination = [];\n\t \n\t for (let j = 0; j < listSize; j++){\n if ((i & (1 << j))){\n combination.push(list[j]);\n }\n\t }\n\n\t if (combination.length > 1) {\n\t \tset.push(combination);\n\t }\n\n }\n\n return set;\n}", "title": "" }, { "docid": "5236fe874b9d26c1fa32003b781e8eef", "score": "0.54172605", "text": "function combinations(items) {\n\treturn [...arguments].reduce((acc,item) => item===0 ? acc : acc*item)\n}", "title": "" }, { "docid": "2e262bbf2aec33b09b71e34c00231149", "score": "0.5412709", "text": "function pyramid(letters) {\n return letters.map(\n (c, index) => c.repeat(index + 1)\n )\n}", "title": "" }, { "docid": "f2becc9e739c518de1ef531523026c84", "score": "0.54091126", "text": "function makeCombo() {\n var r = [],\n arg = arguments,\n max = arg.length - 1;\n function helper(arr, i) {\n for (var j = 0, l = arg[i].length; j < l; j++) {\n var a = arr.slice(0); // clone arr\n a.push(arg[i][j]);\n if (i === max) r.push(a);\n else helper(a, i + 1);\n }\n }\n helper([], 0);\n\n let res = [];\n for (let i = 0; i < r.length; i++) {\n const e = r[i];\n let str = '';\n for (let j = 0; j < e.length; j++) {\n const element = e[j];\n if (str === '') {\n str = element;\n } else str = str + ' / ' + element;\n }\n r[i] = str;\n res = r;\n }\n setLength(res.length);\n return res;\n }", "title": "" }, { "docid": "dca424ad12d5547afb0ce5958a643114", "score": "0.5405959", "text": "function buildArray(number){\n\tvar stringArray = [];\n\tfor (var z = 0; z < number; z++);{\n\t\tstringArray.push(buildString());\n\t}\n\t\treturn stringArray;\n}", "title": "" } ]
73cd4ca226ca95d912a038130dc8d061
Add `node` to `parent`s children or to `tokens`. Performs merges where possible.
[ { "docid": "3ebdc3562409f1de1240c31a2d0d556a", "score": "0.78504187", "text": "function add(node, parent) {\n\t var children = parent ? parent.children : tokens;\n\t var prev = children[children.length - 1];\n\n\t if (\n\t prev &&\n\t node.type === prev.type &&\n\t node.type in MERGEABLE_NODES &&\n\t mergeable(prev) &&\n\t mergeable(node)\n\t ) {\n\t node = MERGEABLE_NODES[node.type].call(self, prev, node);\n\t }\n\n\t if (node !== prev) {\n\t children.push(node);\n\t }\n\n\t if (self.atStart && tokens.length !== 0) {\n\t self.exitStart();\n\t }\n\n\t return node;\n\t }", "title": "" } ]
[ { "docid": "5069e8ce3a42b616dda8395635b6230a", "score": "0.78128934", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "5069e8ce3a42b616dda8395635b6230a", "score": "0.78128934", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "5069e8ce3a42b616dda8395635b6230a", "score": "0.78128934", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "5069e8ce3a42b616dda8395635b6230a", "score": "0.78128934", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "5069e8ce3a42b616dda8395635b6230a", "score": "0.78128934", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "5069e8ce3a42b616dda8395635b6230a", "score": "0.78128934", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "b9676230e29e9254f4afd43391dce423", "score": "0.7810953", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node)) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "9ec1ceec62412e910a813d5fa5ffd8f8", "score": "0.7485153", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var prev = children[children.length - 1]\n var fn\n\n if (\n prev &&\n node.type === prev.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, prev, node)\n }\n\n if (node !== prev) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "title": "" }, { "docid": "23f2eef2e7fd234b13e3f15ffc8ac315", "score": "0.7436828", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var previous = children[children.length - 1];\n var fn;\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote;\n node = fn.call(self, previous, node);\n }\n\n if (node !== previous) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }", "title": "" }, { "docid": "fbf8a6636170b3a3b20c73ad8d15ad52", "score": "0.5737191", "text": "function mutation_append(node, parent) {\n /**\n * To append a node to a parent, pre-insert node into parent before null.\n */\n return mutation_preInsert(node, parent, null);\n}", "title": "" }, { "docid": "f01832fdb589dedd10e9195f360ff8fc", "score": "0.5627517", "text": "function concatenate(node, index, parent) {\n if (parent && parent.type !== 'WordNode' && queue.indexOf(parent) === -1) {\n queue.push(parent)\n }\n }", "title": "" }, { "docid": "a716b8cf9c986d799d5a14596fe50870", "score": "0.56136215", "text": "function visitAstWithParent(node, parent, f) {\n node.children.forEach(function (c) { return visitAstWithParent(c, node, f); });\n f(node, parent);\n}", "title": "" }, { "docid": "2865e8fa99217593eba26ea9721c4606", "score": "0.5568668", "text": "function injectParentPointers(node, parent) {\n node.$parent = parent;\n var list = children(node);\n for (var i=0; i<list.length; i++) {\n injectParentPointers(list[i], node);\n }\n}", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "ab68ccc97a50837eae7a7757b633bf3e", "score": "0.5537082", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "title": "" }, { "docid": "2b6fa9c9ae97994801ad44ae0b934061", "score": "0.5488413", "text": "function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }", "title": "" }, { "docid": "6b0605cb4eb850c2a02664a1e60d78bd", "score": "0.54805255", "text": "function put_to_nodes(node, obj) {\n var leaf = isleaf(node, obj)\n if( leaf.leaf )\n node.l.push(obj)\n else if( leaf.childnode )\n put(leaf.childnode, obj)\n else\n return\n }", "title": "" }, { "docid": "98425153f0a2e83691825e96948f724d", "score": "0.5473705", "text": "function apply(node, parent) {\n\t return pos(add(pos(node), parent), indent);\n\t }", "title": "" }, { "docid": "55b3df35060a627b251b193bffd874fa", "score": "0.5413139", "text": "function setParentPointers(node) {\n visitAstWithParent(node, null, function (c, p) { return p ? c.parent = p : p; });\n}", "title": "" }, { "docid": "656d1df341d95d34e1cd02c83a62c2e6", "score": "0.5380677", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.5379992", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.5379992", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.5379992", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.5379992", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.5379992", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.5379992", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "577adb72f5043f0919eed7f2a3bc94ed", "score": "0.53399885", "text": "function mutation_replaceAll(node, parent) {\n var e_10, _a;\n /**\n * 1. If node is not null, adopt node into parent’s node document.\n */\n if (node !== null) {\n DocumentAlgorithm_1.document_adopt(node, parent._nodeDocument);\n }\n /**\n * 2. Let removedNodes be parent’s children.\n */\n var removedNodes = Array.from(parent._children);\n /**\n * 3. Let addedNodes be the empty list.\n * 4. If node is DocumentFragment node, then set addedNodes to node’s\n * children.\n * 5. Otherwise, if node is non-null, set addedNodes to [node].\n */\n var addedNodes = [];\n if (node && node._nodeType === interfaces_1.NodeType.DocumentFragment) {\n addedNodes = Array.from(node._children);\n }\n else if (node !== null) {\n addedNodes.push(node);\n }\n try {\n /**\n * 6. Remove all parent’s children, in tree order, with the suppress\n * observers flag set.\n */\n for (var removedNodes_1 = __values(removedNodes), removedNodes_1_1 = removedNodes_1.next(); !removedNodes_1_1.done; removedNodes_1_1 = removedNodes_1.next()) {\n var childNode = removedNodes_1_1.value;\n mutation_remove(childNode, parent, true);\n }\n }\n catch (e_10_1) { e_10 = { error: e_10_1 }; }\n finally {\n try {\n if (removedNodes_1_1 && !removedNodes_1_1.done && (_a = removedNodes_1.return)) _a.call(removedNodes_1);\n }\n finally { if (e_10) throw e_10.error; }\n }\n /**\n * 7. If node is not null, then insert node into parent before null with the\n * suppress observers flag set.\n */\n if (node !== null) {\n mutation_insert(node, parent, null, true);\n }\n /**\n * 8. Queue a tree mutation record for parent with addedNodes, removedNodes,\n * null, and null.\n */\n if (DOMImpl_1.dom.features.mutationObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, addedNodes, removedNodes, null, null);\n }\n}", "title": "" }, { "docid": "0ac144437facacea7b2fd2b53897ed96", "score": "0.53257513", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n prev.children = prev.children.concat(node.children)\n\n return prev\n}", "title": "" }, { "docid": "991bb4106490838f50df8174bf55e8be", "score": "0.5315926", "text": "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node;\n }\n\n previous.children = previous.children.concat(node.children);\n\n return previous;\n}", "title": "" }, { "docid": "7cb2cc4e737b907347fcead46aeac534", "score": "0.53137606", "text": "function mergeBlockquote(prev, node) {\n\t if (this.options.commonmark) {\n\t return node;\n\t }\n\n\t prev.children = prev.children.concat(node.children);\n\n\t return prev;\n\t}", "title": "" }, { "docid": "06fe6683a3e6667f063ac0cd38a3a965", "score": "0.5313683", "text": "insertNode(node) {\n\t\tif (!this.root) {\n\t\t\tthis.root = node;\n\t\t\tthis.parentNodes.push(node);\n\t\t\treturn;\n\t\t}\n\t\tthis.parentNodes[0].appendChild(node);\n\t\tif (this.parentNodes[0].left !== null && this.parentNodes[0].right !== null) {\n\t\t\tthis.parentNodes.shift(); //remove 1st element, because it already has both children\n\t\t}\n\t\t// make a node a parent node, i.e. later we can add children to it\n\t\tthis.parentNodes.push(node);\n\t}", "title": "" }, { "docid": "6fe593ab8cd2784a15e27eb03f99404c", "score": "0.5308474", "text": "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "title": "" }, { "docid": "33c37cf945eeff406152d7adf9007918", "score": "0.530003", "text": "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "title": "" }, { "docid": "e8f05091a257950b289816525517aaef", "score": "0.5273495", "text": "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "title": "" }, { "docid": "47aef56a7010b6ae44a68bf13a277a01", "score": "0.52655303", "text": "function noopAdd(node, parent) {\n if (parent) {\n parent.children.push(node)\n }\n\n return node\n}", "title": "" }, { "docid": "3c601e5e6b4178e8a1ea66c0aa545ee9", "score": "0.5212617", "text": "function _insertBefore(parent, node, refNode) {\n\t\tparent.insertBefore(node, refNode);\n\t}", "title": "" }, { "docid": "9da8da4562f05e231c5194a88f33334e", "score": "0.5184504", "text": "function replaceTree(opts) {\n var replacementSourceFile = opts.replacementSourceFile, changingParent = opts.parent, isFirstChild = opts.isFirstChild, childCount = opts.childCount, customMappings = opts.customMappings;\n var sourceFile = changingParent.getSourceFile();\n var compilerFactory = sourceFile.global.compilerFactory;\n var replacingNodes = opts.replacingNodes == null ? undefined : __spread(opts.replacingNodes);\n var parentHandler = new nodeHandlers_1.DefaultParentHandler(compilerFactory, { childCount: childCount, isFirstChild: isFirstChild, replacingNodes: replacingNodes, customMappings: customMappings });\n if (changingParent === sourceFile)\n parentHandler.handleNode(sourceFile, replacementSourceFile);\n else {\n var parentFinderReplacement = new nodeHandlers_1.ParentFinderReplacementNodeHandler(compilerFactory, parentHandler, changingParent);\n parentFinderReplacement.handleNode(sourceFile, replacementSourceFile);\n }\n}", "title": "" }, { "docid": "48a621d2135034f0b14eec27270c2433", "score": "0.5155666", "text": "process(node) {\n let parent = this.parentPrefix(node)\n\n for (let prefix of this.prefixes) {\n if (!parent || parent === prefix) {\n this.add(node, prefix)\n }\n }\n }", "title": "" }, { "docid": "48a621d2135034f0b14eec27270c2433", "score": "0.5155666", "text": "process(node) {\n let parent = this.parentPrefix(node)\n\n for (let prefix of this.prefixes) {\n if (!parent || parent === prefix) {\n this.add(node, prefix)\n }\n }\n }", "title": "" }, { "docid": "0058be244de9070972451eba8931962d", "score": "0.513874", "text": "function replaceNodeWith(node, newNode) {\n var done = false;\n var parent = node.$parent;\n var keys = Object.keys(parent);\n keys.forEach(function(key) {\n if (parent[key] === node) {\n parent[key] = newNode;\n done = true;\n }\n });\n\n if (done) {\n return;\n }\n\n // second pass, now check arrays\n keys.forEach(function(key) {\n if (Array.isArray(parent[key])) {\n var arr = parent[key];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === node) {\n arr[i] = newNode;\n done = true;\n }\n }\n }\n });\n\n assert(done);\n}", "title": "" }, { "docid": "bcfa3e6e1a90de1909a15eb4c874a3fc", "score": "0.5131065", "text": "function mergeCurrentLevel(parentNode) {\r\n\r\n if(parentNode.isFirstMerge != null) {\r\n merge(parentNode);\r\n }\r\n else {\r\n firstMerge(parentNode);\r\n }\r\n}", "title": "" }, { "docid": "22e64624c766405d8868014f5d41ec7f", "score": "0.51277924", "text": "function flattenAst(node, parent) {\n if (Array.isArray(node)) {\n for (let n = 0; n < node.length; n++) {\n node[n] = flattenAst(node[n], parent);\n }\n\n return node;\n }\n\n if (node.content != null) {\n node.content = flattenAst(node.content, node);\n }\n\n if (parent != null && node.type === parent.type) {\n return node.content;\n }\n\n return node;\n}", "title": "" }, { "docid": "fcb6125afa0e47c321b0a6410cb3a885", "score": "0.5125495", "text": "a(parent, node, line) {\n // log 'JsWizziEvalHelper called $.a(' + node.n + ',' + node.v + ')'\n assert(parent, \"wizzi-mtree.JsWizziEvalHelper error. Parent undefined in add. At line \" + line);\n node.parent = parent;\n if (typeof (parent.children) === 'undefined') {\n parent.children = [];\n }\n node.children = [];\n parent.children.push(node);\n }", "title": "" }, { "docid": "657135d0d293cff1116c2cf5611c15fb", "score": "0.50536245", "text": "addNode(node, parentPath) {\n if (parentPath == null || parentPath == \"\") return this.root.addChild(node)\n const parent = this.getNodeByAbsolutePath(parentPath)\n return {\n success: parent == null ? false : parent.addChild(node),\n tree: this\n }\n }", "title": "" }, { "docid": "27bfc0d311bd6f11a8aa19b70e5c8e21", "score": "0.5051177", "text": "function appendNode(node) {\n const parent = stack.peek();\n const containerChildTypes = CONTAINERS[parent.type || parent.kind];\n\n // Wrap node if type is not allowed\n if (\n containerChildTypes\n && (node.kind !== 'block' || !containerChildTypes.includes(node.type))\n ) {\n node = Block.create({\n type: containerChildTypes[0],\n nodes: [node]\n });\n }\n\n const nodes = parent.nodes.push(node);\n stack = stack\n .pop()\n .push(parent.merge({ nodes }));\n }", "title": "" }, { "docid": "c63132ec830703c282decadbcc630274", "score": "0.5042554", "text": "addNode (parentKey, node/*, index TODO */) {\n const { _key, _parentKey, _children, options } = this\n const { keyPropName } = options\n const key = _key(node)\n if (!key) {\n console.warn(`cannot find valid key from node.${keyPropName}`)\n return false\n }\n\n const parent = this.getNode(parentKey)\n if (parentKey && !parent) {\n console.warn(`cannot find parent of key: ${parentKey}`)\n return false\n }\n \n // make sure it has parentKey set\n _parentKey(node, parentKey)\n\n // modify tree\n if (!parent) {\n this.tree.push(node) // add to top level\n } else {\n const children = _children(parent.node)\n if (!children) {\n _children(parent.node, [node])\n } else {\n children.push(node)\n }\n }\n\n // recalculate nodeMap\n this.sync()\n }", "title": "" }, { "docid": "0efbc80fc37f28c06c097290987e996c", "score": "0.5021851", "text": "add(node) {\n if (!(this.update(node.x, node.y, node.moveCost, node.parent))) {\n this._open.push(node);\n }\n }", "title": "" }, { "docid": "65ac671993dc6419e21aaa445d51b58e", "score": "0.5003142", "text": "function add(node) {\r\n if(node.children == null)\r\n node.children = new Array();\r\n if(node.lastNodeIdx == null)\r\n node.lastNodeIdx = 0;\r\n else\r\n node.lastNodeIdx += 1;\r\n // var newIdx;\r\n // if(node.depth == 0)\r\n // newIdx = ++lastNodeIdx;\r\n // else\r\n // newIdx = node.children.length;\r\n var newNode = {};\r\n newNode.id = node.id + \"_\" + node.lastNodeIdx;\r\n newNode.depth = node.depth + 1;\r\n if(newNode.depth > treeDepth) {\r\n treeDepth = newNode.depth;\r\n treeDiameter = 2 * treeDepth * nodesRadius[0] / Math.sin(360 / maxNum * Math.PI / 180 / 2);\r\n tree = d3.layout.tree()\r\n .size([360, treeDiameter / 2])\r\n .separation(function(a, b) {\r\n return (nodesRadius[a.importance] + nodesRadius[b.importance]) / getNodeDepth(a);\r\n })\r\n svgSide = treeDiameter + nodesRadius[0] + margin;\r\n }\r\n //new node always be important\r\n //newNode.importance = Math.floor(Math.random() * 2);\r\n newNode.importance = 0;\r\n newNode.content = \"people post contents\";\r\n newNode.parent = node;\r\n newNode.depth = node.depth + 1;\r\n newNode.cellUser = {};\r\n newNode.cellUser.userId = 100;\r\n newNode.cellUser.email = \"[email protected]\";\r\n newNode.cellUser.name = \"Bing\";\r\n newNode.cellUser.profileImage = \"35_205ba70b7d8889e0d518e886259cf45a\";\r\n newNode.date = new Date();\r\n node.children.push(newNode);\r\n nodes = tree.nodes(nodes[0]);\r\n links = tree.links(nodes);\r\n adjustOverlap();\r\n nodeMerge();\r\n redraw();\r\n}", "title": "" }, { "docid": "cdc76d34933a7b22d37d756c22676d6f", "score": "0.4981741", "text": "function recurse(node) {\n if (node.children) node.children.forEach(recurse);\n if (!node.id) node.id = ++i;\n nodes.push(node);\n }", "title": "" }, { "docid": "ee778a2749d155298ae90950e43ade79", "score": "0.49725348", "text": "function update_parent_node_data(error) {\n if(error) {\n callback(error);\n } else {\n parentNodeData[name] = new DirectoryEntry(node.id, mode);\n context.put(parentNode.data, parentNodeData, update_time);\n }\n }", "title": "" }, { "docid": "96e1c2e80abd941d78062ab9b123e664", "score": "0.49604788", "text": "function n_add(node)\n{\n\tif(node.property >= PROPERTY_THRESHOLD)\t// division condition\n\t{\n\t\tvar newNode = n_create(node);\n\t\tif(node.children != null)\t// If this node already has a children, do a swap (!! MAYBE JUST ADD A SECOND DAUGHTER?)\n\t\t{\n\t\t\tvar temp = node.children;\n\t\t\tnode.children = newNode;\n\t\t\tnode.children.children = temp;\n\t\t\tnode.children.children.pos = getPointAtEndOfArm(node.children.pos[0], node.children.pos[1], node.children.angles, GRID_TILE_SIZE);\t// Calculate the new x and y pos of the original child\n\t\t}\n\t\telse\t// Otherwise just assign the new node\n\t\t{\n\t\t\tnode.children = newNode;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.495195", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "3c811348fe10c15e44685abad40a2a62", "score": "0.49499515", "text": "add (node) {\n // Creating iterator to move through nodes of tree\n let iterator = this.root;\n\n // If arg.\"node\" is not instance od Node, it becomes one\n if (!(node instanceof Node)) {\n node = new Node(node);\n }\n // Checking if root is empty so node can be start of tree\n if (this.root === null) {\n this.root = node;\n\n return this;\n }\n\n /**\n * Looping actions while we are still on node\n * (which means we are still looking for place)\n */\n while (iterator !== null) {\n /**\n * One of 3 cases = inserted node value is greater than value\n */\n if (this.compare(node.value, iterator.value) > 0) {\n if (iterator.rightChild !== null) {\n iterator = iterator.rightChild;\n } else {\n iterator.rightChild = node;\n node.parent = iterator;\n\n return this;\n }\n } else if (this.compare(iterator.value, node.value) > 0) {\n if (iterator.leftChild !== null) {\n iterator = iterator.leftChild;\n } else {\n iterator.leftChild = node;\n node.parent = iterator;\n\n return this;\n }\n }\n else if (this.compare(iterator.value, node.value) === 0) {\n return this;\n }\n }\n }", "title": "" }, { "docid": "078413e5fb4ed88f3dcc6c3c7c374c8f", "score": "0.49489433", "text": "function mutation_preInsert(node, parent, child) {\n /**\n * 1. Ensure pre-insertion validity of node into parent before child.\n * 2. Let reference child be child.\n * 3. If reference child is node, set it to node’s next sibling.\n * 4. Adopt node into parent’s node document.\n * 5. Insert node into parent before reference child.\n * 6. Return node.\n */\n mutation_ensurePreInsertionValidity(node, parent, child);\n var referenceChild = child;\n if (referenceChild === node)\n referenceChild = node._nextSibling;\n DocumentAlgorithm_1.document_adopt(node, parent._nodeDocument);\n mutation_insert(node, parent, referenceChild);\n return node;\n}", "title": "" }, { "docid": "ff6ee8fa5367860aa9e1829c0bc406bb", "score": "0.49408406", "text": "merge(node, index) {\n\t\tlet left = node.arr[index];\n\t\tlet right = node.arr[index + 1];\n\t\tlet start = left.n;\n\t\t// Adding a key from node to the left child.\n\t\tleft.keys[start] = node.keys[index];\n\t\t// Copying the keys from right to left.\n\t\tfor (let i = 0; i < right.n; ++i) {\n\t\t\tleft.keys[start + 1 + i] = right.keys[i];\n\t\t}\n\t\t// Copying the child pointers from right to left.\n\t\tfor (let i = 0; !left.leaf && i <= right.n; ++i) {\n\t\t\tleft.arr[start + 1 + i] = right.arr[i];\n\t\t}\n\t\t// Moving all keys after index in the current node one step forward.\n\t\tfor (let i = index + 1; i < node.n; ++i) {\n\t\t\tnode.keys[i - 1] = node.keys[i];\n\t\t}\n\t\t// Moving the child pointers after (index+1) in the current node one step forward.\n\t\tfor (let i = index + 2; i <= node.n; ++i) {\n\t\t\tnode.arr[i - 1] = node.arr[i];\n\t\t}\n\t\t// Updating the key count of child and the current node\n\t\tleft.n += right.n + 1;\n\t\tnode.n--;\n\t\treturn;\n\t}", "title": "" }, { "docid": "11bd1b46c962ebe7cda3623536322454", "score": "0.49343592", "text": "function visit(node) {\r\n if (visited.has(node)) {\r\n return;\r\n }\r\n visited.add(node);\r\n var children = graph.get(node);\r\n if (children) {\r\n children.forEach(visit);\r\n }\r\n sorted.push(node);\r\n }", "title": "" }, { "docid": "4ed19190ec96ad70b6714845c41c739e", "score": "0.49046937", "text": "function addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}", "title": "" }, { "docid": "1b60ce25b4c031d6bff7bde8a6cc81aa", "score": "0.48867", "text": "function replaceNode(node, newNode, parent, key) {\n if (Array.isArray(parent[key])) {\n if (node) {\n const idx = parent[key].indexOf(node);\n parent[key][idx] = newNode;\n } else parent[key].unshift(newNode);\n } else parent[key] = newNode;\n if (node) {\n newNode.originStart = newNode.start = node.start;\n newNode.originEnd = newNode.end = node.end;\n } else {\n const parentStart = parseInt(parent.start, 10) + 1;\n newNode.originStart = newNode.originEnd = parentStart;\n }\n}", "title": "" }, { "docid": "6aa698835d9a6f79ccefc81f96a073a4", "score": "0.4883849", "text": "function moveNodeInto(arg,into,blockp){\n var baseclass; var node=arg, weird=false;\n if (hasParent(node,into)) return node;\n if (node.nodeType===1) {\n baseclass=node.className;\n if ((baseclass)&&(typeof baseclass !== \"string\"))\n weird=true;}\n else if (node.nodeType===3) {\n if (node.nodeValue.search(/\\S/g)>=0) {\n // Wrap non-empty text nodes in elements before\n // moving\n var wrapnode=fdjtDOM(\n ((blockp)?\"div.codexwraptext\":\"span.codexwraptext\"));\n if (node.parentNode)\n node.parentNode.replaceChild(wrapnode,node);\n wrapnode.appendChild(node);\n baseclass=\"codexwraptext\";\n node=wrapnode;}\n else node=node.cloneNode(true);}\n else {}\n into.appendChild(node);\n return node;}", "title": "" }, { "docid": "df70c2319e307fe30126001c83b5d4f3", "score": "0.48736063", "text": "function mergeText(prev, node) {\n prev.value += node.value\n\n return prev\n}", "title": "" }, { "docid": "fec2414fce7ca195f021130faa34d10f", "score": "0.48698848", "text": "function addNode(array, node) {\n array.push({\n \"loc\": node.loc,\n \"name\": node.name\n });\n }", "title": "" }, { "docid": "8d3076fd27e116a0003176d4926a3eba", "score": "0.4868568", "text": "function asClonedNode (node, parent) {\n\tconst cloneNode = new node.constructor(node);\n\n\tfor (const key in node) {\n\t\tif (key === 'parent') {\n\t\t\tcloneNode.parent = parent;\n\t\t} else if (Array.isArray(node[key])) {\n\t\t\tcloneNode[key] = asClonedArray(node.nodes, cloneNode);\n\t\t} else if (node[key] === Object(node[key])) {\n\t\t\tcloneNode[key] = Object.assign({}, node[key]);\n\t\t}\n\t}\n\n\treturn cloneNode;\n}", "title": "" }, { "docid": "897650d44d0b34807945470240ed2073", "score": "0.4849433", "text": "function enterNode(node) {\n if (!treemap.busy && node._depth !== currentDepth) {\n // Track the progress.\n currentNode = node;\n currentDepth = node._depth;\n\n // Update depth dependent elements.\n setDropDowns(dataLevels.slice(currentDepth));\n updateColors(currentDepth);\n updateCrumbs(node);\n\n // Actually enter.\n treemap.enter(node);\n }\n}", "title": "" }, { "docid": "ee557ed84d9e1a34143d1d45c48e95cd", "score": "0.484338", "text": "function appendBuiltContent (ancestorBranches, key, node) {\n Object(__WEBPACK_IMPORTED_MODULE_1__ascent__[\"c\" /* nodeOf */])(Object(__WEBPACK_IMPORTED_MODULE_3__lists__[\"g\" /* head */])(ancestorBranches))[key] = node\n }", "title": "" }, { "docid": "ee557ed84d9e1a34143d1d45c48e95cd", "score": "0.484338", "text": "function appendBuiltContent (ancestorBranches, key, node) {\n Object(__WEBPACK_IMPORTED_MODULE_1__ascent__[\"c\" /* nodeOf */])(Object(__WEBPACK_IMPORTED_MODULE_3__lists__[\"g\" /* head */])(ancestorBranches))[key] = node\n }", "title": "" }, { "docid": "ee557ed84d9e1a34143d1d45c48e95cd", "score": "0.484338", "text": "function appendBuiltContent (ancestorBranches, key, node) {\n Object(__WEBPACK_IMPORTED_MODULE_1__ascent__[\"c\" /* nodeOf */])(Object(__WEBPACK_IMPORTED_MODULE_3__lists__[\"g\" /* head */])(ancestorBranches))[key] = node\n }", "title": "" }, { "docid": "b1cf1d05ef1b28a8f3263b58b5454942", "score": "0.48328128", "text": "_treeify(tokens, root) {\n root = root || this.root;\n for (let i = 0; i < tokens.length; i++) {\n let node = root,\n words = tokens.slice(i, i + this.n);\n for (let j = 0; j < words.length; j++) {\n node = node.addChild(words[j]);\n }\n }\n }", "title": "" }, { "docid": "0b6cab7d2cd0123fde180ab0351e596c", "score": "0.48295942", "text": "function addChildrenToParent(parentTreeNode, childDataNodes) {\n //Create the new tree nodes\n console.log(parentTreeNode, childDataNodes);\n var childTreeNodes = childDataNodes.map(n => createTreeNode(n));\n\n\n //place these tree nodes in a key.value map\n var childTreeNodesMap = childTreeNodes.reduce((accTree, node) => {\n accTree[node.treeNodeId] = node;\n return accTree;\n }, {});\n\n\n\n //Create a new parent Node that is the same as before, except\n //we update the children field and the status of the node\n var newParentTreeNode = {\n ...parentTreeNode,\n children : Object.keys(childTreeNodesMap),\n status: childTreeNodes.length>0 ? IS_CLOSED : IS_LEAF\n };\n\n //return a new tree with the new children and the updated parent tree\n return {\n //...tree,\n ...childTreeNodesMap,\n [newParentTreeNode.treeNodeId]: newParentTreeNode\n }\n}", "title": "" }, { "docid": "ed1c51bd73d398afd505ee180f81cba9", "score": "0.4825183", "text": "inserted(node, parent) { }", "title": "" }, { "docid": "05fb64066767f21def427398cdd9182c", "score": "0.48244652", "text": "prependTo(node) {\n node.prependChild(this);\n return this;\n }", "title": "" }, { "docid": "3d09e95db9c95cd871f7bc1f74e8bef7", "score": "0.48212558", "text": "function mergeAdjacentWhitespace(node) {\n if (Array.isArray(node.content)) {\n var i = node.content.length - 1;\n while (i-- > 0) {\n if (node.get(i) != null) { \n if (node.get(i).is('space') && node.get(i + 1) && node.get(i + 1).is('space')) {\n node.get(i).content += node.get(i + 1).content;\n node.removeChild(i + 1);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "4c69b22752e40fdd0582592e826246c0", "score": "0.48159322", "text": "function mergeText(previous, node) {\n previous.value += node.value;\n\n return previous;\n}", "title": "" }, { "docid": "c236029f313acbdaee5f0e626c94c833", "score": "0.48060217", "text": "function add_parent_links(node) {\n\tfor(var c = 0; c < node.children.length; c++) {\n\t\tnode.children[c].parent = node;\n\t\tadd_parent_links(node.children[c]);\n\t}\n}", "title": "" }, { "docid": "b06f8b8b501c6277fabb567201a532ed", "score": "0.48048833", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n return prev;\n}", "title": "" }, { "docid": "6adb715b77cde96396c33a4eeaea78f4", "score": "0.4791541", "text": "insert(value, parent) {\n // Set the root as the initial insertion point\n // if it has not been passed\n if (!parent) {\n if (!this.root) {\n this.root = new Node(value);\n this._size++;\n return;\n }\n parent = this.root;\n }\n\n var child = this._comparator.lessThan(value, parent.value) ? 'left' : 'right';\n if (parent[child]) {\n this.insert(value, parent[child]);\n } else {\n parent[child] = new Node(value, parent);\n this._size++;\n }\n }", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.4789698", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.4789698", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.4789698", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.4789698", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.4789698", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.4789698", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "bca6149a3501b775e64afb37c90079c5", "score": "0.47794086", "text": "function replaceNode(node, newNode, parent, key) {\n if (Array.isArray(parent[key])) {\n if (node) {\n const idx = parent[key].indexOf(node);\n parent[key][idx] = newNode;\n } else parent[key].unshift(newNode);\n } else parent[key] = newNode;\n\n const newNodeWithLocation = newNode;\n const nodeWithLocation = node;\n const parentWithLocation = parent;\n\n if (node) {\n newNodeWithLocation.originStart = newNodeWithLocation.start = nodeWithLocation.start;\n newNodeWithLocation.originEnd = newNodeWithLocation.end = nodeWithLocation.end;\n } else newNodeWithLocation.originStart = newNodeWithLocation.originEnd = parentWithLocation.start + 1;\n}", "title": "" }, { "docid": "aa05b8030740ffe660012f0de916162e", "score": "0.47728342", "text": "function mutation_insert_single(node, parent, suppressObservers) {\n /**\n * 1. Let count be the number of children of node if it is a\n * DocumentFragment node, and one otherwise.\n * 2. If child is non-null, then:\n * 2.1. For each live range whose start node is parent and start\n * offset is greater than child's index, increase its start\n * offset by count.\n * 2.2. For each live range whose end node is parent and end\n * offset is greater than child's index, increase its end\n * offset by count.\n * 3. Let nodes be node’s children, if node is a DocumentFragment node;\n * otherwise « node ».\n * 4. If node is a DocumentFragment node, remove its children with the\n * suppress observers flag set.\n * 5. If node is a DocumentFragment node, then queue a tree mutation record\n * for node with « », nodes, null, and null.\n */\n /**\n * 6. Let previousSibling be child’s previous sibling or parent’s last\n * child if child is null.\n */\n var previousSibling = parent._lastChild;\n // set document element node\n if (util_1.Guard.isElementNode(node)) {\n // set document element node\n if (util_1.Guard.isDocumentNode(parent)) {\n parent._documentElement = node;\n }\n // mark that the document has namespaces\n if (!node._nodeDocument._hasNamespaces && (node._namespace !== null ||\n node._namespacePrefix !== null)) {\n node._nodeDocument._hasNamespaces = true;\n }\n }\n /**\n * 7. For each node in nodes, in tree order:\n * 7.1. If child is null, then append node to parent’s children.\n * 7.2. Otherwise, insert node into parent’s children before child’s\n * index.\n */\n node._parent = parent;\n parent._children.add(node);\n // assign siblings and children for quick lookups\n if (parent._firstChild === null) {\n node._previousSibling = null;\n node._nextSibling = null;\n parent._firstChild = node;\n parent._lastChild = node;\n }\n else {\n var prev = parent._lastChild;\n node._previousSibling = prev;\n node._nextSibling = null;\n if (prev)\n prev._nextSibling = node;\n if (!prev)\n parent._firstChild = node;\n parent._lastChild = node;\n }\n /**\n * 7.3. If parent is a shadow host and node is a slotable, then\n * assign a slot for node.\n */\n if (DOMImpl_1.dom.features.slots) {\n if (parent._shadowRoot !== null && util_1.Guard.isSlotable(node)) {\n ShadowTreeAlgorithm_1.shadowTree_assignASlot(node);\n }\n }\n /**\n * 7.4. If node is a Text node, run the child text content change\n * steps for parent.\n */\n if (DOMImpl_1.dom.features.steps) {\n if (util_1.Guard.isTextNode(node)) {\n DOMAlgorithm_1.dom_runChildTextContentChangeSteps(parent);\n }\n }\n /**\n * 7.5. If parent's root is a shadow root, and parent is a slot\n * whose assigned nodes is the empty list, then run signal\n * a slot change for parent.\n */\n if (DOMImpl_1.dom.features.slots) {\n if (util_1.Guard.isShadowRoot(TreeAlgorithm_1.tree_rootNode(parent)) &&\n util_1.Guard.isSlot(parent) && util_2.isEmpty(parent._assignedNodes)) {\n ShadowTreeAlgorithm_1.shadowTree_signalASlotChange(parent);\n }\n }\n /**\n * 7.6. Run assign slotables for a tree with node's root.\n */\n if (DOMImpl_1.dom.features.slots) {\n ShadowTreeAlgorithm_1.shadowTree_assignSlotablesForATree(TreeAlgorithm_1.tree_rootNode(node));\n }\n /**\n * 7.7. For each shadow-including inclusive descendant\n * inclusiveDescendant of node, in shadow-including tree\n * order:\n * 7.7.1. Run the insertion steps with inclusiveDescendant.\n */\n if (DOMImpl_1.dom.features.steps) {\n DOMAlgorithm_1.dom_runInsertionSteps(node);\n }\n if (DOMImpl_1.dom.features.customElements) {\n /**\n * 7.7.2. If inclusiveDescendant is connected, then:\n */\n if (util_1.Guard.isElementNode(node) &&\n ShadowTreeAlgorithm_1.shadowTree_isConnected(node)) {\n if (util_1.Guard.isCustomElementNode(node)) {\n /**\n * 7.7.2.1. If inclusiveDescendant is custom, then enqueue a custom\n * element callback reaction with inclusiveDescendant, callback name\n * \"connectedCallback\", and an empty argument list.\n */\n CustomElementAlgorithm_1.customElement_enqueueACustomElementCallbackReaction(node, \"connectedCallback\", []);\n }\n else {\n /**\n * 7.7.2.2. Otherwise, try to upgrade inclusiveDescendant.\n */\n CustomElementAlgorithm_1.customElement_tryToUpgrade(node);\n }\n }\n }\n /**\n * 8. If suppress observers flag is unset, then queue a tree mutation record\n * for parent with nodes, « », previousSibling, and child.\n */\n if (DOMImpl_1.dom.features.mutationObservers) {\n if (!suppressObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, [node], [], previousSibling, null);\n }\n }\n}", "title": "" }, { "docid": "893eb9b3fa9c0ed33fc71bd5a190be1a", "score": "0.47611374", "text": "function addParent(obj, parent) {\n const isNode = obj && typeof obj.type === 'string';\n const childParent = isNode ? obj : parent;\n for (const k in obj) {\n const value = obj[k];\n if (Array.isArray(value)) {\n value.forEach(function (v) { addParent(v, childParent); });\n }\n else if (value && typeof value === 'object') {\n addParent(value, childParent);\n }\n }\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null\n });\n }\n return obj;\n}", "title": "" }, { "docid": "4e064455480f77ca772740ba2cc4f3e1", "score": "0.47536576", "text": "function mergeInnerWordSlash(child, index, parent) {\n var siblings = parent.children\n var prev\n var next\n var prevValue\n var nextValue\n var queue\n var tail\n var count\n\n prev = siblings[index - 1]\n next = siblings[index + 1]\n\n if (\n prev &&\n prev.type === 'WordNode' &&\n (child.type === 'SymbolNode' || child.type === 'PunctuationNode') &&\n toString(child) === slash\n ) {\n prevValue = toString(prev)\n tail = child\n queue = [child]\n count = 1\n\n if (next && next.type === 'WordNode') {\n nextValue = toString(next)\n tail = next\n queue = queue.concat(next.children)\n count++\n }\n\n if (prevValue.length < 3 && (!nextValue || nextValue.length < 3)) {\n // Add all found tokens to `prev`s children.\n prev.children = prev.children.concat(queue)\n\n siblings.splice(index, count)\n\n // Update position.\n if (prev.position && tail.position) {\n prev.position.end = tail.position.end\n }\n\n // Next, iterate over the node *now* at the current position.\n return index\n }\n }\n}", "title": "" }, { "docid": "7c8bbeb53a5aa82eaeac955d60a63586", "score": "0.47489178", "text": "function addChildrenRecursively(node) {\n curCancellationToken.throwIfCancellationRequested();\n if (!node || ts.isToken(node)) {\n return;\n }\n switch (node.kind) {\n case 153 /* Constructor */:\n // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it.\n var ctr = node;\n addNodeWithRecursiveChild(ctr, ctr.body);\n // Parameter properties are children of the class, not the constructor.\n for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) {\n var param = _a[_i];\n if (ts.isParameterPropertyDeclaration(param)) {\n addLeafNode(param);\n }\n }\n break;\n case 152 /* MethodDeclaration */:\n case 154 /* GetAccessor */:\n case 155 /* SetAccessor */:\n case 151 /* MethodSignature */:\n if (!ts.hasDynamicName(node)) {\n addNodeWithRecursiveChild(node, node.body);\n }\n break;\n case 150 /* PropertyDeclaration */:\n case 149 /* PropertySignature */:\n if (!ts.hasDynamicName(node)) {\n addLeafNode(node);\n }\n break;\n case 240 /* ImportClause */:\n var importClause = node;\n // Handle default import case e.g.:\n // import d from \"mod\";\n if (importClause.name) {\n addLeafNode(importClause);\n }\n // Handle named bindings in imports e.g.:\n // import * as NS from \"mod\";\n // import {a, b as B} from \"mod\";\n var namedBindings = importClause.namedBindings;\n if (namedBindings) {\n if (namedBindings.kind === 241 /* NamespaceImport */) {\n addLeafNode(namedBindings);\n }\n else {\n for (var _b = 0, _c = namedBindings.elements; _b < _c.length; _b++) {\n var element = _c[_b];\n addLeafNode(element);\n }\n }\n }\n break;\n case 177 /* BindingElement */:\n case 227 /* VariableDeclaration */:\n var _d = node, name = _d.name, initializer = _d.initializer;\n if (ts.isBindingPattern(name)) {\n addChildrenRecursively(name);\n }\n else if (initializer && isFunctionOrClassExpression(initializer)) {\n if (initializer.name) {\n // Don't add a node for the VariableDeclaration, just for the initializer.\n addChildrenRecursively(initializer);\n }\n else {\n // Add a node for the VariableDeclaration, but not for the initializer.\n startNode(node);\n ts.forEachChild(initializer, addChildrenRecursively);\n endNode();\n }\n }\n else {\n addNodeWithRecursiveChild(node, initializer);\n }\n break;\n case 188 /* ArrowFunction */:\n case 229 /* FunctionDeclaration */:\n case 187 /* FunctionExpression */:\n addNodeWithRecursiveChild(node, node.body);\n break;\n case 233 /* EnumDeclaration */:\n startNode(node);\n for (var _e = 0, _f = node.members; _e < _f.length; _e++) {\n var member = _f[_e];\n if (!isComputedProperty(member)) {\n addLeafNode(member);\n }\n }\n endNode();\n break;\n case 230 /* ClassDeclaration */:\n case 200 /* ClassExpression */:\n case 231 /* InterfaceDeclaration */:\n startNode(node);\n for (var _g = 0, _h = node.members; _g < _h.length; _g++) {\n var member = _h[_g];\n addChildrenRecursively(member);\n }\n endNode();\n break;\n case 234 /* ModuleDeclaration */:\n addNodeWithRecursiveChild(node, getInteriorModule(node).body);\n break;\n case 247 /* ExportSpecifier */:\n case 238 /* ImportEqualsDeclaration */:\n case 158 /* IndexSignature */:\n case 156 /* CallSignature */:\n case 157 /* ConstructSignature */:\n case 232 /* TypeAliasDeclaration */:\n addLeafNode(node);\n break;\n case 195 /* BinaryExpression */: {\n var special = ts.getSpecialPropertyAssignmentKind(node);\n switch (special) {\n case 1 /* ExportsProperty */:\n case 2 /* ModuleExports */:\n case 3 /* PrototypeProperty */:\n addNodeWithRecursiveChild(node, node.right);\n break;\n case 4 /* ThisProperty */:\n case 5 /* Property */:\n case 0 /* None */:\n break;\n default:\n ts.Debug.assertNever(special);\n }\n }\n // falls through\n default:\n if (ts.hasJSDocNodes(node)) {\n ts.forEach(node.jsDoc, function (jsDoc) {\n ts.forEach(jsDoc.tags, function (tag) {\n if (tag.kind === 288 /* JSDocTypedefTag */) {\n addLeafNode(tag);\n }\n });\n });\n }\n ts.forEachChild(node, addChildrenRecursively);\n }\n }", "title": "" } ]
591aa7444e7e9dfbe47ff22882bede0e
get image file => return object with image properties
[ { "docid": "1434c43df9163aecb257ad942e7cd9c8", "score": "0.0", "text": "function parseImage(image) {\n var result = {};\n var img = image\n\n return new Promise(function (resolve) {\n jimp.read(img)\n .then(function (imageItem) {\n var brightness;\n var vector = [];\n var data = [];\n var pixel = [];\n\n var i = 0;\n imageItem.bitmap.data.forEach(function (item) {\n if (i !== 3) {\n pixel.push(item);\n i = i + 1;\n } else {\n vector.push(pixel);\n pixel = [];\n i = 0;\n }\n data.push(item);\n });\n result.buffer = data;\n result.bitmap = vector;\n result.brightness = calcBrightness(vector);\n\n resolve(result);\n });\n });\n}", "title": "" } ]
[ { "docid": "7ccf0da8e704b5021fd8870f6145ad05", "score": "0.78192383", "text": "get image() {}", "title": "" }, { "docid": "f8e161ebd891bf442154a0e94cef9c8d", "score": "0.6708578", "text": "function getPhoto() {\n\t return {\n\t url: '',\n\t mediaType: '',\n\t base64: false,\n\t\n\t /**\n\t * Attach a photo from a URL\n\t * @param {string} url URL where photo can be found\n\t * @param {string} mediaType Media type of photo (JPEG, PNG, GIF)\n\t */\n\t attachFromUrl: function(url, mediaType) {\n\t this.url = url;\n\t this.mediaType = mediaType;\n\t this.base64 = false;\n\t },\n\t\n\t /**\n\t * Embed a photo from a file using base-64 encoding (not implemented yet)\n\t * @param {string} filename\n\t */\n\t embedFromFile: function(fileLocation) {\n\t this.mediaType = path.extname(fileLocation).toUpperCase().replace(/\\./g, \"\");\n\t var imgData = fs.readFileSync(fileLocation);\n\t this.url = imgData.toString('base64');\n\t this.base64 = true;\n\t }\n\t };\n\t }", "title": "" }, { "docid": "22a58de88d134c4f7763e50a99712e63", "score": "0.66207737", "text": "getImage() {\r\n return this.image;\r\n }", "title": "" }, { "docid": "5a50f8ad23ef1387bba44a6e9da4fca9", "score": "0.6613508", "text": "getImage() {\n return this.image;\n }", "title": "" }, { "docid": "5a50f8ad23ef1387bba44a6e9da4fca9", "score": "0.6613508", "text": "getImage() {\n return this.image;\n }", "title": "" }, { "docid": "55cf9a5db43ce7f7cd3b3d18bc829fc8", "score": "0.6611602", "text": "get image() {\n\t\treturn this.__image;\n\t}", "title": "" }, { "docid": "56e044336d7e3ec58fef35fe183f59ae", "score": "0.6604577", "text": "getImage() {\n return this._image;\n }", "title": "" }, { "docid": "4a7b146b554881478f4a50e52872f78f", "score": "0.65370905", "text": "function getImage(file) {\n\treturn self.createImageBitmap(file)\n}", "title": "" }, { "docid": "f84324ab2027ef6108aa314c2052f8c6", "score": "0.6412236", "text": "getFloorImage(imageName) {\n return this.get('config/v1/maps/imagesource/' + imageName, {},'blob')\n .then(blob => {\n return new Promise(resolve => {\n const reader = new window.FileReader();\n reader.readAsDataURL(blob);\n reader.onload = () => resolve(reader.result);\n })\n }).then(imageSource => {\n const image = new Image();\n image.src = imageSource;\n\n return {image}\n })\n }", "title": "" }, { "docid": "2e3c92dbaf718dcc57d60731b20b8cf5", "score": "0.63731855", "text": "getImageById(imageId) {\n const images = glob.sync(path.join(this.uploadsPath, `${imageId}.*`));\n\n if (images.length === 1) {\n const imageExtension = path.extname(images[0]);\n return new Image(imageId, imageId + imageExtension);\n } else {\n throw new Error('Requested image was not found.');\n }\n }", "title": "" }, { "docid": "f122e8671d4b4c8825416e6b09f50e82", "score": "0.63590795", "text": "get ImageOnly() {}", "title": "" }, { "docid": "0541bc286877db729dd2cfe6f525b943", "score": "0.63569087", "text": "getImg() {\n imageService.getImg()\n }", "title": "" }, { "docid": "71566d83897c73b001639e74ddc00a78", "score": "0.6327157", "text": "function fetchPhoto() {\r\n return {\r\n photo: \"https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png\"\r\n }\r\n}", "title": "" }, { "docid": "6045461975e28d381be0583c15b9fb1e", "score": "0.6304038", "text": "getImage(image){\n if(image != null && image != undefined && image != ''){\n return image.smallImageLocation;\n }\n return imageComing;\n }", "title": "" }, { "docid": "7e9cb89a2f6ca84ae75a5172dc8d2a55", "score": "0.6303769", "text": "get rawImage() {\n return this._image;\n }", "title": "" }, { "docid": "2e7759f0bc284c771176149557e185b2", "score": "0.6274335", "text": "getImageData(glTFImage) {\n return {\n typedArray: this.getBufferView(glTFImage.bufferView),\n mimeType: glTFImage.mimeType || 'image/jpeg'\n };\n }", "title": "" }, { "docid": "cc590948551c098e03e826fb2010b7fa", "score": "0.62689346", "text": "getFoto () {\n\t\treturn this.foto;\n\t}", "title": "" }, { "docid": "c2ff2dd460646caaa8426afab71e7815", "score": "0.62387365", "text": "getImageDetail(params) {\n if (!params.id) {\n throw new Error('[RWV] ImageService.getImageDetail() id parameter required to retreive image details.');\n }\n\n return ApiService.get('image', params.id);\n }", "title": "" }, { "docid": "ec8e8d680472a02d5bb820c754b7a437", "score": "0.622285", "text": "createImage(file) {\n var image = new Image();\n var reader = new FileReader();\n var vm = this;\n\n reader.onload = (e) => {\n vm.image = e.target.result;\n };\n reader.readAsDataURL(file);\n }", "title": "" }, { "docid": "524a4ff3c4eadd9147a1a1485cd9f503", "score": "0.62161404", "text": "function format() { return { type: 'image', content: pictureURL }; }", "title": "" }, { "docid": "74a41ae7e4605dc91e6ab17e73ef44c7", "score": "0.6215894", "text": "function getImageUrl(file) {\n return $.ajax({\n url: imageUrl + file\n });\n }", "title": "" }, { "docid": "983a1e3c1d804c0ad0e33e627b2cd1b3", "score": "0.6213225", "text": "function getImage() {\r\n return {\r\n \".write\": ADD_OR_UPLOADER,\r\n \".validate\": \"newData.child('isBoardImage').val() === false || newData.child('width').val() === 1024 || newData.child('height').val() === 1024\",\r\n \"uploaderEmail\": validateMandatoryEmail(),\r\n \"uploaderUid\": validateMyUid(),\r\n \"createdOn\": validateNow(),\r\n \"width\": validateNumber(10, 1024),\r\n \"height\": validateNumber(10, 1024),\r\n \"isBoardImage\": validateBoolean(),\r\n \"downloadURL\": validateSecureUrl(),\r\n \"sizeInBytes\": validateNumber(100, 2 * 1024 * 1024),\r\n \"cloudStoragePath\": validateRegex(\"(images|compressed)\\\\/\" + ID_PATTERN + \"[.](gif|png|jpg)\"),\r\n \"name\": validateMandatoryString(100),\r\n };\r\n }", "title": "" }, { "docid": "3a5763ea8db7ee5d84bc13fe91e96e5a", "score": "0.6187689", "text": "async function getImage(image) {\n let fm = FileManager.local()\n let dir = fm.documentsDirectory()\n let path = fm.joinPath(dir, image)\n if (fm.fileExists(path)) {\n return fm.readImage(path)\n } else {\n // download once\n let imageUrl\n switch (image) {\n case 'meal.png':\n imageUrl = 'https://cdn2.iconfinder.com/data/icons/international-food/64/hor_mok-64.png'\n break\n default:\n console.log(`Sorry, couldn't find ${image}.`)\n }\n let req = new Request(imageUrl)\n let loadedImage = await req.loadImage()\n fm.writeImage(path, loadedImage)\n return loadedImage\n }\n}", "title": "" }, { "docid": "1bf67d39b268cff4c5ad65053ad5305e", "score": "0.6140577", "text": "function GetImage(id){\n\tif(storeImages){\n\t\tvar dataImage = storageCache[\"imagen\"+id];\n\t\treturn \"data:image/png;base64,\" + dataImage;\n\t}else{\n\t\tvar dataImage = storageCache[\"imagen\"+id];\n\t\treturn storageCache[\"imagen\"+id];\n\t}\n}", "title": "" }, { "docid": "c3822b5c40ed31490ec448d6f27fba3f", "score": "0.6112197", "text": "function getImage(f, opts) {\n // Get image data unit (ADW: Can the HDU indices be set in config?)\n var hdu = 1;\n console.log('Loading IMAGE data from HDU: ' + hdu);\n var dataunit = f.getDataUnit(hdu);\n // Set options to pass to the next callback\n opts[\"dataunit\"] = dataunit;\n opts[\"f\"] = f;\n // Asynchronously get pixels representing the image passing a callback and options\n // First argument is the frame to load the image into\n dataunit.getFrameAsync(0, createVisualization, opts);\n}", "title": "" }, { "docid": "8cc6dec16e97d8c991d926057645d7db", "score": "0.61055404", "text": "get(id) {\n if (!id) {\n return {};\n }\n return find(this.images, { id: Number(id) }) || {};\n }", "title": "" }, { "docid": "0aeaf7482eb38569445306ed890830bc", "score": "0.61012995", "text": "function getImageData(fileList) {\n let file = null;\n\n for (let i = 0; i < fileList.length; i++) {\n if (fileList[i].type.match(/^image\\//)) {\n file = fileList[i];\n break;\n }\n }\n\n if (file !== null) {\n return URL.createObjectURL(file)\n }\n}", "title": "" }, { "docid": "497ee214747927a344134648b7b069f1", "score": "0.60971266", "text": "function getImagePath() {\n return currentPicturePath;\n}", "title": "" }, { "docid": "b746e2361d501905f8c8c61acd2bfcb2", "score": "0.60797143", "text": "function _getImage() {\r\n restApi.getHomeImage()\r\n .success(function (data, status, headers, config) {\r\n if (data != null && data != \"\") {\r\n vm.iimg = data.image;\r\n }\r\n })\r\n\r\n .error(function (error) {\r\n vm.toggleModal('error');\r\n });\r\n }", "title": "" }, { "docid": "0fc8bea42867c52f28f9f2f20fb595e7", "score": "0.6079161", "text": "get image() {\n return this._backbufferResource ? this._backbufferResource : this._image;\n }", "title": "" }, { "docid": "a5be1c4a1b72f061239e2be6eb9d5601", "score": "0.6055793", "text": "async function getImg(image) {\n let fm = FileManager.iCloud();\n let dir = fm.documentsDirectory();\n let path = fm.joinPath(dir + \"/Conversable\", image);\n let download = await fm.downloadFileFromiCloud(path);\n let isDownloaded = await fm.isFileDownloaded(path);\n\n if (fm.fileExists(path)) {\n return fm.readImage(path);\n } else {\n console.log(\"Error: File does not exist.\");\n }\n}", "title": "" }, { "docid": "68db526c9f3829250b38f9bdea68a865", "score": "0.6044365", "text": "function getFileMetaAndURL(file) { //Get real URLs and descriptions for images\n\treturn $.getJSON(URL, {\n\t\taction:\"query\",\n\t\tprop:\"imageinfo\",\n\t\tiiprop:\"url\\|extmetadata\",\n\t\ttitles:file,\n\t})\n}", "title": "" }, { "docid": "1aab5f9634c67bc940962fd25a0a45df", "score": "0.6034392", "text": "get(){\n const image = this.getDataValue('image');\n return \"/img/\"+image;\n }", "title": "" }, { "docid": "68c24b806bd1c5b8a6ec596ca7e7ab95", "score": "0.60101026", "text": "createImageSrc() {\n return URL.createObjectURL(\n new Blob([this.buffer.buffer], { type: \"image/\" + this.type })\n );\n }", "title": "" }, { "docid": "16c441592bd8912f6cddfdfb27612415", "score": "0.5979521", "text": "function getPhoto() {\n // Retrieve image file location from specified source\n navigator.camera.getPicture(rememberImgBase64, onFail, { \n \tquality: 40,\n \tdestinationType: Camera.DestinationType.DATA_URL,\n sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY\n });\n}", "title": "" }, { "docid": "3ffc66c09d37717bd7dcc065fef54791", "score": "0.595151", "text": "Image() {\n return this.IMG;\n }", "title": "" }, { "docid": "3aacacd10057edd0c154a94facd402ab", "score": "0.5949845", "text": "function getImage(url) {\r\n return resourceCache[url];\r\n }", "title": "" }, { "docid": "c6e8e291b9f6c39936baef854d485123", "score": "0.5939867", "text": "function getImage(inImageID) {\n var imageReturned = null;\n if (inImageID >= 0 && inImageID <= imageEnums.kMAX_IMAGES) {\n imageReturned = imageInfoArray[inImageID].cimage.getImage();\n }\n return imageReturned;\n }", "title": "" }, { "docid": "eb2928ccf19961c5f31c750a0dc545b4", "score": "0.5938756", "text": "function readImage(file){\n var fileReader = new FileReader(file);\n\n fileReader.onload = function (e) {\n $timeout(function () {\n file.url = e.target.result;\n });\n\n }\n fileReader.readAsDataURL(file);\n return file;\n }", "title": "" }, { "docid": "e34f22d8583cdd897f2d581757861b78", "score": "0.593444", "text": "function getImage() {\n return '/images/Floorish_900.jpg'\n}", "title": "" }, { "docid": "8fe5e8d8ea9857aa31066b91aadea8bd", "score": "0.5917663", "text": "getImageURL(id){\n return recipe[id].img;\n }", "title": "" }, { "docid": "4b9ab696df5b2b90491eef5c1dfe7c20", "score": "0.5903004", "text": "async function getImage(chefId) {\n\t\t\t\tlet results = await Chefs.chefFile(chefId);\n\t\t\t\tconst files = results.rows.map(file => \n\t\t\t\t\t\t`${req.protocol}://${req.headers.host}${file.path.replace('img', '')}`\n\t\t\t\t);\n\n\t\t\t\treturn files[0];\n\t\t\t}", "title": "" }, { "docid": "cc225106bbad34fbbac5741049251914", "score": "0.5897011", "text": "getBodyImageAsObject(){\n this.updateGlobalPositionBasedOnBodyAndRelativePositioning();\n let obj = {image: null, x: 0, y: 0, w: 0, h: 0, angle: 0, angleRelativeToBody:0,centerRelativeToBody: 0};\n\n Object.keys(this).forEach((key) => {\n if (key in obj) {\n obj[key] = this[key];\n }\n });\n return obj;\n }", "title": "" }, { "docid": "f8a970b59321fc27a18a3b077ed40d7d", "score": "0.58939713", "text": "function getAnimalPic(){\n var pic;\n return pic;\n}", "title": "" }, { "docid": "948e60d3c1c974875077458317c1cc17", "score": "0.58614045", "text": "fetchImage(postImage) {\n return postImage.postImage ? postImage.postImage.fields.file.url : \"\";\n }", "title": "" }, { "docid": "db4f656788c353f7bba20602c8798046", "score": "0.5861", "text": "function getDraggedImageFile(obj) {\n var file = null;\n \n if (!obj) {\n return file;\n }\n\n var e = new Enumerator(obj);\n\n var validExtensions = {\n png: true,\n tif: true,\n tiff: true,\n gif: true,\n jpg: true,\n jpeg: true };\n \n file = e.item();\n var extension = extractExtension(file).toLowerCase();\n \n if (validExtensions[extension] == true) {\n return file;\n }\n \n return null;\n}", "title": "" }, { "docid": "fab3a4d9e730eec8503ac7bc1acb1406", "score": "0.585143", "text": "function getImg() {\n filepicker.setKey('ABDI6UIw6SzCfmtCVzEI3z');\n filepicker.pick({\n \tmimetypes: ['image/*'],\n \tcontainer: 'modal',\n \tservices: filepicker_services(),\n },\n function(InkBlob) {\n \t$('#pic').find('.btn[type=submit]').removeAttr('disabled').removeClass('disabled');\n $('#profile_pic').attr(\"src\", InkBlob.url);\n $('#id_pic_url').attr(\"value\", InkBlob.url);\n });\n}", "title": "" }, { "docid": "6c17b24758c9e645674cea4651df4e5f", "score": "0.58387935", "text": "async load() {\n try {\n const res = await Jimp.read(this.imagePath);\n return this.cropImage(res);\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "49ab1c3f2ac391728bf234cd5f12b568", "score": "0.5835494", "text": "getUserimg() {\n let api = `${this.startpoint}/getUserimg/${this.currentUser.msg._id}`;\n return this.http.get(api);\n }", "title": "" }, { "docid": "f63d8ede899603b1b87fcf13356e8780", "score": "0.5833273", "text": "async getEmployeImage(p_auth) {\n\n const AUTHORIZATION = `${p_auth.auth.token_type} ${p_auth.auth.access_token}`\n const PATH = `empleado/${p_auth.auth['x-user-name']}`\n\n const result = await fetch(`${BASE_API_URL}${PATH}/foto/base64`, {\n method: 'GET',\n headers: {\n Authorization: AUTHORIZATION,\n 'Content-Type': CONTENT_TYPE,\n 'x-user-name': p_auth.auth['x-user-name']\n },\n })\n .then(async (query) => await query.json())\n .catch(error => console.log('error', error))\n return result\n }", "title": "" }, { "docid": "d05a9da8497baa7a34f45959e60cbf71", "score": "0.5817381", "text": "get src() {\n return this._image.src;\n }", "title": "" }, { "docid": "65a4dcd2708d8e3816c4f107f3a07710", "score": "0.58165103", "text": "function GetImage(stream){\n\tvar result = 'img/placeholder.png';\n\tif (stream[PREVIEW_IMGS] != null){\n\t\tif (stream[PREVIEW_IMGS][MED] != null){\n\t\t\tresult = stream[PREVIEW_IMGS][MED];\n\t\t} else if (stream[PREVIEW_IMGS][SMALL] != null){\n\t\t\tresult = stream[PREVIEW_IMGS][SMALL];\n\t\t} else if (stream[PREVIEW_IMGS][LARGE] != null){\n\t\t\tresult = stream[PREVIEW_IMGS][LARGE];\n\t\t}\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "b5b506e75471c03f305c5464f26e3f7d", "score": "0.5811204", "text": "function readImage() {\n if (!this.files || !this.files[0]) return;\n const FR = new FileReader();\n FR.addEventListener(\"load\", (evt) => {\n img.addEventListener(\"load\", () => {\n // drawImgCanvas();\n });\n img.src = evt.target.result;\n });\n FR.readAsDataURL(this.files[0]);\n}", "title": "" }, { "docid": "4e592edcea5d3f54dd808c224d498fb8", "score": "0.58066154", "text": "getBlob() {\n return this.clone(File, \"$value\", false).usingParser(new _pnp_odata__WEBPACK_IMPORTED_MODULE_2__[\"BlobParser\"]())(Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_2__[\"headers\"])({ \"binaryStringResponseBody\": \"true\" }));\n }", "title": "" }, { "docid": "b270d48c6d9fa28d16132ed6723c5d1a", "score": "0.57866037", "text": "readURL() {\n const input = $('#resource-picture').prop('files');\n if (input && input[0]) {\n const reader = new FileReader();\n reader.onload = function(e) {\n $('#image-preview').attr('src', e.target.result);\n };\n reader.readAsDataURL(input[0]); // convert to base64 string\n }\n }", "title": "" }, { "docid": "ec9cf814bebc56e3319e073a5467d3e3", "score": "0.5770513", "text": "readImage() {\n let self = this;\n if ($(this.elementInputFile).files && $(this.elementInputFile).files[0]) {\n var reader = new FileReader();\n reader.onload = function (evt) {\n $(self.elementPreviewImage)\n .attr('src', evt.target.result);\n };\n\n reader.readAsDataURL($(this.elementInputFile).files[0]);\n }\n else $(this.elementPreviewImage).attr('src', self.defaultImg);\n }", "title": "" }, { "docid": "ca38bd628beec252b52023e508aecfb9", "score": "0.57650375", "text": "async getPhoto() {\n let response = fetch(\n 'http://10.0.2.2:3333/api/v0.0.5/chits/' + chit_id + '/photo',\n );\n if (response.status == '200') {\n return response.blob();\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "90f1a6d222a107468e187f3fd87df411", "score": "0.5756777", "text": "loadImage(imageId) {\n const promise = new Promise((resolve, reject) => {\n fetchInstance(imageId.substr(7)).then(instance => {\n const imageObject = createImage(instance)\n resolve(imageObject)\n }, reject)\n })\n\n return {\n promise,\n cancelFn: undefined\n }\n }", "title": "" }, { "docid": "773ec0e6d60074376c3ae2e58e9b03cc", "score": "0.5755889", "text": "function getProps(renderer) {\n // check the offset and bounds\n if (! this.bounds) {\n checkOffsetAndBounds(this, image);\n } // if\n \n return {\n image: image,\n x: this.xy.x + imgOffsetX,\n y: this.xy.y + imgOffsetY\n };\n } // getProps", "title": "" }, { "docid": "34b9def138ec72a30aff8b422dfa9090", "score": "0.57547057", "text": "get image() {\n\t\treturn this.__Internal__Dont__Modify__.image;\n\t}", "title": "" }, { "docid": "412e7051fc8550a09cc7369d3d1355b8", "score": "0.5752154", "text": "getFile() {\n return this.file;\n }", "title": "" }, { "docid": "ae0d2a84b1ee4e50d232a8732c7982f2", "score": "0.57502884", "text": "function SingleImage(props) {\n let image = getImage(props.ImageId)\n return (\n <div className=\"container\">\n <img className=\"card-img-top\" src={image.filePath + image.fileName} alt=\"Exempel\" />\n </div>)\n}", "title": "" }, { "docid": "f8f08935d2ed9ac7b92f6c5a4436e212", "score": "0.5740281", "text": "function WDateChooser_getImage( imgKey ) {\n return this.images[ imgKey ];\n}", "title": "" }, { "docid": "09e23f8307b22b9ff5045daa73f90b81", "score": "0.57397926", "text": "getPhoto() {\n return fetch(\n 'http://10.0.2.2:3333/api/v0.0.5/user/' +\n this.state.userID +\n '/photo?timestamp=' +\n Date.now(),\n )\n .then(response => response.blob())\n .then(image => {\n var reader = new FileReader();\n reader.onload = () => {\n this.setState({\n photo: reader.result,\n });\n };\n reader.readAsDataURL(image);\n })\n .catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "c0b18c314779401a49b0b1ffb43d1574", "score": "0.573934", "text": "function readImage(file) {\n var reader = new FileReader();\n var image = new Image();\n\n reader.readAsDataURL(file); \n reader.onload = function(_file) {\n image.src = _file.target.result; // url.createObjectURL(file);\n image.onload = function() {\n var w = this.width,\n h = this.height,\n t = file.type, // ext only: // file.type.split('/')[1],\n n = file.name,\n s = ~~(file.size/1024) +'KB';\n //$('#uploadPreview').append('<img src=\"' + this.src + '\">');\n $(\"#uploadPreview\").append(\"<span>\"+'<img src=\"' + this.src + '\">'+'</span>');\n };\n\n image.onerror= function() {\n alert('Invalid file type: '+ file.type);\n }; \n};\n\n}", "title": "" }, { "docid": "b45bd275d137c902a28824d11da1ffcb", "score": "0.5736696", "text": "async function getImage(image, imgUrl) {\n\t\tlet fm = FileManager.local()\n\t\tlet dir = fm.documentsDirectory()\n\t\tlet path = fm.joinPath(dir, image)\n\t\tif (fm.fileExists(path)) {\n\t\t\t\treturn fm.readImage(path)\n\t\t} else {\n\t\t\t\t// download once\n\t\t\t\tlet imageUrl\n\t\t\t\tswitch (image) {\n\t\t\t\t\t\tcase 'my-renault-car.png':\n\t\t\t\t\t\t\t\timageUrl = imgUrl\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.log(`Sorry, couldn't find ${image}.`);\n\t\t\t\t}\n\t\t\t\tif(imageUrl){\n\t\t\t\t\tlet iconImage = await loadImage(imageUrl)\n\t\t\t\t\tfm.writeImage(path, iconImage)\n\t\t\t\t\treturn iconImage\n\t\t\t\t}\n\t\t}\n}", "title": "" }, { "docid": "a92c2bdbd2293ef7de5fd37bc6a81743", "score": "0.57327455", "text": "async function getInfos(url) {\n let img = await getImageObject(url)\n let infos = img.getFields().reduce((o, i) => {\n o[i] = img.get(i)\n return o\n }, {})\n // console.log(infos)\n return infos\n}", "title": "" }, { "docid": "8b929b304fe9aeae412b3dd51c07ce8e", "score": "0.5720928", "text": "function showImage(fileInput) {\n if (!fileInput.files && !fileInput.files[0]) {\n return;\n }\n\n var file = fileInput.files[0];\n if (!file.type.match(\"image.*\")) {\n return;\n }\n\n var reader = new FileReader();\n reader.onload = function (e) {\n imageObj.src = e.target.result;\n }\n\n image = { file: file,\n name: file.name };\n reader.readAsDataURL(file);\n }", "title": "" }, { "docid": "d58334ae6c7cf4ca765f4569675c0635", "score": "0.57096773", "text": "getImageObjectType() {\n\t \treturn this.imageObjectType;\n\t }", "title": "" }, { "docid": "7c391e0de3eed0b4f51587b27bfe0182", "score": "0.5707223", "text": "function getAnimalPhoto() { \n\n\tnavigator.camera.getPicture(onAnimalPhotoURISuccess,\n\tonFail,\n\t{quality:50,destinationType:navigator.camera.DestinationType.FILE_URI,\n\tsourceType:navigator.camera.PictureSourceType.PHOTOLIBRARY} );\n}", "title": "" }, { "docid": "ad41bfb28690b6651793cf3045126e3a", "score": "0.57070154", "text": "function getMapImageFile(files) {\n var file = files[0];\n if (!file.type.startsWith('image/')) {\n return\n }\n var img = document.getElementById(\"map_image\");\n img.file = file;\n\n var reader = new FileReader();\n reader.onload = (function(aImg) {\n return function(e) {\n aImg.src = e.target.result;\n };\n })(img);\n reader.readAsDataURL(file);\n}", "title": "" }, { "docid": "0d28081caf7772f9b059b3d778263963", "score": "0.56996465", "text": "function getImage(path, callback) {\n readImage(path, result => {\n callback(result);\n }); \n}", "title": "" }, { "docid": "9645f0cca4895bf4f9bedda06064f9b8", "score": "0.56928855", "text": "function Image(json){\r\n\t\tthis.created = json.created,\r\n\t\tthis.location = json.location,\r\n\t\tthis.thumbnail = json.thumbnail,\r\n\t\tthis.imageSource = json.imageSource,\r\n\t\tthis.imageName = json.imageName,\r\n\t\tthis.metaData = json.metaData,\r\n\t\tthis.owner = json.owner,\r\n\t\tthis.tagList = json.tagList,\r\n\t\tthis.thumbnailBlobUrl = \"\",\r\n\t\tthis.imageSourceBlobUrl = \"\"\r\n\t}", "title": "" }, { "docid": "d0f65ef1dc458c96fb87103932ecab2e", "score": "0.5691304", "text": "function getImageById(req, res) {\n const dream_id = req.params.id;\n dreamsModel.getImageById(dream_id)\n .then(image => {\n res.status(200).json(image)\n })\n .catch(error => {\n res.status(400).json({ error, msg: 'Failed to grab dream by Id' })\n })\n}", "title": "" }, { "docid": "360d5f1cf7f7db8c9bd551e3acef6fea", "score": "0.5687554", "text": "function readFile() {\n\n if (this.files && this.files[0]) {\n\n var FR = new FileReader();\n\n FR.addEventListener(\"load\", function (e) {\n document.getElementById(\"preview\").src = e.target.result;\n\n fabric.Image.fromURL(e.target.result, function (myImg) {\n //i create an extra var for to change some image properties\n var img1 = myImg.set({\n left: 0,\n top: 0,\n });\n canvas.add(img1);\n });\n\n });\n FR.readAsDataURL(this.files[0]);\n }\n}", "title": "" }, { "docid": "985a536545d751e3aa68b1dc790fffd7", "score": "0.5684047", "text": "function getPhoto(source) {\n\t\t// Retrieve image file location from specified source\n\t\tnavigator.camera.getPicture(\n\t\tonPhotoURISuccess, \n\t\tonFail, \n\t\t{ quality: 50, \n\t\t\tdestinationType: destinationType.FILE_URI,\n\t\t\tsourceType: source \n\t\t});\n }", "title": "" }, { "docid": "575ed8a7c25b5bf384e1727f5518faf0", "score": "0.5682336", "text": "function renderImageFromFile(file) {\n let reader = new FileReader() // used to read the file from the users remote system\n\n reader.readAsDataURL(file)\n\n reader.onload = function () {\n var nameOfTheFile = file.name\n\n let obj = {\n name: nameOfTheFile,\n fileSrc: reader.result\n }\n imagesrcresults.push(obj)\n console.log(imagesrcresults)\n displayimage()\n storeInls()\n }\n}", "title": "" }, { "docid": "2c9bb8bd522e624080ff42eec51b2130", "score": "0.5678142", "text": "function getEntityImage() {\n\t\tvar entity = this.get(\"Entity\");\n\t\tvar imageValue = null;\n\t\tvar image = entity ? entity.primaryImageValue || entity.Image : null;\n\t\tif (Ext.isObject(image) || Terrasoft.isGUID(image)) {\n\t\t\timageValue = image.value || image;\n\t\t}\n\t\treturn imageValue ? getImageValue(entity) :\n\t\t\tTerrasoft.ImageUrlBuilder.getUrl(resources.localizableImages.NoChannel);\n\t}", "title": "" }, { "docid": "e61aef75665a5892c1655aa43d6f897e", "score": "0.5675074", "text": "function getImage(filename) {\n image = new Image();\n image.onload = drawImage;\n image.src = filename;\n }", "title": "" }, { "docid": "a7a8588eea7a342730357b04c0c864f2", "score": "0.5668594", "text": "function getImage() {\n return fetch('https://api.unsplash.com/photos/?client_id=_tkNSfuhfFridNmW_422txTpBggjii32OD6aERSRLnE&per_page=100')\n .then(res => res.json())\n .then(res => res)\n}", "title": "" }, { "docid": "c072f1e6752791c68a2ef8bb7dfa95f6", "score": "0.5663955", "text": "function get_image_from_file(filepath, callback) {\n fs.readFile(require('path').join(__dirname, \"/images/default.png\"), function(err, buf) {\n callback(buf);\n });\n}", "title": "" }, { "docid": "6d9755926ccbe68a2ca0cec1b65b11b7", "score": "0.56587166", "text": "function getPhoto(source) {\n // // Retrieve image file location from specified source\n\n navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20,\n destinationType: destinationType.DATA_URL, sourceType: source });\n }", "title": "" }, { "docid": "d6289265742d1bbf76b42641b998d19f", "score": "0.5652152", "text": "loadImage(file) {\n const reader = new FileReader();\n\n reader.onload = e => {\n file.src = e.target.result;\n\n if (this.afterFileSelect) {\n this.afterFileSelect(file);\n }\n };\n\n reader.readAsDataURL(file);\n }", "title": "" }, { "docid": "8b83047b87ddf6425ddc17cb5ca6c5fe", "score": "0.5651089", "text": "function fetch(params) {\n return $http.get('/api/v2/image', {params: params});\n }", "title": "" }, { "docid": "f31e465422497a7891d7f8111d0e5631", "score": "0.5649039", "text": "function imgLoad(url) {\n const image = new Image();\n image.src = url;\n return image;\n}", "title": "" }, { "docid": "c430f7057f141eaebe15412668ccadc7", "score": "0.5641555", "text": "function readImageURL( url ) {\n var ext = url.split( '.' )\n .pop();\n if ( ext === 'hdr' )\n return osg.readHDRImage( url );\n\n return osgDB.readImageURL( url );\n}", "title": "" }, { "docid": "402fcc4aae4410ec188346d69a1b5a3d", "score": "0.56407106", "text": "_getImageThumbnail(image) {\n if (image) {\n if (image.thumbnail) {\n return image.thumbnail;\n }\n return image;\n }\n return \"\";\n }", "title": "" }, { "docid": "fb0038cb8f61934e3da0541705d2a562", "score": "0.56387", "text": "function readImage(input) {\n\t if ( input.files && input.files[0] ) {\n\t var FR= new FileReader();\n\t FR.onload = function(e) {\n\t $('#img').attr( \"src\", e.target.result );\n\t $('#img').removeClass().addClass(\"show\");\n\t $('#base').text( e.target.result );\n\t console.log(this.width);\n\t console.log(this.height);\n\t }; \n\t FR.readAsDataURL( input.files[0] );\n\t }\n\t}", "title": "" }, { "docid": "70f9ce38548db9ef2a1c7e55ca990af0", "score": "0.5636973", "text": "load_image(name, file_type){\n this._image_loader.load_image(name, file_type);\n }", "title": "" }, { "docid": "cd4317075db8e8fa082f24801f7b9403", "score": "0.5635152", "text": "function getImage(f, opts) {\n // Get image data unit\n var dataunit = f.getDataUnit(2);\n // Set options to pass to the next callback\n opts[\"dataunit\"] = dataunit;\n opts[\"f\"] = f;\n // Asynchronously get pixels representing the image passing a callback and options\n dataunit.getFrameAsync(0, createVisualization, opts);\n}", "title": "" }, { "docid": "65077f3d5fdd1560a3b9eb02d088eaa7", "score": "0.56342787", "text": "function getImage(header) {\nvar oImg = header;\n\n if(oImg.tagName != \"IMG\") oImg=oImg.children.tags(\"IMG\")(0);\n return oImg;\n}", "title": "" }, { "docid": "eae94ac5d28dd63f88303e09a04c1024", "score": "0.563094", "text": "function getImageMetadata(filepath) {\n\treturn exiftool.read(filepath);\n}", "title": "" }, { "docid": "0ff110480d267465ea80e353b898c14b", "score": "0.5630527", "text": "static get properties() {\n return {\n imageSrc: {\n type: String,\n attribute: \"image-src\",\n },\n imageAlt: {\n type: String,\n attribute: \"image-alt\",\n },\n imageAlign: {\n type: String,\n attribute: \"image-align\",\n },\n imageValign: {\n type: String,\n attribute: \"image-valign\",\n },\n horizontal: {\n type: Boolean,\n attribute: \"horizontal\",\n },\n };\n }", "title": "" }, { "docid": "e19fb003e67ee9baf0c875c010af5549", "score": "0.5624462", "text": "static get properties() {\n return {\n /**\n * image's details in as a string of HTML\n */\n details: {\n type: String\n }\n };\n }", "title": "" }, { "docid": "0ad87371e372fb5359ef712911f431d0", "score": "0.5613878", "text": "function createImage(file, id = null) {\n var img = URL.createObjectURL(file);\n var dataId = id != null ? `id=\"p-${id}\"` : \"\";\n return $( //html\n `\n <div class=\"col-sm-3 item-container\" ${dataId}>\n <div class=\"card\">\n <div class=\"image-container\">\n <img src=\"${img}\" alt=\"Imagen\">\n </div>\n </div>\n </div>\n `);\n}", "title": "" }, { "docid": "33db84fcb2f7636d610fd9239ab272a0", "score": "0.5611761", "text": "async function getImage(req, res) {\n const payload = {\n id: req.params.id,\n fileName: req.params.file,\n path: \"uploads/user\"\n };\n try {\n const resp = await fileMethods.getFile(payload);\n return res.sendFile(path.resolve(resp.url));\n } catch (err) {\n return res.status(err.code).send(err);\n }\n}", "title": "" }, { "docid": "9d8ec7983dee1cbff6d29e820dc1684a", "score": "0.5609491", "text": "function getImageFromAlbum() {\n navigator.camera.getPicture(onSuccess, onFailure, {\n destinationType: navigator.camera.DestinationType.DATA_URL,\n sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,\n targetWidth: 512,\n targetHeight: 512,\n });\n }", "title": "" }, { "docid": "b125ebeed746bc68f8513ab9f0f72dfb", "score": "0.56069463", "text": "load_recipe_image(theRecipeID) {\n const recipeImage = Images.find({ recipeID: theRecipeID }, { fields: { imageURL: 1 } }).fetch();\n let res = '';\n if (recipeImage.length === 1) {\n res = recipeImage[0].imageURL;\n }\n return res;\n }", "title": "" }, { "docid": "b125ebeed746bc68f8513ab9f0f72dfb", "score": "0.56069463", "text": "load_recipe_image(theRecipeID) {\n const recipeImage = Images.find({ recipeID: theRecipeID }, { fields: { imageURL: 1 } }).fetch();\n let res = '';\n if (recipeImage.length === 1) {\n res = recipeImage[0].imageURL;\n }\n return res;\n }", "title": "" }, { "docid": "700cef9ab44b3b7776701557d90496e2", "score": "0.55960083", "text": "function LoadImage(path)\n{\n\tif(path != null && path != undefined)\n\t{\n\t\tvar img = new Image();\n\t\timg.src = path;\n\t\treturn img;\n\t}\n}", "title": "" }, { "docid": "3fdd0c86e10b6cc9d6deaf1071fe2ba4", "score": "0.55957115", "text": "function getPhoto(source) {\n\t// Retrieve image file location from specified source\n\tnavigator.camera.getPicture(onPhotoURISuccess, onFail, {\n\t\tquality : 50,\n\t\tdestinationType : destinationType.FILE_URI,\n\t\tsourceType : source\n\t});\n}", "title": "" } ]
ce98a01dbd9d3b7ce540522fe3d237f6
formats dates from being in totalmillisecondsfromepoch format into a humanreadable, presentable format.
[ { "docid": "7feb7e4c7f7af8bb12bd9438089fa12c", "score": "0.0", "text": "function formatDate(date) {\n if (date == null) {\n return \"\";\n }\n var d = new Date(date);\n var min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes();\n return (d.getMonth() + 1) + \"/\" + d.getDate() + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + min;\n}", "title": "" } ]
[ { "docid": "4a9266ada0f4e5219c29ad32a7f4a5a7", "score": "0.6201448", "text": "function dateEpochToHuman(pythonDate) {\n var d = new Date(Math.floor(pythonDate * 1000));\n var datestring = d.getFullYear() + \"-\" + (\"0\"+(d.getMonth()+1)).slice(-2) + \"-\" + (\"0\" + d.getDate()).slice(-2) + \" \" + (\"0\" + d.getHours()).slice(-2) + \":\" + (\"0\" + d.getMinutes()).slice(-2) + \":\" + d.getSeconds(); return datestring;\n}", "title": "" }, { "docid": "aba0095a4945136eae18193d918b23bf", "score": "0.60211957", "text": "formatDate(timestamp,format,unix){// unix timestamp is seconds, JS is milliseconds\nif(unix){timestamp=1e3*timestamp}return new Date(timestamp).format(format)}", "title": "" }, { "docid": "effe262fd6466517d24d24404a01b13f", "score": "0.6015777", "text": "function formatTime(epoch){\n var timestamp = 1293683278;\n var date = new Date(timestamp * 1000);\n return \" \"\n \n}", "title": "" }, { "docid": "521514a3cba60f7ce1ab94bb070386d4", "score": "0.5904382", "text": "function cubism_graphiteFormatDate(time) {\n return Math.floor(time / 1000);\n}", "title": "" }, { "docid": "521514a3cba60f7ce1ab94bb070386d4", "score": "0.5904382", "text": "function cubism_graphiteFormatDate(time) {\n return Math.floor(time / 1000);\n}", "title": "" }, { "docid": "23142668eb33f4af33d7fa23b3c995f2", "score": "0.58535534", "text": "formatDate(unixTimestamp) {\n\t\t// define milliseconds using unix time stamp\n\t\tconst milliseconds = unixTimestamp * 1000;\n\t\t// create a new date using milliseconds\n\t\tconst date = new Date(milliseconds);\n\n\t\tconst day = `${date.getDate()}`.padStart(2, 0);\n\t\tconst month = `${date.getMonth() + 1}`.padStart(2, 0);\n\t\tconst year = date.getFullYear();\n\t\tconst displayDate = `${day}/${month}/${year}`;\n\n\t\treturn displayDate;\n\t}", "title": "" }, { "docid": "35f19ce5985eb3b52841fac455c0c615", "score": "0.5837642", "text": "function daysToMS(days){\r\treturn days * 24 * 60 * 60 * 1000;\r}", "title": "" }, { "docid": "1d573038eec20cb8bf65108bd1a0af4e", "score": "0.5793333", "text": "function convertDate(date){\n var epochDate = new Date(date);\n epochDate = epochDate.getTime()/1000;\n console.log(epochDate);\n return epochDate;\n}", "title": "" }, { "docid": "7818d71e0e4aa5b8b245f91fd8c74bd4", "score": "0.57736766", "text": "SS (date) {\n return pad(Math.floor(date.getMilliseconds() / 10))\n }", "title": "" }, { "docid": "4936b2cb9d1c5f03435289642debf4ee", "score": "0.57702327", "text": "function getFormatteddate(epoch) {\n var formdate = new Date(epoch * 1000);\n formdate = moment(formdate).utc().format('MM/DD/YYYY');\n return formdate;\n }", "title": "" }, { "docid": "579c5a164005bb7c0a887773b2daeb68", "score": "0.57699275", "text": "function convertMillisecondsToCustomFormat(ms) {\n var date = new Date(ms);\n var str = date.getUTCFullYear() + '-' +\n (date.getUTCMonth() + 1) + '-' +\n (date.getUTCDate()) + ' ' +\n addZero(date.getUTCHours()) + ':' +\n addZero(date.getUTCMinutes()) + ':' +\n addZero(date.getUTCSeconds()) + ' ';\n // console.log(str);\n\n var hours = Math.floor(ms / 3600000); // 1 Hour = 36000 Milliseconds\n var minutes = Math.floor((ms % 3600000) / 60000); // 1 Minutes = 60000 Milliseconds\n var seconds = Math.floor(((ms % 360000) % 60000) / 1000);// 1 Second = 1000 Milliseconds\n // console.log(\"hours\" + hours);\n return {\n hours: hours,\n minutes: minutes,\n seconds: seconds,\n // clock: hours + \":\" + minutes + \":\" + seconds\n clock: str\n };\n }", "title": "" }, { "docid": "8e881321b2ecf755a8016ed7522168ac", "score": "0.57519126", "text": "S (date) {\n return Math.floor(date.getMilliseconds() / 100)\n }", "title": "" }, { "docid": "06d6d536a9fa1ea656fb676f33ef0d54", "score": "0.5735609", "text": "function formatDate(value){\n var d = new Date(value*1000);\n return d.toString();\n }", "title": "" }, { "docid": "c665c18433d8b98b211a45519851c79e", "score": "0.5732395", "text": "function dt2ms(v, _, calendar, opts) {\n if ((opts || {}).msUTC && isNumeric(v)) {\n // For now it is only used\n // to fix bar length in milliseconds & gl3d ticks\n // It could be applied in other places in v3\n return +v;\n }\n\n // NOTE: Changed this behavior: previously we took any numeric value\n // to be a ms, even if it was a string that could be a bare year.\n // Now we convert it as a date if at all possible, and only try\n // as (local) ms if that fails.\n var ms = dateTime2ms(v, calendar || ax.calendar);\n if (ms === BADNUM) {\n if (isNumeric(v)) {\n v = +v;\n // keep track of tenths of ms, that `new Date` will drop\n // same logic as in Lib.ms2DateTime\n var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);\n var msRounded = Math.round(v - msecTenths / 10);\n ms = dateTime2ms(new Date(msRounded)) + msecTenths / 10;\n } else return BADNUM;\n }\n return ms;\n }", "title": "" }, { "docid": "faaf8969dfa1971cee87d5dbffab57fd", "score": "0.56778824", "text": "function unixTime(dt) {\n let date = new Date(dt * 1000);\n let month = date.getMonth() + 1;\n let day = date.getDate();\n let year = date.getFullYear();\n displayDate = month + \"/\" + day + \"/\" + year;\n }", "title": "" }, { "docid": "f9f24afb66635a3b27cccf48be73da27", "score": "0.5668333", "text": "function formatDateFromMilliseconds(date) {\r\n let month = String(date.getMonth() + 1);\r\n let day = String(date.getDate());\r\n const year = String(date.getFullYear());\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n\r\n return `${day}/${month}/${year}`;\r\n}", "title": "" }, { "docid": "4df2668b95978862e753077e0a6ebff4", "score": "0.5637668", "text": "function epoch() {\n\tvar date = new Date();\n\tvar time = Math.round(date.getTime() / 1000);\n\treturn time;\n}", "title": "" }, { "docid": "7745a86abe128e4ef7d4d39a4f529df3", "score": "0.56222886", "text": "function naturalToUnix(date) {\n return moment(date, \"MMMM, D YYYY\").format(\"X\");\n }", "title": "" }, { "docid": "21b0224e97576db477e2e2b02afc93db", "score": "0.5602864", "text": "function daysToMS(days){\n\treturn days * 24 * 60 * 60 * 1000;\n}", "title": "" }, { "docid": "2c4da2feffe121079c38e77f6ad31c64", "score": "0.5589952", "text": "function timeFormat(ms) {\r\n\tif (ms > 3600000) {\r\n\t\treturn d3.utcFormat(\"%H:%M:%S\")(new Date(ms));\r\n\t}\r\n\tif (ms > 60000) {\r\n\t\treturn d3.utcFormat(\"%M:%S.%L\")(new Date(ms));\r\n\t}\r\n\treturn d3.utcFormat(\"%S.%L\")(new Date(ms));\r\n}", "title": "" }, { "docid": "b3d24990e8268a0d76a28a2d601f3910", "score": "0.5585838", "text": "static formatTime(milliseconds) {\n const seconds = milliseconds / 1000;\n let s = seconds % 60;\n const m = (seconds - s) / 60;\n\n if (s < 10) {\n s = `0${s}`;\n }\n\n return `${m}:${s}`;\n }", "title": "" }, { "docid": "70a56c18b2846e507b3ed54e7d1d7e37", "score": "0.55586267", "text": "function millisecondsToStr(a){\"use strict\";function b(a){return a>1?\"s ago\":\" ago\"}var c=Math.floor(a/1e3),d=Math.floor(c/31536e3);if(d)return d+\" year\"+b(d);var e=Math.floor((c%=31536e3)/2592e3);if(e)return e+\" month\"+b(e);var f=Math.floor((c%=2592e3)/86400);if(f)return f+\" day\"+b(f);var g=Math.floor((c%=86400)/3600);if(g)return\"about \"+g+\" hour\"+b(g);var h=Math.floor((c%=3600)/60);if(h)return h+\" minute\"+b(h);var i=c%60;return i?i+\" second\"+b(i):\"just now\"}", "title": "" }, { "docid": "7cabc6cffab2d7114e80afbec9d4fd0a", "score": "0.5537637", "text": "function generalLong() {\n return doFormat(date, {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "title": "" }, { "docid": "5dbd220a58d84398389f760b314dc793", "score": "0.55280995", "text": "function natToUnix(date) {\n return moment(date, \"MMMM D, YYYY\").format(\"X\");\n }", "title": "" }, { "docid": "b7f8c3fdac02fde1f766433dde73c32d", "score": "0.549978", "text": "function formatDate(date) {\n var timestamp;\n if (date instanceof Date) {\n // Datadog expects seconds.\n timestamp = Math.round(date.getTime() / 1000);\n } else if (date instanceof Number) {\n // Make sure it is an integer, not a float.\n timestamp = Math.round(date);\n }\n return timestamp;\n}", "title": "" }, { "docid": "2ef227620921198c298a1dd1e770745f", "score": "0.5494144", "text": "function timeConverter(UNIX) {\n var a = new Date(UNIX * 1000);\n var months = [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\"];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var displayedDate = month + \"/\" + date + \"/\" + year;\n return displayedDate;\n}", "title": "" }, { "docid": "806a36c6571ab6016a87e24689b7c772", "score": "0.54879177", "text": "function epochToDate(epoch) {\n epoch = parseFloat(epoch) * 1000;\n var dateVal = \"/Date(\" + epoch + \")/\";\n var date = new Date(parseFloat(dateVal.substr(6)));\n\n return date.toLocaleString();\n\n}", "title": "" }, { "docid": "e182f6e32e48c9b24b31989c2f5e06ab", "score": "0.5486625", "text": "function convert_ms(ms) {\n let time_left = '';\n for (k in ms_conversion) {\n time_left += zero_pad(Math.floor(ms / ms_conversion[k]).toString(), 2);\n if (k !== 's') {\n time_left += ':';\n }\n ms = ms % ms_conversion[k];\n }\n return time_left;\n}", "title": "" }, { "docid": "5d3a5c9aa902721ba93dca41178ca9b9", "score": "0.54828817", "text": "function formatTime(ms) {\n var result = \"\",\n secs = ms / 1000;\n if (secs >= 60 * 60 * 24 * 365) {\n result = (Math.floor(secs / (60 * 60 * 24 * 365))) + \"y \";\n secs = secs % (60 * 60 * 24 * 365);\n }\n if (secs >= 60 * 60 * 24) {\n result = (Math.floor(secs / (60 * 60 * 24))) + \"d \";\n secs = secs % (60 * 60 * 24);\n }\n if (secs >= 60 * 60) {\n result = result + (Math.floor(secs / (60 * 60))) + \"h \";\n secs = secs % (60 * 60);\n }\n if (secs >= 60) {\n result = result + (Math.floor(secs / 60)) + \"m \";\n secs = secs % 60;\n }\n if (result === \"\" || secs > 0) {\n result = result + Math.round(10 * secs) / 10 + \"s\";\n }\n if (result[result.length - 1] === \" \") {\n result = result.substring(0, result.length - 1);\n }\n return result;\n }", "title": "" }, { "docid": "3fd7b35337d8ca6090dcb338b0f96144", "score": "0.544862", "text": "function getReadableTime(epoch) {\n var a = new Date(epoch*1000);\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; \n var date = a.getDate() + '/' +months[a.getMonth()] +'/'+a.getFullYear();\n var time = a.getHours() + \":\" + getTwoDigits(a.getMinutes()) + \":\" + getTwoDigits(a.getSeconds());\n var timestamp = date + ' ' + time;\n return timestamp;\n}", "title": "" }, { "docid": "69184d222e08c0418fc3b4b6a1d22e9d", "score": "0.54460794", "text": "function toEpoch(date){\n\tvar date = Date.parse(date);\n\treturn date / 1000;\n}", "title": "" }, { "docid": "c7f5e14caa5d6416b72649ed857ec221", "score": "0.54430497", "text": "function convertDate(timeStamp) {\n return new Date(timeStamp * 1000).toLocaleString(\"en-US\", {\n month: \"numeric\",\n day: \"numeric\",\n year: \"numeric\"\n });\n }", "title": "" }, { "docid": "ee6cb2782f17e5221ec17e491d972596", "score": "0.54363996", "text": "function parseEpochTime(date) {\n\n let dateUnixTime = date.getTime()\n\n return {unixtime: dateUnixTime}\n}", "title": "" }, { "docid": "1ddafea5413903c79e7321471f8c8ab0", "score": "0.5423436", "text": "function ms(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "abfd8444c8ad672b1a8aebfcaf4f297e", "score": "0.5422895", "text": "function universal() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "title": "" }, { "docid": "3588c20d8b4ad24db6021e4e13e41e99", "score": "0.5412634", "text": "function dateToUnixTimestampMilliseconds() {\n return operator_1.cast(instance_of_date_1.instanceOfDate(), function (d) { return d.getTime(); }, number_1.integer());\n}", "title": "" }, { "docid": "40844e8c5d1edb3fe80a6fb3d330a797", "score": "0.54106104", "text": "function convertTime(unix){\n\t\tvar dt = unix * 1000;\n\t\tvar date = new Date(dt);\n\t\tvar dayOfTheWeek = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\t\tvar monthName = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"June\", \"July\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\t\tvar formattedDate = dayOfTheWeek[date.getDay()] + \", \" + monthName[date.getMonth()] + \" \" + date.getDate() + \", \" + date.getFullYear();\n\n\t\treturn formattedDate; \n\t}", "title": "" }, { "docid": "b7a14d734cef7a99d2c695ac90c5f788", "score": "0.5409975", "text": "function epochSeconds() { return new Date().getTime() / 1000 }", "title": "" }, { "docid": "00a4c59a8463818700709fcca9d877ca", "score": "0.53977376", "text": "function dt2ms(v, _, calendar) {\n\t // NOTE: Changed this behavior: previously we took any numeric value\n\t // to be a ms, even if it was a string that could be a bare year.\n\t // Now we convert it as a date if at all possible, and only try\n\t // as (local) ms if that fails.\n\t var ms = dateTime2ms(v, calendar || ax.calendar);\n\t if(ms === BADNUM) {\n\t if(isNumeric(v)) ms = dateTime2ms(new Date(+v));\n\t else return BADNUM;\n\t }\n\t return ms;\n\t }", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5389488", "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]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5389488", "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]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5389488", "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]}", "title": "" }, { "docid": "e62f7b123c3ae15e04079f3e23a8656d", "score": "0.53830725", "text": "function formatMillisecondsToStr (milliseconds) {\n var temp = Math.floor(milliseconds / 1000);\n var years = Math.floor(temp / 31536000);\n var fomattedTime = \"\";\n if (years) {\n fomattedTime += years + ' year' + checkEndingNumber(years) + ' ';\n }\n var days = Math.floor((temp %= 31536000) / 86400);\n if (days) {\n fomattedTime += days + ' day' + checkEndingNumber(day) + ' ';\n }\n var hours = Math.floor((temp %= 86400) / 3600);\n if (hours) {\n fomattedTime += hours + ' hour' + checkEndingNumber(hours) + ' ';\n }\n var minutes = Math.floor((temp %= 3600) / 60);\n if (minutes) {\n fomattedTime += minutes + ' minute' + checkEndingNumber(minutes) + ' ';\n }\n var seconds = temp % 60;\n if (seconds) {\n fomattedTime += seconds + ' second' + checkEndingNumber(seconds) + ' ';\n }\n return fomattedTime;\n}", "title": "" }, { "docid": "a39f1005ad34915af0c1c76d83ef2d52", "score": "0.5378748", "text": "function millisToDateUS(millis) {\r\n\tvar datetime = new Date(millis);\r\n\r\n\tvar theyear=datetime.getFullYear();\r\n\tvar themonth=datetime.getMonth()+1;\r\n\tvar theday=datetime.getDate();\r\n\r\n\tdateString = (themonth+\"/\"+theday+\"/\"+theyear);\r\n\r\n\treturn dateString;\r\n}", "title": "" }, { "docid": "9f5bda9bea824f11417fd69650c2fd4f", "score": "0.5378641", "text": "function formatDigitalOutput(totalTimeInMillisec) {\n const min = Math.floor(totalTimeInMillisec/60000);\n const sec = Math.floor((totalTimeInMillisec - min*60000) / 1000);\n const secHundredth = Math.floor((totalTimeInMillisec - min*60000 - sec*1000) / 10);\n const timeValues = { min, sec, secHundredth };\n const timeDigital = [];\n\n // Prefix time value with a zero if < 10.\n Object.entries(timeValues).forEach(([unit, value]) => {\n let formatted = value < 10? '0' + value : value;\n timeDigital.push(formatted);\n });\n\n return timeDigital.join(':');\n }", "title": "" }, { "docid": "2a86e4a803b295a7226f29fcef92f4e3", "score": "0.5373561", "text": "function humanizeDate(date) {\n return moment(date).format('lll');\n}", "title": "" }, { "docid": "a79e8a8259fb9b6fb7e68096d1f9797c", "score": "0.53670645", "text": "function formatMilliseconds(millis, data) {\n // Use jintervals if available, else default formatter\n var formatter;\n if (typeof jintervals == 'function') {\n formatter = function(millis, data){return jintervals(millis/1000, data.format);};\n } else {\n formatter = defaultFormatMilliseconds;\n }\n formatMilliseconds = function(millis, data) {\n return formatter(millis, data);\n };\n return formatMilliseconds(millis, data);\n }", "title": "" }, { "docid": "d6fd5e1998efb40961cdff8bfe255cd4", "score": "0.536385", "text": "function toDD_MM_YY_format(unixTimeStamp) {\r\n var d = new Date(unixTimeStamp * 1000);\r\n var month = (d.getMonth()) + 1; //unix time stamp month starts from 0.\r\n var formattedDate = d.getDate() + \"-\" + month + \"-\" + d.getFullYear();\r\n return formattedDate;\r\n }", "title": "" }, { "docid": "9c42d136507c6a79276a9330ec8781ac", "score": "0.53374547", "text": "function dt2ms(v, _, calendar) {\n // NOTE: Changed this behavior: previously we took any numeric value\n // to be a ms, even if it was a string that could be a bare year.\n // Now we convert it as a date if at all possible, and only try\n // as (local) ms if that fails.\n var ms = dateTime2ms(v, calendar || ax.calendar);\n if(ms === BADNUM) {\n if(isNumeric(v)) ms = dateTime2ms(new Date(+v));\n else return BADNUM;\n }\n return ms;\n }", "title": "" }, { "docid": "9c42d136507c6a79276a9330ec8781ac", "score": "0.53374547", "text": "function dt2ms(v, _, calendar) {\n // NOTE: Changed this behavior: previously we took any numeric value\n // to be a ms, even if it was a string that could be a bare year.\n // Now we convert it as a date if at all possible, and only try\n // as (local) ms if that fails.\n var ms = dateTime2ms(v, calendar || ax.calendar);\n if(ms === BADNUM) {\n if(isNumeric(v)) ms = dateTime2ms(new Date(+v));\n else return BADNUM;\n }\n return ms;\n }", "title": "" }, { "docid": "236fd699f3452ef3ff214154586bd858", "score": "0.5336979", "text": "function formatDateNumber(n) {\n if(n>9) return n;\n return \"0\"+n;\n }", "title": "" }, { "docid": "ef6f75634a7514d717a3d1299b80d8c7", "score": "0.5314395", "text": "function convertMilliseconds(milliseconds) {\n\n // Convert each part\n var seconds = parseInt((milliseconds / 1000) % 60);\n var minutes = parseInt((milliseconds / (1000 * 60)) % 60)\n var hours = parseInt((milliseconds / (1000 * 60 * 60)) % 24);\n var days = parseInt((milliseconds / (1000 * 60 * 60 * 24)));\n\n var convertedValue = '';\n\n // Only include days if at least one day\n if (days > 0) {\n convertedValue = convertedValue + days + (days == 1 ? ' day, ' : ' days, ');\n }\n\n // Include hours if not the first element, otherwise only include hours if at least one hour\n if (convertedValue || hours > 0) {\n convertedValue = convertedValue + hours + (hours == 1 ? ' hour, ' : ' hours, ');\n }\n\n // Include minutes if not the first element, otherwise only include minutes if at least one minute\n if (convertedValue || minutes > 0) {\n convertedValue = convertedValue + minutes + (minutes == 1 ? ' minute, ' : ' minutes, ');\n }\n\n // Always include seconds\n convertedValue = convertedValue + seconds + (seconds == 1 ? ' second' : ' seconds');\n\n return convertedValue;\n}", "title": "" }, { "docid": "16bfe8c33a097786e3ddbe1c8a687255", "score": "0.5306768", "text": "function formatTime(tm) {\r\n\tvar str = (Math.floor(tm / 1000)).toString(10);\r\n\tvar d = Math.floor((tm % 1000) / 100);\r\n\treturn str + \".\" + d;\r\n}", "title": "" }, { "docid": "a7fecbbe9afbf67cb61e90814889ba1e", "score": "0.53019255", "text": "function formatTime(milliSeconds) {\n let time = new Date(milliSeconds);\n let seconds = time.getUTCSeconds().toString();\n let minutes = time.getUTCMinutes().toString();\n\n if (seconds.length < 2) {\n seconds = `0${seconds}`;\n }\n\n if (minutes.length < 2) {\n minutes = `0${minutes}`;\n }\n timer.innerHTML = `${minutes}:${seconds}`;\n}", "title": "" }, { "docid": "0f23b9d7f6663476c6824562a8472faa", "score": "0.53005487", "text": "SSS (date) {\n return pad(date.getMilliseconds(), 3)\n }", "title": "" }, { "docid": "f7aaf84456635f68a93b693835b43256", "score": "0.52750266", "text": "function millisToDateUN(millis) {\r\n\tvar datetime = new Date(millis);\r\n\r\n\tvar theyear=datetime.getFullYear();\r\n\tvar themonth=datetime.getMonth()+1;\r\n\tvar theday=datetime.getDate();\r\n\tdateString = (theday+\"/\"+themonth+\"/\"+theyear);\r\n\r\n\treturn dateString;\r\n}", "title": "" }, { "docid": "2be91f15a5e4fd378acb40c3e0fae8e5", "score": "0.52740735", "text": "function formatDate(UNIX_timestamp){\n var a = new Date(UNIX_timestamp*1000);\n var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n var time = date + ', ' + month + ' ' + year;\n\n return time;\n\n}", "title": "" }, { "docid": "b20efb31d278d245b9e0094434ff7abf", "score": "0.5254716", "text": "function convertUnix(unix)\n {\n\n var a = new Date(unix*1000);\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var dateString = date + '/' + month + '/' + year; \n return dateString;\n }", "title": "" }, { "docid": "119dea13446b2624e1fb82749c8a33fc", "score": "0.52510923", "text": "function reformat (d) {\n\t\n \td = d3.time.format('%Y%m%d').parse(d);\n \td = new Date(d);\n \treturn d.getTime();\n}", "title": "" }, { "docid": "ac1eda066b6f0fb73f3e1f30b2a64011", "score": "0.5244618", "text": "function dateToMillisUS(date) {\r\n\tvar dateString = date;\r\n\tvar date = new Date(date);\r\n\tvar themillis = Date.parse(date);\r\n\tif(isNaN(themillis) || dateString.length == 6){\r\n\t\t\tif(dateString.length == 8){\r\n\t\t\t\tvar monthDeli = dateString.substr(0,2);\r\n\t\t\t\tvar dayDeli = dateString.substr(2,2);\r\n\t\t\t\tvar yearDeli = dateString.substr(4,8);\r\n\t\t\t\tdateString = monthDeli+\"/\"+dayDeli+\"/\"+yearDeli;\r\n\t\t\t}\r\n\t\t\telse if(dateString.length == 6){\r\n\t\t\t\tvar monthDeli = dateString.substr(0,2);\r\n\t\t\t\tvar dayDeli = dateString.substr(2,2);\r\n\t\t\t\tvar yearDeli = dateString.substr(4,6);\r\n\t\t\t\tdateString = monthDeli+\"/\"+dayDeli+\"/\"+yearDeli;\r\n\t\t\t}\r\n\t\t\r\n\tvar splitDate = dateString.split(\"/\");\r\n\tvar themonth=splitDate[0];\r\n\tvar theday=splitDate[1];\r\n\tvar theyear=splitDate[2];\r\n\t//IWS-255: When the user enters \"08\" in date box for the 'year, it automatically gets selected as \"1908\" instead of \"2008\".\r\n\t// 1. If user enters 00 to 49 as year, it sets to 2000 to 2049.\r\n\t// 2. If user enters 50 to 99 as year, it sets to 1950 to 1999.\r\n\tif (theyear.length == 2){ \r\n\t\tvar newyear = \"20\" + theyear;\r\n\t\tif (newyear < \"2050\"){ theyear = newyear; }\r\n\t\telse { theyear = \"19\" + theyear}\r\n\t}\r\n\r\n\tdateString = (themonth+\"/\"+theday+\"/\"+theyear);\r\n\t\r\n\tvar useDate = new Date(dateString);\r\n\tvar themillis = Date.parse(useDate);\r\n\treturn themillis;\r\n\t}else{\r\n\t\treturn themillis;\r\n\t}\r\n}", "title": "" }, { "docid": "97784b95d47dc760938af5f45d4be0c7", "score": "0.52343607", "text": "function date_to_str(date)\n{\n return format(\"%02u/%02u/%02u\", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100);\n}", "title": "" }, { "docid": "34413342982185101fb69e299cb7071c", "score": "0.5233398", "text": "function time2str(UNIX_timestamp){\r\n // FTP/Unix 'ls' dates are somewhat annoying. If the date are +- 6 months\r\n // from now, it uses \"Sep 5 14:51\". Otherwise it picks the less accurate\r\n // \"Feb 27 2006\"\r\n var a = new Date(UNIX_timestamp*1000);\r\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\r\n var milliseconds = new Date().getTime();\r\n var halfyear = 183 * 24 * 60 * 60 * 1000;\r\n var d = \"\"+a.getDate();\r\n d = Array(2 + 1 - d.length).\r\n join(\"0\")\r\n + d;\r\n\r\n if ((a.getTime() > (milliseconds + halfyear)) ||\r\n (a.getTime() < (milliseconds - halfyear))) {\r\n return months[a.getMonth()] + \" \" + d + \" \" + a.getFullYear();\r\n }\r\n\r\n var hours = \"\"+a.getHours();\r\n var mins = \"\"+a.getMinutes();\r\n hours = Array(2 + 1 - hours.length).join(\"0\") + hours;\r\n mins = Array(2 + 1 - mins.length).join(\"0\") + mins;\r\n\r\n return months[a.getMonth()] + \" \" + d + \" \" + hours + \":\" + mins;\r\n}", "title": "" }, { "docid": "293175a3d924ad75ff7a19084239edde", "score": "0.5230786", "text": "date_fmt (date, force_time_only) {\n const dt = moment(new Date(parseInt(date)));\n if (force_time_only || dt.isSame(new Date(), \"day\")) {\n console.log(dt)\n return dt.format(\"HH:mm:ss.SSS\");\n }\n else {\n return dt.format(\"L HH:mm:ss.SSS\");\n }\n }", "title": "" }, { "docid": "d777f91266cd5b205a07f42fd0e540a6", "score": "0.5223955", "text": "function msConversion(millis) {\n let sec = Math.floor(millis / 1000);\n let hrs = Math.floor(sec / 3600);\n sec -= hrs * 3600;\n let min = Math.floor(sec / 60);\n sec -= min * 60;\n\n sec = '' + sec;\n sec = ('00' + sec).substring(sec.length);\n\n if (hrs > 0) {\n min = '' + min;\n min = ('00' + min).substring(min.length);\n return hrs + \":\" + min + \":\" + sec;\n }\n else {\n return min + \":\" + sec;\n }\n\n /**\n let minutes = Math.floor(millis / 60000);\n let seconds = ((millis % 60000) / 1000).toFixed(0);\n return (seconds == 60 ? (minutes+1) + \":00\" : minutes + \":\" + (seconds < 10 ? \"0\" : \"\") + seconds);\n **/\n}", "title": "" }, { "docid": "c7425dcf69485e54efaf0be5a1d6b1d6", "score": "0.5183649", "text": "function calcUnixTime()\n {\n var t = new Number(document.unixtime.time.value);\n\n setJulian(J1970 + (t / (60 * 60 * 24)));\n }", "title": "" }, { "docid": "2c523f1deb3d83ffaf005d3e318db5bf", "score": "0.51802236", "text": "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "title": "" }, { "docid": "60fdf0e8627f024619e996a675870484", "score": "0.5168238", "text": "function formatTicks(d) \r\n {\r\n return d3\r\n .format(\"~s\")(d) // will change 0's to M, G, T\r\n\r\n // now replace those single letter to something more meaningful to users\r\n .replace(\"M\", \" mil\") // million\r\n .replace(\"G\", \" bn\") // billion\r\n ;\r\n }", "title": "" }, { "docid": "72504fc104da5a4e55a7cdf8b7671c5a", "score": "0.516445", "text": "function timestamp()\r\n {\r\n return this.format(\"dd.MM.yyyy hh:mm:ss.ffffff\");\r\n }", "title": "" }, { "docid": "e186af620fb10c4e89b9bf0d04ce71ee", "score": "0.51526576", "text": "function long() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long'\n });\n }", "title": "" }, { "docid": "cc832120d88799edf06693acd30c5050", "score": "0.5152378", "text": "static getTimeInMs() {\n let seconds;\n let nanoseconds;\n [seconds, nanoseconds] = process.hrtime();\n return seconds * 1000 + nanoseconds / 1000000;\n }", "title": "" }, { "docid": "f0db5dae2ef7ed9deb3bb77860399558", "score": "0.5150927", "text": "function humanReadable(seconds) {\n let ms = new Date(seconds * 1000),\n hh = Math.floor(seconds / 3600),\n mm = Math.floor((seconds % 3600) / 60),\n ss = Math.floor((seconds % 3600) % 60)\n if (hh < 9) hh = 0 + hh.toString()\n if (mm < 9) mm = 0 + mm.toString()\n if (ss < 9) ss = 0 + ss.toString()\n return `${hh}:${mm}:${ss}`\n\n //p=n=>`0${n}`.slice(-2),humanReadable=(s)=>(m=s/60|0,p(m/60|0)+':'+p(m%60)+':'+p(s%60))\n /*function humanReadable(seconds) {\n return [(seconds / 3600) | 0, seconds % 3600 / 60, seconds % 3600 % 60].map(n => ('0' + ( '' + n|0)).substr(-2)).join(':')\n }*/\n /*\n function humanReadable(seconds) {\n return `${Math.floor(seconds / 3600).toString().padStart(2,'0')}:${Math.floor(seconds / 60 % 60).toString().padStart(2,'0')}:${(seconds % 60).toString().padStart(2,'0')}`\n }*/\n}", "title": "" }, { "docid": "d507255d7173b0b5f194e99fdbb774ee", "score": "0.5144514", "text": "_formatTime(ms) {\n const total = {\n ms: 0,\n sec: 0,\n min: 0,\n formatted: null,\n };\n\n if (!isFinite(ms)) {\n total.formatted = '00: 00';\n return total;\n }\n\n const seconds = Math.floor((ms / 1000) % 60),\n minutes = Math.floor((ms / 1000 / 60) % 60);\n\n\n // Add zeros if it needs\n if (String(seconds).length < 2) {\n total.sec = `0${String(seconds)}`;\n } else {\n total.sec = String(seconds);\n }\n\n if (String(minutes).length < 2) {\n total.min = `0${String(minutes)}`;\n } else {\n total.min = String(minutes);\n }\n\n total.ms = ms;\n total.formatted = `${total.min}: ${total.sec}`;\n return total;\n }", "title": "" }, { "docid": "18a6a41b90d59b0914694f54320d8269", "score": "0.51389205", "text": "function unixToNatural(date) {\n return moment.unix(date).format(\"MMMM, D YYYY\");\n }", "title": "" }, { "docid": "ccc174833b8dd788216bdce0ce33db10", "score": "0.5136699", "text": "function ms_seconds(x){ return x / 1000;}", "title": "" }, { "docid": "5f95198912c39aab3db963a1eb7373b8", "score": "0.5135981", "text": "function formatDate(d) {\n if (d<10) {\n d = \"0\" + d;\n }\n return d;\n }", "title": "" }, { "docid": "c3f0afdcce68e0505e95ad58cc77f8d2", "score": "0.51356506", "text": "function unixToNatural(unix) {\n unix -= unix % secs_in_day;\n var days = unix / secs_in_day;\n var fourYearBlocks = Math.floor(days / (365*3 + 366));\n var daysToCount = days - fourYearBlocks*(365*3 + 366);\n var year;\n if (daysToCount >= 365*2 + 366) {\n year = 1970 + 4*fourYearBlocks + 3;\n daysToCount -= 365*2 + 366;\n } else if (daysToCount >= 365*2) {\n year = 1970 + 4*fourYearBlocks + 2;\n daysToCount -= 365*2;\n } else if (daysToCount >= 365) {\n year = 1970 + 4*fourYearBlocks + 1;\n daysToCount -= 365;\n } else {\n year = 1970 + 4*fourYearBlocks;\n }\n var month = 0;\n if (isLeapYear(year)) {\n while (daysToCount >= getDaysInMonthLeap(month)) {\n daysToCount -= getDaysInMonthLeap(month);\n month++;\n }\n } else {\n while (daysToCount >= getDaysInMonth(month)) {\n daysToCount -= getDaysInMonth(month);\n month++;\n }\n }\n var day = daysToCount + 1;\n return [day.toString(), getMonthString(month), year.toString()];\n}", "title": "" }, { "docid": "7f3e097737351de876a80d2a6fff9f09", "score": "0.51311576", "text": "function Pd(i,ee,te){var se=\" \";return(i%100>=20||i>=100&&i%100==0)&&(se=\" de \"),i+se+{mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[te]}", "title": "" }, { "docid": "6c003c7a736b62309c83366c5d0fdfb5", "score": "0.512396", "text": "static normalizeTimestamp(timestamp) {\n const milliseconds = (timestamp.seconds.low + \n (\n (timestamp.nanos / 1000000) / 1000\n )\n ) * 1000;\n\n return new Date(milliseconds);\n }", "title": "" }, { "docid": "bde12890a98890e0589ed94a5649e7c3", "score": "0.5123557", "text": "function toTimestamp(rpepoch) {\n return (rpepoch + 0x386D4380) * 1000;\n}", "title": "" }, { "docid": "bde12890a98890e0589ed94a5649e7c3", "score": "0.5123557", "text": "function toTimestamp(rpepoch) {\n return (rpepoch + 0x386D4380) * 1000;\n}", "title": "" }, { "docid": "159553db6f893b0de6b83aab2bc3cf0e", "score": "0.51224244", "text": "function timeConverter(UNIX_timestamp){\n let a = new Date(UNIX_timestamp * 1000);\n let year = a.getFullYear();\n let month = a.getMonth()+1;\n let date = a.getDate();\n //this changes the time stamp to a date form at (MM/DD/YYYY)\n let time = \"(\" + month + '/' + date+ '/' + year + \")\";\n //returns a formatted string of the time stamp\n return time;\n }", "title": "" }, { "docid": "26dfa88531bf7bb8ae3e7435f1c76a5a", "score": "0.51044583", "text": "function relativeTimeWithPlural(number,withoutSuffix,key){var format={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},separator=\" \";return(number%100>=20||number>=100&&number%100===0)&&(separator=\" de \"),number+separator+format[key]}", "title": "" }, { "docid": "6ff3acf81f212aa7ebc8921060b595d1", "score": "0.5099307", "text": "function short (ms) {\n if (ms >= d) return Math.round(ms / d) + 'd'\n if (ms >= h) return Math.round(ms / h) + 'h'\n if (ms >= m) return Math.round(ms / m) + 'm'\n if (ms >= s) return Math.round(ms / s) + 's'\n return ms + 'ms'\n}", "title": "" }, { "docid": "deb358a64bd36ad0d8cb5d81e042e159", "score": "0.50990736", "text": "function unixToNat(unixDt) {\n return moment.unix(unixDt).format(\"MMMM D, YYYY\");\n }", "title": "" }, { "docid": "0e32d1cb8d5220994bb1357da43979f4", "score": "0.50965226", "text": "function formatDate(date) {\n var d = new Date(date * 1000);\n\n var dd = d.getDate();\n if (dd < 10) dd = \"0\" + dd;\n\n var mm = d.getMonth() + 1;\n if (mm < 10) mm = \"0\" + mm;\n\n return dd + \".\" + mm + \" \" + getWeekDay(d);\n}", "title": "" }, { "docid": "32d8913a1d23bb8db4b083922e84bf88", "score": "0.5095127", "text": "function millisecondsToTime(milli) {\r\n var milliseconds = milli % 1000;\r\n var seconds = Math.floor((milli / 1000) % 60);\r\n var minutes = Math.floor((milli / (60 * 1000)) % 60);\r\n\t \r\n\t if(seconds<10){\r\n\t\tseconds = '0'+seconds; \r\n\t }\r\n\t \r\n\t if(minutes<10){\r\n\t\tminutes = '0'+minutes; \r\n\t }\r\n\t return seconds+' SEC';\r\n}", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.5087481", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.5087481", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.5087481", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "d73088d6d42998c01bfa1a820b5f5e22", "score": "0.5085756", "text": "function toUnixDate(t){var e=t.split(\".\"),r=new Date;return r.setFullYear(e[2],e[1]-1,e[0]),r.setHours(0),r.setMinutes(0),r.setSeconds(0),Math.floor(r.getTime()/1e3)}", "title": "" }, { "docid": "78dac0598df976efa19965d6cbea6f12", "score": "0.50679904", "text": "function timeConverter(unix_timestamp) {\n //const months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n // tzDiff = 8 * 60 * 60 * 1000 - Pacific time is 8 hours behind UTC (daylight savings).\n //const tzDiff = 28800000;\n // tzOiff = 7 * 60 * 60 * 1000. // standard time.\n // TODO: make this conversion more robust.\n const tzDiff = 25200000;\n // Create a new JavaScript Date object based on the timestamp.\n // Multiplied by 1000 so that the argument is in milliseconds, not seconds.\n let date = new Date(unix_timestamp - tzDiff);\n let year = date.getFullYear();\n //var month = months[date.getMonth()];\n let month = date.getMonth() + 1;\n let day = date.getDate();\n let hours = date.getHours();\n let minutes = '0' + date.getMinutes();\n let seconds = '0' + date.getSeconds();\n\n // Will display time in M D HH:MM format\n //var formattedTime = month + \" \" + day + \" \" + hours + \":\" + minutes.substr(-2);\n // Will display in 2013-10-04 22:23:00 format\n let formattedTime = year+'-'+month+'-'+day+' '+hours+':'+minutes.substr(-2)+':'+seconds.substr(-2);\n return formattedTime;\n}", "title": "" }, { "docid": "9bf0639906ec1b68a809eb6a6243a4ca", "score": "0.5067334", "text": "function yearsToMS(years){\r\treturn years * 365.25 * 24 * 60 * 60 * 1000;\r}", "title": "" }, { "docid": "6effdf32c5643b2c98546c184a9f1d36", "score": "0.5067122", "text": "function getEpochDate(date){\n\n\tvar myDate = new Date(date);\n\tvar epoch = myDate.getTime()/1000.0;\n\n\treturn epoch;\n}", "title": "" }, { "docid": "0f55f4d88226b0a316fdb33e419d4cd0", "score": "0.5065902", "text": "function convUnix(t) {\n var date = new Date(parseInt(t) * 1000);\n return date;\n}", "title": "" }, { "docid": "9b01144cadf1912f3b983529459cd3bb", "score": "0.5064908", "text": "function toTimeStamp(date) {\r\n\t\ttry {\r\n\t\t\tvar x= new Date(date).getTime()/1000;\r\n\t\t\treturn x;\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e);\r\n\t\t\tvar x= new Date().getTime()/1000;\r\n\t\t\treturn x; \r\n\t\t} \r\n\t}", "title": "" }, { "docid": "6148331a5954a28fe1be58dbd90f86e7", "score": "0.5064124", "text": "function parseTimestamp() {\n var el = $(this);\n var timestamp = parseInt(el.text(), 10);\n\n if (timestamp && !isNaN(timestamp)) {\n el.text(exports.utils.formatDate(timestamp * 1000));\n } else {\n el.text('');\n }\n }", "title": "" }, { "docid": "42cc2315760f2fdb6f26abc9ff68e920", "score": "0.5061401", "text": "function toMs(s) {\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\n }", "title": "" }, { "docid": "ac9b7bc29d8a3d30ba4ab24d1adb65d4", "score": "0.50505865", "text": "function timeConverter(UNIX_timestamp) {\n\tvar a = new Date(UNIX_timestamp * 1000);\n\tvar months = [\n\t\t'Jan',\n\t\t'Feb',\n\t\t'Mar',\n\t\t'Apr',\n\t\t'May',\n\t\t'Jun',\n\t\t'Jul',\n\t\t'Aug',\n\t\t'Sep',\n\t\t'Oct',\n\t\t'Nov',\n\t\t'Dec',\n\t];\n\tvar year = a.getFullYear();\n\tvar month = a.getMonth() + 1;\n\tvar date = a.getDate();\n\tvar finalDate = month + '/' + date + '/' + year;\n\treturn finalDate;\n}", "title": "" }, { "docid": "c915f0b5954b6bbe31bc8fd02b4495b8", "score": "0.50505537", "text": "function formatDate(unix, offset, dateFormat = 'full') {\n const date = (0,date_fns_fromUnixTime__WEBPACK_IMPORTED_MODULE_0__.default)(unix + offset).toUTCString();\n let dayOfWeek = date.slice(0, 3);\n let dayOfMonth = date.slice(5, 7);\n const month = date.slice(8, 11);\n const year = date.slice(14, 16);\n let suffix;\n\n // change 01 to 1 etc\n if (dayOfMonth < 10) {\n dayOfMonth = dayOfMonth.slice(1);\n }\n\n // generate corect date suffix\n if (dayOfMonth.slice(-1) === '1') {\n suffix = 'st';\n } else if (dayOfMonth.slice(-1) === '2') {\n suffix = 'nd';\n } else if (dayOfMonth.slice(-1) === '3') {\n suffix = 'rd';\n } else {\n suffix = 'th';\n }\n\n // those pesky 11, 12, 13 ths\n if (dayOfMonth > 3 && dayOfMonth < 21) {\n suffix = 'th';\n }\n\n // convert short day name to full day name\n if (dayOfWeek === 'Mon') {\n dayOfWeek = 'Monday';\n } else if (dayOfWeek === 'Tue') {\n dayOfWeek = 'Tuesday';\n } else if (dayOfWeek === 'Wed') {\n dayOfWeek = 'Wednesday';\n } else if (dayOfWeek === 'Thu') {\n dayOfWeek = 'Thursday';\n } else if (dayOfWeek === 'Fri') {\n dayOfWeek = 'Friday';\n } else if (dayOfWeek === 'Sat') {\n dayOfWeek = 'Saturday';\n } else if (dayOfWeek === 'Sun') {\n dayOfWeek = 'Sunday';\n }\n\n // return only the day of week\n if (dateFormat === 'day') {\n return dayOfWeek;\n }\n\n // return full date string\n return `${dayOfWeek}, ${dayOfMonth}${suffix} ${month} '${year}`;\n}", "title": "" }, { "docid": "5e694aa1b68ac280a1346267019c527b", "score": "0.5049697", "text": "function toMs(s) {\r\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\r\n}", "title": "" }, { "docid": "5e694aa1b68ac280a1346267019c527b", "score": "0.5049697", "text": "function toMs(s) {\r\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\r\n}", "title": "" } ]
8065685fac1cd9d3397fe7435f9cd247
supports only 2.0style add(1, 's') or add(duration)
[ { "docid": "62e73b56182fcc56d1a4aab89525f7aa", "score": "0.0", "text": "function add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n }", "title": "" } ]
[ { "docid": "9f52187b925af5a789a58cbb5807f630", "score": "0.6559725", "text": "function durationValue(value) {\n\t\t\t return value + 's';\n\t\t\t }", "title": "" }, { "docid": "0be56c97c948a4bfa3c3263a5e0480de", "score": "0.6238", "text": "function _addSeconds(number)\n\t{\n\t\tvar milliseconds = EZ.toInt(number, 1) * (60 * 1000);\n\t\treturn _addMilliseconds(milliseconds);\n\t}", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "0cc5d0000bfc9d5735aeeb18d172896c", "score": "0.6106808", "text": "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "title": "" }, { "docid": "48e2ce2d88f7c97f4e81bed978186daa", "score": "0.6014902", "text": "static seconds(quantity) {\n return new Duration(quantity, Duration.Unit.SECONDS);\n }", "title": "" }, { "docid": "849909b2f3bba95fe6c00bc17049bb61", "score": "0.60134435", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "be4a0141566e05c8b0fcd359d5c32a29", "score": "0.60061204", "text": "function duration_add_subtract__add(input, value) {\n\t\t\t\t\treturn duration_add_subtract__addSubtract(this, input, value, 1);\n\t\t\t\t}", "title": "" }, { "docid": "80e046f6e60ddb8c61c9bf5161542276", "score": "0.59763896", "text": "function duration_add_subtract__add(input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "f7d82671129984fb8594be1664dc344c", "score": "0.59647655", "text": "function formatDuration (seconds) {\n // Complete this function\n}", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" }, { "docid": "7527074d3ec9c1aca96052fed9c9987a", "score": "0.58929473", "text": "function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }", "title": "" } ]
b8b5888ae8a3ae0936856be01c142e3a
init rectangle except for ONE player
[ { "docid": "fe881449b0beb189951ef83592c6a39b", "score": "0.0", "text": "function initRects(idExcept = -1){ // idExcept -- winner, if -1, then clear all\n\t// if(idExcept == -1){ clearAllRects(); }\n\tfor(var p = 0; p < 120; p++){\n\t\tfor(var q = 0; q < 120; q++){\n\t\t\tif(idExcept == -1){\n\t\t\t\tclearRect(context, q, p); // NEED TEST\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(lineInd[p][q] == idExcept || rectsInd[p][q] == idExcept){\n\t\t\t\t// clearRect(context, q, p);\n\t\t\t}else{\n\t\t\t\tclearRect(context, q, p);\n\t\t\t}\n\t\t}\n\t}\n\n\t// draw initial pixels\n\tvar dirs = [[0, 1], [1, 0], [0, -1], [-1, 0], [1, 1], [1, -1], [-1, 1], [-1, -1], [0, 0]];\n\tfor (var k = positions.length - 1; k >= 0; k--) {\n\t\tif(k == idExcept){\n\t\t\tcontinue;\n\t\t}\n\t\tdrawing[k] = false;\n\t\tfor (var i = dirs.length - 1; i >= 0; i--) {\n\t\t\tvar tmp = addPoint(positions[k], dirs[i]);\n\t\t\tif(isValid(tmp)){\n\t\t\t\tdrawRect(context, tmp[0], tmp[1], k, false, true);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "ff2b4321a2e6418596ba28e978d2f384", "score": "0.70648897", "text": "function init(){\n\n // Instanciamos cada uno de nuestros rectangulos\n rect[0] = new Rectangule({\n x: 100, \n y: 100, \n color: 'blue'\n })\n\n rect[1] = new Rectangule({\n x: 110,\n y: 230,\n color: '#00FF00',\n limit: 200,\n hspeed: 2\n })\n \n rect[2] = new Rectangule({\n x: rect[0].getX() + 70,\n y: rect[0].getY(),\n color: 'red',\n limit: 65,\n vspeed: 4\n })\n \n // Agregamos todos los elementos a nuestro stage\n rect.forEach(function(obj){\n stage.add(obj)\n })\n\n // Iniciamos el GameLoop\n run(loop)\n\n }", "title": "" }, { "docid": "884656c61a89b7cff4d918f8d2684d76", "score": "0.66597885", "text": "constructor()\n {\n this.posX =0;\n this.topCollider = new RectCollider();\n this.bottomCollider = new RectCollider();\n this.successCollider = new RectCollider();\n this.isActive = false;\n }", "title": "" }, { "docid": "fd335bcfcce12f2e91238ebba8ad9bfb", "score": "0.6650767", "text": "function drawPlayer()\n{\n ctx.beginPath();\n ctx.rect(playerX, canvas.height - playerHeight, playerWidth, playerHeight);\n ctx.fillStyle = 'black';\n ctx.fill();\n ctx.closePath();\n}", "title": "" }, { "docid": "25ae06b01ddcf67795c2d2938a36b9d5", "score": "0.66228884", "text": "createInteractionZones() {\n this.room2b_graphics = this.add.graphics({fillStyle: {color: 0xFFFFFF, alpha: 0.0}});\n //this.graphicsTest = this.add.graphics({fillStyle: {color: 0x4F4F4F, alpha: 1.0}});\n //TOP ZONES\n //xpos ypos x y\n this.room2b_quiz_info = new Phaser.Geom.Rectangle(975,250,250,250);\n this.room2b_graphics.fillRectShape(this.room2b_quiz_info);\n\n this.room2b_middle_info = new Phaser.Geom.Rectangle(700, 350, 200, 200);\n this.room2b_graphics.fillRectShape(this.room2b_middle_info);\n \n this.room2b_hole_zone = new Phaser.Geom.Rectangle(150, 332,240,150);\n this.room2b_graphics.fillRectShape(this.room2b_hole_zone);\n\n\n }", "title": "" }, { "docid": "d9bdeef0229df248662dcfc886d8a0dc", "score": "0.656184", "text": "function createRect(){\n new Rectangle(rectHeight, rectWidth); \n}", "title": "" }, { "docid": "4a31ae4faa4a53532da57a4b764687f0", "score": "0.64463216", "text": "function drawPlayer() {\r\n fill(fillRed, fillGreen, fillBlue);\r\n noStroke();\r\n rect(posX, posY, 60, 60);\r\n}", "title": "" }, { "docid": "7f5fcf215e4caf8d8eec9005f42b58b9", "score": "0.6393102", "text": "getRect () {\n return new Phaser.Rectangle(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "b49dc127f04801ffacee0102ce2867b5", "score": "0.6351781", "text": "set rect(value) {}", "title": "" }, { "docid": "f319921b3d5122b76be714551b6986a8", "score": "0.63358617", "text": "function addRectangle(board, initVal) {\n\tvar x = initVal.x;\n\tvar y = initVal.y;\n\n\tvar pt1 = board.create('point', [x,y]); \n\tvar pt2 = board.create('point', [x+3,y+2]); \n\tvar pt3 = board.create('point', [function(){return pt1.X();},function(){return pt2.Y();}], {color:'blue'});\n\tvar pt4 = board.create('point', [function(){return pt2.X();},function(){return pt1.Y();}], {color:'blue'});\n\t\n\tvar rect = board.create('polygon',[pt1,pt3,pt2,pt4], {hasInnerPoints:true});\n\tpt3.isDraggable = true;\n\tpt4.isDraggable = true;\t\n}", "title": "" }, { "docid": "41f989969c407d394f7b76382dd88e44", "score": "0.6293996", "text": "drawObj(){\n if(this.inactive)\n return;\n rect(this.v,0,this.w,this.pad_top);\n rect(this.v, this.pad_top+mrg, this.w, height-(this.pad_top+mrg));\n }", "title": "" }, { "docid": "50a57b79a79f2995c19be0c1c23c85e2", "score": "0.6288396", "text": "function drawPlayer() {\n fill(255,0,0);\n rect(x,y,50,100);\n push();\n fill(255,235,199);\n translate(0,-50);\n rect(x,y,50,50);\n translate(0,-5);\n fill(255,0,0);\n rect(x,y,60,5);\n translate(0,-20);\n rect(x,y,50,20);\n \n pop();\n \n}", "title": "" }, { "docid": "1deb7aa9d48a3fa37f8c2d58689750ea", "score": "0.6268171", "text": "updateRect() {\n this.x1 = typeof this.options.x1 === 'undefined' ? this.options.x : this.options.x1;\n this.y1 = typeof this.options.y1 === 'undefined' ? this.options.y : this.options.y1;\n this.x2 = typeof this.options.x2 === 'undefined' ? this.x1 + this.options.w : this.options.x2;\n this.y2 = typeof this.options.y2 === 'undefined' ? this.y1 + this.options.h : this.options.y2;\n this.x = typeof this.options.x === 'undefined' ? this.x1 : this.options.x;\n this.y = typeof this.options.y === 'undefined' ? this.y1 : this.options.y;\n this.w = typeof this.options.w === 'undefined' ? this.x2 - this.x1 : this.options.w;\n this.h = typeof this.options.h === 'undefined' ? this.y2 - this.y1 : this.options.h;\n }", "title": "" }, { "docid": "f6a670ad3ecbcbc5d9aacfba7654518f", "score": "0.624339", "text": "initGame() {\n\n // create the base objects for both players\n this.addObjectToWorld(new Base(++this.world.idCount, PADDING, 1));\n this.addObjectToWorld(new Base(++this.world.idCount, WIDTH - PADDING, 2));\n\n}", "title": "" }, { "docid": "31e030e7189702eb4dc7a8e038cbace9", "score": "0.6237414", "text": "function player(){\n if (state === \"level 1\" || state === \"level 2\"){\n fill(\"red\");\n rect(playerX, playerY, 50, 100);\n if (movingUp) {\n playerY -= 3;\n }\n if (movingLeft) {\n playerX -= 5;\n }\n if (movingRight) {\n playerX += 5; \n }\n if (key === \"r\"){\n playerX = width/2;\n playerY = height - 150;\n dy = 0;\n }\n }\n}", "title": "" }, { "docid": "88336611612deb32347ba9c93babf600", "score": "0.62241626", "text": "function player2_bars(){\n\tctx.fillStyle= \"#96b2d0\";\n\troundedRect(ctx, 50, 50, WIDTH-100, HEIGHT-100, 10, true, false);\n\tctx.fillStyle= \"#002851\";\n\troundedRect(ctx, (WIDTH/2) - (WIDTH/16), HEIGHT-100, (WIDTH/8), 100, 10, true, true);\n\troundedRect(ctx, (WIDTH/2) - (WIDTH/8), 0, (WIDTH/4), 100, 10, true, true);\n}", "title": "" }, { "docid": "74d9c65aee52034db5e51dbeaf9d6ead", "score": "0.6215355", "text": "constructor() {\n\t\t\t/** The x coordinate of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.x = 0;\n\t\t\t/** The y coordinate of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.y = 0;\n\t\t\t\n\t\t\t/** The end x coordinate (i.e. the right) of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.ex = 0;\n\t\t\t/** The end y coordinate (i.e. the bottom) of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.ey = 0;\n\t\t\t\n\t\t\t/** The width of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.width = 0;\n\t\t\t/** The height of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.height = 0;\n\t\t}", "title": "" }, { "docid": "8f367e4211de7543b5836e2270446296", "score": "0.62137014", "text": "constructor(world, x, y, w, h, options={}) {\r\n super(world, x, y, w, h, options);\r\n this.label('PRectangle');\r\n this.fill = undefined;\r\n this.stroke = undefined;\r\n this.strokeThickness = 1;\r\n }", "title": "" }, { "docid": "d88a0aec84e40572e0a083afbd387374", "score": "0.6205864", "text": "function player1_bars(){\n\tctx.fillStyle= \"#96b2d0\";\n\troundedRect(ctx, 50, 50, WIDTH-100, HEIGHT-100, 10, true, false);\n\tctx.fillStyle= \"#002851\";\n\troundedRect(ctx, (WIDTH/2) - (WIDTH/8), HEIGHT-100, (WIDTH/4), 100, 10, true, true);\n\troundedRect(ctx, (WIDTH/2) - (WIDTH/16), 0, (WIDTH/8), 100, 10, true, true);\n}", "title": "" }, { "docid": "57c929054c1c80ba13040570f8fe7512", "score": "0.62021434", "text": "constructor(){\n this.value = null; //either O or x but at the starting it is null\n this.isHighLighted = false; //if any player wins then it will highlight the blocks of gameboard\n }", "title": "" }, { "docid": "8e5d6ddcbb558d9dd927a2b125a9d57b", "score": "0.619451", "text": "function PlayerBox(canvas,player,x,y)\n{\n var width = 120;\n var height = 25;\n this.x = x;\n this.y = y;\n this.canvas = canvas;\n this.player = player;\n this.currentAB = false;\n\n /**\n * Function to draw this player box\n * @type {Function}\n */\n this.draw = draw;\n function draw()\n {\n var ctx = canvas.getContext(\"2d\");\n var oldFont = ctx.font;\n ctx.font = height/2+'px Sans-Serif';\n // Entire box probably redundant\n // use below line to indicate current batter.\n ctx.strokeRect(x,y,width,height);\n if(this.currentAB)\n {\n ctx.fillStyle = \"red\";\n ctx.fillRect(x,y,width,height);\n }\n else\n {\n ctx.fillStyle = \"white\";\n ctx.fillRect(x,y,width,height);\n }\n ctx.fillStyle = \"white\";\n // Player's # box\n ctx.fillRect(x,y,width/6,height);\n ctx.strokeRect(x,y,width/6,height);\n // Player's P box\n ctx.fillRect(x+(width*(5/6)),y,width/6,height);\n ctx.strokeRect(x+(width*(5/6)),y,width/6,height);\n\n ctx.fillStyle = \"black\";\n ctx.strokeRect(x,y+height,width,height);\n ctx.strokeRect(x,y+height,width/6,height);\n ctx.strokeRect(x+(width*(5/6)),y+height,width/6,height);\n ctx.fillText (this.player.number,x+(width/40), y+(height/1.33));\n ctx.fillText (this.player.name,x+(width/4), y+(height/1.33));\n ctx.fillText (this.player.position,x+(width *.87), y+(height/1.33));\n ctx.font = oldFont;\n }\n\n}", "title": "" }, { "docid": "43cf497d7c8733f411d8576d1390aa13", "score": "0.6192948", "text": "function setupGameArea() {\n // Set relative width and position of game field\n gameWidth = width * 0.75;\n gameHeight = height;\n gameX = gameWidth/2;\n gameY = gameHeight/2;\n // Create game area as a new block object\n gameArea = new Block(gameX,gameY,gameWidth,gameHeight,255,255,255,255);\n\n // Create another block object to cover everything in the game area\n // Used in alarm level\n cover = new Block(gameX,gameY,gameWidth,gameHeight,0,0,0,255);\n}", "title": "" }, { "docid": "00a45b21b815bbe493663123ff5124b9", "score": "0.61912614", "text": "function rectSpawn(){\n if(mouseIsPressed){\n fill(255);\n rectMode(CENTER);\n rect(mouseX, rectangle.y, rectangle.size);\n rectangle.y = rectangle.y + 5;\n } else{ rectangle.y = 100}\n}", "title": "" }, { "docid": "88d6cb90785705409e272623daec2dbe", "score": "0.6152124", "text": "function initializePlayer(){\n const tempBlock = createBlock(pieces[pieces.length * Math.random() | 0]);\n player.pos = {x:4, y:0}; \n\n player.block = new Block(tempBlock);\n if (board.collide(player)){\n board.forEach(row => row.fill(0));\n }\n //console.log(player.block.patten);\n //console.log(player.pos);\n //console.log('chuang jian cheng gong');\n}", "title": "" }, { "docid": "47b346d3a27d5fac93a993e549631196", "score": "0.6137642", "text": "function initBoard() {\n isRunning = false;\n pianoSprite = new PianoSprite();\n drumSprite = new DrumSprite();\n bassSprite = new BassSprite();\n canvas = new Canvas(document, 'main',10);\n w = new World(canvas.width-1,canvas.height-1,10);\n }", "title": "" }, { "docid": "801961c16c7df96b430bbbc3c099095a", "score": "0.61356044", "text": "function rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y) {\n\t//Create the sprite\n\tvar sprite = new Rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y);\n\t//Add the sprite to the stage\n\tstage.addChild(sprite);\n\t//Return the sprite to the main program\n\treturn sprite;\n}", "title": "" }, { "docid": "3a50758367af590863a51e49ae8b3c51", "score": "0.6121318", "text": "function Rectangle(left, top, right, bottom) {\n this.init(new Point((left || 0), (top || 0)),\n new Point((right || 0), (bottom || 0)));\n}", "title": "" }, { "docid": "05f5ef916d46c4490d7e0f2e7c077867", "score": "0.6115824", "text": "construct_player() {\n this.player = new Player(this);\n this.player.x = 800;\n this.player.y = 480;\n this.nubs = this.add.group();\n this.left_nub = this.physics.add.sprite(this.player.x - 17, this.player.y).setBodySize(3, 3);\n this.nubs.add(this.left_nub);\n this.right_nub = this.physics.add.sprite(this.player.x + 17, this.player.y).setBodySize(3, 3);\n this.nubs.add(this.right_nub);\n this.up_nub = this.physics.add.sprite(this.player.x, this.player.y - 17).setBodySize(3, 3);\n this.nubs.add(this.up_nub);\n this.down_nub = this.physics.add.sprite(this.player.x, this.player.y + 17).setBodySize(3, 3);\n this.nubs.add(this.down_nub);\n\n }", "title": "" }, { "docid": "d5e6fea45beedc703f2fe344621d9a00", "score": "0.6063468", "text": "function rect(lon, lar) {\n this.longueur = lon;\n this.largeur = lar;\n}", "title": "" }, { "docid": "8149e0eeb21b44f924f47cbf36953fbf", "score": "0.60503435", "text": "get rect() {}", "title": "" }, { "docid": "52eb3ee13ef4da2a3626a6b4b6666adf", "score": "0.60469186", "text": "function Player(startX,startY) {\n\t//starting position\n\tthis.x = startX;\n\tthis.y = startY;\n\t\n\t//rect1: main body\n\tthis.width1 = 36;\n\tthis.height1 = 20;\n\t\n\t//rect2: top\n\tthis.width2 = 10;\n\tthis.height2 = 20;\n\tthis.x_offset = 13;\n\tthis.y_offset = -12;\n\t\n\t//horizontal speed\n\tthis.x_speed = 3;\n\t\n\t//draws the player object each frame\n\tthis.draw = function() {\n\t\tctx.beginPath();\n\t\tctx.rect(this.x, this.y, this.width1, this.height1);\n\t\tctx.rect(this.x + this.x_offset, this.y + this.y_offset, this.width2, this.height2);\n\t\tctx.fillStyle = \"white\";\n\t\tctx.fill();\n\t\tctx.closePath();\n\t};\n\n\t//Passed 2 (x,y) pairs, it determines if any part of the rectangle formed by the two intersects with the player sprite\n\tthis.inHitbox = function(x1,y1,x2,y2) {\n\t\tif (\n\t\tthis.x < x2 &&\n\t\tthis.x + this.width1 > x1 &&\n\t\tthis.y < y2 && \n\t\tthis.y + this.height1 > y1){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false; \n\t}\n\t\n\t//Moves left by this.x_speed\n\tthis.moveLeft = function() {\n\t\tif (this.x > 0){ \n\t\t\tthis.x -= this.x_speed;\n\t\t}\n\t}\n\t\n\t//Moves right by this.x_speed\n\tthis.moveRight = function() {\n\t\tif (this.x + this.width1 < canvas.width){ \n\t\t\tthis.x += this.x_speed;\n\t\t}\n\t}\n\t\n\t//Spawns PlayerBullet\n\tthis.shoot = function() {\n\t\tif (playerBullet == undefined){\n\t\t\tplayerBullet = new PlayerBullet(this.x,this.y + this.y_offset);\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "8dcb19b6c297c16848b27dea99725dcc", "score": "0.6044889", "text": "function addRectangle() {\n var rect = new fabric.Rect({\n left: 100,\n top: 100,\n fill: `${defaultObjectColor}`,\n width: 100,\n height: 100,\n objectCaching: false,\n strokeWidth: 0\n });\n\n canvas.add(rect);\n canvas.setActiveObject(rect);\n}", "title": "" }, { "docid": "aecce0b4e1d8978835d1136f3838cdd3", "score": "0.60207075", "text": "iniciEntorn() {\n\n var rect_nomscastellers = new Konva.Rect({\n x: 20,\n y: 100,\n width: 300,\n height: 600,\n fill: \"#dbdbdb\",\n cornerRadius: 10,\n id: -1\n });\n // add the shape to the layer\n\n this.layerPinya.add(rect_nomscastellers);\n\n var rect_plantilla = new Konva.Rect({\n x: 350,\n y: 100,\n width: 1000,\n height: 600,\n fill: '#dbdbdb',\n cornerRadius: 10,\n id: -1\n });\n this.layerPinya.add(rect_plantilla);\n\n }", "title": "" }, { "docid": "e1fcbb8f6787aecde9d12b07fcf76b8d", "score": "0.60198516", "text": "function Rect(x, y, w, h) {\n this.x = x; this.y = y;\n this.w = w; this.h = h;\n}", "title": "" }, { "docid": "5d84d49482626738a30f1422da80b3b9", "score": "0.601653", "text": "function init() {\n dropIntervall = 100;\n scoreBorder = 500;\n player.score = 0;\n Game.resetShape();\n Game.checkGameOver();\n Matrix.draw();\n Game.endGame();\n}", "title": "" }, { "docid": "8b71c91d69d833141f50b4c064f26a8c", "score": "0.60016406", "text": "constructor(x, y, playerNum) {\n this.x = x;\n this.y = y;\n this.speed = 13;\n this.h = 120;\n this.w = 20;\n if (playerNum == 1) {\n this.hue = 146;\n this.s = 50.3;\n this.l = 65;\n } else {\n this.hue = 300;\n this.s = 100;\n this.l = 50;\n }\n }", "title": "" }, { "docid": "b4b0becec2e82743237a21adf2e16961", "score": "0.59974694", "text": "function createBoard() {\n\t\tctx.beginPath();\n\t\tctx.rect(boardX, canvas.height - boardHeight, boardWidth, boardHeight);\n\t\tctx.fillStyle = 'blue';\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "title": "" }, { "docid": "b9c457d6931aa11957ea1456622941c6", "score": "0.5986612", "text": "constructor(x,y,width,height){\r\n \r\n var options = {\r\n \r\n isStatic:true,\r\n \r\n \r\n }\r\n this.body = Bodies.rectangle(x,y,options);\r\n \r\n World.add(world,this.body);\r\n\r\n this.body = Bodies.rectangle(x,y,options);\r\n \r\n World.add(world,this.body);\r\n\r\n this.body = Bodies.rectangle(x,y,options);\r\n \r\n World.add(world,this.body);\r\n\r\n }", "title": "" }, { "docid": "42274bfce951cfa2bdee0143cf9f6db3", "score": "0.5983636", "text": "function inBounds () {\n if (player.x >= canvas.width) { \n player.x = canvas.width - 40;\n }\n else if (player.x <= 0) {\n player.x = 40;\n }\n if (player.y >= canvas.height) {\n player.y = canvas.height - 40;\n }\n else if (player.y <= 0) {\n player.y = 40;\n }\n\n if (object.x >= canvas.width) { \n object.x = canvas.width - 40;\n }\n else if (object.x <= 0) {\n object.x = 40;\n }\n if (object.y >= canvas.height) {\n object.y = canvas.height - 40;\n }\n else if (object.y <= 0) {\n object.y = 40;\n }\n}", "title": "" }, { "docid": "abc9cf611f15455f3735086de22a9267", "score": "0.5983049", "text": "function PurpleRect(){\n NewRectangle.addImage(PUrectangle);\n NewRectangle.scale = 0.2;\n}", "title": "" }, { "docid": "21f402b92cf7e92ddeb0e46cebe0ac56", "score": "0.5978733", "text": "function WhiteRect(){\n NewRectangle.addImage(Wrectangle);\n NewRectangle.scale = 0.2;\n}", "title": "" }, { "docid": "88b4aaf728805bf7f9163314fb2c9f6f", "score": "0.5961373", "text": "function Rectangles(a, b){\n this.a = a;\n this.b = b;\n}", "title": "" }, { "docid": "278148d8f7748c774b0e10644b6b7ab7", "score": "0.59592044", "text": "function Game_Obj()\r\n{\r\n\r\n\tthis.y = 0;\r\n\tthis.x = 0;\r\n\tthis.set_random_color();\r\n\tthis.set_random_data();\r\n\tthis.height = this.data.length;\r\n\tthis.width = this.data[0].length;\r\n}", "title": "" }, { "docid": "d5ddfc69027a27ba5c893e4c363b6129", "score": "0.59451896", "text": "function init() {\n game.stage = new easel.Stage(CanvasConfig.ID);\n\n Ticker.start(game.stage, collisionDetection);\n createBoard();\n }", "title": "" }, { "docid": "4821f69bdf74629ee926c75b6f062a71", "score": "0.59450924", "text": "function initLogicalGround() {\r\n\t\tfor (var i = 0; i < GRIDSIZE ; i++) \r\n\t\t\tfor (var j = 0; j < GRIDSIZE ; j++) \r\n\t\t\t\tUNDERSIDE[i][j] = GRID_GROUND; \r\n\t}", "title": "" }, { "docid": "7d894f9025cf3505c334567256ca7441", "score": "0.59353983", "text": "function initGame(){\n\n bg1X = 0;\n bg2X = 0;\n score = 0;\n $('.score').html(score + ' PTS');\n\n $('.container').css({'background-color':'rgb(255, 255, 255, 0)'});\n $('.gameSpace').show();\n $('.infosLayer').show();\n $('.overlay').css({'opacity':0});\n $('.overlay h2').css({'top':'600px'});\n $('.winner').css({'opacity':0});\n $('.winner h2').css({'top':'620px'});\n\n $('.level').stop();\n $('.level').css({'width':'100%', 'opacity':1});\n $('.level').removeClass('level1').removeClass('level2').removeClass('level3').removeClass('level0');\n $('.level').addClass('level4');\n\n myShip.ship.css({'background-position-y':-750});\n myShip.posY = 225;\n myShip.posX = -150;\n // myShip.ship.css({'top':'225px'});\n $('.spaceship').css({'top':'225px'});\n myShip.ship.css({'left':'-150px'});\n myShip.ship.removeClass('power');\n myShip.health = 4;\n myShip.power = 0;\n\n ammunitions.forEach(function(oneShot){\n oneShot.strenght = 10;\n });\n\n $('.shot').css({'display':'none', 'width':'10px', 'height':'4px'}).addClass('armed');\n\n superPower = 0;\n\n bossInvincible = true;\n\n $('.boss').css({'display':'none', 'left':'1000px', 'top':'-250px'});\n $('.boss').css({'background-position-y':'-1250px', 'background-position-x':'0px'});\n $('.boss .eye').css({'display':'none'});\n boss.posX = 1000;\n boss.posY = -250;\n boss.health = 200;\n\n $('.powerBar').css({'display':'none'});\n}", "title": "" }, { "docid": "0766c0a561ebc6bc471010a1a4d8aad0", "score": "0.592784", "text": "function initScreen() {\n canvas = document.getElementById('myCanvas');\n context = canvas.getContext('2d');\n\n context.fillStyle = \"#000000\";\n context.fillRect(0, 0, 800, 600);\n\n rects = [\n {id: 1, x: 50, y: 50, w: 220, h: 240, color: \"\"},\n {id: 2, x: 290, y: 50, w: 220, h: 240, color: \"\"},\n {id: 3, x: 530, y: 50, w: 220, h: 240, color: \"\"},\n {id: 4, x: 50, y: 310, w: 220, h: 240, color: \"\"},\n {id: 5, x: 290, y: 310, w: 220, h: 240, color: \"\"},\n {id: 6, x: 530, y: 310, w: 220, h: 240, color: \"\"}\n ];\n\n for (var i = 0, len = rects.length; i < len; i++) {\n context.fillStyle = rects[i].color;\n context.fillRect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);\n\n }\n\n canvas.addEventListener('click', function (e) {\n var mousePos = getMousePos(canvas, e);\n var rect = collides(rects, mousePos.x, mousePos.y);\n\n if (rect) {\n if (nullSlot[rect.id] == false) {\n heroIdSelected = rect.id;\n socket.emit('selectHero', {heroId: rect.id, email: email});\n } else {\n slotNumb = parseInt(rect.id);\n document.getElementById(\"createHero\").style.display = \"block\";\n }\n }\n }, false);\n}", "title": "" }, { "docid": "4aebcb6909cd0a2bb57113873a99e883", "score": "0.5925058", "text": "constructor(valid, row, col, player) {\n this.valid = valid;\n this.row = row;\n this.col = col;\n this.player = player;\n }", "title": "" }, { "docid": "fcb05481ea365765bf20ffd0198f3bb0", "score": "0.5913373", "text": "function Rect(x2,y2,w,h) {\r\n ctx.beginPath();\r\n ctx.rect(x2,y2,w,h);\r\n ctx.closePath();\r\n ctx.fillStyle = \"red\";\r\n ctx.fill();\r\n}", "title": "" }, { "docid": "d86d88bd482322ff31dcf272ccd7d2e1", "score": "0.5910241", "text": "function avatarZone() {\n fill(\"#ead2f7\");\n rect(0,fieldHeight,width,height-fieldHeight);\n}", "title": "" }, { "docid": "fdd1e660e18440a59b2b26c5797ce4b3", "score": "0.5908242", "text": "function init() {\n\tplayer.x = player.width;\n\tplayer.y = (HEIGHT - player.height)/2;\n\tai.x = WIDTH - (player.width + ai.width);\n\tai.y = (HEIGHT - ai.height)/2;\n\tball.serve(1);\n}", "title": "" }, { "docid": "9858d3c7f9c613feb1cb0177509883f2", "score": "0.59026676", "text": "set FullRect(value) {}", "title": "" }, { "docid": "d55ded53d25accb69ee317fc80eaf838", "score": "0.5901645", "text": "hasCollRect(Rect,where){\n \n if (where==\"top\"){\n this.velocity=new Vector(this.velocity.x/4,-this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n this.origin = new Vector (this.origin.x,this.origin.y+this.radius);\n }else if (where==\"left\"){\n this.velocity=new Vector(-this.velocity.x/4,this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n this.origin = new Vector (this.origin.x-this.radius,this.origin.y);\n }else if (where==\"right\"){\n this.velocity=new Vector(-this.velocity.x/4,this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n this.origin = new Vector (this.origin.x+this.radius,this.origin.y);\n }else if (where==\"bot\"){\n this.velocity=new Vector(this.velocity.x/4,-this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n Rect.origin = new Vector (Rect.origin.x,Rect.origin.y+Rect.height/2);\n }else if (where==\"left-bot\"){\n this.velocity=new Vector(-this.velocity.x/4,-this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n Rect.origin = new Vector (Rect.origin.x,Rect.origin.y+Rect.height/2);\n this.origin = new Vector (this.origin.x+this.radius,this.origin.y+this.radius);\n }else if (where==\"right-bot\"){\n this.velocity=new Vector(-this.velocity.x/4,-this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n this.origin = new Vector (this.origin.x-this.radius,this.origin.y+this.radius);\n }else if (where==\"right-top\"){\n this.velocity=new Vector(-this.velocity.x/4,-this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n this.origin = new Vector (this.origin.x+this.radius,this.origin.y+this.radius);\n }else if (where==\"left-top\"){\n this.velocity=new Vector(-this.velocity.x/4,-this.velocity.y/4);\n Rect.velocity=Rect.velocity.add(Vector.ZERO.sub(this.velocity));\n this.origin = new Vector (this.origin.x-this.radius,this.origin.y+this.radius);\n }\n\n }", "title": "" }, { "docid": "dd2c59f11f9c7f35ff163f22cc377919", "score": "0.59006304", "text": "function CollisionBox() {\n\t\t//context.fillRect(background.x, 520, 2210, 80);\n\t\t//context.fillRect(background(2280), 520, 500, 80);\n\t}", "title": "" }, { "docid": "3f457be3904f66ecc3987aaf55ae6803", "score": "0.589543", "text": "function Rectangles(sideA, sideB) {\n this.sideA = sideA;\n this.sideB = sideB;\n}", "title": "" }, { "docid": "541c21107c2b026d628104c1ef36dbff", "score": "0.58938044", "text": "function setUp() {\n\t\tvar player = document.createElement(\"div\");\n\t\tplayer.id = \"player\";\n\t\tplayer.style.left = 350 + \"px\";\n\t\tplayer.style.top = 350 + \"px\";\n\t\tplayer.style.width = 10 + \"px\";\n\t\tplayer.style.height = 10 + \"px\";\n\t\tdocument.getElementById(\"game-area\").appendChild(player);\n//\t\tsetGrid();\n\t}", "title": "" }, { "docid": "da9c74e39328d40d261abf2334e393bd", "score": "0.5891245", "text": "function rect(x, y, w, h, mode) {\r\n if (mode === \"fill\") {\r\n ctx.fillRect(x, y, w, h);\r\n } else if(mode === \"stroke\"){\r\n ctx.strokeRect(x, y, w, h);\r\n }\r\n}", "title": "" }, { "docid": "93cbd6a6a96325302f7c6afe143d06e8", "score": "0.5891067", "text": "static rect(_c) {\r\n\t\tif(_c.c==undefined)\r\n\t\t\t_c.c = {}\r\n\t\t_c.c.dynamicShadow = false\r\n\t\treturn {\r\n\t\t\tp: _c,\r\n\t\t\tv: Renderable.rectVertices(),\r\n\t\t\tc: _c.c\r\n\t\t} \r\n\t}", "title": "" }, { "docid": "ffd635bb7de2ea8fda85c42dc78c2938", "score": "0.5890573", "text": "function initAllVars () {\r\n game.arena.Element.style.backgroundPositionY = game.arena.y + 'px';\r\n\r\n //ROCKET\r\n game.rocket.Element.style.left = game.rocket.x + 'px';\r\n game.rocket.Element.style.top = game.rocket.y + 'px';\r\n game.rocket.Element.style.width = game.rocket.width + 'px';\r\n}", "title": "" }, { "docid": "3d2b80ca2a071a19e715ec7750a295df", "score": "0.58765024", "text": "function rectangle(scene, args, s, t) {\n\n\tCGFobject.call(this,scene);\n\t\n\tthis.x_left = args[0];\n\tthis.y_top = args[1];\n\tthis.x_right = args[2];\n\tthis.y_bottom = args[3];\n\n\t// amplification factors\n\tthis.s = s || 1;\t\t\n\tthis.t = t || 1;\n\n\tthis.initBuffers();\n\n}", "title": "" }, { "docid": "c3ad457f2b695db1a4d921eae465cf75", "score": "0.58734345", "text": "function CreateGameBoard() {\n ctx.rect(canvas.width / bss, canvas.height / bss, canvas.width - (canvas.width / (bss / 2)), canvas.height - (canvas.height / (bss / 2)));\n ctx.fillStyle = '#CD8646';\n ctx.fill();\n ctx.lineWidth = 2;\n ctx.strokeStyle = \"#46444C\";\n\n var x = (Width / bss),\n y = (Height / bss);\n\n //vertical lines\t\n ctx.beginPath();\n ctx.moveTo(x, y);\n for (var i = 0; i < bs; i++) {\n ctx.moveTo(x, y);\n ctx.lineTo(x, Height - (Height / bss));\n x = x + (Width / bss);\n }\n ctx.closePath();\n ctx.stroke();\n\n x = (Width / bss);\n y = (Height / bss);\n\n //horizontal lines\t\n ctx.beginPath();\n ctx.moveTo(x, y);\n for (var i = 0; i < bs; i++) {\n ctx.moveTo(x, y);\n ctx.lineTo(Width - (Width / bss), y);\n y = y + (Height / bss);\n }\n ctx.closePath();\n ctx.stroke();\n}", "title": "" }, { "docid": "631a435776362378d5ad470d914032af", "score": "0.5867478", "text": "createPlayer() {\n\t\tif (this.player1Selction.index === 0) {\n\t\t\tthis.player1 = new Ryu(this.ctx, false);\n\t\t} else if (this.player1Selction.index === 1) {\n\t\t\tthis.player1 = new Ken(this.ctx, false);\n\t\t} else if (this.player1Selction.index === 2) {\n\t\t\tthis.player1 = new Chun(this.ctx, false);\n\t\t}\n\n\t\tif (this.player2Selction.index === 0) {\n\t\t\tthis.player2 = new Ryu(this.ctx, true);\n\t\t} else if (this.player2Selction.index === 1) {\n\t\t\tthis.player2 = new Ken(this.ctx, true);\n\t\t} else if (this.player2Selction.index === 2) {\n\t\t\tthis.player2 = new Chun(this.ctx, true);\n\t\t}\n\t}", "title": "" }, { "docid": "8335a5d250779e4a2ed9a35e3c9295cb", "score": "0.58630586", "text": "function init() {\n canvas = document.getElementById(\"mycanvas\");\n\n //variables with not any data type are global variables\n\n W = canvas.width = 500;\n H = canvas.height = 500;\n\n //canvas is used to draw graphics\n\n pen = canvas.getContext('2d');\n\n //by pen we can draw something on the canvas\n\n rect = {\n x: 20,\n y: 20,\n w: 40,\n h: 40,\n speed: 10\n }\n}", "title": "" }, { "docid": "7d6d146f03f8b312781b50c883b7db39", "score": "0.5859714", "text": "function rect(x, y, w, h) { // rectangle factory\n\t ctx.beginPath();\n\t ctx.rect(x, y, w, h);\n\t ctx.closePath();\n\t ctx.fill();\n\t ctx.stroke();\n\t}", "title": "" }, { "docid": "573b8b6991ea5377ebc0f493bce9d96c", "score": "0.5858218", "text": "function Rect(x, y, w, h, color, strokeColor, strokeWidth) {\n //sets this specific rectangle to parameter properties\n this.type = \"rectangle\";\n this.x = x || 250;\n this.y = y || 250;\n this.width = w || 50;\n this.height = h || 50;\n this.color = color || \"rgba(0, 0, 0, 1)\";\n this.strokeColor = strokeColor || \"rgba(0, 0, 0, 0)\";\n this.strokeWidth = strokeWidth || 0;\n this.rotation = 0;\n //add to objects to be drawn\n objects.push(this);\n //adds rect to canvas\n this.add = function() {\n //translate and rotate the drawing context\n ctx.save();\n ctx.translate(this.x + this.width / 2, this.y + this.height / 2);\n ctx.rotate(this.rotation * Math.PI / 180);\n ctx.translate(-this.x - this.width / 2, -this.y - this.height / 2);\n //draw the filled rectangle\n ctx.fillStyle = this.color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n //draw the strokes\n ctx.strokeStyle = this.strokeColor;\n ctx.lineWidth = this.strokeWidth;\n ctx.strokeRect(this.x, this.y, this.width, this.height);\n ctx.restore();\n }\n //moves gameobject certain amount\n this.move = function (speedX, speedY) {\n this.x += speedX || 0;\n this.y += speedY || 0;\n this.add();\n }\n //gets user input degrees, rotates the drawing context to certain degrees, moves it to the center point of object, and draws\n this.rotate = function (degrees) {\n this.rotation += degrees || 0;\n this.add();\n }\n //scales gameobject, giving it a new width and height. shortcut for making it new, or can directly modify width and height\n this.scale = function (newWidth, newHeight) {\n this.width = newWidth || this.width;\n this.height = newHeight || this.height;\n this.add();\n }\n}", "title": "" }, { "docid": "8806a6b04ba0fcaf67c2f98583344df3", "score": "0.5853782", "text": "function rect(x, y, w, h) {\r\n ctx.beginPath();\r\n ctx.rect(x, y, w, h);\r\n ctx.strokeStyle =\"black\";\r\n ctx.closePath();\r\n ctx.fill();\r\n}", "title": "" }, { "docid": "f021ddb5a3f2cc69f76be49c50e9a512", "score": "0.5840408", "text": "show(){\r\n\r\n //fill(50, 255, 75);\r\n fill(this.color);\r\n rect(this.x, 0, this.width, this.ytop);\r\n rect(this.x, this.ybottom, this.width, height - this.ybottom);\r\n\r\n }", "title": "" }, { "docid": "dbcce497f45958db671bcddda8fd3980", "score": "0.58384997", "text": "backgroundRect(x, y, w, h){\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.fillStyle = \"rgb(0,103,23)\";\n ctx.fill(); \n }", "title": "" }, { "docid": "d1db6d69f80ea84f451ea4b3390a4071", "score": "0.5836925", "text": "function Rectangles(a, b) {\n this.a = a;\n this.b = b;\n}", "title": "" }, { "docid": "42458639472d01c222b812196adb6eee", "score": "0.5828054", "text": "function initPlayer(){\n player = { \n x: 1,\n y: 1\n }\n world_status.player = player;\n\n player = world.selectAll('g.player').data([world_status.player])\n .enter()\n .append('g')\n .classed('player', true)\n .attr('transform', d => 'translate(' + (d.x-1) * SQUARE_SIZE + ',' + (4-d.y) * SQUARE_SIZE + ')');\n\n player.append('circle')\n .attr('cx', SQUARE_SIZE / 2)\n .attr('cy', SQUARE_SIZE / 2)\n .attr('r', 10)\n .classed('player', true)\n }", "title": "" }, { "docid": "c04787dc6254719b6e7fab9a57e59ce4", "score": "0.58178824", "text": "_createRect(rectId, x, y){\n let curRect = document.createElement('div');\n \n curRect.setAttribute('id', rectId);\n curRect.setAttribute('class', 'rect');\n \n curRect.style.left = CONSTANTS.RECT_WIDTH * x + 'px';\n curRect.style.top = y * CONSTANTS.RECT_HEIGHT + 'px';\n \n document.getElementById(\"canvas-id\").append(curRect);\n return curRect;\n }", "title": "" }, { "docid": "c68cecd4b6df6c6c5d19f02a84c408fb", "score": "0.581658", "text": "function Rectangle(options ={}) {\n this.top = options.top || 0,\n this.left = options.left || 0,\n this.width = options.width || 0,\n this.height = options.left || 0,\n\n this.getArea = function(){\n \n }\n}", "title": "" }, { "docid": "4c913f6aca0907aa7a2b3e6d2e8d4894", "score": "0.5812624", "text": "function drawRect(xx,yy,type){\n\tvar game_context = game_canvas.getContext(\"2d\");\n\tgame_context.fillStyle = dotcolor[type];\n\tgame_context.fillRect(xx*bpix, yy*bpix, bpix, bpix);\n\tgame_context.fillStyle = dotcolor[SNAKE]; //reset color to SNAKE\n}", "title": "" }, { "docid": "048660a9de34f38c9824d79f98fe7718", "score": "0.5802154", "text": "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.color = 'grey';\n this.player = 0;\n this.size = 8;\n this.edges = [];\n this.liberty = false;\n this.owned = -1;\n }", "title": "" }, { "docid": "2c6ae2649819245ba452bbeb0ff6e9f3", "score": "0.5801829", "text": "function getCurrentPlayerPositions()\n{\n playerRectangles = \"\";\n players.forEach( function(i)\n {\n playerRectangles += \"<rect x='\" + i.x + \"' y='\" + i.y + \"' width='50' height='50' fill='\" + i.color + \"' id='\" + i.id + \"'/>\";\n });\n return playerRectangles;\n}", "title": "" }, { "docid": "25b1751eca2c022b62165501ebc0bec7", "score": "0.58000904", "text": "function initObjects() {\n player.x = player.width;\n player.y = (HEIGHT - player.height)/2;\n ai.x = WIDTH - (player.width + ai.width);\n ai.y = (HEIGHT - ai.height)/2;\n ball.serve(1);\n }", "title": "" }, { "docid": "856ddefd3b560d400a70c4cc15b8802a", "score": "0.5799233", "text": "init() {\n /**\n * Game stage\n * @protected\n * @type {Stage}\n */\n this.stage = (new UnderStageParser().parse(`src/res/stage/map1.json`, Screen.it.width, Screen.it.height));\n\n /**\n * Game player\n * @protected\n * @type {Player}\n */\n this.player = this.stage.getEntities().filter((it) => it instanceof Player)[0];\n\n // initialize layer\n this.layers.length = 0;\n this.layers.push(new DebugLayer(this.stage));\n this.layers.push(new UILayer(this.player));\n /**\n * Whether the game is over\n * @protected\n * @type {bool}\n */\n this.gameover = false;\n }", "title": "" }, { "docid": "c5682a4e8f92ccc42e157e4276205f34", "score": "0.5797765", "text": "function initializeBoard () {\n canvasObj = $('#gameCanvas');\n cState = new CanvasState(canvasObj[0]);\n\n resetBoard();\n}", "title": "" }, { "docid": "efa6b70a5c0dfa74543980d2586ea27b", "score": "0.5791988", "text": "function Rectangle() {\n var _this = _super.call(this) || this;\n _this.className = \"Rectangle\";\n _this.element = _this.paper.add(\"rect\");\n //this.pixelPerfect = false;\n _this.applyTheme();\n return _this;\n }", "title": "" }, { "docid": "69fa1676506d113fcab0d97336589713", "score": "0.57882804", "text": "initScene() {\n // sprites to draw\n this.sprites = [];\n this.sprites.push(new Player(this.ctx));\n }", "title": "" }, { "docid": "9a0b26205bf04c2c864c8da28489ff44", "score": "0.5786771", "text": "constructor() {\n this.rowStep = 83; //values for x/y coor taken from engine where it specifies col=101, row =83 *MOVES ALONG Y AXIS (UP/DOWN)\n this.colStep = 101; //step over columns on x-axis, step up and down row on y-axis *MOVES ALONG X AXIS (RIGHT/LEFT)\n this.startY = (this.rowStep * 4) + 55; //moves player 5 rows down, -20 adds padding to help center the player\n this.startX = (this.colStep * 2); //moves player 2 columns to the right\n this.x = this.startX; //puts player at bottom center of game, will use in our reset method later\n this.y = this.startY;\n this.sprite = 'images/char-boy.png';\n this.winGame = false; //initially false when object created, will switch to true when conditions met inside update() method\n }", "title": "" }, { "docid": "571797f8ab938a78e52d7fd5a4171221", "score": "0.5777137", "text": "function init(e) {\n size = e.target.id;\n gameOver = false;\n\n styleGameBoard(size);\n createGameBoardDivs(size);\n createGameBoardArray(size);\n}", "title": "" }, { "docid": "a028130d10bc6361bdc0b1a808f5db44", "score": "0.5771894", "text": "function rectObj(w,h, id){\n this.x = random(width);\n this.y = random(height);\n this.w = w;\n this.h = h;\n this.id = id;\n this.hit = true;\n this.mouse = true;\n this.a=random(0,20);\n\n this.stroke=color(255);\n\n\n\n this.place = function(objArray){\n\n for(i=0;i<objArray.length;i++){\n if(this.id != i){ \n\n //detect the collide between each rectangle\n this.hit = collideRectRect(this.x, this.y, this.w,this.h, objArray[i].x, objArray[i].y, objArray[i].w,objArray[i].h); //colliding with anything?\n \n //detect if mouse is over the rectangle\n this.mouse = collidePointRect(mouseX,mouseY,this.x, this.y, this.w,this.h);\n\n //if collide is true, change the position to another random value, \n //means generate a new one on the screen\n if(this.hit == true){ \n this.x=random(500);\n this.y =random(500);\n\n }\n\n //if mouse is over the rectangle\n if(this.mouse == true){ \n //increase the size, and change the colour\n this.w+=0.02;\n this.h+=0.02;\n this.color='yellow';\n\n }else{ this.color=color(250,150);\n this.stroke=color(255);\n\n }\n\n\n\n }\n }\n }\n\n//display function\n this.disp = function(){\n\n stroke(this.stroke);\n rectMode(CORNER);\n fill(this.color);\n\n // add the fifth parameter to control the corner radius: translate the rectangle to circle\n rect(this.x,this.y,this.w,this.h,cor);\n \n \n \n\n }\n\n}", "title": "" }, { "docid": "81b4549d815a6f6f8fc3fb808a0972c8", "score": "0.57718796", "text": "_initPrivateVars() {\r\n [this._width, this._height] = [Graphics.width, Graphics.height];\r\n this._sprites = [];\r\n }", "title": "" }, { "docid": "2f59705ede41ee257db911364c2966ce", "score": "0.5768434", "text": "function rect(x, y, w, h) {\n context.beginPath();\n context.rect(x, y, w, h);\n context.fill();\n}", "title": "" }, { "docid": "2f59705ede41ee257db911364c2966ce", "score": "0.5768434", "text": "function rect(x, y, w, h) {\n context.beginPath();\n context.rect(x, y, w, h);\n context.fill();\n}", "title": "" }, { "docid": "c7482b659d48b2132b89678fe8d03f3d", "score": "0.57668346", "text": "function mapRect(x, y, width, height, properties) { //addes reactangles to map array\n map[map.length] = Bodies.rectangle(x + width / 2, y + height / 2, width, height, properties);\n }", "title": "" }, { "docid": "e173a3ff22ed26a8a8ffc23ef22b1e70", "score": "0.5766653", "text": "get FullRect() {}", "title": "" }, { "docid": "303054681fa3ad733f994b6365ccc634", "score": "0.57649374", "text": "draw() {\n rect(this.left, this.top, this.width, this.height);\n }", "title": "" }, { "docid": "901895b6af54304baae4b4b64f72a583", "score": "0.57617664", "text": "function Rect(x, y, width, height) {\n this._x = x;\n this._y = y;\n this._width = width;\n this._height = height;\n }", "title": "" }, { "docid": "e29ce4effc3af4a753f8b7aba86c5cca", "score": "0.5759521", "text": "setRect(rect) {\n this.setAttr('x', rect.p.x);\n this.setAttr('y', rect.p.y);\n this.setAttr('width', rect.w);\n this.setAttr('height', rect.h);\n }", "title": "" }, { "docid": "da23ef4babf374781344ddc193d283f9", "score": "0.5759066", "text": "resetPlayer() {\n this.x = 200;\n this.y = 400;\n playerPos.collision = false;\n }", "title": "" }, { "docid": "915fecbc0051c32281356fa699e1aae1", "score": "0.57585645", "text": "function initGame() {\n gLevel = {\n Size: 4,\n Mines: 2\n }\n gBoard = buildBoard()\n renderBoard(gBoard)\n updateLife(0)\n renderScore()\n gGame.isOn = true\n}", "title": "" }, { "docid": "0f7df64fc6c05fe2b071b1f1cfa5ec58", "score": "0.575572", "text": "function initGame() {\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n renderLives();\r\n renderHints();\r\n\r\n}", "title": "" }, { "docid": "51231383643deffa8504de6078493345", "score": "0.57553494", "text": "function init_team()\n{\n\t// Resize\n\tresize_team();\n}", "title": "" }, { "docid": "1f0c46c05473f5a833dd6ade350c5921", "score": "0.57414234", "text": "function BlueRect(){\n NewRectangle.addImage(Brectangle);\n NewRectangle.scale = 0.2;\n}", "title": "" }, { "docid": "b98293f1fb39f03e7e567dfe122a27a5", "score": "0.57401776", "text": "function drawRectangle(rect_name, x, y, width, height, alpha_val, cursor) {\n rect_name.graphics.beginFill(\"red\").drawRect(x, y, width, height);\n rect_name.alpha = alpha_val;\n rect_name.cursor = cursor;\n water_analysis_stage.addChild(rect_name);\n}", "title": "" }, { "docid": "415f473273f00a168556a74666ea3c3b", "score": "0.5738245", "text": "function YellowRect(){\n NewRectangle.addImage(Yrectangle);\n NewRectangle.scale = 0.2;\n}", "title": "" }, { "docid": "fac85b3895ee899020cec36319d7ff5e", "score": "0.57355934", "text": "init() {\n var docElement = document.createElementNS(this.xmlns, 'rect');\n if (this.id) {\n docElement.setAttribute('id', this.id);\n }\n if (this.cssClass) {\n docElement.setAttribute('class', this.cssClass);\n }\n if (this.x) {\n docElement.setAttribute('x', this.x);\n }\n if (this.y) {\n docElement.setAttribute('y', this.y);\n }\n if (this.width) {\n docElement.setAttribute('width', this.width);\n }\n if (this.height) {\n docElement.setAttribute('height', this.height);\n }\n if (this.fill) {\n docElement.setAttribute('fill', this.fill);\n }\n if (this.opacity) {\n docElement.setAttribute('opacity', this.opacity);\n }\n if (this.stroke) {\n docElement.setAttribute('stroke', this.stroke);\n }\n if (this.strokeWidth) {\n docElement.setAttribute('stroke-width', this.strokeWidth);\n }\n if (this.onMouseOut) {\n docElement.setAttribute('onmouseout', this.onMouseOut);\n }\n if (this.onMouseOver) {\n docElement.setAttribute('onmouseover', this.onMouseOver);\n }\n if (this.onMouseDown) {\n docElement.setAttribute('onmousedown', this)\n }\n if (this.cursor) {\n docElement.setAttribute('style', 'cursor: ' + this.cursor + ';');\n }\n if (this.cornerRadius) {\n docElement.setAttribute('rx', this.cornerRadius);\n docElement.setAttribute('ry', this.cornerRadius);\n }\n docElement.setAttribute('title', 'this is a rectangle');\n this._docElementNS = docElement;\n if (this.children.length > 0) {\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (child.docElementNS) {\n this.docElementNS.appendChild(child.docElementNS);\n }\n }\n }\n if (this.autoBind) {\n this.bind();\n }\n }", "title": "" }, { "docid": "46dbe52c4c85fbc04c156bcb013be7db", "score": "0.57329345", "text": "function Rectangle() {\n var _this = _super.call(this) || this;\n\n _this.className = \"Rectangle\";\n _this.element = _this.paper.add(\"rect\"); //this.pixelPerfect = false;\n\n _this.applyTheme();\n\n return _this;\n }", "title": "" }, { "docid": "bbae166797dcca9b2d12db4596cc4478", "score": "0.57317054", "text": "function _addNewRectangle (left, top, fill, width, height) {\n var rect = new fabric.Rect({\n left: (left ? left : self.DropX),\n top: (top ? top : self.DropY),\n fill: (fill ? fill : self.CurrentSelectedColour),\n width: (width ? width : 50),\n height: (height ? height : 50),\n lockScalingX: true,\n lockScalingY: true,\n lockRotation: true\n });\n _drawObjectOnCanvas(rect); \n }", "title": "" }, { "docid": "c78ae06282318102fd391fb2ccefd37d", "score": "0.5725693", "text": "function Rect(Height, Width){\n this.xx = new Vector3(Height/2, Width/2, 0);\n this.xy = new Vector3(Height/2, -Width/2, 0);\n this.yy = new Vector3(-Height/2, -Width/2, 0);\n this.yx = new Vector3(-Height/2, Width/2, 0);\n}", "title": "" } ]
32d685c3c103c6a503c7a339a55352db
Hard coded function to return list of tables with records
[ { "docid": "6cd03ec3d58f8f11f47794633e979f79", "score": "0.55612105", "text": "getTablesWithData(){\n\treturn this.query(\"CREATE TABLE #temp (table_name sysname, row_count INT, reserved_size VARCHAR(50), data_size VARCHAR(50), index_size VARCHAR(50), unused_size VARCHAR(50)) SET NOCOUNT ON INSERT #temp EXEC sp_msforeachtable 'sp_spaceused ''?''' SELECT a.table_name, a.row_count, COUNT(*) AS col_count, a.data_size FROM #temp a INNER JOIN information_schema.columns b ON a.table_name collate database_default = b.table_name collate database_default WHERE a.row_count > 0 GROUP BY a.table_name, a.row_count, a.data_size ORDER BY CAST(REPLACE(a.data_size, ' KB', '') AS integer) DESC DROP TABLE #temp;\") \n }", "title": "" } ]
[ { "docid": "2ca4c94f2d94ab8b56ababa74886d3d2", "score": "0.6917445", "text": "itemsList(tableName){\n\t\ttableName = this.idCorrection(tableName);\n\t\tvar res = {isPresent: false, table: []};\n\t\tlet index = this.globalTables.search(tableName);\n\t\tif (index!=-1){\n\t\t\tres.isPresent = true;\t\t\t\n\t\t\tres.table = this.globalTables[index];\n\t\t}\n\t\treturn res;\n\t}", "title": "" }, { "docid": "2967c6da467762688eb8218140cb6abc", "score": "0.67877614", "text": "function list() {\n return db(tableName).select(\"*\").orderBy(\"table_name\");\n}", "title": "" }, { "docid": "2238a974b8e6c097874b50b45e3fb762", "score": "0.67768174", "text": "function getTables() {\n\n var tables = {\n\n 'Clients' : {\n query: 'SELECT ClientID, Title.Description as Title, Forename, Middlename, Surname, '\n + 'AddressLine1, AddressLine2, Town, Postcode, '\n + 'HomePhone, MobilePhone, EMail, isWheelchair, isActive, DateOfBirth '\n + 'FROM (Client LEFT OUTER JOIN Title ON Client.TitleID = Title.ID)',\n DateOnlyFields: {DateOfBirth: true},\n ChoiceOnlyFields: {Gender: ['M', 'F', 'X']}\n },\n 'Destinations' : {\n query: 'SELECT * FROM Destination'\n },\n 'DestinationType' : {},\n 'Drivers' : {\n query: 'SELECT * FROM Driver',\n DateOnlyFields: {DateOfBirth: true}\n },\n 'Jobs' : {}\n };\n \n for (var sTablename in tables) {\n\n if (tables[sTablename].query == undefined) {\n\n tables[sTablename].query = 'SELECT * from ' + sTablename;\n }\n }\n\n getTables = function() {\n return tables;\n };\n\n return tables;\n}", "title": "" }, { "docid": "9f0e74d12a37d163d142bb4738cdb689", "score": "0.65391123", "text": "tables() {\n\t\treturn this.db.raw( \"SELECT name FROM sqlite_master WHERE type='table'\", [] ).then( ( response ) => {\n\t\t\treturn response.map( ( value, index, array ) => {\n\t\t\t\treturn value[Object.keys( value )[0]];\n\t\t\t} );\n\t\t} ).then( ( tables ) => {\n\t\t\treturn Promise.all( tables.map( ( table, index, array ) => {\n\t\t\t\treturn this.fields( table )\n\t\t\t\t .then( ( fields ) => {\n\t\t\t\t\t return {\n\t\t\t\t\t\t name: table,\n\t\t\t\t\t\t fields: fields\n\t\t\t\t\t };\n\t\t\t\t } );\n\t\t\t} ) ).then( ( models ) => {\n\t\t\t\tlet fields = new Map();\n\n\t\t\t\tmodels.forEach( ( value, index, array ) => {\n\t\t\t\t\tfields.set( value.name, new ModelFields( value.fields ) );\n\t\t\t\t} );\n\n\t\t\t\treturn fields;\n\t\t\t} );\n\t\t} );\n\t}", "title": "" }, { "docid": "8a3fc788bf04b98753e89a7801a698c5", "score": "0.6498293", "text": "function list(){\n return knex(\"tables\")\n .select(\"*\")\n .orderBy(\"table_name\")\n}", "title": "" }, { "docid": "29d9232dd043bff19886c83e472839af", "score": "0.64250576", "text": "function list_tables()\n{\n var tables = FusionTables.Table.list();\n var result_HTML = \"\";\n var table = \"\";\n if (tables.items)\n {\n for (var i = 0; i < tables.items.length; i++)\n {\n table = tables.items[i];\n result_HTML += \" <strong>Table ID:</strong>&nbsp;&nbsp;&nbsp;\" + table.tableId\n + \" &nbsp;&nbsp;&nbsp;<strong>Table name:</strong>&nbsp;&nbsp;&nbsp;\" + table.name + \"<br>\";\n }\n }\n else\n {\n Logger.log('No tables found.');\n }\n return result_HTML;\n}", "title": "" }, { "docid": "034358e343b833816059b208f9487be8", "score": "0.6395856", "text": "function tables(callback) {\n db.transaction(function (tx) {\n executeSqlLog(tx, \"select distinct(table_name) from schema\", function(tx, results) {\n var tables = [];\n for (i = 0; i < results.rows.length; i++) {\n var row = results.rows.item(i);\n tables.push(row.table_name);\n }\n callback(tables); \n });\n });\n }", "title": "" }, { "docid": "39d03789d709fe6d2c603e02559d4a83", "score": "0.63798434", "text": "function gettable()\n{\n return table;\n}", "title": "" }, { "docid": "4d67d40741a623c0b050f9a8174f61e4", "score": "0.6287095", "text": "fetchTablesList() {\n return Api().get('table/fetchList')\n .then(res => res.data.tablesList)\n .catch(err => console.log('createTable err:', err));\n }", "title": "" }, { "docid": "b1e004859d370a25de702ac63c82267b", "score": "0.61910343", "text": "function showRecords (records) {\n var origRecords = records // needs to be returned to the promise chain\n if (!showRawRecords || !records || !records.length) {\n return origRecords\n }\n\n const ellipsis = false\n const howMany = 3\n if (ellipsis && records.length > (howMany * 2)) {\n var dotdotdot = blankedObject(records[0], '.')\n records = records.slice(0, howMany).concat(dotdotdot, records.slice(-howMany))\n }\n\n var table = newTable(['stamp', 'host', 'user', 'type', 'md5'])\n records.forEach(function (r) {\n var record = [r.stamp, r.host, r.user, r.type, r.md5]\n table.push(record)\n })\n console.log(table.toString())\n return origRecords\n}", "title": "" }, { "docid": "3589eb9321fe30664ba6149885e68b22", "score": "0.6188199", "text": "function list(){\n return knex(table).select(\"*\")\n}", "title": "" }, { "docid": "484db5631c3b3f358470db0cd19ff49a", "score": "0.61225796", "text": "getAllTables() {\n return this.execute('SHOW TABLES;').map(item => item[Object.keys(item)[0]]);\n }", "title": "" }, { "docid": "e1f9f4c764c00b2b5cbb5c4ab7e98438", "score": "0.610816", "text": "getTable(table, baseId = this.defaultBaseId, apiKey = this.defaultApiKey) {\n // ensure existence of airtable connection to base\n const base = this.getOrConnect(baseId, apiKey);\n if (base == null) {\n return;\n }\n\n let response = [];\n return base(table)\n .select()\n .eachPage(function page(records, fetchNextPage) {\n // This function (`page`) will get called for each page of records.\n records.forEach(function(record) {\n // attach json array with record fields and id to response\n record.fields.id = record.id;\n response.push(record.fields);\n });\n fetchNextPage();\n })\n .then(() => {\n return response;\n });\n }", "title": "" }, { "docid": "f072f6314503a420ef4ea5facfb1a987", "score": "0.60499597", "text": "function getAllTables(rawData) {\n\tvar result =\n\t\t$('<div>')\n\t\t.addClass('filter-allTables')\n\t\t.append(\n\t\t\trawData.find('font font > table')\n\t\t);\n\treturn result;\n}", "title": "" }, { "docid": "75939a6ea3d8c000f6dfb420688c2a54", "score": "0.60430354", "text": "function printCreateTableQueries() {\n for (table in model) {\n query = getCreateTableQuery(table)\n console.log(query)\n }\n}", "title": "" }, { "docid": "ce15692a7027b48ee3254f15f4db4094", "score": "0.602949", "text": "getTables() {\n return this.root.getChain().map(node => node.table).filter(table => table);\n }", "title": "" }, { "docid": "a1116f7040388eb7d150c8e07fcab0dc", "score": "0.6021594", "text": "function getTablesForCustomer() {\n var nrOfTables = getNumTables();\n\n for (let i = 0; i < nrOfTables; i++) {\n //var table = getTableByIndex(i);\n var listElem = document.createElement('div');\n var listElemContent = `\n <li>\n <a href=\"#\" id=\"table-${i}\" onclick=\"customersTable(${i})\">Table ${i + 1}</a>\n </li>`\n listElem.innerHTML = listElemContent;\n var list = document.getElementsByClassName('pick-table-menu-list')[0];\n list.append(listElem);\n }\n\n customersTable(0); //TODO: change to activeTable-element? Shouldn't be here?\n}", "title": "" }, { "docid": "b397fc894c05b2c3c93688e59db8cf60", "score": "0.5998436", "text": "function get_table_info() {\n ;\n}", "title": "" }, { "docid": "55a92257a55368ce07e4a99174930574", "score": "0.5968659", "text": "function showall()\n {\n displayedTable = {}\n for (var key in tables) {\n if (tables.hasOwnProperty(key)) {\n displayedTable[key] = tables[key]\n }\n }\n displayedLoadedTables = {}\n for(var item in loadedTables){\n if(loadedTables.hasOwnProperty(item)){\n displayedLoadedTables[item] = loadedTables[item]\n }\n }\n displayTable(displayedTable, displayedLoadedTables)\n }", "title": "" }, { "docid": "e593f261e3f8b4f632009d01716f3f9c", "score": "0.5944904", "text": "function listRecordsFromAirtable(settings, tableName, maxRecords) {\n tableName = tableName || settings.tableName;\n maxRecords = maxRecords || 1200;\n \n // Airtable API reference:\n var apiDocUrl = 'https://airtable.com/' +settings.appId+ '/api/docs#curl/table:'+tableName+':create';\n\n // Make a POST request with a JSON payload.\n var options = {\n 'muteHttpExceptions': true,\n 'method': 'GET',\n 'headers': {\n 'Authorization': \"Bearer \" + settings.apiKey, \n 'Content-Type': 'application/json'\n },\n };\n \n var tableUrl = 'https://api.airtable.com/v0/'+settings.appId+'/'+tableName\n +'?maxRecords='+maxRecords+'&view=Grid%20view';\n var response = JSON.parse(UrlFetchApp.fetch(tableUrl, options).getContentText());\n Logger.log(tableUrl);\n \n // success\n if (response.hasOwnProperty(\"records\")) {\n return response.records;\n }\n \n // failure\n if (response.hasOwnProperty(\"error\")) {\n throw response.error;\n }\n\n // failure?\n return null;\n}", "title": "" }, { "docid": "32e2ae4e7acff6e6b5b673f93059457a", "score": "0.5918586", "text": "function _getFields(pTable) {\n\t\ttry {\n\t\t\t//Variable to keep query statement \n\t\t\tvar lvQuery = 'SELECT * FROM \"' + gvVATSchemaName + '\".\"' + gvMappingTableName + '\"';\n\t\t\tvar lvQuery = lvQuery + ' WHERE \"OUT_TABLE\" = ' + \"'\" + pTable + \"'\";\n\n\t\t\t//Connect to the Database and execute the query\n\t\t\tvar oConnection = $.db.getConnection();\n\t\t\tvar oStatement = oConnection.prepareStatement(lvQuery);\n\t\t\toStatement.execute();\n\t\t\tvar oResultSet = oStatement.getResultSet();\n\t\t\tvar oResult = {\n\t\t\t\trecords: []\n\t\t\t};\n\t\t\twhile (oResultSet.next()) {\n\n\t\t\t\tvar record = {\n\t\t\t\t\tIN_TABLE: oResultSet.getString(1),\n\t\t\t\t\tIN_FIELD: oResultSet.getString(2),\n\t\t\t\t\tIN_TABLE2: oResultSet.getString(3),\n\t\t\t\t\tIN_FIELD2: oResultSet.getString(4),\n\t\t\t\t\tIN_TABLE3: oResultSet.getString(5),\n\t\t\t\t\tIN_FIELD3: oResultSet.getString(6),\n\t\t\t\t\tIN_TABLE4: oResultSet.getString(7),\n\t\t\t\t\tIN_FIELD4: oResultSet.getString(8),\n\t\t\t\t\tIN_TABLE5: oResultSet.getString(9),\n\t\t\t\t\tIN_FIELD5: oResultSet.getString(10),\n\t\t\t\t\tIN_TABLE_ALIAS: oResultSet.getString(11),\n\t\t\t\t\tOUT_TABLE: oResultSet.getString(12),\n\t\t\t\t\tOUT_FIELD: oResultSet.getString(13),\n\t\t\t\t\tOUT_TABLE_ALIAS: oResultSet.getString(14),\n\t\t\t\t\tMANDATORY: oResultSet.getString(15),\n\t\t\t\t\tRULE: oResultSet.getString(16)\n\t\t\t\t};\n\t\t\t\toResult.records.push(record);\n\t\t\t\trecord = \"\";\n\t\t\t}\n\n\t\t\toResultSet.close();\n\t\t\toStatement.close();\n\t\t\toConnection.close();\n\n\t\t\t//Return the result\n\t\t\treturn oResult.records;\n\n\t\t} catch (errorObj) {\n\t\t\tgvErrorMessage = errorObj.message;\n\t\t\tif (oStatement !== null) {\n\t\t\t\toStatement.close();\n\t\t\t}\n\t\t\tif (oConnection !== null) {\n\t\t\t\toConnection.close();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "11d42b1696a015b5b4fed579461eaf20", "score": "0.59162813", "text": "function showItems(displaytable){\n let table=new Table({\n head:[\"id\",\"product\",\"department\",\"price\",\"quantity\"]\n });\n connection.query(\"SELECT * FROM Products\",function(err,res){\n if(err) throw err;\n for (let i=0;i<res.length; i++){\n table.push([res[i].id,res[i].product,res[i].department,res[i].price,res[i].quantity]);\n }\n console.log(table.toString());\n displaytable();\n });\n}", "title": "" }, { "docid": "02e4357487df117c4130400eadc0adb7", "score": "0.5910303", "text": "getTableNames(){\n return this.query(\"SELECT name FROM sys.tables;\")\n }", "title": "" }, { "docid": "87b61c29ae4617654dfc659962b27d8d", "score": "0.5863519", "text": "function createListTableObject() {\n let allTableData = [];\n for (var i = 0; i < dateArr.length; i++) {\n allTableData.push({\n date: dateArr[i],\n listSM: listFromMod(daysDiff(dateArr[i]), \"SM\"),\n listDW: listFromMod(daysDiff(dateArr[i]), \"DW\"),\n listJW: listFromMod(daysDiff(dateArr[i]), \"JW\")\n });\n }\n return allTableData;\n}", "title": "" }, { "docid": "89ac7e47d495fdf60e644654e15406cd", "score": "0.58435875", "text": "function myTable() {\n connection.query('SELECT * FROM orders', (err, res) => {\n const myTable = [];\n\n res.forEach(element => {\n let newRow = {};\n newRow.id = element.id;\n newRow.name = element.name;\n newRow.price = element.price;\n newRow.stock_quantity = element.stock_quantity;\n myTable.push(newRow);\n });\n console.table(myTable);\n });\n \n start(); //moves on to the store questions\n}", "title": "" }, { "docid": "f6f1a99fc72a3c2d385f3653d47418ea", "score": "0.58094406", "text": "function getTables() {\n\n var deferred = $q.defer();\n\n checkService.getTables()\n .then(function(data) {\n deferred.resolve(data);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "141802c12ca378b2e51ae6fc754d66a0", "score": "0.5797838", "text": "getTables() {\n return this.content.tables;\n }", "title": "" }, { "docid": "de035663159d35e00d26b24565836797", "score": "0.57977945", "text": "function calculateTable() {\n // dump(\"calculateTable\\n\");\n\n // Find the types that we will display in the dropdown\n // list box, and associated objects of those types.\n\n var subjects, types;\n\n var s = discoverTypes(); subjects = s[0]; types = s[1]; // no [ ] on LHS\n\n for (var typeUrl in subjects) {\n // dump(\"calculateTable - typeUrl\"+typeUrl+\"\\n\");\n var subjectList = subjects[typeUrl];\n var type = types[typeUrl];\n\n identifyColumnsForType(type, subjectList);\n }\n\n // TODO: Special type that captures all rows.\n // Combine columns from all types\n\n var allType = new SubjectType(null);\n\n return [ allType, objectToArray(types) ];\n }", "title": "" }, { "docid": "a3bb8ae57b964c889d73c9e76996564d", "score": "0.5792818", "text": "function listItems(){\n var query=\"select * from products\"\n connection.query(query, function(err,res){\n if(err) throw err;\n //if no record found\n if(res.length<=0)\n {\n console.log(\"\\nNo Records found!!\\n\");\n }\n else\n {\n //Table object\n var table = new Table({\n head: ['Id', 'Product_name', 'price','stock_quantity']\n , colWidths: [4, 30, 10,20]\n });\n for(i=0;i<res.length;i++){\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price,res[i].stock_quantity]\n );\n }\n \n console.log(table.toString());\n \n }\n\n runSearch();\n });\n }", "title": "" }, { "docid": "2ea88ca53414976a0438dd5a3e10723b", "score": "0.5775452", "text": "function tableLibraryItems()\n\t\t{\n\t\t\tvar table = new Table(dom.library.items);\n\t\t\ttrace(table.render());\n\t\t}", "title": "" }, { "docid": "9567e690f0cdb3c7a60bd0042a008670", "score": "0.57129526", "text": "function show_items(){\n connection.query(\n 'SELECT * FROM product_list',function(err,res){\n var product_table = new table({\n head: ['ID','Product','Department','Price','Current Stock']\n });\n for(item in res){\n product_table.push(\n [res[item].id, res[item].product_name,res[item].department_name,res[item].price,res[item].stock_quantity]\n )\n }\n console.log(product_table.toString());\n connection.end();\n }\n )\n}", "title": "" }, { "docid": "003be8af579653ee6c99ce2c0456ca81", "score": "0.56972855", "text": "function showTodoRecord(){\n displayTable(generateTodoRecordArray().flat())\n}", "title": "" }, { "docid": "a34cf4ffa5fb40fab440e873f2b40755", "score": "0.56950915", "text": "function showTable() {\n\tmyDB.transaction(function(transaction) {\n\ttransaction.executeSql('SELECT * FROM patients_local', [], function (tx, results) {\n\t\tvar len = results.rows.length, i;\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tpatients[i] = {\"id\":results.rows.item(i).id, \"name\":results.rows.item(i).name, \"date\":results.rows.item(i).date, \"image\":results.rows.item(i).image};\n\t\t}\n\t\tdisplayList(patients);\n\t}, null);\n\t});\n}", "title": "" }, { "docid": "67dc91e9cfa86f65048a6fc63ab9bcde", "score": "0.5691848", "text": "function table(arr) {\n let lean = arr.map((doc) => doc.toObject());\n return console.table(lean);\n}", "title": "" }, { "docid": "578ab268a264d03e9342c651cb977a73", "score": "0.5682075", "text": "findAllRecords(err, success) {\n tables[table].findAll({\n include: [{\n all: true,\n nested: true,\n }],\n }).then(success).catch(err);\n\n log(null, __filename,\n 'Model CRUD',\n 'Find all records');\n }", "title": "" }, { "docid": "f515a28500bddbfd368925261dc3fe25", "score": "0.567392", "text": "listAll(cb){\n var q = \"SELECT * FROM `\" + conf.structureBucket + \"`\";\n this.bucket.query(N1qlQuery.fromString(q), (err, rows) => {\n cb(err, rows.map((x) => x[conf.structureBucket]));\n });\n }", "title": "" }, { "docid": "6fb7934d1a686dc705f5ea749d4ca628", "score": "0.56723046", "text": "function createTable(result) {\t\n\tfor (var i = 0; i < result.length; i++) {\n\t\ttable.push(\n\t [result[i].itemId, result[i].productName, result[i].departmentName, result[i].Price, result[i].stockQuantity]\n\t);\n}\t\nconsole.log(table.toString());\ncontinueOrEnd();\n}", "title": "" }, { "docid": "3a91a45d2a1ccf7c287af82c88296567", "score": "0.5670557", "text": "function viewDataAll(table) {\n console.log(\"view data all...\");\n db.transaction(function(transaction) {\n transaction.executeSql('SELECT * FROM '+table, [], function (tx, results) {\n var resLen = results.rows.length;\n console.log(\"table results=\"+JSON.stringify(results));\n for (i = 0; i < resLen; i++){\n console.log(\"id=\"+results.rows.item(i).id+\"-title=\"+results.rows.item(i).title+\"-desc=\"+results.rows.item(i).desc);\n $(\"#data-output\").append(\"<p>id=\"+results.rows.item(i).id+\" - title=\"+results.rows.item(i).title+\" - desc=\"+results.rows.item(i).desc)\n }\n }, null);\n });\n }", "title": "" }, { "docid": "35df378bd88183870e4f19637611e704", "score": "0.5658771", "text": "get_all_db_records_bin() {\n var res = [];\n res.push(this.get_record_bin());\n return res;\n }", "title": "" }, { "docid": "27b8fc0b1e3fa0dc88364ff64166e77c", "score": "0.5656151", "text": "function makeTable() {\n var queryfortable = \"Select * FROM products\";\n connection.query(queryfortable, function(error, results){\n if(error) throw error;\n var tableMaker = new Table ({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [10,25,20,10,20]\n });\n for(var i = 0; i < results.length; i++){\n tableMaker.push(\n [results[i].item_id,\n results[i].product_name,\n results[i].department_name, \n results[i].price,\n results[i].stock_quantity]\n );\n }\n console.log(tableMaker.toString());\n firstPrompt()\n })\n }", "title": "" }, { "docid": "610c5d71b14fb8d6fbb1a70fa1782386", "score": "0.56437314", "text": "function createTableFromList() {\n sortViewList();\n\n var newTable = document.createElement(\"table\");\n newTable.setAttribute(\"class\", \"display-items\");\n\n //create header\n var headerRow = createTableHeader();\n newTable.appendChild(headerRow);\n\n //create HTML of each Item, which takes one row\n itemViewList.forEach(function (item, index) {\n newTable.appendChild(createTableRowHTML(item));\n });\n return newTable;\n}", "title": "" }, { "docid": "2ba5e85492b8c77da39c0b482da8c2b0", "score": "0.5642677", "text": "function showTable(results) {\n var table = new Table();\n table.push([\n 'ID'.bgRed,\n 'Item Name'.bgRed,\n 'Department Name'.bgRed,\n 'Price'.bgRed,\n 'Stock Quantity'.bgRed]);\n results.forEach(function (row) {\n table.push([\n row.itemId,\n row.productName,\n row.departmentName,\n accounting.formatMoney(row.price),\n accounting.formatNumber(row.stockQuantity)\n ]);\n });\n console.log('' + table);\n}", "title": "" }, { "docid": "19b1d8aac7c1f7c62c393f56beae3478", "score": "0.56351155", "text": "function buildTable(){\n\n}", "title": "" }, { "docid": "c4d179e1bd35419b0a16f7e91a8464de", "score": "0.56233937", "text": "function getTable() {\n\n if (this.object) {\n var tbody = $('#gcodelist tbody');\n\n // clear table\n $(\"#gcodelist > tbody\").html(\"\");\n\n for (let i = 0; i < this.object.userData.lines.length; i++) {\n var line = this.object.userData.lines[i];\n\n if (line.args.origtext != '') {\n tbody.append('<tr><th scope=\"row\">' + (i + 1) + '</th><td>' + line.args.origtext + '</td></tr>');\n }\n }\n\n // set tableRows to the newly generated table rows\n tableRows = $('#gcodelist tbody tr');\n }\n}", "title": "" }, { "docid": "8da81feaf56b49693fd09660005c15c7", "score": "0.5605942", "text": "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with it\n // in this case we'll just loop through it and output the results to the console\n for (var i = 0; i < rs.rows.length; i++) {\n /* alert(JSON.stringify(rs.rows.item(i)));*/\n }\n }\n\n app.selectAllRecords(render);\n}", "title": "" }, { "docid": "8da81feaf56b49693fd09660005c15c7", "score": "0.5605942", "text": "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with it\n // in this case we'll just loop through it and output the results to the console\n for (var i = 0; i < rs.rows.length; i++) {\n /* alert(JSON.stringify(rs.rows.item(i)));*/\n }\n }\n\n app.selectAllRecords(render);\n}", "title": "" }, { "docid": "9e5b8138d3b2b9cd6c1c5b97de8a7c90", "score": "0.56044483", "text": "function getObjects() {\n var $result = {};\n $result.err = [];\n $result.arr = [];\n\n $container.find(\".object[data-static='0']\").each(function() {\n var $obj = $(this);\n var $o = {};\n $o.name = $.trim($obj.find(\".object-name\").val());\n $o.tableName = $.trim($obj.find(\".object-name\").attr(\"data-sqltable\"));\n $result.err.push(validate($o.name));\n \n var $records = [];\n var $table = $obj.find(\".object-table\");\n var $tbody = $table.find(\"tbody\");\n \n var n = \"\", t0 = 0, t1 = \"\", d = \"\", ai = false, pk = false;\n \n $tbody.find(\"tr\").each(function() {\n n = $.trim($(this).find(\".td-name\").text());\n $result.err.push(validate(n));\n \n var $s = $(this).find(\".sel-record-type option:selected\");\n var t0 = getInt($s.val());\n var t1 = $.trim($s.text());\n var d = $.trim($(this).find(\".td-default\").text());\n ai = $(this).find(\".sel-ai-class option:selected\").val() == \"1\";\n pk = $(this).find(\".sel-pk-class option:selected\").val() == \"1\";\n\n d = (t1.indexOf(\"<\") >= 0) ? t1 : d;\n\n d = (d.length === 0) ? returnDefault(t0, t1) : d;\n \n var btn = $(this).find(\".btn-object-ref\");\n var ref = {active: (btn.attr(\"data-ref\") == \"1\"), cls:btn.attr(\"data-class\"), field:btn.attr(\"data-field\")};\n \n $records.push({name: n, typeID:t0, typeName:t1, def:d, ref:ref, primaryKey:pk, autoIncrement:ai}); \n });\n \n $o.records = $records;\n \n $result.arr.push($o);\n \n });\n \n return $result;\n }", "title": "" }, { "docid": "f9b5dd4f461743acfcee328a3660d9f1", "score": "0.5602726", "text": "function fetchResultsTable(_x,_x2,_x3){return _fetchResultsTable.apply(this,arguments);}", "title": "" }, { "docid": "dbf2786d9c30b37226ae8c535e82731c", "score": "0.5579753", "text": "function showTables() {\n var connStr =\n 'jdbc:google:rdbms://' +\n 'elwarbito:chapter6/contacts',\n conn,\n stmt,\n rs,\n sql;\n sql = 'SHOW TABLES';\n conn = Jdbc.getCloudSqlConnection(connStr);\n stmt = conn.createStatement();\n rs = stmt.executeQuery(sql);\n while (rs.next()) {\n Logger.log(rs.getString(1));\n }\n rs.close();\n stmt.close();\n conn.close();\n}", "title": "" }, { "docid": "f6f46ef62d43d69f628529e4b2fbeb0b", "score": "0.5573774", "text": "async function findTableRecords(stream, numTables) {\n const tableMeta = {};\n for (let i = 0; i < numTables; i++) {\n const tag = await stream.read(4);\n const data = await stream.read(12);\n for (const [name, table] of Object.entries(tableInfo)) {\n if (tag.equals(table.tag)) {\n tableMeta[name] = {\n offset: data.readUInt32BE(4),\n length: data.readUInt32BE(8)\n };\n if (tableMeta.name && tableMeta.ltag && tableMeta.os2) {\n return tableMeta;\n }\n }\n }\n }\n return tableMeta;\n}", "title": "" }, { "docid": "11ee6f6f472722ffbb70efe239f38832", "score": "0.5565378", "text": "function selectAll(table) {\n return db.query('SELECT * FROM ??', [table]);\n}", "title": "" }, { "docid": "0ae69d82264a7e43f509722497000aef", "score": "0.5548758", "text": "function records_maker() {\n for (const key in Ledger) {\n const LedgerItems = Ledger[key];\n records.push({\n accountid: LedgerItems.AccountID,\n accounttype: LedgerItems.AccountType,\n initiatortype: LedgerItems.InitiatorType,\n datetime: LedgerItems.DateTime,\n transactionvalue: LedgerItems.TransactionValue\n })\n }\n }", "title": "" }, { "docid": "184d8d417829f35eae539092611843c1", "score": "0.5546601", "text": "function displayAll() {\n connection.query(\"SELECT id, product_name, price FROM products\", function(err, res){\n if (err) throw err;\n console.log(\"\");\n console.log(' WELCOME TO BAMAZON ');\n var table = new Table({\n head: ['Id', 'Product Description', 'Price'],\n colWidths: [5, 50, 7],\n colAligns: ['center', 'left', 'right'],\n style: {\n head: ['cyan'],\n compact: true\n }\n });\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].price]);\n }\n console.log(table.toString());\n // productId();\n }); //end connection to products\n}", "title": "" }, { "docid": "399ee2945e68d5e140e1bfd0a8a7ef1a", "score": "0.5530794", "text": "function departmentTable() { }", "title": "" }, { "docid": "a3e0a100fb53de7444e166f65c0a1a03", "score": "0.552633", "text": "function transactionTable() { }", "title": "" }, { "docid": "a640ed365ede1af377478e708eb4bb6e", "score": "0.55219376", "text": "function itemTable() { }", "title": "" }, { "docid": "99af05e13b5fd67c73a2704c72e3bb91", "score": "0.5515144", "text": "function showProducts() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n var table = new Table({\n head: [\"ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [4, 18, 17, 10, 7]\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push([\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(\"\\n\" + table.toString() + \"\\n\");\n });\n}", "title": "" }, { "docid": "3c99cbc278833174323fe44143f3e031", "score": "0.55146927", "text": "function createTempTables(client, tablePrefix) {\n return Object.keys(baseDatamodels).map(function (dataModelName) {\n var datamodel = baseDatamodels[dataModelName];\n return function () {\n return createTempTable(client, tablePrefix + datamodel.table, datamodel.table);\n };\n }).reduce(Q.when, Q.when(null));\n}", "title": "" }, { "docid": "ccd307ad535a4aeb52fd965c3d32f335", "score": "0.550856", "text": "getTabelasDeBancoDeDadosLinks() {\n let statement = this.statements['tabelasWiki'];\n\n return this._fetchWebApiResults(statement,['query','results'],{},'get', (data) => {\n let results = {'tabelas':[]};\n for (let key in data.query.results) {\n let tabelas = data.query.results[key].printouts['Possui direito de leitura em'];\n tabelas.forEach( (item) => {\n let nomeTabela = item['fulltext'];\n if (!results.tabelas.includes(nomeTabela)) results.tabelas.push(nomeTabela);\n } );\n }\n return results;\n });\n }", "title": "" }, { "docid": "a161d9b35bf68353496bbc95c27b7684", "score": "0.5499251", "text": "function displayTable(results) {\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Department', 'Price', 'Stock']\n , colWidths: [10, 30, 15, 10, 10]\n });\n for (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, results[i].stock_quantity]\n );\n }\n console.log(table.toString());\n}", "title": "" }, { "docid": "299e7cdc22a349bfeeab981f8b3482d7", "score": "0.54885983", "text": "function subfields_table(typelist) {\n return _.reduce(_.map(typelist, function(type) {\n if (_.isString(type)) {\n return [[type, null]];\n } else if (_.isArray(type)) {\n return [type.slice(0, 2)].concat(_.isArray(type[2]) ? subfields_table(type[2]) : []);\n }\n }), function(memo, type) {\n return memo.concat(type);\n }, []);\n }", "title": "" }, { "docid": "afc5dbe33debe4984c14cb2755d2b7f1", "score": "0.5482413", "text": "function AllTableToReportMultiple(table, nameTable){\n\tvar field4rows = $.parseJSON($('textarea#'+nameTable+'DataExport').val());\n\tvar table=table;\n\tvar tab_text=\"<table border='2px'><thead><tr bgcolor='#87AFC6'>\";\n\tvar line = \"\";\n\tvar tab = $(table);\n\tvar theader=$('#'+table+' tr:eq(0) th');\n\tfor (c=0;c<theader.length;c++){\n\t\ttest='#'+table+' tr:eq(0) th:eq('+c+')';\n\t\tline=line+\"<th>\"+$(test).text()+\"</th>\";\n\t}\n\ttab_text=tab_text+line+\"</tr>\"+\"</thead><tbody>\";\n\t\tfor(j = 0; j<=field4rows.length; j++){\n\t\t\tvar r1 = field4rows[j];\n\t\t\tline=\"<tr>\";\n\t\t\tfor(var obj1 in r1){\n\t\t\t\tvar r2 = r1[obj1];line = line+\"<td>\"+r2+\"</td>\";\n\t\t\t} //end for obj1\n\t\t\ttab_text=tab_text+line+\"</tr>\";\n\t\t}\n\n\ttab_text=tab_text+\"</tbody></table>\";\n\treturn (tab_text);\n}", "title": "" }, { "docid": "bfe809870c599090ae0de7216b23c3d5", "score": "0.54709363", "text": "function userTable() { }", "title": "" }, { "docid": "029ab9f115d5801265982e6ad4eeaf4a", "score": "0.54497516", "text": "function display() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n var table = new Table({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock Qty\"],\n colWidths: [6, 45, 16, 11, 11]\n });\n \n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity],\n );\n }\n console.log(table.toString());\n start()\n });\n}", "title": "" }, { "docid": "59fa4b99a3275036b77465aa18186c8a", "score": "0.544934", "text": "function table(res) {\n var store = [];\n for (i = 0; i < res.length; i++) {\n var id = res[i].id\n var name = res[i].product_name\n var price = res[i].price\n var stock = res[i].stock_quantity\n var department = res[i].department_name\n var prod = new Product(id, name, price, stock, department);\n store.push(prod);\n }\n console.log(`\n `)\n console.table(store);\n}", "title": "" }, { "docid": "3535d1527d72f5f75b4821db6476ecd7", "score": "0.54445314", "text": "getTableWithId(id){\n\t\tvar res = null;\n\t\tthis.goodsTable.forEach(function(table){\n\t\t\ttable.forEach(function(item){\n\t\t\t\tif (item.itemName===\"id\"){\n\t\t\t\t\tif (+item.itemValues==id)\n\t\t\t\t\t\tres = table;\n\t\t\t\t}\n\t\t\t});\n\t\t});\t\t\n\t\treturn res;\n\t}", "title": "" }, { "docid": "0eb140315b59653dd205ce9e9605150d", "score": "0.54415286", "text": "function tablePerms(sql) {\n var allInto = [],\n allFrom = []\n\n function parseFrom(ast) {\n if (Array.isArray(ast)) ast.map(a => parseFrom(a))\n else if (typeof ast === 'object') {\n for (var p in ast) {\n if (p === 'variant' && ast[p] === 'table') allFrom.push(ast.name)\n parseFrom(ast[p])\n }\n }\n }\n\n function parse(ast) {\n if (Array.isArray(ast)) ast.map(a => parse(a))\n else if (typeof ast === 'object') {\n for (var p in ast) {\n if (p === 'into' && (ast[p].variant === 'table' || ast[p].format === 'table')) allInto.push(ast[p].name) \n if (p === 'from') {\n if (ast.variant === 'delete' && ast[p].variant === 'table') allInto.push(ast[p].name)\n else parseFrom(ast[p])\n } else parse(ast[p])\n }\n }\n }\n\n parse(sqliteParser(sql))\n return { write: allInto, read: allFrom }\n}", "title": "" }, { "docid": "dbdc9676d55cd74291edc5ada787bac4", "score": "0.5438724", "text": "function list(projects) {\r\n var table = $('<table>').class('table');\r\n var head = $('<tr>').append('<th>Name</th>').appendTo(table);\r\n\r\n projects.forEach(function(project) {\r\n var row = $('<tr>').append(\r\n $('<td>').text(project.name)\r\n ).appendTo(table);\r\n });\r\n\r\n return table;\r\n}", "title": "" }, { "docid": "5f1eb21385353da8b0f9640b13c81657", "score": "0.54246503", "text": "function viewAllProducts() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Price Per', 'Stock Qty']\n });\n\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n connection.end();\n });\n}", "title": "" }, { "docid": "4bec546a4f221a8b0aef26667543a178", "score": "0.54169446", "text": "function getTablesForATM(){\n try{\n \n theTables = originalWindow.document.getElementsByTagName(\"table\");\n for (var x = 0; x < theTables.length; x++) {\n var headers = theTables[x].querySelectorAll(\"tbody tr th\");\n for (var y = 0; y < headers.length; y++) {\n if (headers[y].innerText == \"Affiliate Table\") {\n theRightTable = theTables[x];\n } else if (headers[y].innerText == \"Organizations Table\") {\n theRightOrgsTable = theTables[x];\n } else if (headers[y].innerText == \"Topics Table\") {\n theRightTopicsTable = theTables[x];\n }\n }\n }\n affilRows_atm = theRightTable.querySelectorAll(\"tbody tr\");\n topicRows_atm = theRightTopicsTable.querySelectorAll(\"tbody tr\");\n orgRows_atm = theRightOrgsTable.querySelectorAll(\"tbody tr\");\n } catch (err) {\n atmWindow.alert(err);\n\t atmWindow.console.log(err);\n }\n }", "title": "" }, { "docid": "260f7428ef896e5c9a8800d3905ebaf0", "score": "0.5406888", "text": "function listar_tabela(nometabela,callback)\n\t{\n\n\t\tvar db = window.openDatabase(localStorage['bd_nomebd'], \"1.0\", localStorage['bd_nomebd'], 200000);\n\t\t\tdb.transaction( function coletandovisitas(tx){\n\t\t\t\ttx.executeSql('SELECT * FROM '+nometabela+'', [], function percorrendolinhas(tx, results) {\n\t\t\t\t\tvar len = results.rows.length;\n\t\t\t\t\tvar array_retorno = new Array();\n\t\t\t\t\tfor (var i=0; i<len; i++){\n\t\t\t\t\t\t array_retorno[i] = results.rows.item(i);\n\t\t\t\t\t}\n\t\t\t\t\tcallback(array_retorno);\n\t\t\t\t}, function err(){ alert('erro ao coletar') } );\t\t\t\n\t\t\t},function erro(){ alert('erro ao coletar dados') }, function acerto(){ } );\n\n\t}", "title": "" }, { "docid": "0f8bb1658d9062cb7a77308a1ca8536c", "score": "0.5392297", "text": "function list() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['Product ID', 'Product Name', 'Price', 'Stock', 'Department'],\n color: [\"blue\"],\n colAligns: [\"center\"]\n })\n res.forEach(function(row) {\n let newRow = [row.item_id, row.product_name, \"$\" + row.price, row.stock_quantity, row.department_name]\n table.push(newRow)\n })\n console.log(\"Current Bamazon Products\")\n console.log(\"\\n\" + table.toString())\n menu();\n })\n}", "title": "" }, { "docid": "0b10befe7106ffef954a997313ffadfa", "score": "0.53898036", "text": "static async getAllOfThem(){\n const { rows } = await pool.query(\n `SELECT name, type\n FROM animals\n LEFT JOIN species\n ON animals.species_id = species.id`\n );\n return rows;\n }", "title": "" }, { "docid": "9cfc1cf02d51bb9543db52621605d946", "score": "0.53823465", "text": "function showAllTr() {\r\n getAllTr().then(function(list) {\r\n $(\"#transactionListC\").html('');\r\n list.forEach(function(item, index) {\r\n $(\"#transactionListC\").append(\"<tr><td>\" + item.id + \"</td><td>\" + item.currentTx + \"</td><td>\" + item.referenceTx + \"</td><td>\" + item.se + \"</td><td>\" + item.re + \"</td><td>\" + item.time + \"</td></tr>\");\r\n });\r\n })\r\n}", "title": "" }, { "docid": "9933e558c3c8c99f80afe5633a5ae54e", "score": "0.538163", "text": "function tablePersons() {\n\tvar pdata = [];\n\tif (trjs.data.persons) {\n\t\tfor (var i=0 ; i < trjs.data.persons.length; i++) {\n\t\t\tpdata.push({\n\t\t\t// 'Code': trjs.data.persons[i][\"code\"],\n\t\t\t'ID': trjs.data.persons[i][\"id\"],\n\t\t\t'Name': trjs.data.persons[i][\"name\"],\n\t\t\t'Age': trjs.data.persons[i][\"age\"],\n\t\t\t'Role': trjs.data.persons[i][\"role\"],\n\t\t\t'Sex': trjs.data.persons[i][\"sex\"],\n\t\t\t'Lang': trjs.data.persons[i][\"xml_lang\"],\n\t\t\t'Group': trjs.data.persons[i][\"group\"],\n\t\t\t'SES': trjs.data.persons[i][\"ses\"],\n\t\t\t'Educ': trjs.data.persons[i][\"educ\"],\n\t\t\t'Source': trjs.data.persons[i][\"source\"],\n\t\t\t'Info': trjs.data.persons[i][\"custom\"]\n\t\t\t});\n\t\t}\n\t\tif (pdata.length === 0) {\n\t\t\tpdata.push({\n\t\t\t\t// 'Code': \"xxx\",\n\t\t\t\t'ID': \"x\",\n\t\t\t\t'Name': \"---\",\n\t\t\t\t'Age': \"\",\n\t\t\t\t'Role': \"\",\n\t\t\t\t'Sex': \"\",\n\t\t\t\t'Lang': \"\",\n\t\t\t\t'Group': \"\",\n\t\t\t\t'SES': \"\",\n\t\t\t\t'Educ': \"\",\n\t\t\t\t'Source': \"\",\n\t\t\t\t'Info': \"\",\n\t\t\t});\n\t\t}\n\t} else {\n\t\tpdata.push({\n\t\t\t// 'Code': \"xxx\",\n\t\t\t'ID': \"x\",\n\t\t\t'Name': \"---\",\n\t\t\t'Age': \"\",\n\t\t\t'Role': \"\",\n\t\t\t'Sex': \"\",\n\t\t\t'Lang': \"\",\n\t\t\t'Group': \"\",\n\t\t\t'SES': \"\",\n\t\t\t'Educ': \"\",\n\t\t\t'Source': \"\",\n\t\t\t'Info': \"\",\n\t\t});\n\t}\n\treturn pdata;\n}", "title": "" }, { "docid": "dc7a66629faa996dc9232cef3e081200", "score": "0.5371915", "text": "function buildTables() {\n var headings = [\"Course ID\", \"Course\", \"Course Tutor\", \"Credits\", \"Duration (Year)\"];\n return \"<h3>Course Information:</h3>\" + getTable(headings);\n}", "title": "" }, { "docid": "7c23d162340a66dc0553ea93f670c5eb", "score": "0.53597325", "text": "function getRecordList() {\n // get the URL:\n url = document.getElementById('db').value;\n\n // get the records from the database using jquery ($)\n // When you do, run saveRecordList():\n $.get(url + '_all_docs', saveRecordList, 'json');\n}", "title": "" }, { "docid": "a1f1c31f7baa8cfff9b1ffba7af5b5af", "score": "0.5358582", "text": "async table2list(cols, new_key_1, new_key_2, df = this.df) {\n var res = []\n df.forEach(row => {\n for (const [key, value] of Object.entries(row)) {\n if (!cols.includes(key)) {\n var temp = {}\n cols.forEach(c => temp[c] = row[c])\n temp[new_key_1] = key\n temp[new_key_2] = value\n res.push(temp)\n }\n }\n });\n // TODO remove_duplicate\n return res\n }", "title": "" }, { "docid": "5ebf883db6403f7c74183ca1172753ba", "score": "0.5348736", "text": "async _listTable(table, conditions = {}, client = undefined) {\n assert(typeof table === 'string');\n assert(typeof conditions === 'object');\n\n // We want a FOR UPDATE query if a client is passed in because the only\n // reason to pass in a client for a query is to lock the rows as part of a\n // transaction!\n let {text, values} = this._generateTableListQuery(table, conditions, client ? true : false);\n\n let result;\n if (client) {\n result = await client.query({text, values});\n } else {\n result = await this._pgpool.query({text, values});\n }\n\n return result.rows; \n }", "title": "" }, { "docid": "647d501f38156ab9b6a65cdbca0f1abd", "score": "0.5348114", "text": "function showProducts(){\n\n var query = \"SELECT * FROM products;\"\n connection.query(query, function(err, res){\n \n var productTable = new Table\n \n res.forEach(function(product) {\n productTable.cell(\"Item ID\", product.Item_ID)\n productTable.cell(\"Product\", product.Product_Name)\n productTable.cell(\"Department\", product.Department_Name)\n productTable.cell(\"Price($)\", product.Price, Table.number(2))\n productTable.cell(\"Quantity Left\", product.Stock_Quantity, Table.number(0))\n productTable.newRow()\n })\n \n console.log(\"\\nITEMS FOR SALE: \\n\\n\" + productTable.toString());\n\n });\n \n}", "title": "" }, { "docid": "8af75bead295757577585cc08abd361d", "score": "0.53479093", "text": "function getResultsFromTable(table) {\r\n var resultIndex= table[0].length - 1;\r\n var results= [];\r\n for (var rows= 1; rows < table.length; rows++) {\r\n results.push(table[rows][resultIndex]);\r\n }\r\n return results;\r\n}", "title": "" }, { "docid": "19c83b13095285e31a0dba0f321f26be", "score": "0.5343659", "text": "function resultTable() {\n var $table = $container.find(tableSelector).filter(':first'),\n $tbody = $table.find('tbody:first');\n return $tbody.length > 0 ? $tbody : $table;\n }", "title": "" }, { "docid": "888bdfec38b917a0e14fe5ae9bc405cf", "score": "0.53373736", "text": "function DataTable() {}", "title": "" }, { "docid": "8333f2aa903030a6d016e1d5e0d6efb4", "score": "0.5334559", "text": "function generateTable(rows){\n let table = '';\n for (const row in rows){\n console.log(typeof row);\n table+=generateRow(row);\n }\n return table;\n}", "title": "" }, { "docid": "59d5cc8b62bf2a14c0e924d1fb70c566", "score": "0.53341496", "text": "function renderTable (records, config) {\n var tableHeadHtml = '';\n var tableBodyHtml = '';\n var schemas = config.schemas;\n var routes = config.routes;\n var scriptHtml = '';\n var tableId = 'list-' + config.tableName;\n var colspan;\n\n schemas.forEachField(function (name, field) {\n tableHeadHtml += th().html(field.text ? field.text : field.name);\n }, Present.getFieldNames(config.showFields));\n\n if (!config.readonly) {\n tableHeadHtml += th({style: 'width: 150px'}).html('操作');\n }\n\n tableHeadHtml = tr().html(tableHeadHtml);\n\n if (records.length > 0) {\n records.forEach(function (record) {\n var trHtml = '';\n var links = [];\n var present = Present.create(config, record);\n var viewLink, editLink, deleteLink;\n\n present.showAll().forEach(function (ele) {\n trHtml += td().html(ele);\n });\n\n viewLink = present.viewLink();\n editLink = present.editLink();\n deleteLink = present.deleteLink();\n\n if (viewLink) { links.push(viewLink); }\n\n if (editLink) { links.push(editLink); }\n\n if (deleteLink) { links.push(deleteLink); }\n\n trHtml += td().html(links.join('&nbsp;|&nbsp;'));\n\n tableBodyHtml += tr().html(trHtml);\n });\n\n } else {\n colspan = config.showFields.length + 1;\n tableBodyHtml = tr().html(td({colspan: colspan}).html(\n Html.p('text-center').html('还没有记录')\n ));\n }\n\n return table({id: tableId, class: 'table table-striped'}).html(\n thead().html(tableHeadHtml),\n tbody().html(tableBodyHtml)\n ) + Present.setCsrfAjax(config);\n}", "title": "" }, { "docid": "42880e6d43140238e3a5e643f52b70b5", "score": "0.5331391", "text": "function getTablesNames(){\n let xhttp = new XMLHttpRequest();\n\n \txhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n let returnValues = JSON.parse(this.responseText);\n if (returnValues.boolean) {\n for (let i = 0; i < Object.keys(returnValues.requestBody).length ; i++) {\n if (returnValues.requestBody[i].Tables_in_logopedia !=\"Patients\" && returnValues.requestBody[i].Tables_in_logopedia !=\"Resultats\") {\n mvTablesList.tables.push(returnValues.requestBody[i].Tables_in_logopedia);\n }\n }\n }\n else{\n console.log(returnValues.message);\n }\n }\n };\n\n \txhttp.open(\"GET\", \"https://\"+ DOMAIN_IP +\"/api/admin/tables_name?admin_user=\" + USERNAME + \"&admin_password=\" + PASSWORD, true);\n xhttp.send();\n}", "title": "" }, { "docid": "af8eb281acd3aeee8e0cf206579725ae", "score": "0.53279513", "text": "tablename(context) {\n switch (context) {\n case \"select\":\n case \"selectOne\":\n return \"(select * from tablename1 join tablename2 on tablename1.id = tablename2.id)\";\n case \"insert\":\n case \"update\":\n case \"delete\":\n return \"tablename1\";\n }\n }", "title": "" }, { "docid": "0def66982ac6edd8f89b1174d8922e92", "score": "0.53263515", "text": "function viewAllEmp() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY e.last_name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ---------------------------------- \\n ALL COMPANY EMPLOYEES AT THIS TIME \\n ----------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "8e5cefd0631a53ea1d4b13049b3eacd5", "score": "0.5325489", "text": "function listProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['ID', 'Name', 'Department', 'Price', 'Stock']\n })\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id, res[i].product_name, res[i].department_name, `$${res[i].price}`, res[i].stock_quantity]);\n };\n console.log(\"\\n\")\n console.log(table.toString());\n });\n placeOrder();\n}", "title": "" }, { "docid": "7dff122b453054dc6c4b4a82beb32c41", "score": "0.5324495", "text": "function tableView() {\n\tconnection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function(err, results) {\n if (err) throw err;\n\n// table \n\tvar table = new Table({\n \thead: ['ID#', 'Item Name', 'Department', 'Price($)', 'Quantity Available'],\n \t colWidths: [10, 20, 20, 20, 20],\n \t style: {\n\t\t\t head: ['cyan'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center'],\n\t\t }\n\t});\n//Loop through the data\n\tfor(var i = 0; i < results.length; i++){\n\t\ttable.push(\n\t\t\t[results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n\t\t);\n\t}\n\tconsole.log(table.toString());\n\n });\n}", "title": "" }, { "docid": "1af3a3fa27940e53d30ae9607f5d1ef6", "score": "0.53242373", "text": "function accountListings(result){\n var a = [\"Textbook\",\"Price\",\"ISBN\",\"Status\"];\n var table = \"<table><caption>Your Current Listings<tr><th>Textbook<th>Price ($)<th>ISBN<th>Status\";\n for (var i = 0; i < result.length; i++) {\n table += \"<tr>\";\n for (var j = 0; j < a.length; j++) {\n table += \"<td>\" + result[i][a[j]] + \"</td>\";\n }\n table += \"</tr>\";\n }\n return table;\n}", "title": "" }, { "docid": "3d3a429092785fe712cdd638d9b3ac89", "score": "0.53221303", "text": "function getTemplateTables(templateID) {\n var deferred = $q.defer();\n\n requestService.get('./scenario/tables/' + templateID).success(function (data) {\n deferred.resolve(data);\n }).error(function (err) {\n DataService.error(err);\n deferred.reject();\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "6e2e12b055f88da34259ea502556ca18", "score": "0.5316691", "text": "getTableRowsScoped(tableName) {\n return this.blockchain.getTableRowsScoped(this.accountName, tableName);\n }", "title": "" }, { "docid": "4fd4da61819a8cce3f24a3cb7b462d25", "score": "0.5316334", "text": "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "title": "" }, { "docid": "f0658671de244976ac82dd99c30785eb", "score": "0.5315486", "text": "function displayInventoryTable(res) {\r\n\r\n const table = new Table({\r\n head: ['Product #', 'Department', 'Product', 'Price', 'Qty In Stock'],\r\n colWidths: [15, 20, 30, 15, 15]\r\n });\r\n\r\n for (let i = 0;\r\n (i < res.length); i++) {\r\n var row = [];\r\n row.push(res[i].item_id);\r\n row.push(res[i].department_name);\r\n row.push(res[i].product_name);\r\n row.push(res[i].price);\r\n row.push(res[i].stock_quantity);\r\n table.push(row);\r\n }\r\n\r\n console.log(table.toString());\r\n}", "title": "" }, { "docid": "eb2a0e5376c21b82a77940ff9f69adbc", "score": "0.5314958", "text": "function makeTable(data) {\n var tableData = data.map(person => \"<tr><td>\" + person.id + \"</td><td>\" + person.age + \"</td><td>\" + person.name + \"</td><td>\" + person.gender + \"</td><td>\" + person.email + \"</td></tr>\");\n tableData.unshift('<table class=\"table\"><tr><th scope=\"col\">id</th><th scope=\"col\">age</th><th scope=\"col\">name</th><th scope=\"col\">gender</th><th scope=\"col\">email</th></tr>');\n tableData.push(\"</table>\");\n return tableData.join(\"\");\n}", "title": "" }, { "docid": "b3098ef8789cc68cc2ac01380b74b6e5", "score": "0.5313434", "text": "function lowInventoryList() {\n connection.query(\"SELECT item_id, product_name, stock_quantity FROM products WHERE stock_quantity < 5\", function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Stock Qty']\n });\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n connection.end();\n });\n}", "title": "" }, { "docid": "89cb33f7f93b3abe27c74f986fd2f548", "score": "0.5313257", "text": "function table_orders (){\n var filebuffer = fs.readFileSync('orders_tpv.db');\n var db = new sqlite3.Database(filebuffer);\n sqlstr = \"SELECT * FROM orders;\";\n var results = db.exec(sqlstr);\n var dataset = results[0];\n db.close();\n return dataset;\n}", "title": "" }, { "docid": "f194c65a6c0baae970ef28b9c2cd6421", "score": "0.5312503", "text": "function GetDataRows() {\n let rows = \"\";\n packingList.forEach(row => {\n rows = rows\n + \"<tr>\"\n + \"<td>\" + row.part_number + \"</td>\"\n + \"<td>(\" + row.qty + \"x) \" + row.description + \"</td>\"\n + \"<td align='right'>\" + (row.weight * row.qty).toFixed(2) + \"</td>\"\n + \"<td align='right'>$\" + (row.price * row.qty).toFixed(2) + \"</td>\"\n + \"</tr>\";\n });\n\n return rows;\n }", "title": "" }, { "docid": "c4485487526fd0ce267d2856d31a856e", "score": "0.53070253", "text": "function TableMapper() {\r\n}", "title": "" } ]
3dc2cc14cf5cb8a76873bd9efe38f785
This function checks if alternating chicken cross the way of the character.
[ { "docid": "882bfff2296efc39dcf3a8c18d2bdef4", "score": "0.58648485", "text": "function checkForAlternatingHenCollision() {\n for (let index = 0; index < alternatingHens.length; index++) {\n let hen = alternatingHens[index];\n let hen_x = hen.position_x + bg_ground;\n let hen_y = hen.position_y;\n let timePassedSinceJump = new Date().getTime() - lastJumpStarted;\n\n if (characterIsColliding(hen, hen_x, 40)) {\n if (timePassedSinceJump < 800 && character_y > hen_y - 168 - 100 && character_y < hen_y - 168) {\n henDies(hen);\n }\n if (characterIsColliding(hen, hen_x, 40) && character_y == hen_y - 168) {\n if (character_energy > 0) {\n if (timePassedSinceHurt > 2 * HURT_TIME) {\n characterGetsHurt();\n }\n } else {\n characterDies();\n }\n }\n }\n }\n}", "title": "" } ]
[ { "docid": "47acfa0a8f458c50dad4630abae34c67", "score": "0.62914777", "text": "function checkStraight() {}", "title": "" }, { "docid": "4a7457a990a23d353d734b76a472b934", "score": "0.62337446", "text": "checkLine(a, b, c) {\n if (a === b && b === c && c === a && a !== \"\")\n this.setState({ winner: !this.state.currentPlay ? \"cross\" : \"zero\" });\n return;\n }", "title": "" }, { "docid": "3af6254bf7b14f01e2d77c718f2b2dc8", "score": "0.61144114", "text": "checkCollision (snake_x, snake_y) {\n if ((this.x == snake_x) & (this.y == snake_y)) {\n this.times_eaten += 1;\n return true\n }\n }", "title": "" }, { "docid": "e86645d70d35d9449051cdc3d197aaa9", "score": "0.60185206", "text": "function checkOut() {\n\tif (snake[0].x === 20 || snake[0].x === -1 || snake[0].y === 20 || snake[0].y === -1) {\n\t\treturn true\n\t}\n\tfor (let i = 1; i < snake.length; i++) {\n\t\tif(snake[0].x === snake[i].x && snake[0].y === snake[i].y) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "4af93dfe58d3e7f704987749373c5f7f", "score": "0.6015737", "text": "function down_check(a,b,game_piece) {\r\n if(isValidMove(a+1,b)) {\r\n if(char_arr[a+1][b] == game_piece && (game_piece == 'X' || game_piece == 'O')) {\r\n vert_int++;\r\n if(vert_int == 4) {\r\n is_vertical = true;\r\n }\r\n down_check(a+1,b,game_piece);\r\n }\r\n }\r\n vert_int = 0;\r\n}", "title": "" }, { "docid": "dd4450275570930368f5a998a4e40d79", "score": "0.599802", "text": "function check_collide(){\n\tif (frogYPos > 277){\t\t// if on lower part of board ['highway']\n\t\tcheck_cars();\t\t\t// check if collided with cars\n\t}\n\telse {\n\t\tcheck_water();\t\t\t// otherwise, check water\n\t}\n}", "title": "" }, { "docid": "a9add7ee9d46666b9bf216c74040f338", "score": "0.59694767", "text": "function catchDog(cop){\n if (Math.abs(player.xPos - cop.xPos) == 1 && Math.abs(player.yPos - cop.yPos) == 1){\n console.log(\"Ya Busted!\");\n }\n}", "title": "" }, { "docid": "7aa0aa01f6bb4d7024c6eea5270e81ac", "score": "0.5945412", "text": "function checkVictory(row, col) {\n if (\n _checkRow(row) ||\n _checkCol(col) ||\n _checkBackSlash(row, col) ||\n _checkSlash(row, col)\n )\n gState.isGameOver = true;\n}", "title": "" }, { "docid": "7266498770e5b8e054e0d2682b490710", "score": "0.594126", "text": "function isCollide(snake){ \r\n // If you bump into yourself \r\n for (let i = 1; i < snakeArray.length; i++) {\r\n if(snake[i].x === snake[0].x && snake[i].y === snake[0].y){\r\n return true;\r\n }\r\n }\r\n // If you bump into the wall\r\n if(snake[0].x >= 25 || snake[0].x <=0 || snake[0].y >= 25|| snake[0].y <=0){\r\n return true;\r\n }\r\n return false ;\r\n}", "title": "" }, { "docid": "80b2e8a1914c8f1bc2f76693b927409a", "score": "0.5931857", "text": "function isNotCrossed(boat){\n return boats.every(function (b) {\n if(boat === b){\n return true;\n }\n var boatX = boat.gridX;\n var boatY = boat.gridY;\n for (var boatI = 0; boatI < +boat.size; ++boatI) {\n var bX = b.gridX;\n var bY = b.gridY;\n for (var bI = 0; bI < +b.size; ++bI) {\n if (boatX === bX && boatY === bY) {\n return false;\n }\n if (b.orientation === 'horizontal') {\n ++bX;\n } else {\n ++bY;\n }\n }\n if (boat.orientation === 'horizontal') {\n ++boatX;\n } else {\n ++boatY;\n }\n }\n return true;\n });\n }", "title": "" }, { "docid": "daa4cc30ff8d85d0b192b2e3d296606c", "score": "0.5891874", "text": "checkAppleCollision(){\n var snake = this.snake;\n var apple = this.apple;\n if(snake.headX==apple.appleX && snake.headY==apple.appleY)\n return true;\n else\n return false;\n }", "title": "" }, { "docid": "c81ac2c3fd0e5a3d47939528fcd661b8", "score": "0.5884918", "text": "function chechForNaborsGreen(player, row, win) {\n\n\n\n\n\n for (var i = 0; i < 5; i++) {\n x = win[row]\n\n var chick = player.includes(x[i]);\n\n if ((row % 2) != 0) {\n if (chick) {\n\n chick = x[i];\n console.log(chick)\n if (chick % 2 == 0) {\n\n var chick2 = player.includes(chick + 1);\n if (row == 3) {\n var chick3 = player.includes(chick - 1) + player.includes(chick + 4) + player.includes(chick - 6);\n // console.log(\"chick3 \" + chick3)\n if (chick2 >= 1 && chick3 >= 1) {\n // console.log(\"5 or 10\" + chick3)\n\n return true\n }\n\n }\n else {\n if (chick2 >= 1) {\n\n return true\n }\n }\n }\n else {\n var chick2 = player.includes(chick + 1) + player.includes(chick + 6) + player.includes(chick - 4);\n if (row == 3) {\n var chick3 = player.includes(chick - 1);\n\n if (chick2 >= 1 && chick3 >= 1) {\n\n return true\n }\n\n\n if (chick2 >= 1) {\n\n return true\n }\n }\n\n }\n\n }\n }\n\n\n\n\n\n else {\n if (chick) {\n // console.log(\"even \")\n chick = x[i];\n if (chick % 2 != 0) {\n\n var chick2 = player.includes(chick + 1);\n if (chick2 >= 1) {\n\n return true\n }\n }\n else {\n var chick2 = player.includes(chick + 1) + player.includes(chick + 6) + player.includes(chick - 4);\n if (chick2 >= 1) {\n\n return true\n }\n }\n\n }\n }\n }\n}", "title": "" }, { "docid": "77ca2b098bef8d6113f456b84a319565", "score": "0.5867284", "text": "static canChow(a, b, c){\n if (a.suit === b.suit && a.suit === c.suit && a.suit < 3 && \n a.rank !== b.rank && a.rank !== c.rank && b.rank !== c.rank){\n let lo = Math.min(a.rank, b.rank, c.rank);\n let hi = Math.max(a.rank, b.rank, c.rank);\n return hi - lo === 2;\n }\n return false;\n }", "title": "" }, { "docid": "738e514a258c81e6b5971b1d8dedf54d", "score": "0.5861541", "text": "function bishopAndPawn(cell1, cell2) {\n var getX = function(pos) {\n return pos.charCodeAt() - 'A'.charCodeAt();\n }\n var getY = function(pos) {\n return pos.charCodeAt() - '1'.charCodeAt();\n }\n var x1 = getX(cell1[0]),\n y1 = getY(cell1[1]),\n x2 = getX(cell2[0]),\n y2 = getY(cell2[1]);\n if (x1 + y1 === x2 + y2 || x1 - y1 === x2 - y2) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "6c3d04e9dd56f18ac75f7a617e5e831a", "score": "0.58541465", "text": "function collision() {\n // check if conga hits the borders\n if (snakeX + snakeWidth > canvas.width) {\n gameOver = true;\n };\n if (snakeX < 0) {\n gameOver = true;\n };\n if (snakeY + snakeWidth > canvas.height) {\n gameOver = true;\n };\n if (snakeY < 0) {\n gameOver = true;\n };\n // check if conga hits itself\n for (let i = 0; i < tail.length-1;i++) {\n if (snakeX == tail[i].x && snakeY == tail[i].y) {\n gameOver = true;\n };\n };\n}", "title": "" }, { "docid": "8f5e2306e21b88a31e05249f070f3b68", "score": "0.58494776", "text": "function collision(px, py, pw, ph, ex, ey, ew, eh) {\n //If the two characters are within proximity of each other then they collide (= true).\n return (Math.abs(px - ex) * 2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n}", "title": "" }, { "docid": "627443d2f6d3b9873f69791e61c9058b", "score": "0.584595", "text": "static checkWinner(draw) {\n if (\n (draw[0] === draw[1] && draw[1] === draw[2]) ||\n (draw[0] !== draw[1] && draw[1] !== draw[2] && draw[0] !== draw[2])\n )\n return true;\n else return false;\n }", "title": "" }, { "docid": "6240afbc496f4bae8294fd62e7dbb6b1", "score": "0.5843713", "text": "isTangled(){\n let head = this.getHead;\n let rest = this.tail.slice( 0, this.tail.length -1);\n\n return rest.some( snakeBit => {\n return( head.x === snakeBit.x && head.y === snakeBit.y);\n });\n }", "title": "" }, { "docid": "713d7f0f819ee44e0eb42fc119376e77", "score": "0.58154875", "text": "function isAllyPiece() {\n return Object.values(turn).indexOf(piece) >= 0\n }", "title": "" }, { "docid": "7662e06092d2f96e6cb18649054e40f5", "score": "0.58095336", "text": "function validMove(blockColor, towerColor, towerLength){\r\n\tif ((colors.indexOf(blockColor)<colors.indexOf(towerColor)) || towerLength===0){\r\n\t\tplaySound(\"correct.mp3\");\r\n\t\treturn(true);\r\n\t}else return(false);\r\n\t\r\n}", "title": "" }, { "docid": "c8c5225afc94dcf39de8cb368c300f81", "score": "0.58016205", "text": "function up_check(a,b,game_piece) {\r\n if(isValidMove(a-1,b)) {\r\n if(char_arr[a-1][b] == game_piece && (game_piece == 'X' || game_piece == 'O')) {\r\n vert_int++;\r\n if(vert_int == 4) {\r\n is_vertical = true;\r\n }\r\n up_check(a-1,b,game_piece);\r\n }\r\n }\r\n vert_int = 1;\r\n}", "title": "" }, { "docid": "d75bc285324671ff0ce5b20a3bb9d379", "score": "0.57943475", "text": "function checkSnakeCollision() {\n const snakeHeadX = xCor[xCor.length - 1];\n const snakeHeadY = yCor[yCor.length - 1];\n for (let i = 0; i < xCor.length - 1; i++) {\n if (xCor[i] === snakeHeadX && yCor[i] === snakeHeadY) {\n return true;\n }\n }\n}", "title": "" }, { "docid": "a34bd362b72f7c964af9532ff8191719", "score": "0.5790725", "text": "function checkCanyon(t_canyon) {\n if (\n gameChar_world_x > t_canyon.x_pos &&\n gameChar_world_x < t_canyon.x_pos + t_canyon.width &&\n gameChar_y >= floorPos_y\n ) {\n isFalling = true;\n }\n}", "title": "" }, { "docid": "373d9c0bea123883067c5aabb5ca8f14", "score": "0.5786563", "text": "function isOneAway(a, b) {\n let i = 0, j = 0;\n let nrOfDifferentChars = 0;\n while (i < a.length && j < b.length) {\n console.log(`a[${i}] = ${a[i]}, b[${j}] = ${b[j]}`)\n if (nrOfDifferentChars > 1) return false;\n if (a[i] !== b[j]) {\n if (a[i + 1] === b[j]) {\n i++;\n } else if (a[i] === b[j + 1]) {\n j++;\n } else {\n i++; j++;\n }\n nrOfDifferentChars++;\n } else {\n i++; j++;\n }\n }\n\n if (i < a.length || j < b.length) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "09e485a8e667527260870c6502f6945e", "score": "0.5782668", "text": "function checkSnakeCollision() {\n var snakeHeadX = xCor[xCor.length - 1];\n var snakeHeadY = yCor[yCor.length - 1];\n for (var i = 0; i < xCor.length - 1; i++) {\n if (xCor[i] === snakeHeadX && yCor[i] === snakeHeadY) {\n return true;\n }\n }\n }", "title": "" }, { "docid": "e09903fbc03c1b245c969eaf5b692fb6", "score": "0.5777379", "text": "function junkCheck(x,y){\n // if(junkArray.some(pOj => rev.x === pOj.x && rev.y === pOj.y)){\n // return true;\n // }\n let playerWidth, playerHeight, playerX, playerY;\n let junkWidth, junkHeight, junkX, junkY;\n for (let i = 0; i < junkArray.length; i++){\n playerWidth = player.offsetWidth;\n playerHeight = player.offsetHeight;\n playerLeft = player.offsetLeft;\n playerTop = player.offsetTop;\n Width = junkArray[i].offsetWidth;\n junkHeight = junkArray[i].offsetHeight;\n junkLeft = junkArray[i].offsetLeft;\n junkTop = junkArray[i].offsetTop;\n if ((playerWidth + playerLeft) > junkLeft && playerLeft < (junkLeft + junkWidth) && (playerTop + playerHeight) > junkTop && playerTop < (junkTop + junkHeight)){\n colAction(rev.x, rev.y);\n console.log('we have a hit');\n return true\n }\n }\n return false;\n }", "title": "" }, { "docid": "f93fdaa23e4a16df0b2c3c3d6a292c60", "score": "0.5777247", "text": "function check_duo_collision(){\n console.log(snake_array)\n console.log(snake_array.length)\n // Edge Case someone purposely tries it. Don't.\n if (snake_array.length > 6){\n for (var j = 0; j < snake_array.length; j++) {\n if (c1 != undefined){\n //console.log(c.x,c1.x);\n for (var i = 0; i < c1.length; i++) {\n if (snake_array[j].x == c1[i].x && snake_array[j].y == c1[i].y){\n return true;\n }\n };\n }\n };\n }\n }", "title": "" }, { "docid": "511b48bba20942776177f36ede2781b4", "score": "0.57763165", "text": "function crosses(plane) {\n return (plane_list[temp_side + plane] == temp_color);\n }", "title": "" }, { "docid": "0accbc8e2e7f8e2e9041e14bcccf8fdc", "score": "0.57665795", "text": "function checkForChickenCollission() {\n for (let index = 0; index < chickens.length; index++) {\n let chicken = chickens[index];\n let chicken_x = chicken.position_x + bg_ground;\n let timePassedSinceJump = new Date().getTime() - lastJumpStarted;\n\n if (characterIsColliding(chicken, chicken_x, 40)) {\n if (timePassedSinceJump < 800 && character_y > 100 && character_y < 150) {\n henDies(chicken);\n }\n if (character_y == 150) {\n if (character_energy > 0) {\n if (timePassedSinceHurt > 2 * HURT_TIME) {\n characterGetsHurt();\n }\n } else {\n characterDies();\n }\n }\n }\n }\n}", "title": "" }, { "docid": "8439f68111cb7bb8b2a067935055a11d", "score": "0.57634544", "text": "function isIsosceles(t) {\n if (t.sideA === t.sideB || t.sideA === t.sideC || t.sideB === t.sideC) {\n console.log(\"The triangle is isosceles\");\n return true;\n } else {\n console.log(\"The triangle is not isosceles.\");\n return false;\n }\n}", "title": "" }, { "docid": "15e8f68d4002a264cb13e3aefcb0a393", "score": "0.57624704", "text": "function chechForNabors(player, row, win) {\n\n for (var i = 0; i <= 5; i++) {\n x = win[row]\n // console.log(x)\n\n var chick = player.includes(x[i]);\n // console.log(chick)\n\n if ((row % 2) != 0) {\n if (chick) {\n console.log(\"odd \")\n if (row == 3) {\n chick = x[i];\n var chick2 = player.includes(chick + 4) + player.includes(chick + 5);\n var chick3 = player.includes(chick - 5) + player.includes(chick - 6)\n if (chick2 >= 1 && chick3 >= 1) {\n\n return true\n }\n\n }\n else {\n chick = x[i];\n var chick2 = player.includes(chick + 4) + player.includes(chick + 5);\n // var chick3 = player.includes(chick + 10) + player.includes(chick + 11) ,;\n if (chick2 >= 1) {\n\n console.log(\"you did it \")\n return true\n }\n }\n }\n\n }\n\n\n else {\n if (chick) {\n console.log(\"even \")\n\n chick = x[i];\n var chick3 = player.includes(chick - 5) + player.includes(chick - 4)\n\n var chick2 = player.includes(chick + 6) + player.includes(chick + 5);\n if (chick2 >= 1 && chick3 >= 1) {\n\n console.log(\"you did it god\")\n return true\n\n }\n\n }\n }\n }\n}", "title": "" }, { "docid": "9c33106d980d66670792dd336e5c97ad", "score": "0.57529765", "text": "function checkCanyon()\n{\n\tfor (i = 0; i < canyons.length; i++) {\n\t\tif(canyons[i].x_pos < gameChar_world_x && canyons[i].x_pos+canyons[i].width-30 > gameChar_world_x){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "834c8fe5d60d51704118b9e0398353ef", "score": "0.57527024", "text": "function characterNotBumping(me, solid) {\n if(me.top + me.toly + abs(me.yvel) > solid.bottom) return true;\n return false;\n}", "title": "" }, { "docid": "0e1f362e18bf98d3ff24586c0cdd0b7b", "score": "0.5743022", "text": "function checkColliision() {\n // if the snake hits any of its joints the game is over\n for (let z = dots; z > 0; z--) {\n if ((z > 4) && (x[0] === x[z]) && (y[0] === y[z])) {\n inGame = false;\n };\n }\n // if the snake hits the bottom of the canvas the game is finished\n if (y[0] >= C_HEIGHT) {\n inGame = false;\n }\n\n if (y[0] < 0) {\n inGame = false;\n }\n // if the snake hits the side of the canvas the game is finished\n if (x[0] >= C_WIDTH) {\n inGame = false;\n }\n\n if (x[0] < 0) {\n inGame = false;\n }\n}", "title": "" }, { "docid": "1172f2eec84fe6a1660be96274af952f", "score": "0.57363904", "text": "function checkIfWon(){\n\n\tvar good = true;\n\n\t$(pieces).each(function(){\n\n\t\tvar piecenumber = $(this).html();\n\t\tvar xpos = parseInt($(this).attr(\"x\"));\n\t\tvar ypos = parseInt($(this).attr(\"y\"));\n\n\t\tif(xpos != (piecenumber-1)%numpieces || ypos != Math.ceil(piecenumber/numpieces - 1))\n\t\t\tgood = false;\n\n\t});\n\n\tif(good)\n\t\tyouWin();\n}", "title": "" }, { "docid": "b13c57e33ad9171340a65d1ec225012c", "score": "0.571385", "text": "function canMoveH(){\n let flag = false;\n for(let i=0;i<15;i++){\n if(squares[i].innerHTML == squares[i+1].innerHTML && squares[i].innerHTML!=0){\n flag = true;\n }\n }\n return flag;\n }", "title": "" }, { "docid": "ff1bccd0a556fc013103c9a1486db3b9", "score": "0.5712892", "text": "checkCollisions() {\n if (!super.checkCollisions()) return false;\n\n // Also check if it is ABOUT TO hit an interactable.\n const nextRowCol = this.board.getRowColInFront(this.direction, this.row, this.col);\n\n const boardTileInFront = this.board.grid[nextRowCol.row][nextRowCol.col];\n\n // Check if it is about to hit something that blocks high things.\n if (boardTileInFront.isHighBlocked() === true) {\n this.handleCollision(boardTileInFront.static);\n }\n\n return this.shouldContinueCheckCollisionsChain();\n }", "title": "" }, { "docid": "f8f100f3ba59076c4f53fed45215c334", "score": "0.57043916", "text": "checkColission(xCord,yCord){\n \t\n }", "title": "" }, { "docid": "bb8dcdf5bfa4379e75e28af8236a3ba1", "score": "0.57040656", "text": "isChained(block) {\n let isChained = false;\n const variation = this.grid[block.row][block.col];\n const row = block.row;\n const col = block.col;\n\n // left\n if (variation == this.grid[row][col - 1] && variation == this.grid[row][col - 2])\n isChained = true;\n\n // right\n if (variation == this.grid[row][col + 1] && variation == this.grid[row][col + 2])\n isChained = true;\n\n // up\n // preventing undefined\n if (this.grid[row - 2])\n if (variation == this.grid[row - 1][col] && variation == this.grid[row - 2][col])\n isChained = true;\n\n // down \n if (this.grid[row + 2])\n if (variation == this.grid[row + 1][col] && variation == this.grid[row + 2][col])\n isChained = true;\n\n // center - horizontally\n if (variation == this.grid[row][col - 1] && variation == this.grid[row][col + 1])\n isChained = true;\n\n // center - vertically\n if (this.grid[row - 1] && this.grid[row + 1])\n if (variation == this.grid[row - 1][col] && variation == this.grid[row + 1][col])\n isChained = true;\n\n return isChained;\n }", "title": "" }, { "docid": "86ee020f403a3bebb504a0feff70b8fa", "score": "0.5697569", "text": "checkCollision(thing) {\n\t\tif(this.x + this.width > thing.x &&\n\t this.x < thing.x + thing.width &&\n\t thing.y < this.y + this.height && \n\t thing.y + thing.height > this.y\n\t\t)\n\t\t{\t\n\t\t\treturn true\n\t\t} else \n\t\t\treturn false\n\t}", "title": "" }, { "docid": "609d446b3e27e5b29bfc58f00cd136d1", "score": "0.5681236", "text": "function isCollide(pFish, trash) {\r\n return pFish.x < trash.x + trash.trashImage.width &&\r\n pFish.x + pFish.image.width > trash.x &&\r\n pFish.y < trash.y + trash.trashImage.height + 5 &&\r\n pFish.y + pFish.image.height > trash.y + 5;\r\n}", "title": "" }, { "docid": "4965f3dfd61279d8dd2447f5630c6811", "score": "0.56728417", "text": "function checkPieceConditions() {\n\tif (selectedShashki.isKing) {\n\t\tgivePieceBorder();\n\t} else {\n\t\tif (turn) {\n\t\t\tselectedShashki.minusSeventhSpace = false;\n\t\t\tselectedShashki.minusNinthSpace = false;\n\t\t\tselectedShashki.minusFourteenthSpace = false;\n\t\t\tselectedShashki.minusEighteenthSpace = false;\n\t\t} else {\n\t\t\tselectedShashki.seventhSpace = false;\n\t\t\tselectedShashki.ninthSpace = false;\n\t\t\tselectedShashki.fourteenthSpace = false;\n\t\t\tselectedShashki.eighteenthSpace = false;\n\t\t}\n\t\tgivePieceBorder();\n\t}\n\n}", "title": "" }, { "docid": "0db37d22c0670d65d234cedf3b9e34f4", "score": "0.56711847", "text": "checkForWin() {\n const lengthPhrases = $('.letter').length;\n const lengthMatch = $('.letter.show').length;\n //if all the letter length match to the letter being click/shown it should call the gameOver\n if ( lengthPhrases === lengthMatch) {\n return true;\n }\n }", "title": "" }, { "docid": "0ef6582aba6ae4dd15267fccdfdafd89", "score": "0.5670365", "text": "function check_win_colms(marking) {\n\n\tvar marking_count = 0;\n\n \tfor(var i = 0; i < 3; i++) {\n\t\tfor(var j = 0; j < 3; j++) {\n\n\t\t\tif(array[j][i][0] == marking) {\n\t\t\t\tmarking_count++;\n\t\t\t} \t\t\n\t\t}\n\n\t\tif(marking == 'X' && marking_count == 3) {\n\t\t\talert(\"Player 1 wins!\");\t\n\t\t\t//$(\"td\").off();\t\t\t\n\t\t\treturn true;\n\t\t\t\t\t\t \n\t\t} else if(marking == 'O' && marking_count == 3) {\n\t\t\talert(\"Player 2 wins!\");\n\t\t\t$(\"td\").off();\n\t\t\ttileHover();\n\t\t\t//$(\"td\").off();\n\t\t\talert(\"Play again?\");\t\t\t\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\tmarking_count = 0;\t\t\t\n\t\t}\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "189636e0474f3bb623116770f1b36050", "score": "0.56642365", "text": "function canCapture([yourRook, opponentsRook]) {\n let myRook = yourRook;\n let hisRook = opponentsRook;\n if (myRook.charAt(0) === hisRook.charAt(0)) {\n return true;\n } else if (myRook.charAt(1) === hisRook.charAt(1)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "43472c9411ce71741d86584900ddfcc5", "score": "0.56631154", "text": "function checkOverlap() {\n for (let i = 0; i < candiesNumber; i++) {\n if (candies[i].caught === false) {\n if (\n ghost.x < candies[i].x + candies[i].img.width &&\n ghost.x + imgGhost.width > candies[i].x &&\n ghost.y < candies[i].y + candies[i].img.height &&\n ghost.y + imgGhost.height > candies[i].y\n ) {\n // Collision detected:\n // The candy disappears and the score is incremented by 1.\n candies[i].caught = true;\n score += 1;\n\n // The ghost goes faster!\n ghost.speed += 1;\n\n // The candies go faster!\n candies[i].speed = candies[i].speed + 1;\n\n // If the score is equal to the number of candies, the user wins!\n if (score === candiesNumber) {\n state = `win`;\n for (let i = 0; i < candiesNumber; i++) {\n candies[i].caught = false;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "6eae4d59352c44e3b126fddf054e26b0", "score": "0.5661672", "text": "function checkIsStraight(hand) {\n var handNoWilds = removeWilds(hand);\n var wilds = hand.length - handNoWilds.length;\n var sortedHandUp = handNoWilds.sort(lowHighSort);\n var sortedHandDown = handNoWilds.slice(0).sort(highLowSort);\n \n // in order to handle the fact that the ace (here 14) can be low, we simply\n // include both a 1 and a 14 if an ace is in the hand and then check each\n // hand for a straight that starts high and again for one starting low\n // (the same thing for any hand that does not contain an ace)\n if(sortedHandDown[0] == 14) {\n sortedHandUp.splice(0, 0, 1);\n sortedHandUp.splice(sortedHandUp.length-1, 1);\n }\n \n var lastCardUp = sortedHandUp[0];\n var lastCardDown = sortedHandDown[0];\n var firstCardDown = lastCardDown;\n var straightUp = true;\n var straightDown = true;\n var wildsUp = wilds;\n var wildsDown = wilds;\n for(var i = 1; i < sortedHandUp.length; i++) {\n var thisCardUp = sortedHandUp[i];\n var cardUp = thisCardUp;\n var thisCardDown = sortedHandDown[i];\n var cardDown = thisCardDown;\n while(thisCardUp != lastCardUp+1 && wildsUp > 0) {\n wildsUp--;\n thisCardUp--;\n }\n if(thisCardUp != lastCardUp+1) {\n straightUp = false;\n }\n else {\n lastCardUp = cardUp;\n }\n \n while(thisCardDown != lastCardDown-1 && wildsDown > 0) {\n wildsDown--;\n thisCardDown++;\n }\n if(thisCardDown != lastCardDown-1) {\n straightDown = false;\n }\n else {\n lastCardDown = cardDown;\n }\n }\n \n var highestDown = firstCardDown + wildsDown;\n if (highestDown > 14) highestDown = 14;\n var highestUp = lastCardUp + wildsUp;\n if (highestUp > 14) highestUp = 14;\n \n if(straightDown && straightUp) {\n var highcard = (highestUp > highestDown) ? highestUp : highestDown\n return [4, highcard];\n }\n else if(straightUp) {\n return [4, highestUp];\n }\n else if(straightDown) {\n return [4, highestDown];\n }\n \n return false;\n}", "title": "" }, { "docid": "545dde52948ecc5e3732fe2aff973df8", "score": "0.56615555", "text": "function isGameOver() {\n if(($('.transparent').length) == ((numbers * colours.length * 2) - 2)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "e2f485fcbb00791e9bfcf2dca8ab4417", "score": "0.5652692", "text": "charCollision(direction, char1, char2, char3) {\n let posChar1 = char1.getPosition();\n let posChar2 = char2.getPosition();\n let posChar3 = char3.getPosition();\n if (direction === \"up\") {\n if (\n (posChar1.x === posChar2.x && posChar1.y - 1 === posChar2.y) ||\n (posChar1.x === posChar3.x && posChar1.y - 1 === posChar3.y) ||\n (posChar2.x === posChar3.x && posChar2.y - 1 === posChar3.y)\n ) {\n return true;\n } else {\n return;\n }\n }\n\n if (direction === \"down\") {\n if (\n (posChar1.x === posChar2.x && posChar1.y + 1 === posChar2.y) ||\n (posChar1.x === posChar3.x && posChar1.y + 1 === posChar3.y) ||\n (posChar2.x === posChar3.x && posChar2.y + 1 === posChar3.y) ||\n (posChar3.x === posChar1.x && posChar3.y + 1 === posChar1.y)\n ) {\n //console.log(\"don't move down!collision!\");\n return true;\n } else {\n return;\n }\n }\n\n if (direction === \"left\") {\n if (\n (posChar1.x - 1 === posChar2.x && posChar1.y === posChar2.y) ||\n (posChar1.x - 1 === posChar3.x && posChar1.y === posChar3.y) ||\n (posChar2.x - 1 === posChar3.x && posChar2.y === posChar3.y)\n ) {\n //console.log(\"don't move left!collision!\");\n return true;\n } else {\n return;\n }\n }\n\n if (direction === \"right\") {\n if (\n (posChar1.x + 1 === posChar2.x && posChar1.y === posChar2.y) ||\n (posChar1.x + 1 === posChar3.x && posChar1.y === posChar3.y) ||\n (posChar2.x + 1 === posChar3.x && posChar2.y === posChar3.y)\n ) {\n //console.log(\"don't move right!collision!\");\n return true;\n } else {\n return;\n }\n }\n }", "title": "" }, { "docid": "3d9493153c1cfee847e4b3ff53147c99", "score": "0.5639548", "text": "function gameOfThrones(s) {\n var arr = s.split('');\n arr.sort();\n var count=0;\n for(var i=0;i<arr.length;) {\n var x=arr[i];\n var alphacount=0;\n var j=i;\n while(x==arr[j]) {\n alphacount++;\n j++;\n }\n if(alphacount%2!=0) {\n count++;\n }\n i=i+j;\n \n }\n if(count<=1)\n return \"YES\"\n else\n return \"NO\"\n}", "title": "" }, { "docid": "86f379ddf5005aba57431e04c47255b4", "score": "0.5633579", "text": "function checkWin() {\n\tif (redSnack.length == 1 && blueEat){\n\t\tblueWin = true;\n\t}\n\tif (blueSnack.length == 1 && redEat){\n\t\tredWin = true;\n\t}\n}", "title": "" }, { "docid": "d22e8d8adbab1d560dafd69c98991238", "score": "0.56331193", "text": "function checkEarlierCards() {\n return true;\n}", "title": "" }, { "docid": "36f6b71d0b61c7164c31e775b74bbbdf", "score": "0.5629033", "text": "function gameOver() {\n // For loop to check if snake has collided into itself\n for (let i = 4; i < snake.length; i++) {\n if (snake[i].x === snake[0].x && snake[i].y === snake[0].y) {\n // If snake crashes into itself then game over\n return true;\n };\n }\n const crashLeftWall = snake[0].x < 0;\n const crashRightWall = snake[0].x > gameBoard.width - 10;\n const crashTopWall = snake[0].y < 0;\n const crashBottomWall = snake[0].y > gameBoard.height - 10;\n\n if (crashLeftWall || crashRightWall || crashTopWall || crashBottomWall) return true;\n}", "title": "" }, { "docid": "390d8afc8ca50453bff9786038d4907e", "score": "0.562181", "text": "function isWinning(arr, char) {\n let leftDiagonal = arr[0][0] + arr[1][1] + arr[2][2];\n let rightDiagonal = arr[0][2] + arr[1][1] + arr[2][0];\n const arrayColumn = (a, c) => a.map((x) => x[c]);\n for (let i = 0; i < arr.length; i++) {\n let horizontal = arr[i].reduce((a, c) => a + c, \"\");\n let column = arrayColumn(arr, i);\n let vertical = column.reduce((a, c) => a + c, \"\");\n if (\n char.repeat(3) === horizontal ||\n char.repeat(3) === vertical ||\n char.repeat(3) === leftDiagonal ||\n char.repeat(3) === rightDiagonal\n ) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "c221e1971c19e3cedbac1be759cee2ac", "score": "0.5607096", "text": "isIsosceles() {\n return (\n this.sideA === this.sideB ||\n this.sideA === this.sideC ||\n this.sideB === this.sideC\n );\n }", "title": "" }, { "docid": "c9e901fb51ef051c143777ba960d150a", "score": "0.56027013", "text": "checkChow(tile){\n return this.currentHand.checkChow(tile);\n }", "title": "" }, { "docid": "8bb29120c8742a3c7e6c72ebcee26220", "score": "0.56014436", "text": "function eatFood(){\n if(xFood == x && yFood == y){\n return true;\n }\n}", "title": "" }, { "docid": "30c452dad5f28e7b4b0c47e517aeafad", "score": "0.56005275", "text": "isCollided(ax, ay) {\n\t\t// Collision with walls\n\t\tlet widthLine = this.snake.stage.width / this.snake.stage.config.cw;\n\t\tlet heightLine = this.snake.stage.height / this.snake.stage.config.cw;\n\n\t\t// Self collision\n\t\tlet selfCollision = false;\n\n\t\tfor (let i = 1; i < this.snake.stage.blocks.length; i++) {\n\t\t\tvar x = this.snake.stage.blocks[i].x;\n\t\t\tvar y = this.snake.stage.blocks[i].y;\n\t\t\tif (x == ax && x > 3 && y == ay) selfCollision = true;\n\t\t}\n\n\t\tif (~[-1, widthLine].indexOf(ax) || ~[-1, heightLine].indexOf(ay) || selfCollision) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "672bb6ab9521a111cba4993234af76e2", "score": "0.55957127", "text": "isStraight(roll) {\r\n for (let i = 0; i < roll.length-1; i++) {\r\n if (roll[i] !== roll[i+1] + 1)\r\n return false\r\n }\r\n return true\r\n }", "title": "" }, { "docid": "a567c01f15e31b68783b97fa6616d4a7", "score": "0.55918384", "text": "function checkCollisions(){\n if(pacman.x === inky.x && pacman.y === inky.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n if(pacman.x === pinky.x && pacman.y === pinky.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n if(pacman.x === clyde.x && pacman.y === clyde.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n if(pacman.x === blinky.x && pacman.y === blinky.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n}", "title": "" }, { "docid": "45b229e35254bdaa9d516250eaa99ec3", "score": "0.5586854", "text": "function checkLossCondition(){\n for (var i = 0; i < monkeys.length; i++) {\n if(monkeyShow[i] && monkeys[i][1]+width > posy){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3bc326d62b3b296a909f72901f4a5334", "score": "0.5580746", "text": "function henIsClucking(hen, hen_x, collisionWidth) {\n if ((hen_x - collisionWidth) < character_x && (hen_x + collisionWidth) > character_x && !hen.dead) {\n AUDIO_HEN.play();\n }\n}", "title": "" }, { "docid": "46eb03b3bbd36ef071cb588829f45087", "score": "0.55737126", "text": "function snakeEatsItself() {\n let EatsItself = false;\n for (const key of snakeBody) {\n if (key.y == snakeHead.y && key.x == snakeHead.x) {\n EatsItself = true;\n }\n }\n return EatsItself;\n}", "title": "" }, { "docid": "c4f11a2dace892fb5bf8488db15120ee", "score": "0.5567651", "text": "function checkWon() {\n // Horizontal\n for (let row = 0; row < 3; row++) {\n let count = 0;\n for (let col = 0; col < 3; col++) {\n if (gameboard[row][col] == currentPlayer) {\n count++;\n }\n }\n if (count == 3) {\n return true;\n }\n count = 0;\n }\n\n // Vertical\n for (let col = 0; col < 3; col++) {\n let count = 0;\n for (let row = 0; row < 3; row++) {\n if (gameboard[row][col] == currentPlayer) {\n count++;\n }\n }\n if (count == 3) {\n return true;\n }\n count = 0;\n }\n\n // Diagonal\n if (gameboard[0][0] == currentPlayer && \n gameboard[1][1] == currentPlayer &&\n gameboard[2][2] == currentPlayer) {\n return true;\n }\n\n if (gameboard[0][2] == currentPlayer && \n gameboard[1][1] == currentPlayer &&\n gameboard[2][0] == currentPlayer) {\n return true;\n }\n\n return false\n}", "title": "" }, { "docid": "1d9c92c65f129a24bd2efbfae71c9526", "score": "0.5566213", "text": "function checkIfGameOver(newTile) {\r\n if(newTile < 22 || newTile > 460 || newTile % 22 === 0 || newTile % 22 === 21){\r\n return true;\r\n } else {\r\n if(checkIfSnake(newTile)){\r\n return true;\r\n } else {\r\n return false\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6720529f8d03359098f729f8b9f61f43", "score": "0.55608904", "text": "checkWinner() {\n if (this.guessedLetter.length===this.secretWord.length && this.guessedLetter.split(\"\").sort().join() == this.secretWord.split(\"\").sort().join())\n {\n return true\n }\n else {\n return false\n }\n /* TODO : this is a bit complicated because the game designer decided to store the guessedLetter as a string, but you will manage :-) */\n }", "title": "" }, { "docid": "5553e901acaa60723d4b2e671445e428", "score": "0.5558998", "text": "function right_check(a,b,game_piece) {\r\n if(isValidMove(a,b+1)) {\r\n if(char_arr[a][b+1] == game_piece && (game_piece == 'X' || game_piece == 'O')) {\r\n hori_int++;\r\n if(hori_int == 4) {\r\n is_horizontal = true;\r\n }\r\n left_check(a,b+1,game_piece);\r\n }\r\n }\r\n hori_int = 1;\r\n}", "title": "" }, { "docid": "06c78f26c05c22b36e71192c08213bc2", "score": "0.555853", "text": "isCollision(coinInstance, santaInstance) {\n if (\n coinInstance.x < santaX + santaInstance.santaWidth &&\n coinInstance.x + coinInstance.width > santaX &&\n coinInstance.y < santaY + santaInstance.santaHeight &&\n coinInstance.y + coinInstance.height > santaY\n ) {\n return true;\n }\n }", "title": "" }, { "docid": "165d714ef224eb54e104d779cc6d5b96", "score": "0.5558354", "text": "function checkEggToFloor(egg)\n{\n if(collision(egg , floor))\n {\n showBrokenEgg(egg);\n decrementLife();\n return true;\n }\n else\n {\n return false;\n }\n}", "title": "" }, { "docid": "78723c88e509e9aa6fd60ae7a65b8f10", "score": "0.55517536", "text": "canEscape(x,y){\r\n\t\tlet escape=true;\r\n\t\tlet nbWalls=4;\r\n\t\tlet cellTest;\r\n\t\tif ( x > 0) {\r\n\t\t\tcellTest=this.pickCell(x-1,y);\r\n\t\t\tif ( !cellTest.checkWall() ) { nbWalls--;}\r\n\t\t}\r\n\t\t\r\n\t\tif ( x < this.sizeX-1 ) {\r\n\t\t\tcellTest=this.pickCell(x+1,y);\r\n\t\t\tif ( !cellTest.checkWall() ) { nbWalls--;}\r\n\t\t}\r\n\t\t\r\n\t\tif ( y < this.sizeY-1 ) {\r\n\t\t\tcellTest=this.pickCell(x,y+1);\r\n\t\t\tif ( !cellTest.checkWall() ) { nbWalls--;}\r\n\t\t}\r\n\r\n\t\tif ( y > 0) {\r\n\t\t\tcellTest=this.pickCell(x,y-1);\r\n\t\t\tif ( !cellTest.checkWall() ) { nbWalls--;}\r\n\t\t}\r\n\r\n\t\tif ( nbWalls===4 ) {\r\n\t\t\tescape=false;\r\n\t\t}\r\n\r\n\t\t//console.log(`can escape from ${x}:${y} ? ${escape}`);\r\n\r\n\t\treturn escape;\r\n\t}", "title": "" }, { "docid": "5dd1b7c629f5fde61db18fb68c0b6c7d", "score": "0.55516434", "text": "function isWinner(char){\n if ( cell(0) === char && cell(1) === char && cell(2) === char ){return true;}\n else if ( cell(3) === char && cell(4) === char && cell(5) === char ){return true;}\n else if ( cell(6) === char && cell(7) === char && cell(8) === char ){return true;}\n else if ( cell(0) === char && cell(3) === char && cell(6) === char ){return true;}\n else if ( cell(1) === char && cell(4) === char && cell(7) === char ){return true;}\n else if ( cell(2) === char && cell(5) === char && cell(8) === char ){return true;}\n else if ( cell(0) === char && cell(4) === char && cell(8) === char ){return true;}\n else if ( cell(2) === char && cell(4) === char && cell(6) === char ){return true;}\n else {return false;}\n }", "title": "" }, { "docid": "d278a512e27a471960d988118cbb1eaa", "score": "0.55479676", "text": "function check_victory(){\n\tvar square;\n\tvar ok = true;\n\t//check for every square if it is in the correct position\n\tfor(var i=0; i<15 && ok; i++){\n\t\tsquare = $(\"square_\"+parseInt(i/4)+\"_\"+parseInt(i%4));\n\t\tif(square == null) //check for free square\n\t\t\tok = false;\n\t\telse\n\t\t\tok = (parseInt(square.innerHTML) == (i+1));\n\t}\n\treturn ok;\n}", "title": "" }, { "docid": "b73c9fb849b5777dba4ad5db5be506de", "score": "0.5544834", "text": "function checkSnakeEatApple(game) {\n const snakeHead = game.snake.segments[0];\n for (const apple of game.apples) {\n if (snakeHead.isCollidingWith(apple)) {\n eatApple(game, apple);\n }\n }\n}", "title": "" }, { "docid": "1e615e4fb1ba2c57cba94e05f460b65b", "score": "0.5540738", "text": "isCool(a){if(a[0]==a[a.length-1]){return true;}return false;}", "title": "" }, { "docid": "9ba1cffad3ed3c39c0fdbe4eea17a2b2", "score": "0.55382997", "text": "function isConsonant(letter) {\n return consonants.indexOf(letter) >= 0;\n}", "title": "" }, { "docid": "9ba1cffad3ed3c39c0fdbe4eea17a2b2", "score": "0.55382997", "text": "function isConsonant(letter) {\n return consonants.indexOf(letter) >= 0;\n}", "title": "" }, { "docid": "6234352b90bd4aba8f3a64411acee2af", "score": "0.553713", "text": "function Jackpot(arr) {\n if (\n arr[0] === arr[1] &&\n arr[1] === arr[2] &&\n arr[2] === arr[3] &&\n arr[3] === arr[0]\n ) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "bb30786af68c2a4fecc2e543ba1a37d4", "score": "0.55316716", "text": "function verWinCheck() {\n for (var col = 0; col < 7; col++) {\n for (var row = 0; row < 3; row++) {\n if(colorMatch(returnColor(row,col), returnColor(row+1,col) ,returnColor(row+2,col), returnColor(row+3,col))){\n console.log(\"4 chips connected vertically\");\n reportWin(row,col);\n return true;\n }else {\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "656c6d0a4f19262f4e8b424f244d6b08", "score": "0.55288225", "text": "function isCheck(position,color) {\n var king = {\n p:\"k\",\n col:color\n };\n var kingSquare = findPiece(position, king);\n var xK,yK;\n xK = kingSquare[1];\n yK = kingSquare[0];\n var oppColor = getOppositeColor(color);\n //for all kind of piece available, check if one of this kind is attacking the king\n var square;\n var dir, dirs;\n var x,y;\n var tmp;\n for(piece in Pieces) {\n if(inArray([\"pn\",\"pl\",\"ps\",\"t\"],piece)) {\n continue;\n }\n if(piece === \"g\") {\n dirs = reverseMove(xK,yK,piece,oppColor);\n for(dir in dirs) {\n for(square in dir) {\n x = square[0];\n y = square[1];\n tmp = position[y][x];\n if(tmp === 0) {\n continue;\n }\n if(tmp.col === oppColor && inArray([\"g\",\"pn\",\"pl\",\"ps\",\"t\"],piece)) {\n return true;\n }\n break;\n } \n }\n } else {\n dirs = reverseMove(xK,yK,piece,oppColor);\n for(dir in dirs) {\n for(square in dir) {\n x = square[0];\n y = square[1];\n tmp = position[y][x];\n if(tmp === 0) {\n continue;\n }\n if(tmp.col === oppColor && tmp.p === piece) {\n return true;\n }\n break;\n } \n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "1c389cd86b462657694093f47f8de271", "score": "0.5525425", "text": "function chase(x, y, z) {\n const catA = Math.abs((z-x));\n const catB = Math.abs((z-y));\n\n if(catA > catB) {\n console.log('cat B wins');\n return y;\n }\n if (catA < catB) {\n console.log('cat A wins');\n return x;\n } else if(catA === catB) {\n console.log('Mouse wins');\n return z;\n }\n}", "title": "" }, { "docid": "48027582ec3181db2389a364e63789a8", "score": "0.5525177", "text": "function checkColl(params) {\n\tvar blueHead = blueSnack[0];\n\tvar redHead = redSnack[0];\n\t// check eat in normal situation\n\tif (blueSnack.length != 1 && redSnack.length != 1) {\n\t\tfor (var i = 0; i < redSnack.length; i++) {\n\t\t\tif (blueHead.x == redSnack[i].x && blueHead.y == redSnack[i].y && blueHead != redHead) {\n\t\t\t\tblueEat = true;\n\t\t\t}\n\t\t}\n\n\t\tfor (var i = 0; i < blueSnack.length; i++) {\n\t\t\tif (redHead.x == blueSnack[i].x && redHead.y == blueSnack[i].y && redHead != blueHead) {\n\t\t\t\tredEat = true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//check eat while one is to die\n\telse{\n\t\tfor (var i = 0; i < redSnack.length; i++) {\n\t\t\tif (blueHead.x == redSnack[i].x && blueHead.y == redSnack[i].y) {\n\t\t\t\tblueEat = true;\n\t\t\t}\n\t\t}\n\n\t\tfor (var i = 0; i < blueSnack.length; i++) {\n\t\t\tif (redHead.x == blueSnack[i].x && redHead.y == blueSnack[i].y) {\n\t\t\t\tredEat = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t//check blue wall\n\tif (blueHead.x == 0){\n\t\tif (blueDrt == direction.Left){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\tif (blueHead.x == width - 1){\n\t\tif (blueDrt == direction.Right){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\tif (blueHead.y == 0){\n\t\tif (blueDrt == direction.Up){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\tif (blueHead.y == height - 1){\n\t\tif (blueDrt == direction.Down){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\t//check red wall\n\tif (redHead.x == 0){\n\t\tif (redDrt == direction.Left){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\tif (redHead.x == width - 1){\n\t\tif (redDrt == direction.Right){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\tif (redHead.y == 0){\n\t\tif (redDrt == direction.Up){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\tif (redHead.y == height - 1){\n\t\tif (redDrt == direction.Down){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\t\n\t//check if they crash in heads\n\tif (blueHead == redHead){\n\t\treset = true;\n\t}\n}", "title": "" }, { "docid": "5916a422cf3ddf9a9116911ea95980ec", "score": "0.5524231", "text": "function check_north_east(a,b,game_piece) {\r\n if(isValidMove(a-1,b+1)) {\r\n if(char_arr[a-1][b+1] == game_piece && (game_piece == 'X' || game_piece == 'O')) {\r\n diag_inc++;\r\n if(diag_inc == 4) {\r\n is_diagonal = true;\r\n }\r\n check_north_east(a-1,b+1,game_piece);\r\n }\r\n }\r\n diag_inc = 1;\r\n}", "title": "" }, { "docid": "abfc19d5e72fff67f82cc53903faaccb", "score": "0.5521189", "text": "function checkVictory() {\n if (topRowWin()) {\n return true;\n }\n if (middleRowWin()) {\n\n return true;\n }\n if (bottomRowWin()) {\n return true;\n }\n if (leftColumnWin()) {\n return true;\n }\n if (middleColumnWin()) {\n return true;\n }\n if (rightColumnWin()) {\n return true;\n }\n if (topLeftBottomRightWin()) {\n return true;\n }\n if (topRightBottomLeftWin()) {\n return true;\n }\n}", "title": "" }, { "docid": "f46aa6b32dba53ab1f3d9989028efda5", "score": "0.55208015", "text": "function checkCanyon(t_canyon)\n{\n \n //console.log(t_canyon.x_pos, gameChar_world_x);\n if(gameChar_y < floorPos_y)\n {\n gameChar_y += 2.5;\n isFalling = true;\n }\n else\n {\n isFalling = false;\n }\n \n if(t_canyon.x_pos < gameChar_world_x && gameChar_world_x < t_canyon.x_pos + t_canyon.width && gameChar_y >= floorPos_y)\n {\n isPlummeting = true;\n }\n if(isPlummeting == true)\n {\n gameChar_y += 25;\n }\n}", "title": "" }, { "docid": "d9f5e6e471c7bee2485cc5eb96909101", "score": "0.5520453", "text": "checkCollision2(bot, spot) {\n // simple AABB checking\n if (bot.x < spot.x + spot.width && \n bot.x > spot.x && \n bot.y < spot.y + spot.height &&\n bot.y > spot.y) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "127e63d4b66f4adb923992da68c6aed6", "score": "0.55145514", "text": "function checkCollision(){\n var head = snakeBits[0];\n \n if(head.x < 0 || head.x >= MAX_X || \n head.y < 0 || head.y >= MAX_Y ||\n inSnake(head.x, head.y, false)\n )\n {\n gameOver()\n }\n }", "title": "" }, { "docid": "5abaf006276bd54f78397eb09bbf13b8", "score": "0.5512555", "text": "isColliding(){\n if(this.loc.x>paddle.loc.x &&\n this.loc.x<paddle.loc.x + paddle.w &&\n this.loc.y>paddle.loc.y &&\n this.loc.y<paddle.loc.y + paddle.h){\n return true;\n }else{\n return false;\n }\n\n }", "title": "" }, { "docid": "8f583bf2760361babb085974b9836976", "score": "0.55087596", "text": "function characterOnSolid(me, solid) {\n return (me.resting == solid || (objectOnSolid(me, solid) && me.yvel >= 0 &&\n me.left + me.xvel + unitsize != solid.right && me.right - me.xvel - unitsize != solid.left));\n // me.left - me.xvel + unitsize != solid.right && me.right + me.xvel - unitsize != solid.left));\n // me.left - me.xvel + unitsize != solid.right && me.right - me.xvel - unitsize != solid.left));\n}", "title": "" }, { "docid": "9151664cd4c4bc850a1015a75bbe2ea7", "score": "0.5502862", "text": "function snakeDies() {\n\n if (snake[0] < 1) {\n gameOver()\n } else if (snake[0] > 398) {\n gameOver()\n } else if (snake[0] % width === width - 1) {\n gameOver()\n } else if (snake[0] % width === width + 1) {\n gameOver()\n } else if (snake.slice(1).includes(snake[0])) {\n gameOver()\n }\n \n \n }", "title": "" }, { "docid": "6ba32cd8ab928fb318e46d73ea5ec023", "score": "0.5500269", "text": "function win(){\n for(let col=0; col<column; col++) {\n for(let ro=0; ro<row; ro++) {\n let b = bricks[col][ro];\n if (b[2]==1){\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "c8a9d13e7bc0c6db7aef4c0c402bba03", "score": "0.54948604", "text": "function checkIfHurt() {\n setInterval(function () {\n\n characterHurting(isFacingRight, characterGraphicsHurtRight);\n characterHurting(isFacingLeft, characterGraphicsHurtLeft);\n\n }, 125);\n}", "title": "" }, { "docid": "ba65a44790574a2ad2d5c5dc77ffe7e2", "score": "0.5494299", "text": "function gameOfThrones(input) {\n\tvar codedString = input.split(\"\");\n\tvar letterObject = {};\n\tvar letterCount = 0;\n\tvar oneOdd = false;\n\tvar isSolo = false;\n\tvar passedTest = true;\n\tfor (i=0;i<codedString.length;i++) {\n\t\tif (letterObject.hasOwnProperty(codedString[i])) {\n\t\t\tletterObject[codedString[i]]++;\n\t\t} else {\n\t\t\tletterObject[codedString[i]] = 1;\n\t\t\tletterCount++;\n\t\t}\n\t}\n\tfor (letter in letterObject) {\n\t\tif (letterObject[letter] % 2 != 0) {\n\t\t\tif(oneOdd == false) {oneOdd=true\n\t\t\t} else if (oneOdd == true) {\n\t\t\t\tconsole.log(\"NO\")\n\t\t\t\tpassedTest = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(letterObject[letter] == 1 && isSolo == false) {\n\t\t\t\tisSolo = true;\n\t\t\t} else if (letterObject[letter] == 1 && isSolo == true) {\n\t\t\t\tconsole.log(\"NO\");\n\t\t\t\tpassedTest = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (passedTest) {console.log(\"YES\")}\n}", "title": "" }, { "docid": "93390cf051d39dc7f1b84369bd2c9a79", "score": "0.54925925", "text": "function isWinner(tile_clicked, checked_tiles, win_num, symbol) {\n var x = tile_clicked[0]\n var y = tile_clicked[1]\n console.log(x, y)\n var i, j\n var n = win_num\n var temp = 0\n // Check horizontal line\n for (i = x - win_num + 1; i <= x + win_num - 1; i++){\n if (i < 0 || i > 4) {continue}\n if (checked_tiles[y][i] == symbol){\n temp++\n if (temp == win_num){\n return true\n }\n }else{\n temp = 0\n }\n }\n temp = 0\n // Check vertical line\n for (i = x - win_num + 1; i <= x + win_num - 1; i++){\n if (i < 0 || i > 4) {continue}\n if (checked_tiles[i][x] == symbol){\n temp++\n if (temp == win_num){\n return true\n }\n }else{\n temp = 0\n }\n }\n temp = 0\n // Check diagnal, from north west to south east\n for (i = x - win_num + 1, j = y - win_num + 1; i <= x + win_num - 1 || j <= y + win_num - 1; i++, j++){\n if (i < 0 || j < 0 || i > 4 || j > 4) {continue}\n if (checked_tiles[j][i] == symbol){\n temp++\n if (temp == win_num){\n return true\n }\n }else{\n temp = 0\n }\n }\n temp = 0\n // Check diagnal, from north east to south west\n for (i = x + win_num - 1, j = y - win_num + 1; i >= x - win_num + 1 || j <= y + win_num - 1; i--, j++){\n if (i < 0 || j < 0 || i > 4 || j > 4) {continue}\n if (checked_tiles[j][i] == symbol){\n temp++\n if (temp == win_num){\n return true\n }\n }else{\n temp = 0\n }\n }\n temp = 0\n return false\n}", "title": "" }, { "docid": "79741be42f5bb30cae86fbd75856db5e", "score": "0.5489487", "text": "function cross(piece, future){\n var pos = piece.position(),\n pass = true;\n\n piece.children().each( function (idx1, val1) {\n var tetra = $(val1).position();\n\n tetra.left += pos.left + future.left;\n tetra.top += pos.top + future.top;\n\n if(tetra.left >= 0 && tetra.left < t.STAGE_WIDTH && tetra.top < t.STAGE_HEIGHT ){\n\n $.each(t.FIELD, function (idx2, val2) {\n if(val2.top == tetra.top && val2.left == tetra.left ){\n return pass = false;\n }\n });\n } else {\n return pass = false;\n }\n });\n\n return pass;\n }", "title": "" }, { "docid": "ef7683ffb647013d9b56cd7ebab02724", "score": "0.5489056", "text": "function checkHexBlue(x, y) {\n if (checkForBlue(x, y) && !alreadyScored(x, y)) {\n // console.log(\"looking at surrounding hexes\")\n if (checkForBlue(x-1, y-1) || checkForBlue(x+1, y-1) || checkForBlue(x-2, y) || checkForBlue(x+2, y) || checkForBlue(x-1, y+1) || checkForBlue(x+1, y+1)) {\n markScoredBlue(x, y)\n blueLength += 1\n blueScore += 1\n // console.log('blueLength incremented because of ' + '(' + x + ',' + y +')')\n checkHexBlue(x-1, y-1)\n checkHexBlue(x+1, y-1)\n checkHexBlue(x-2, y)\n checkHexBlue(x+2, y)\n checkHexBlue(x-1, y+1)\n checkHexBlue(x+1, y+1)\n }\n }\n else {return}\n}", "title": "" }, { "docid": "bc572470938113b4469d412521e38c53", "score": "0.5488303", "text": "function strike() {\n return bowler.rolls[frameIndex] === 10;\n }", "title": "" }, { "docid": "7c886fab986750efb17fcd2eecc5071b", "score": "0.548653", "text": "function checkAces(side) {\n while (side.total > 21) {\n if (!side.aces) break;\n\n side.aces -= 1;\n side.total -= 10;\n }\n}", "title": "" }, { "docid": "cd6074aac8d629a250d06788362731dc", "score": "0.5485857", "text": "function checkCollision(x1,y1,h1,w1,x2,y2,h2,w2)\n{\n \n if (x1 < x2 + w2 && x1 + w1 > x2 && y1 < y2 + h2 && y1 + h1 > y2)\n {\n document.getElementById('gameOver').innerHTML = \"<h1> GAME OVER<h2>\";\n startGame = false;\n \n \n return true; \n\n }\n else\n {\n return false; \n } \n}", "title": "" }, { "docid": "261e41c63b1f63da3cf941ecce9d1f2b", "score": "0.5484068", "text": "function isConsonant(letter) {\n return !isVowel(letter);\n}", "title": "" }, { "docid": "5e418d89ffe3987cd3a7b17b33b6ef47", "score": "0.5483149", "text": "function checkForCollusion(playerX, playerY, playerWidth, playerHeight, tileX, tileY, tileWidth, tileHeight) {\n if (playerX < tileX + tileWidth && playerX + playerWidth > tileX &&\n playerY < tileY + tileHeight && playerY + playerHeight > tileY) {\n return true;\n }\n return false;\n}", "title": "" } ]
3b0a56d8323aaf1e86e0fb793cc1b033
Compatible with repeat class, Discard after can be deleted Compatible with repeat class, Discard after can be deleted
[ { "docid": "2b76bc350cf26ab4588d8411b659706e", "score": "0.0", "text": "function ActionInterval(d) {\n var _this;\n\n _this = _FiniteTimeAction.call(this) || this;\n _this.MAX_VALUE = 2;\n _this._elapsed = 0;\n _this._firstTick = false;\n _this._easeList = [];\n _this._speed = 1;\n _this._repeatForever = false;\n _this._repeatMethod = false;\n _this._speedMethod = false;\n\n if (d !== undefined && !isNaN(d)) {\n _this.initWithDuration(d);\n }\n\n return _this;\n }", "title": "" } ]
[ { "docid": "8ee927d2808a070b7d5da6b331c0b257", "score": "0.5770758", "text": "removed() {}", "title": "" }, { "docid": "50ec68c9ed22ae9177b2dca59a3ab20f", "score": "0.5660337", "text": "removeAll() {\n return this.ensureNonAliasedItems(), this.items.length = 0, this;\n }", "title": "" }, { "docid": "ab3d6d3c4a89b94556c895fd4d89a4da", "score": "0.5605561", "text": "while (viewsLength > itemsLength) {\n viewsLength--;\n repeat.removeView(viewsLength, true);\n }", "title": "" }, { "docid": "3da1073c332455fc0c11c3b6fddf6aec", "score": "0.5575914", "text": "function startOver() {\n let addedElements = document.getElementsByClassName('added');\n for (var i = addedElements.length - 1; i >= 0 ; i--) {\n addedElements[i].remove(); \n };\n}", "title": "" }, { "docid": "83bb97b029f9a53393cfaaacd418b5ef", "score": "0.5552413", "text": "remove() {return false}", "title": "" }, { "docid": "5c23946a189dc358231640175218519d", "score": "0.5507337", "text": "function removeDuplictes(){\n\t\n}", "title": "" }, { "docid": "44e00afc37fc010770d08550fb72abfe", "score": "0.5503502", "text": "shuffleDiscard () {\n this.discarded = this.randomiseArray(this.discarded.slice())\n }", "title": "" }, { "docid": "888a056f95be7174cb8ab2226716c68e", "score": "0.54932714", "text": "withoutRepeatStrategy() {\n this.registerRepeatStrategy = false;\n }", "title": "" }, { "docid": "470652c812f72e3a9e3a08dea3a417d0", "score": "0.5478846", "text": "discard() {\n\t\tthis._pop();\n\t}", "title": "" }, { "docid": "11ac0a53062e791ec7aac26bcc2badcc", "score": "0.54627967", "text": "remove() {}", "title": "" }, { "docid": "1211831065034ca80a8311c9d18777a1", "score": "0.54510975", "text": "removeDupes() {\n\n }", "title": "" }, { "docid": "2c76dee1da39ddd886bc9e38c2f3f4b4", "score": "0.54327697", "text": "dupe() {\n\t\tthis._dupe();\n\t}", "title": "" }, { "docid": "d13031fb2b4d8b0fdf875fc0a8a36c7a", "score": "0.54195994", "text": "deleteClassCallCheck() {\r\n const blocks = this._constructor.body.body;\r\n const constractorName = this._constructor.id.name;\r\n for (let i = 0; i < blocks.length; i++) {\r\n let block = blocks[i];\r\n if (block.type == \"ExpressionStatement\") {\r\n let expressions;\r\n let hasMultipleExps = false;\r\n\r\n if (block.expression.expressions) {\r\n expressions = block.expression.expressions;\r\n hasMultipleExps = true;\r\n } else {\r\n expressions = [block.expression];\r\n }\r\n\r\n for (let j = 0; j < expressions.length; j++) {\r\n if (\r\n expressions[j].type == \"CallExpression\" &&\r\n expressions[j].arguments &&\r\n expressions[j].arguments[0].type == \"ThisExpression\" &&\r\n expressions[j].arguments[1].name == constractorName\r\n ) {\r\n if (hasMultipleExps) expressions.splice(j, 1);\r\n else blocks.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "af6d7ce01d57b2a1f48ae47446b58e95", "score": "0.5386111", "text": "discard(fromOrder, itemIndex, orderIndex) {\n\n if(fromOrder) {\n console.log(itemIndex, orderIndex);\n let order = this._orderQueue.orders[orderIndex];\n let item = order.items._items[itemIndex];\n //check the food tray first before settings this\n let foodTrayItems = this._foodTray.items;\n for(let x = 0 ; x < foodTrayItems.length ; x++) {\n if(foodTrayItems[x]._id === item._id) {\n item._isDone = foodTrayItems[x]._isDone;\n item._time = foodTrayItems[x]._time;\n foodTrayItems.splice(x, 1);\n return\n }\n }\n\n item._isDone = false;\n item._time = 0;\n\n } else {\n this._foodTray.items.splice(itemIndex, 1);\n }\n }", "title": "" }, { "docid": "13fe87c93e65aa5819264f2a4d90c26e", "score": "0.53825456", "text": "remove() { }", "title": "" }, { "docid": "329356fe05893aadba97ae5b59090052", "score": "0.5363387", "text": "cleanup() {\n this.index = _.pickBy(this.index, v => v.length > 1)\n }", "title": "" }, { "docid": "f31e7003099ccaae08963cc20b59348d", "score": "0.5347809", "text": "dispose() {\n const self = this;\n // @ts-ignore\n Data.remove(self.element, self.name);\n // @ts-ignore\n Object.keys(self).forEach((prop) => { self[prop] = null; });\n }", "title": "" }, { "docid": "0d9d39add3ea9d457062234c7a347001", "score": "0.5323462", "text": "allowRepeats() {\n return (!this.no_repeats || (this.numPlayable() == 1));\n }", "title": "" }, { "docid": "05b17f2f611848b435c4d8c732530d1e", "score": "0.53157634", "text": "remove() {\n this.forEach(function (item) {\n item.remove();\n });\n }", "title": "" }, { "docid": "6b0cb43260cbb85a662a5f308b6ce592", "score": "0.5300313", "text": "disable() {\n this.constructor.all = this.constructor.all.filter((el) => el !== this);\n }", "title": "" }, { "docid": "cd9322a3949ac91f81cb62a1cbd8f4ea", "score": "0.5292061", "text": "toggleRepeat() {\n toggleRepeat();\n }", "title": "" }, { "docid": "8e6830faa1adb60310bb76f4f944bb53", "score": "0.52816325", "text": "truncate() {\n return co(function*() {\n for (var key in this._instances) {\n var instance = this._instances[key];\n var model = instance.model();\n yield model.remove();\n }\n }.bind(this));\n }", "title": "" }, { "docid": "3edcec4ac5212503a563b53fc2d9d7b7", "score": "0.5280397", "text": "stripInstances(obj) {\n const copy = Object.assign({}, obj);\n delete copy.instance;\n\n // Copy and delete instances from the details array too\n const detailCopy = Array.from(copy.details)\n for (let j = 0; j < detailCopy.length; j++) {\n const lineCopy = Object.assign({}, detailCopy[j]);\n delete lineCopy.instance;\n detailCopy[j] = lineCopy;\n }\n\n copy.details = detailCopy;\n return copy;\n }", "title": "" }, { "docid": "29b1aee90c4108ea27787e2f5c902425", "score": "0.52779174", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: '_md-leave'}).start();\n }", "title": "" }, { "docid": "29b1aee90c4108ea27787e2f5c902425", "score": "0.52779174", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: '_md-leave'}).start();\n }", "title": "" }, { "docid": "0b82697b15dc56d91dbef95332b2f9f4", "score": "0.5273588", "text": "drop() {\n return co(function*() {\n for (var key in this._instances) {\n var instance = this._instances[key];\n yield instance.drop();\n }\n }.bind(this));\n }", "title": "" }, { "docid": "c8702d188c08b9dc05c8d0890b9fae07", "score": "0.52734727", "text": "removeAll() {\n this.modList = {};\n }", "title": "" }, { "docid": "6b1d21bd275b6bf72072b4c7f3358d0b", "score": "0.52666533", "text": "removeLife(){\n const hearts = document.querySelectorAll('.tries');\n hearts[this.missed].classList.add('remove');\n this.missed++;\n }", "title": "" }, { "docid": "35594be16aa0dacf55a59537c9e5cdb0", "score": "0.52637553", "text": "remove(){\n return this.each((e)=>{\n e.parentNode.removeChild(e)\n })\n }", "title": "" }, { "docid": "3542a5492a8f3fd5f5881f8e8d4dfd78", "score": "0.5251898", "text": "function _changeRepeat(){\n\t\t_repeat=!_repeat;\n\t}", "title": "" }, { "docid": "f94aaf915e094ad09722a1e63311a753", "score": "0.52505356", "text": "removeLife() {\n\t\t//select heart elements \n\t\tlet hearts = document.getElementsByClassName('tries');\n\t\t//remove first heart item \n\t\thearts[0].remove();\n\t\t//increment missed tracker\n\t\tthis.missed++\n\t\t\tif (this.missed == 5) {//when 5 wrong guesses end game \n\t\t\t\tthis.gameOver(0);\n\t\t\t}\n\t}", "title": "" }, { "docid": "5b1f9a7c31abfb986e3d95c0acd9e568", "score": "0.52248204", "text": "function EndRepeat() {\n Row.call(this);\n this.hasDrawable = false;\n}", "title": "" }, { "docid": "19fe422d3894a0430d02453e712816fa", "score": "0.52186465", "text": "function cardsDontMatch() {\n for (let i = 0; i < shownCards.length; i++) {\n shownCards[i].classList.remove(\"open\", \"show\");\n }\n shownCards.splice(0, 2);\n}", "title": "" }, { "docid": "a4ffc72aece0f313573574ffba5d2df9", "score": "0.52079403", "text": "removed() {\n // do nothing\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "c760b0ee1f5ee54e7f49be5ff454c7a6", "score": "0.52025753", "text": "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "title": "" }, { "docid": "ed918fbb95521c8c8b6dca10b59dd83f", "score": "0.52013135", "text": "remove() {\n\n }", "title": "" }, { "docid": "26f50ff4efeb687d974ccfca2143ed98", "score": "0.518129", "text": "_optimizeTyping() {\n const indiciesToRemove = [];\n\n for (let i = 0; i < this._steps.length - 1; i++) {\n const currentAction = this._steps[i];\n if (!(currentAction instanceof Type)) {\n continue;\n }\n\n if (currentAction.isEqual(this._steps[i + 1])) {\n // Mark this index for removal\n indiciesToRemove.push(i);\n\n console.log(`Removed redundant typing action ${this._steps[i]}`);\n }\n }\n\n // Remove duplicate indicies\n this._removeIndicies(indiciesToRemove);\n }", "title": "" }, { "docid": "db8d29142b26b93eee6e02e1f209383c", "score": "0.51786155", "text": "removeRepeatFromChildViews(view) {\n const nonRepeatSubViews = this.getNonRepeatSubtrees(view);\n nonRepeatSubViews.forEach(childView => {\n const repeatedFields = view.repeat.column.concat(view.repeat.row);\n childView.encodings.forEach((value, key) => {\n if (channeldef_1.isFieldDef(value)) {\n if (channeldef_1.isRepeatRef(value.field)) {\n const index = Math.floor(Math.random() * repeatedFields.length);\n const fieldRef = {\n field: repeatedFields[index],\n type: value.type\n };\n childView.overwrittenEncodings.set(key, fieldRef);\n }\n }\n });\n });\n }", "title": "" }, { "docid": "84f45b3aecaf5aebe19a4c34f3364bf7", "score": "0.5174968", "text": "function classClearer(elementsByClass) {\n for (let i = (elementsByClass.length - 1); i >= 0; i--) {\n elementsByClass[i].remove();\n }\n}", "title": "" }, { "docid": "f2d0d6c95c73a3171db3ea42a146be93", "score": "0.5171659", "text": "removeAll() {\n this.grp.removeAll();\n this.items = [];\n }", "title": "" }, { "docid": "9c778cdf17e88dfa221e5862f0971f4b", "score": "0.51697254", "text": "function SkipSelfDecorator() { }", "title": "" }, { "docid": "9c778cdf17e88dfa221e5862f0971f4b", "score": "0.51697254", "text": "function SkipSelfDecorator() { }", "title": "" }, { "docid": "9c778cdf17e88dfa221e5862f0971f4b", "score": "0.51697254", "text": "function SkipSelfDecorator() { }", "title": "" }, { "docid": "9c778cdf17e88dfa221e5862f0971f4b", "score": "0.51697254", "text": "function SkipSelfDecorator() { }", "title": "" }, { "docid": "afc13901bdcaa3455e460632010bb623", "score": "0.51694936", "text": "collapseList() {\n // ******* TODO: PART IV *******\n let i = this.tableElements.length;\n while (i--) {\n //check if game line, remove\n if (this.tableElements[i].value.type === 'game')\n this.tableElements.splice(i, 1);\n }\n\n }", "title": "" }, { "docid": "67eae154289d310faff3486e35866f3e", "score": "0.5165664", "text": "_removeFadeOut() {\n const that = this,\n fadeOutItems = that.$.itemsContainer.getElementsByClassName('smart-out');\n\n if (fadeOutItems.length) {\n for (let i = 0; i < fadeOutItems.length; i++) {\n fadeOutItems[i].classList.remove('smart-out');\n }\n }\n }", "title": "" }, { "docid": "31dea5ed146cedaf985e8c357f709773", "score": "0.51523024", "text": "function onDiscardAnimEnd() {\n this.classList.add('odiscard-tile');\n}", "title": "" }, { "docid": "159a6cbe36ec92ad2563f9c726700525", "score": "0.5148031", "text": "forgetState() {\n if (this.mPreservedPos.length) {\n this.mPreservedPos.pop();\n }\n }", "title": "" }, { "docid": "8a2ed48bf9b847c7a20ccfbeb05e7762", "score": "0.5144142", "text": "removeClasses() {\n this._element.classList.remove(arrTypeClasses[this._type]);\n }", "title": "" }, { "docid": "dce0ec1fa803f107da55b1cdb669da20", "score": "0.5140879", "text": "removeClass(cl){\n this.each((e)=>{\n e.classList.remove(cl)\n })\n return this\n }", "title": "" }, { "docid": "6327f473037bf4dd5374093b0ce71db1", "score": "0.51314914", "text": "freeze() {\r\n this.pause = true;\r\n this.elements.forEach(element => {\r\n element.object.stop();\r\n });\r\n return this;\r\n }", "title": "" }, { "docid": "67153943572b6fcb8bab7c213097a0e0", "score": "0.51253664", "text": "function animateRemoval() {\r\n return $animateCss(element, {addClass: 'md-leave'}).start();\r\n }", "title": "" }, { "docid": "67153943572b6fcb8bab7c213097a0e0", "score": "0.51253664", "text": "function animateRemoval() {\r\n return $animateCss(element, {addClass: 'md-leave'}).start();\r\n }", "title": "" }, { "docid": "deb940cff50e266dae0930c5d039d7b7", "score": "0.51194704", "text": "function LimparMensagens() {\r\n $(\".item\").remove();\r\n}", "title": "" }, { "docid": "5d4b1146fd560346a46a92475e52ba12", "score": "0.5114373", "text": "removeItem(_item) { }", "title": "" }, { "docid": "c92eabf320184603eb6034bd57fcb51e", "score": "0.51138055", "text": "function clearNoRepeatMode(){\n let nrRemainingDisplay = document.getElementById(\"nrLeft\");\n while(nrCommentDisplay.firstChild){\n nrCommentDisplay.removeChild(nrCommentDisplay.firstChild);\n }\n while(nrSeeListDisplay.firstChild){\n nrSeeListDisplay.removeChild(nrSeeListDisplay.firstChild);\n }\n while(nrLandedDisplay.firstChild){\n nrLandedDisplay.removeChild(nrLandedDisplay.firstChild);\n }\n while(nrRemainingDisplay.firstChild){\n nrRemainingDisplay.removeChild(nrRemainingDisplay.firstChild);\n }\n while(landedListDisplay.firstChild){\n landedListDisplay.removeChild(landedListDisplay.firstChild);\n }\n noRepeatTricks = [];\n noRepeatLanded = 0;\n noRepeatTried = 0;\n nrList = '';\n }", "title": "" }, { "docid": "b0dd23df683893a1c93c7e4efaa69e82", "score": "0.51134527", "text": "DiscardContents() {}", "title": "" }, { "docid": "282c992a301dc5b610b7310e3ac8f815", "score": "0.5093764", "text": "pop() {\n if (this.count == 0) return undefined;\n let deleteItem = this.items[this.count];\n this.count -= 1;\n console.log(`${deleteItem} removed ${this.item}`);\n return deleteItem;\n }", "title": "" }, { "docid": "8125afc332cde966a42544fd3d24813a", "score": "0.50907975", "text": "continue() {\n this.disable = false;\n this.add(null, null, true);\n }", "title": "" }, { "docid": "bd66fd53d36c26b80836bc04befd9b95", "score": "0.509038", "text": "function afterRemoved() {\n //TODO\n}", "title": "" }, { "docid": "e8aff2ea1a0eaa8380212abced1f43b5", "score": "0.50862265", "text": "_remove(item) {\n throw new GObject.NotImplementedError(`_remove in ${this.constructor.name}`);\n }", "title": "" }, { "docid": "7102f571651040815c5817777b22ee06", "score": "0.5079731", "text": "discardNotes() {\n this.cards = {};\n }", "title": "" }, { "docid": "30e382e41fd0ccd7f111cf161430b038", "score": "0.5076763", "text": "removeTodoListCompletedItems() {\n removeTodoListCompletedItems();\n }", "title": "" }, { "docid": "d6e8db96354497b746f5e5216acaea38", "score": "0.5063402", "text": "resetElements_() {\n this.currentIndex_ = 0;\n\n this.$['voice-match-entries'].hidden = false;\n this.$['later-button'].hidden = false;\n this.$['loading-animation'].hidden = true;\n\n for (let i = 0; i < MAX_INDEX; ++i) {\n const entry = this.$['voice-entry-' + i];\n entry.removeAttribute('active');\n entry.removeAttribute('completed');\n }\n }", "title": "" }, { "docid": "9a5b62745b858d6169a253c23ed5d9d7", "score": "0.5062179", "text": "desolder(component) {\n\t this.notifyObservers(this.ON_DESOLDER);\n\t\n\t component.Circuit = null;\n\t Util.removeFromArray(this.elementList, component);\n\t\n\t // TODO: REMOVE NODES\n\t\n\t for (let nodeIdx of component.nodes) {\n\t let node = this.getNode(nodeIdx);\n\t\n\t if (!node)\n\t console.warn(`Error deleting nodes for ${component} No node found at ${nodeIdx}!`);\n\t\n\t if (node && node.getNeighboringElements() == [this]) {\n\t console.log(\"Orphaned node: \", nodeIdx)\n\t }\n\t }\n\t\n\t this.invalidate();\n\t this.recomputeBounds();\n\t }", "title": "" }, { "docid": "560b25ae7129cc9da2195ba4ed5f077a", "score": "0.5062128", "text": "remove() {\r\n if (!this.done) {\r\n this.done = true;\r\n this.stop();\r\n }\r\n this.layer.elements = this.layer.elements.filter(e => {\r\n return (e.object != this);\r\n });\r\n }", "title": "" }, { "docid": "b95902d3f3ceb27896303260a132c097", "score": "0.5061649", "text": "remove() {\n this.#selector.remove();\n }", "title": "" }, { "docid": "2a7b2080b996908d209a67df2644e281", "score": "0.50578123", "text": "pop() {\n if (this.count == 0) return undefined;\n let deleteItem = this.item[this.count - 1];\n this.count -= 1;\n console.log(`${deleteItem} removed`);\n return deleteItem;\n }", "title": "" }, { "docid": "c8b9be661152d6dacc35682487b64bd3", "score": "0.5056445", "text": "dispose() {\n const self = this;\n Data.remove(self.element, self.name);\n // @ts-ignore\n ObjectKeys(self).forEach((prop) => { self[prop] = null; });\n }", "title": "" }, { "docid": "ef06ac26a2bcfdfb61925c3f1181b17b", "score": "0.5044239", "text": "deQueue() {\n return this.collection.shift();\n }", "title": "" }, { "docid": "5f8e6bace30ba2eb9c377c707e1addc4", "score": "0.5042806", "text": "function DeleteRepeaterField(event) {\r\n event.preventDefault();\r\n var currentItem = $(this).parent('div');\r\n\r\n var otherItems = currentItem.siblings('.LdlRepeaterItem');\r\n\r\n var numberOtherItems = otherItems.length;\r\n\r\n if (numberOtherItems > 0) {\r\n currentItem.slideUp('slow', function () {\r\n currentItem.remove();\r\n\r\n otherItems.each(function () {\r\n resetAttributeNames($(this));\r\n });\r\n // Update emailConditionsValues\r\n SetRepeaterFields(event);\r\n });\r\n }\r\n else {\r\n resetAttributeNames(currentItem);\r\n currentItem.find(':input').val(\"\");\r\n // Update emailConditionsValues\r\n SetRepeaterFields(event);\r\n }\r\n }", "title": "" }, { "docid": "417edf784f74544f0ab84c332ff5c1b0", "score": "0.50343204", "text": "filterRule_no_repeat(obj) {\n //([a - zA - Z])(\\1) + //如果匹配成功代表删除该项目\n let reg = /([a - zA - Z])(\\1)+/;\n let result = null == reg.exec(obj[\"key\"]);\n return result;\n }", "title": "" }, { "docid": "d3e79c51929b035db3024139d110e49c", "score": "0.5034215", "text": "function doNoMatch() {\n listOfCards[0].classList.remove('open','show');\n listOfCards[1].classList.remove('open','show');\n}", "title": "" }, { "docid": "86d140a67f3c530ac2de9f5d3da9f8a4", "score": "0.5032151", "text": "removeAll() {\r\n return super.removeAll(this.getType());\r\n }", "title": "" }, { "docid": "86d140a67f3c530ac2de9f5d3da9f8a4", "score": "0.5032151", "text": "removeAll() {\r\n return super.removeAll(this.getType());\r\n }", "title": "" }, { "docid": "86d140a67f3c530ac2de9f5d3da9f8a4", "score": "0.5032151", "text": "removeAll() {\r\n return super.removeAll(this.getType());\r\n }", "title": "" }, { "docid": "8a47fede83b77b6dd1bd78cafdba5492", "score": "0.50298584", "text": "function postList_dissapear(){\n\tresult=document.getElementById('postList');\t\n if(result.classList.contains('animate-postList'))\n {\n\tresult.classList.add('regress-postList');\n\t\t\n\tresult.classList.remove('animate-postList');\n\t\n\tsetTimeout(()=>{\n\t result.classList.remove('regress-postList');\n\t},500);\n }\t\n}", "title": "" }, { "docid": "cb86b44a91f4e4e00ba478953602ab90", "score": "0.5027591", "text": "forgetInstance(abstract) {\n delete this.instances[abstract];\n delete this.bindings[abstract];\n delete this.aliases[abstract];\n }", "title": "" }, { "docid": "d209ea22a3379c1bb5540d3db3d24378", "score": "0.5026911", "text": "clear() {\n return;\n }", "title": "" }, { "docid": "d209ea22a3379c1bb5540d3db3d24378", "score": "0.5026911", "text": "clear() {\n return;\n }", "title": "" }, { "docid": "16057d74ba8569e0640ab84f13fa47a7", "score": "0.5020557", "text": "function Gr(e){delete qr[e]}", "title": "" }, { "docid": "714428ceecfdc3bcff4885ee4a4e6fe6", "score": "0.5020067", "text": "function removeTaskInImportantCategory(target) {\n let flag =0;\n for(i = 0; i < taskList.length; i++){\n if(taskList[i].category === \"Important\") {\n for(j = 0; j < taskList[i].tasks.length; j++) { \n if(target.previousSibling.innerHTML === taskList[i].tasks[j].taskName) {\n target.parentNode.remove();\n taskList[i].tasks.splice(j, 1);\n }\n }\n } else{\n checkContainsInList(target.previousSibling.innerHTML);\n for(j = 0; j < taskList[i].tasks.length; j++) { \n if(target.previousSibling.innerHTML === taskList[i].tasks[j].taskName) {\n taskList[i].tasks[j].isImportant = \"false\";\n target.className = \"far fa-star\"; \n flag = 1;\n break;\n }\n }\n if(flag === 1){\n break;\n }\n }\n }\n renderCornerContainer(target.previousSibling);\n}", "title": "" }, { "docid": "82aa18720b3bf34931bc2b50f436868b", "score": "0.5016132", "text": "removeItems() {\n this._resetFixModels();\n\n this._items = [];\n }", "title": "" }, { "docid": "0b321b126e2666bb356f6c92c00046b6", "score": "0.5015713", "text": "function P(e){\"new\"in e&&(e.returnOriginal=!e.new,delete e.new)}", "title": "" }, { "docid": "00c625fa7fb30a6dcd25e479a029fec8", "score": "0.501502", "text": "function destructClassName(sClassName) {\n var setup_list = document.getElementsByClassName(sClassName);\n\n while(setup_list[0]) {\n //alert(\"removing: \" + setup_list[0]);\n setup_list[0].parentNode.removeChild(setup_list[0]);\n }\n }", "title": "" }, { "docid": "746fe1b6f84a403a5cc72e52909ea757", "score": "0.50119424", "text": "removeLife() {\n this.missed += 1;\n for (let i = 0; i < this.missed; i++) {\n $(\".tries img\")\n .eq(i)\n .addClass(\"redLife\")\n .delay(400)\n .queue(function(next) {\n $(this).attr(\"src\", \"images/lostHeart.png\");\n next();\n });\n }\n\n if (this.missed === 5) {\n this.gameOver(\"lost\");\n }\n }", "title": "" }, { "docid": "684a3f3dbcf09c72b7e7ec58cb1a3a63", "score": "0.50110114", "text": "deassert() {\n this.wires.forEach(function (item, index) {\n item.deassert();\n });\n }", "title": "" }, { "docid": "0b267cb0b98ea534a6a73993d83253b1", "score": "0.50100833", "text": "function quitar(id){\n//alert('bien');\n var i=0;\n var encontrado=false;\n while((i<canasto.length)&&(!encontrado)){\n//alert(i);\n if(canasto[i].id==id){\n//alert('encontrado');\n encontrado=true;\n//lo eliminamos de la lista con prototype\n canasto=canasto.without(canasto[i]);\n }\n else{\n i++;\n }\n }\n actualizarCanasto();\n}", "title": "" }, { "docid": "cb362d8c6dbadb99c7905b4660eca6fc", "score": "0.50063884", "text": "hideItems() {\n source.remove();\n }", "title": "" }, { "docid": "6255cf90af5cfe41302cc1eb849e3aa8", "score": "0.50027186", "text": "function removeAllProds() {\n const latest = cards_section.querySelectorAll(\".col-6\");\n latest.forEach((item) => {\n item.remove();\n });\n}", "title": "" }, { "docid": "57c04a479d2d92b72309346b81f99597", "score": "0.4997848", "text": "function remove() {\n return test.each(function () {\n let item = $(this).removeClass(\"showActive\");\n return item;\n });\n}", "title": "" }, { "docid": "fe03eeb5d0b1c0312be627166a7c57ef", "score": "0.4995329", "text": "_reset() {\n // eslint-disable-line class-methods-use-this\n return;\n }", "title": "" }, { "docid": "fe03eeb5d0b1c0312be627166a7c57ef", "score": "0.4995329", "text": "_reset() {\n // eslint-disable-line class-methods-use-this\n return;\n }", "title": "" }, { "docid": "d306d68d9f6a0afece4f8f7318a45018", "score": "0.49930504", "text": "function removeClasses() {\r\n for (const index in cards) {\r\n cards[index].classList.remove(\"match\", \"open\", \"show\");\r\n };\r\n}", "title": "" }, { "docid": "63ad5d0e2d82540724d62a3068b283ea", "score": "0.49901292", "text": "cleanse() {\n this.containerElement.querySelectorAll('.block.right-end').forEach(blockElement => {\n blockElement.remove();\n });\n }", "title": "" } ]
41e005957560859d247c6f39bab1a405
create option changed event
[ { "docid": "32ac32187f9145b36c4cd0dd0abd4128", "score": "0.66811687", "text": "function optionChanged(id) {\n getPlots(id);\n getDemoInfo(id);\n}", "title": "" } ]
[ { "docid": "2c7d7865fe8be44c80c5d912bf71b832", "score": "0.7469466", "text": "function optionChanged(select) {\r\n metaData(select);\r\n bar(select);\r\n bubble(select);\r\n}", "title": "" }, { "docid": "1821ba86c9667d0ad4becf82e05b1f43", "score": "0.73629975", "text": "function optionChanged(select) {\n metaData(select);\n bar(select);\n bubble(select);\n gauge(select);\n}", "title": "" }, { "docid": "d0837042f2c058014728b5ccea33908d", "score": "0.69826514", "text": "function optionChanged(event) {\n\tif (this.type == \"checkbox\") {\n\t\tvar group = this.id.split(\"/\")\n\t\tif (group[1] && group[0] == \"cleanwatch\") {\n\t\t\tvar cleanwatch = pref.getPref(\"cleanwatch\"),\n\t\t\t\tnode = this.parentNode.parentNode\n\n\t\t\tvar logid = this.id,\n\t\t\t\tlogfrom = cleanwatch[group[1]],\n\t\t\t\tlogto = this.checked\n\n\t\t\tif (/sub\\-group/.test(node.className)) {\n\t\t\t\tvar id = node.parentNode.firstElementChild.id.split(\"/\")[1]\n\t\t\t\tif (/^all/.test(id)) {\n\t\t\t\t\tvar all = node.querySelectorAll(\"input\")\n\t\t\t\t\tall = Array.prototype.every.call(all, function (el) { return el.checked })\n\n\t\t\t\t\tif (all) {\n\t\t\t\t\t\tlogid = id\n\t\t\t\t\t\tlogto = true\n\t\t\t\t\t\tlogfrom = cleanwatch[id]\n\n\t\t\t\t\t\tcleanwatch[id] = true\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcleanwatch[group[1]] = this.checked\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcleanwatch[group[1]] = this.checked\n\t\t\t}\n\t\t\telse\n\t\t\t\tcleanwatch[group[1]] = this.checked\n\n\t\t\tlog.info('opt-prefs:',\n\t\t\t\t\t 'An option is changed.',\n\t\t\t\t\t 'ID: ' + logid + '.',\n\t\t\t\t\t 'From: ' + logfrom + '.',\n\t\t\t\t\t 'To: ' + logto + '.')\n\n\t\t\tpref.setPref(\"cleanwatch\", cleanwatch)\n\t\t}\n\t\telse {\n\t\t\tlog.info('opt-prefs:',\n\t\t\t\t\t 'An option is changed.',\n\t\t\t\t\t 'ID: ' + this.id + '.',\n\t\t\t\t\t 'From: ' + pref.getPref(this.id) + '.',\n\t\t\t\t\t 'To: ' + this.checked + '.')\n\n\t\t\tpref.setPref(this.id, this.checked)\n\t\t}\n\t}\n\telse if (this.type == \"color\" || this.type == \"range\") {\n\t\tvar customcolor = pref.getPref(\"customcolor\"),\n\t\t\tgroup = this.id.split(/\\/|\\-/)\n\n\t\tvar logfrom = customcolor[group[1]]\n\n\t\tif (group[1] && group[0] == \"customcolor\")\n\t\t\tcustomcolor[group[1]] = rgb2hsla(this.value, this.nextElementSibling.value)\n\t\telse\n\t\t\tcustomcolor[group[1]] = rgb2hsla(this.previousElementSibling.value, this.value)\n\n\t\tlog.info('opt-prefs:',\n\t\t\t\t 'An option is changed.',\n\t\t\t\t 'ID: customcolor/' + group[1] + '.',\n\t\t\t\t 'From: ' + logfrom + '.',\n\t\t\t\t 'To: ' + customcolor[group[1]] + '.')\n\n\t\tpref.setPref(\"customcolor\", customcolor)\n\t}\n\telse if (this.type == \"text\" || this.type == \"select-one\" || this.type == \"number\") {\n\t\tlog.info('opt-prefs:',\n\t\t\t\t 'An option is changed.',\n\t\t\t\t 'ID: ' + this.id + '.',\n\t\t\t\t 'From: ' + pref.getPref(this.id) + '.',\n\t\t\t\t 'To: ' + this.value + '.')\n\n\t\tpref.setPref(this.id, this.value)\n\t}\n}", "title": "" }, { "docid": "3a7fecf2520f5476e460e099c5abdb12", "score": "0.6847369", "text": "function optionChanged(id) {\n getData(id);\n fetchDemoInfo(id);\n}", "title": "" }, { "docid": "3f9c72caac4ac3637ae168bbcb28cdc6", "score": "0.68255144", "text": "function optionChanged(id) {\n build_chart(id);\n}", "title": "" }, { "docid": "4994391434bf463ce3b3a2ba82e2de8a", "score": "0.67442936", "text": "function optionChanged(selection){\n createPlots(selection);\n createMeta(selection);\n creategauge(selection);\n}", "title": "" }, { "docid": "dab526fcaf75bb0a3fdf1d66d98b4e4c", "score": "0.6737068", "text": "changeOption(event) {\n const info = event.target.id.split(\";\");\n const dmLei = info[0];\n const geneId = info[1];\n const genes = this.state.currentGenePanel;\n\n // Checks if it is disease mode or last exon important that should be changed\n if (dmLei === \"dm\") {\n genes[geneId].disease_mode = event.target.value;\n } else {\n genes[geneId].last_exon_important = event.target.value;\n }\n\n // updates the value\n this.setState({\n currentGenePanel: genes\n }, function() {\n this.createGeneComponents();\n });\n }", "title": "" }, { "docid": "1086cc56036224706fc5d01c1358c2c8", "score": "0.6717509", "text": "function optionChanged(newDate) {\n // Fetch new data each time a new sample is selected\n console.log(\"OPTION CHANGED\");\n // buildMetadata(newDate);\n}", "title": "" }, { "docid": "4eb44a085e69ce4ab3c84f5edf1dc950", "score": "0.6684319", "text": "function optionChanged (id) {\n buildAllCharts(id);\n}", "title": "" }, { "docid": "03e51da0d607960ea0f7f7302500a9c1", "score": "0.6674147", "text": "function optionChanged(newSample) {\r\n // function calls - the volunteer id within newSample will be passed through\r\n buildMetadata(newSample);\r\n buildCharts(newSample);\r\n buildGaugeChart(newSample);\r\n}", "title": "" }, { "docid": "048c8d34996a8e1d5ff5616ba982d23c", "score": "0.6640408", "text": "function optionChanged(subject) {\n buildPlots(subject);\n getDemographicInfo(subject);\n}", "title": "" }, { "docid": "a0125ad48b44bcba15b6e80dc71bd1e5", "score": "0.6630148", "text": "function optionChanged(id) {\n Plot(id);\n demographics(id);\n gauge(id);\n}", "title": "" }, { "docid": "5e12772532cb1a972a467873a480c5c2", "score": "0.6624637", "text": "function optionChanged(id) {\n charts(id);\n demographic_info(id);\n}", "title": "" }, { "docid": "dcbaba057f0f581a78ff76c50081a737", "score": "0.66229236", "text": "function optionChanged(id) {\n plotData(id);\n getData(id);\n }", "title": "" }, { "docid": "900339f4a87580d5e44f16c1eecf4a6c", "score": "0.6616845", "text": "_onchange() {}", "title": "" }, { "docid": "900339f4a87580d5e44f16c1eecf4a6c", "score": "0.6616845", "text": "_onchange() {}", "title": "" }, { "docid": "a9d08031c9314f471bb2f3178ceb057b", "score": "0.6615523", "text": "function optionChanged(id_num) {\n if(id_num)\n {\n buildCharts(id_num);\n buildMetadata(id_num);\n }\n}", "title": "" }, { "docid": "4d73e5a8381c20a6326f04958f40efc9", "score": "0.66102445", "text": "function optionChanged(newID) {\n getMetadata(newID);\n getCharts(newID);\n}", "title": "" }, { "docid": "3eae83c099b7406fa35bb342861e56b3", "score": "0.66020215", "text": "function optionChanged(id){\r\n demInfo(id);\r\n generatePlot(id);\r\n}", "title": "" }, { "docid": "d9861274b23a02a80ce30b0f5cd31ab5", "score": "0.6595214", "text": "function optionChanged(id) {\r\n getSample(id);\r\n indivInfo(id);\r\n \r\n}", "title": "" }, { "docid": "b57fbac21e4636f280e49697b8132a8d", "score": "0.6584341", "text": "function optionChanged(id) {\n \n buildPlot(id);\n getMetainfo(id);\n }", "title": "" }, { "docid": "a8cff2ab81afc3501c88659e3db64ae2", "score": "0.6577949", "text": "function optionChanged(sample) {\n graphs(sample);\n demo_Info(sample);\n }", "title": "" }, { "docid": "8f7c3f16160bf87bddce93de35ed4adc", "score": "0.6563689", "text": "function optionChanged(aNewSample) {\n chartBuilder(aNewSample);\n buildData(aNewSample); \n}", "title": "" }, { "docid": "8de759557c677ad0cc0929330e4e0889", "score": "0.6560428", "text": "slottedOptionsChanged(prev, next) {\n super.slottedOptionsChanged(prev, next);\n this.updateValue();\n }", "title": "" }, { "docid": "d9adda78b3d96fba727c7fa02002b1b5", "score": "0.65555644", "text": "function optionChanged(newSelection) \n{\n console.log(`The user selected ${newSelection}`);\n \n drawBubbleChart(newSelection);\n drawBarGraph(newSelection);\n drawGauge(newSelection);\n showMetaData(newSelection);\n}", "title": "" }, { "docid": "8c5af2f59944b49810f69d61ee7258fb", "score": "0.654979", "text": "function optionChanged(dropdown_value)\n{\n DrawCharts(dropdown_value);\n DisplayMetadata(dropdown_value);\n}", "title": "" }, { "docid": "337c6aa40750a4dcc26fac0efff3c765", "score": "0.65441376", "text": "function optionChanged(id) {\n \n getPlot(id);\n getInfo(id);\n}", "title": "" }, { "docid": "e75aa54aa4c3656fb4903c30ec5697ae", "score": "0.6540168", "text": "function optionChanged(newSample) {\n createCharts(newSample);\n }", "title": "" }, { "docid": "efa0c057a413be22fc967639738b7f61", "score": "0.6531261", "text": "function optionChanged(newId){\n buildChart(newId);\n buildMetadata(newId);\n}", "title": "" }, { "docid": "51a808dd70b903149433f699b8faed6b", "score": "0.652287", "text": "function optionChanged(id) {\n giveMeThosePlost(id);\n giveMeThatBoxInfo(id);\n}", "title": "" }, { "docid": "3942bf2a489a97ceae28a8edc0b0d200", "score": "0.6513904", "text": "function optionChanged(id) {\n plots(id);\n getInfo(id);\n}", "title": "" }, { "docid": "a0a55537e015ebef72dd88832c159e0a", "score": "0.6510686", "text": "function optionChanged(id) {\n getPlot(id);\n getInfo(id);\n}", "title": "" }, { "docid": "a169524e840aefe4195344f7974813e4", "score": "0.65025705", "text": "function optionChanged(selectedPatientID) {\r\n console.log(selectedPatientID);\r\n buildCharts(selectedPatientID);\r\n populateDemographicInfo(selectedPatientID);\r\n}", "title": "" }, { "docid": "8def32fcd00572677fd69c67c4f1eaf9", "score": "0.64967453", "text": "function onChangeCallback () {\n if ($scope.options && $scope.options.onChange) {\n\n // Sort by day name and time\n var sortedSelected = [];\n selected.forEach(function(item){\n var el = item.split('-');\n var o = {day: _.find($scope.days, {name: el[0]}), time: parseInt(el[1])};\n sortedSelected.push(o);\n });\n\n sortedSelected = _.sortBy(_.sortBy(sortedSelected, function(item){\n return item.time;\n }), function(item){\n return item.day.position;\n });\n\n selected = sortedSelected.map(function(item){\n return item.day.name + '-' + item.time;\n })\n\n if (daypartsEqual(selected, weekend)) {\n $rootScope.$broadcast('weekendPreset', weekend);\n } else if (daypartsEqual(selected, weekdays)) {\n $rootScope.$broadcast('weekdayPreset', weekdays);\n } else if (daypartsEqual(selected, businessHours)) {\n $rootScope.$broadcast('businessHoursPreset', businessHours);\n } else if (daypartsEqual(selected, eveningHours)) {\n $rootScope.$broadcast('eveningHoursPreset', eveningHours);\n } else if (daypartsEqual(selected, week)) {\n $rootScope.$broadcast('allPreset', week);\n }\n\n $scope.options.onChange(selected);\n }\n }", "title": "" }, { "docid": "003c7901b28640885b1251264d59c213", "score": "0.64722955", "text": "function optionChanged(ID) {\n\t// update the metadata\n\tloadMetadata(ID);\n\n\t// Plot the data for the selected ID\n\tbuildPlot(ID);\n\n\t// Plot the bonus guage chart\n\tgaugeChart(ID);\n\t\n}", "title": "" }, { "docid": "b2e8cc89b21a5b6ee9ad930b927050d6", "score": "0.6467675", "text": "function optionChanged(id) {\n buildPlots(+id);\n buildMetaTable(+id);\n}", "title": "" }, { "docid": "65698ee5f147bb063307b733f67743f5", "score": "0.646178", "text": "function bind_event_with_dropdown(obj, channel_id){\r\n\tobj.addEventListener('change', function(event){\r\n\t\t// console.log(event.target.selectedIndex, event.target.selectedOptions[0].value);\r\n\t\tif(confirm(\"The associated messages for this key have been lost. Do you want to change the associated key for this channel?\")){\r\n\t\t\t// This function is used to change default key for this channel_id with new key\r\n\t\t\tchange_default_key_for_channel('channel', channel_id, event.target.selectedOptions[0].value)\r\n\t\t}else{\r\n\t\t\tvar options = obj.querySelectorAll('option');\r\n\t\t\tfor(var i=0;i<options.length;i++){\r\n\t\t\t\tif(options[i].value == default_key)\r\n\t\t\t\t\toptions[i].setAttribute('selected', true);\r\n\t\t\t\telse\r\n\t\t\t\t\toptions[i].removeAttribute('selected');\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "c9c4a4c47fa78fdb1b1afad4d0b6870f", "score": "0.64475405", "text": "optionSelected(e) {\n // Must click <option> with value set.\n if (!e.target.value) return;\n this.closeDatalist();\n this.associatedInput.value = e.target.innerText;\n this._value = e.target.value;\n if (this.callback) this.callback();\n }", "title": "" }, { "docid": "54357569c3471ec347f30eabc21c5664", "score": "0.6436081", "text": "function optionChanged(newSample){\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "64134a23887e3c3050dc35f6f21875b7", "score": "0.64329565", "text": "function optionChanged(sample){\n buildBar(sample);\n buildBubble(sample);\n displayMeta(sample);\n}", "title": "" }, { "docid": "d52e4e994fb9253d2c00c97b4fe03c07", "score": "0.64313155", "text": "function optionChanged(selectedPatientID) {\r\n // console.log(selectedPatientID);\r\n buildCharts(selectedPatientID);\r\n populateDemographicInfo(selectedPatientID);\r\n}", "title": "" }, { "docid": "755b7c61847523f0de130e2cb4f6551b", "score": "0.6431156", "text": "function optionChanged(id) {\n render_chart(id);\n panel_data(id);\n}", "title": "" }, { "docid": "fcabf66e0397f120e1e9168a40a9c157", "score": "0.6430343", "text": "_emitChangeEvent(options) {\n this.selectionChange.emit(new MatSelectionListChange(this, options[0], options));\n }", "title": "" }, { "docid": "fcabf66e0397f120e1e9168a40a9c157", "score": "0.6430343", "text": "_emitChangeEvent(options) {\n this.selectionChange.emit(new MatSelectionListChange(this, options[0], options));\n }", "title": "" }, { "docid": "cd61cdbd8b0cc27422019f3029c8fddd", "score": "0.6428781", "text": "function optionChanged(newSample) {\n //recall function inside option change (buildPlot(neewsample))\n buildPlot(newSample);\n }", "title": "" }, { "docid": "567541f83ba83901c94c6ebd6f4d1f9c", "score": "0.64281076", "text": "function optionChanged(dataID) {\n buildPlots(dataID);\n displayDemo(dataID);\n}", "title": "" }, { "docid": "6f0dc05332699b9f2051a8f1403b83de", "score": "0.6425181", "text": "function optionChanged(id){\n createMetaData(id);\n createChart(id);\n gaugeChart(id);\n bubbleChart(id);\n}", "title": "" }, { "docid": "896369545d061d8213739db4b86f6e9d", "score": "0.64111614", "text": "function onOptionChange(newOption) {\n /*--------------*/\n const action_updateImageSelectionOption = updateImageSelectionOption(\n newOption\n );\n dispatch(action_updateImageSelectionOption);\n /*--------------*/\n }", "title": "" }, { "docid": "fd8ea867ef94f9c68d9937259a452089", "score": "0.6406849", "text": "onChange(cb) {\n this.on('change', cb);\n }", "title": "" }, { "docid": "bfbdc55c52552ad18d4f25a16dc65eac", "score": "0.639648", "text": "function optionChanged(newSample){\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "title": "" }, { "docid": "f804076195537a3041a413c49037efd6", "score": "0.63899654", "text": "function optionChanged(id) {\n\n //resets data\n resetData();\n\n //plot chart\n plotCharts(id);\n}", "title": "" }, { "docid": "29359a07f590e652e99788b98517eb43", "score": "0.6384538", "text": "function optionChanged(newSample) {\n // Fetch new data each time a new sample is selected\n // console.log(newSample);\n secdrop(newSample);\n buildCharts2(newSample)\n}", "title": "" }, { "docid": "3016c4ebeecf2ec4cc11f929dc1abded", "score": "0.6377544", "text": "function optionChanged(newProp) {\n // pass value from selct list into global variable\n selProp = newProp; \n \n // remove and recreate map\n map.remove()\n createMap();\n createPlot();\n}", "title": "" }, { "docid": "a9a9d5c0897d2f461f44e2f68fed2110", "score": "0.6371782", "text": "function optionChanged(newSample) {\n getcharts(newSample);\n metadata(newSample);\n}", "title": "" }, { "docid": "5139c4edfa817a179d521e9080243a8c", "score": "0.63516814", "text": "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "5139c4edfa817a179d521e9080243a8c", "score": "0.63516814", "text": "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "0b985e95d5ce9c3e7354d37c68e387fc", "score": "0.6345289", "text": "function optionChanged(newSample) {\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "title": "" }, { "docid": "0b985e95d5ce9c3e7354d37c68e387fc", "score": "0.6345289", "text": "function optionChanged(newSample) {\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "title": "" }, { "docid": "25a179960c7dfe5d9d25842c0c75bfcb", "score": "0.63435555", "text": "function enablePlaceDropdownChangeEvent() {\n $(Tag.SELECTPLACE).on(\"change\", function () {\n //change the value of plae dorpdown to name\n var selectedPlace = $(this).children(\"option:selected\").val();\n setSuburbDropdown(selectedPlace);\n });\n}", "title": "" }, { "docid": "4d15fc60c1ba719183f7b592233bcbe8", "score": "0.633874", "text": "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "4d15fc60c1ba719183f7b592233bcbe8", "score": "0.633874", "text": "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "9685eff7a13a824ea05283885c67da9b", "score": "0.63302845", "text": "_handleChange(e){this.value=e.detail.value;if(this.__ready!==void 0)this.dispatchEvent(new CustomEvent(\"change\",{bubbles:!0,detail:this}))}", "title": "" }, { "docid": "8e7250799b2fa002bf34721b14fe2cf2", "score": "0.63225985", "text": "function on_select_change(type) {\n\treturn function(ev) {\n\t\ttry { \n\t\t\tif (type == 'events') {\n\t\t\t\t$('resources').selectedIndex = -1;\n\t\t\t} else {\n\t\t\t\t$('events').selectedIndex = -1;\n\t\t\t}\n\t\t\tvar index = ev.target.value;\n\t\t\tif (index == \"new\") {\n\t\t\t\tvar item = create_new[type]()\n\t\t\t\tindex = project[type].length;\n\t\t\t\tproject[type].push( item );\n\t\t\t\tev.target.selectedIndex = add_option(type)(item);\n\t\t\t}\n\t\t\t$('display-area').style.display = 'none';\n\t\t\t$('display-area').innerHTML = '';\n\t\t\tdisplay[type](project[type][index]);\n\t\t\t$('display-area').style.display = 'block';\n\t\t} catch (e) {\n\t\t\talert(\"problem changing selection : \" + e);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "8552183aa1acb8427354ca2ab6bace00", "score": "0.6311574", "text": "function optionChanged(newId) {\n Plot(newId);\n}", "title": "" }, { "docid": "ed96e9e7b52e2805529b15820ad8ffa6", "score": "0.6308654", "text": "function optionChanged(newEnt) {\n lineChartMaker(newEnt);\n}", "title": "" }, { "docid": "e0ca832e69e5f6a04cdde729946f0721", "score": "0.63073134", "text": "function optionChanged(newdba) {\n buildPanel(newdba);\n buildMarker(newdba);\n}", "title": "" }, { "docid": "27705d79bc66d776ef58da9e384dd0dc", "score": "0.6305241", "text": "function optionChanged(id) {\n //update and build new plots with new data selected\n getPlots(id);\n getData(id);\n}", "title": "" }, { "docid": "bfb61e4be8644b0992362c99501f2ea2", "score": "0.62706107", "text": "function optionChanged(newName) { \n console.log(`New Test Subject: ${newName}`);\n buildPlot(newName);\n buildInfo(newName); \n}", "title": "" }, { "docid": "c8bbccb60449a7f6cce5091c442106cd", "score": "0.6269466", "text": "function optionChanged(id) {\n newPlot(id);\n displayInfo(id);\n}", "title": "" }, { "docid": "7220e7e59f757ed05a6676e53af23d94", "score": "0.6238028", "text": "function MenuWidget_selectChange(e) {\n\n // Cross-browser discovery of the event target\n // By Stuart Landridge in \"DHTML Utopia ...\"\n var target;\n if (window.event && window.event.srcElement) {\n target = window.event.srcElement;\n } else if (e && e.target) {\n target = e.target;\n } else {\n alert('MenuWidget ERROR:\\n> selectChange: This browser does not support standard javascript events.');\n return;\n }\n\n if (target.nodeName.toLowerCase() != 'select') {\n alert('MenuWidget ERROR:\\n> selectChange: event target [' + target.nodeName.toLowerCase() + '] should instead be [select]');\n return;\n }\n// NOTE: I believe that this function is evaluated outside the context of the MenuWidget.\n// NOTE: Hence the need to extract the Widget from the Select object.\n var MW = target.widget;\n\n if (MW.callback) {\n MW.callback(MW);\n }\n}", "title": "" }, { "docid": "a4386225eaa17bcdeb0990efc9b2a4c6", "score": "0.62345004", "text": "function optionChanged(newSampleId) {\r\n\r\n buildDemoInfoTable(newSampleId);\r\n buildPlots(newSampleId);\r\n\r\n} // end optionChanged()", "title": "" }, { "docid": "d72c9307fd635d138ac29a68acc07e40", "score": "0.62338674", "text": "function optionChanged(id){\n plot(id);\n demInfo(id);\n}", "title": "" }, { "docid": "5e8bde0bfeca701b2690e24b78d73be7", "score": "0.62226903", "text": "_handleOptionFocus(e){if(this.__ready!==void 0)this.dispatchEvent(new CustomEvent(\"option-focus\",{detail:this}))}", "title": "" }, { "docid": "0a76d2df5d5c7b0c2a0f5ad12558a922", "score": "0.622146", "text": "function addEvents() {\n // Add an events to control the options. \n document.getElementById(\"volume\").addEventListener('change',adjustVolumeMaster); \n}", "title": "" }, { "docid": "589ad0b91808ade60bb759481af2e4bb", "score": "0.6214467", "text": "function optionChanged(newPatient) {\n buildPlots(newPatient);\n}", "title": "" }, { "docid": "468d822a9037b03e51564f6081c728e2", "score": "0.62030935", "text": "function setting_changed(context, event) {\n\t\tvar elem = $(event.currentTarget);\n\t\tvar name = elem.attr('name');\n\t\tvar item = context.config_list[name];\n\t\tvar config;\n\n\t\t// Extract the value\n\t\tvar value;\n\t\tvar itype = ((item.type==='input' && item.subtype==='number') ? 'number' : item.type);\n\t\tswitch (itype) {\n\t\t\tcase 'dropdown':\n\t\t\tcase 'list':\n\t\t\t\tif (item.multi === true) {\n\t\t\t\t\tvalue = {};\n\t\t\t\t\telem.find('option').each(function(i,e){\n\t\t\t\t\t\tvar opt_name = e.getAttribute('name') || '#'+e.index;\n\t\t\t\t\t\tvalue[opt_name] = e.selected;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tvalue = elem.find(':checked').attr('name');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'checkbox': value = elem.is(':checked'); break;\n\t\t\tcase 'number': value = Number(elem.val()); break;\n\t\t\tdefault: value = elem.val(); break;\n\t\t}\n\n\t\t// Validation\n\t\tvar valid = {valid:true, msg:''};\n\t\tif (typeof item.validate === 'function') valid = item.validate.call(event.target, value, item);\n\t\tif (typeof valid === 'boolean')\n\t\t\tvalid = {valid:valid, msg:''};\n\t\telse if (typeof valid === 'string')\n\t\t\tvalid = {valid:false, msg:valid};\n\t\telse if (valid === undefined)\n\t\t\tvalid = {valid:true, msg:''};\n\t\tswitch (itype) {\n\t\t\tcase 'number':\n\t\t\t\tif (typeof item.min === 'number' && Number(value) < item.min) {\n\t\t\t\t\tvalid.valid = false;\n\t\t\t\t\tif (valid.msg.length === 0) {\n\t\t\t\t\t\tif (typeof item.max === 'number')\n\t\t\t\t\t\t\tvalid.msg = 'Must be between '+item.min+' and '+item.max;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tvalid.msg = 'Must be '+item.min+' or higher';\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof item.max === 'number' && Number(value) > item.max) {\n\t\t\t\t\tvalid.valid = false;\n\t\t\t\t\tif (valid.msg.length === 0) {\n\t\t\t\t\t\tif (typeof item.min === 'number')\n\t\t\t\t\t\t\tvalid.msg = 'Must be between '+item.min+' and '+item.max;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tvalid.msg = 'Must be '+item.max+' or lower';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!valid)\n\t\t\t\tbreak;\n\n\t\t\tcase 'text':\n\t\t\t\tif (item.match !== undefined && value.match(item.match) === null) {\n\t\t\t\t\tvalid.valid = false;\n\t\t\t\t\tif (valid.msg.length === 0)\n\t\t\t\t\t\tvalid.msg = item.error_msg || 'Invalid value';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Style for valid/invalid\n\t\tvar parent = elem.closest('.right');\n\t\tparent.find('.note').remove();\n\t\tif (typeof valid.msg === 'string' && valid.msg.length > 0)\n\t\t\tparent.append('<div class=\"note'+(valid.valid?'':' error')+'\">'+valid.msg+'</div>');\n\t\tif (!valid.valid) {\n\t\t\telem.addClass('invalid');\n\t\t} else {\n\t\t\telem.removeClass('invalid');\n\t\t}\n\n\t\tvar script_id = context.cfg.script_id;\n\t\tvar settings = wkof.settings[script_id];\n\t\tif (valid.valid) {\n\t\t\tif (item.no_save !== true) set_value(context, settings, name, value);\n\t\t\tif (typeof item.on_change === 'function') item.on_change.call(event.target, name, value, item);\n\t\t\tif (typeof context.cfg.on_change === 'function') context.cfg.on_change.call(event.target, name, value, item);\n\t\t\tif (item.refresh_on_change === true) refresh(context);\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "ed3c10c3186040cd297f77edb71e98e5", "score": "0.61930364", "text": "function optionChanged(){\n\n var dropdownMenu = d3.selectAll(\"#selDataset\");\n var dataset = dropdownMenu.property(\"value\");\n \n createPlots(dataset);\n}", "title": "" }, { "docid": "65491ce204c81a03c8b288d79f4090e6", "score": "0.61918586", "text": "_handleOptionFocus(e) {\n if (this.__ready !== undefined)\n this.dispatchEvent(new CustomEvent(\"option-focus\", { detail: this }));\n }", "title": "" }, { "docid": "2decd1016604da4e6c0a4c14b9e2fb59", "score": "0.618151", "text": "function optionChanged(selected){\n console.log(selected);\n buildBar(selected);\n buildTable(selected);\n}", "title": "" }, { "docid": "f373961270222cb6150c10c6e37e8cf3", "score": "0.61756694", "text": "_handleOptionFocus(e) {\n this.dispatchEvent(new CustomEvent(\"option-focus\", { detail: this }));\n }", "title": "" }, { "docid": "c7cd651cd8858184a914c68f1d2ef999", "score": "0.617533", "text": "function optionChanged(selectedVal) {\n console.log(\"selected value:\" + selectedVal);\n currentTestSubject = selectedVal;\n console.log(\"currentTestSubject \" + currentTestSubject);\n barGraph(selectedVal);\n demographics(selectedVal);\n bubbles(selectedVal, d3.select(\"#selBubscale\").property(\"value\"));\n console.log(d3.select(\"#selBubscale\").property(\"value\"));\n gauge(selectedVal);\n}", "title": "" }, { "docid": "d14a697f783893a2adb767666857ead7", "score": "0.6165869", "text": "function optionChanged(newID) {\n\n plotCharts(newID);\n plotDemographicData(newID);\n}", "title": "" }, { "docid": "f8463602fe7b5151963a0170f85f30a4", "score": "0.6164855", "text": "function optionChanged(country_name){\n filterdata(country_name);\n}", "title": "" }, { "docid": "14cd6cfe1dd88bd66a2c83f0a91a5465", "score": "0.61539304", "text": "function registerListeners() {\n optionDefinitions.forEach(function (option) {\n document.getElementById(option.id).addEventListener('change', saveOptions);\n });\n}", "title": "" }, { "docid": "3f64221955b0fc2c9d4d175263171846", "score": "0.61488575", "text": "function optionChanged(selected){\r\n makeBar(selected);\r\n makeBubble(selected);\r\n makeTable(selected);\r\n makeGauge(selected); \r\n}", "title": "" }, { "docid": "99021ad9f7a17c080243980a1c2ff78d", "score": "0.61460716", "text": "function onChange() {\n\t\t\tassert.ok(false, \"unexpected event called\");\n\t\t}", "title": "" }, { "docid": "92783ab35e8bb7e8754b79dd0b159cd4", "score": "0.61402184", "text": "function optionChanged(selectedID) {\n plots(selectedID);\n metadata(selectedID);\n}", "title": "" }, { "docid": "e7f190c284994920c0443016b12ffe3c", "score": "0.6136443", "text": "changeSelect(event){\n\t\tApi.getEquipos({id_servicio:this._id_servicio.value});\n\t}", "title": "" }, { "docid": "45d7b7342ccb061d064da1e6b7b91b09", "score": "0.61339974", "text": "function optionChanged(id) {\n barPlot(id);\n bubbleChart(id);\n demoGraphic(id);\n gaugeChart(id);\n}", "title": "" }, { "docid": "58025ebb79a2b6b4dcab9c61d22642b1", "score": "0.61308646", "text": "function optionChanged(sampleID) {\n console.log(sampleID);\n buildBarPlot(sampleID);\n buildBubblePlot(sampleID);\n IndividualInfo(sampleID);\n buildGaugePlot(sampleID);\n}", "title": "" }, { "docid": "db802831574a434f9d5788c343c1bfd5", "score": "0.612822", "text": "function optionChanged(newSample) {\n buildPlots(newSample);\n buildMetadata(newSample);\n }", "title": "" }, { "docid": "a774f8e32d09a0c855f42a869d574d39", "score": "0.61278236", "text": "handleOptionChange(changeEvent) {\n this.setState({\n selectedOption: changeEvent.target.value,\n });\n }", "title": "" }, { "docid": "2e8a234cb105d5cddec41cd2de7e0d0c", "score": "0.6115738", "text": "function optionChanged (show) {\n MetadataChart(show);\n }", "title": "" }, { "docid": "36a0ae1b0cbbe90aae3c2e4d819f28dc", "score": "0.6113894", "text": "addOptionSelectListener() {\n this._datalist.addEventListener('click', this.optionSelected.bind(this));\n }", "title": "" }, { "docid": "029f53cc8457914bb0a8f58ca110a8ba", "score": "0.61136955", "text": "function optionChanged(newSampleID) {\n console.log(`Option changed to ${newSampleID}`);\n\n DrawBargraph(newSampleID);\n DrawBubblechart(newSampleID);\n Demographics(newSampleID);\n}", "title": "" }, { "docid": "9c85acda291391829c73cee9bd67ea3d", "score": "0.6103278", "text": "function optionChanged(nextSample) {\r\n buildSiteCharts(nextSample);\r\n buildSampleMetadata(nextSample);\r\n}", "title": "" }, { "docid": "d6bbff0916c1d9bc4b79da22c08a5bcc", "score": "0.6099001", "text": "function bubbleChange() {\n\t\t _events.call('change');\n\t\t }", "title": "" }, { "docid": "9be6fb7447205fff478a7586f10269c5", "score": "0.60989046", "text": "function onChangeEvent() {\n 'use strict';\n\n // retrieve index of selected item\n var start = 'option_'.length;\n var reminder = this.value.substr(start);\n\n // store currently selected class (index of this class) in closure\n coursesSelectedIndex = parseInt(reminder);\n }", "title": "" }, { "docid": "2b49f3803d84c5ac61da4e01ad48de24", "score": "0.60915077", "text": "function optionChanged(sampleid) {\r\n buildmetadata(sampleid);\r\n buildCharts(sampleid);\r\n buildCharts2(sampleid)\r\n}", "title": "" }, { "docid": "2f3ff064febbcb80aa4d6ad0e7ffc225", "score": "0.6080714", "text": "function addOptionEventHandler(){\n $('option').click(function(){\n $('option').removeClass(\"selected\");\n $(this).addClass(\"selected\");\n });\n}", "title": "" } ]
205b3c72288579d0a5de0e6f85c95568
Creates a new React class that is idempotent and capable of containing other React components. It accepts event listeners and DOM properties that are valid according to `DOMProperty`. Event listeners: `onClick`, `onMouseDown`, etc. DOM properties: `className`, `name`, `title`, etc. The `style` property functions differently from the DOM API. It accepts an object mapping of style properties to values.
[ { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.0", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" } ]
[ { "docid": "14624c287638c8e9714103ce3b24c36e", "score": "0.5600523", "text": "function Style (displayName, style, options) {\n\toptions = options || {};\n\t\n\tthis.displayName = displayName;\n\n\tthis._prefix = 'react-' + toHyphenDelimited(displayName) + '_';\n\t\n\tthis._selectorPrefix = '.react-view.' + this._prefix.substr(0, this._prefix.length-1) + ' ';\n\n\tthis.rules = {};\n\tthis.animations = {};\n\tthis.instanceRules = {};\n\tthis.mediaQueries = {};\n\n\tthis.parseStyle(style);\n}", "title": "" }, { "docid": "0ff068bef15d9c39862bf31d233e051b", "score": "0.55527467", "text": "function Component(options) {\n //tslint:disable-line\n return descriptor => {\n return {\n elements: descriptor.elements,\n constructor: undefined,\n kind: 'class',\n finisher: target => {\n if (!_customelement__WEBPACK_IMPORTED_MODULE_0__[\"CustomElement\"].isPrototypeOf(target)) {\n throw new Error(`${target.name} must extend CustomElement`);\n }\n\n const componentExtendedOptions = { ...options,\n cssStyles: [],\n shadyCSSStyleSheetAdopted: false,\n templateCache: null\n };\n const prototype = Object.getPrototypeOf(target);\n const prototypeClassProperties = Object(_classproperties__WEBPACK_IMPORTED_MODULE_1__[\"getClassProperties\"])(prototype);\n\n if (prototypeClassProperties) {\n const targetClassProperties = Object(_classproperties__WEBPACK_IMPORTED_MODULE_1__[\"getClassProperties\"])(target);\n prototypeClassProperties.forEach((value, key) => {\n targetClassProperties.set(key, value);\n });\n }\n\n const componentStyles = Array.isArray(options.style) ? options.style : [options.style || ''];\n const componentCSSStyles = componentStyles.map(value => {\n if (_utils__WEBPACK_IMPORTED_MODULE_6__[\"supportsAdoptingStyleSheets\"]) {\n const css = new CSSStyleSheet();\n css.replaceSync(value);\n return css;\n } else {\n return {\n cssText: value\n };\n }\n });\n\n if (componentExtendedOptions.inheritStyle) {\n const parentStyle = Object(_componentproperties__WEBPACK_IMPORTED_MODULE_2__[\"getComponentProperties\"])(prototype).cssStyles;\n componentExtendedOptions.cssStyles.push(...parentStyle);\n componentExtendedOptions.cssStyles.push(...componentCSSStyles);\n } else {\n componentExtendedOptions.cssStyles.push(...componentCSSStyles);\n }\n\n const prototypeWatcher = Object(_classpropertywatcher__WEBPACK_IMPORTED_MODULE_3__[\"getAllClassPropertyWatcher\"])(prototype);\n\n if (prototypeWatcher.size > 0) {\n Array.from(prototypeWatcher.entries()).forEach(([property, watcher]) => {\n Object(_classpropertywatcher__WEBPACK_IMPORTED_MODULE_3__[\"getClassPropertyWatcher\"])(target, property).push(...watcher);\n });\n }\n\n const prototypeInterceptor = Object(_classpropertyinterceptors__WEBPACK_IMPORTED_MODULE_4__[\"getAllClassPropertyInterceptors\"])(prototype);\n\n if (prototypeInterceptor.size > 0) {\n Array.from(prototypeInterceptor.entries()).forEach(([property, interceptor]) => {\n Object(_classpropertyinterceptors__WEBPACK_IMPORTED_MODULE_4__[\"getClassPropertyInterceptor\"])(target, property).push(...interceptor);\n });\n }\n\n const events = Object(_classevents__WEBPACK_IMPORTED_MODULE_5__[\"getClassEvents\"])(prototype);\n\n if (events.size > 0) {\n Array.from(events.entries()).forEach(([event, option]) => {\n Object(_classevents__WEBPACK_IMPORTED_MODULE_5__[\"getClassEvents\"])(target).set(event, option);\n });\n }\n\n Object(_componentproperties__WEBPACK_IMPORTED_MODULE_2__[\"setComponentProperties\"])(target, componentExtendedOptions);\n window.customElements.define(options.tag, target);\n }\n };\n };\n}", "title": "" }, { "docid": "45088302fb076c8e4bcfb968141eec1f", "score": "0.55227333", "text": "updateNativeProps(nativeProps, classList) {\n let { style, pointerEvents } = nativeProps;\n\n if (pointerEvents) {\n style || (style = {});\n style.pointerEvents = pointerEvents;\n delete nativeProps.pointerEvents;\n }\n\n if (style == null) {\n return;\n }\n if (style.constructor !== Object) {\n throw TypeError('Expected `nativeProps.style` to be an Object!');\n }\n\n const classNamesByProp = {};\n forEach(classList, (className) => {\n const { prop } = this.styleManager.getDeclaration(className);\n prop && (classNamesByProp[prop] = className);\n });\n\n const inlineStyle = {};\n style = createReactDOMStyle(style);\n Object.keys(style).forEach(prop => {\n const value = style[prop];\n if (value != null) {\n const className = this.styleManager.getClassName(prop, value);\n if (className) {\n const prevClassName = classNamesByProp[prop];\n if (!prevClassName) {\n classList.add(className);\n }\n else if (className !== prevClassName) {\n classList.remove(prevClassName);\n classList.add(className);\n }\n inlineStyle[prop] = null;\n } else {\n inlineStyle[prop] = value;\n }\n }\n });\n\n nativeProps.style = prefixInlineStyles(inlineStyle);\n }", "title": "" }, { "docid": "e44dbcca8671226c504d8983199cfeaf", "score": "0.5431109", "text": "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){if(typeof props.$$typeof==='undefined'||props.$$typeof!==REACT_ELEMENT_TYPE){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "6b60cad30f3fd7f3d94eea3362943b1d", "score": "0.5421757", "text": "function getMyReact() {\n function render(element, parent) {\n // Get the props and type from element object\n const { type, props } = element;\n\n // Check if it is a text element\n const isTextElement = type === \"TEXT_ELEMENT\";\n\n // Create a new dom element\n const dom = !isTextElement\n ? document.createElement(type)\n : document.createTextNode(props.nodeValue);\n\n // Filter for eventListeners in the props\n const isListener = name => name.startsWith(\"on\");\n\n // Add eventListeners to the dom element\n Object.keys(props)\n .filter(isListener)\n .forEach(name => {\n const eventType = name.toLowerCase().substring(2);\n dom.addEventListener(eventType, props[name]);\n });\n\n const isAttribute = name => !isAttribute && name !== \"children\";\n\n Object.keys(props)\n .filter(isAttribute)\n .forEach(name => {\n dom[name] = props[name];\n });\n\n // Check if there are any childrens of the given element\n const childElements = props.children || [];\n\n // render those childrens recursively first\n childElements.forEach(el => render(el, dom));\n\n // finally append the element to the parent element\n parent.appendChild(dom);\n }\n\n function createElement(type, config, ...args) {\n const props = Object.assign({}, config);\n const hasChildren = args.length > 0;\n\n const allChildren = hasChildren ? [].concat(...args) : [];\n\n props.children = allChildren\n .filter(child => child !== null && child !== false)\n .map(child =>\n child instanceof Object ? child : createTextElement(child)\n );\n\n return { type, props };\n }\n\n function createTextElement(value) {\n return {\n type: TEXT_ELEMENT,\n props: {\n nodeValue: value\n }\n };\n }\n return {\n render,\n createElement\n };\n}", "title": "" }, { "docid": "db640b80d16a2be58b7817b498f3bd7c", "score": "0.5409846", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx_default()(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: clsx_default()(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "46c21c7c1966f52ab58a43ffe4cf961a", "score": "0.53792065", "text": "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"i\" /* isArray */])(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"t\" /* reduce */])(traits, function(attrs, t) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"i\" /* isArray */])(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])({}, defaultStyles, custom || {}));\n };\n}", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321388", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321388", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321388", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "aad3b02a884039d3e4ce775dd7ead1a8", "score": "0.53187746", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "aad3b02a884039d3e4ce775dd7ead1a8", "score": "0.53187746", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "aad3b02a884039d3e4ce775dd7ead1a8", "score": "0.53187746", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305959", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9d46e8d6d4266f3eeaf54c8353ad8724", "score": "0.530163", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = _objectWithoutProperties$1(options, [\"name\"]);\n\n var classNamePrefix = name;\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(_extends$5({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = makeStyles(stylesOrCreator, _extends$5({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = _objectWithoutProperties$1(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react.cloneElement(children, _extends$5({\n className: clsx(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(_extends$5({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react.createElement(FinalComponent, _extends$5({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n hoistNonReactStatics_cjs(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n }", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.527235", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.527235", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.527235", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "f6f0583c22e27f7f4f406c079c3c9aa1", "score": "0.5249984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "3366fa3b7cd858fa0684c69566cc66e9", "score": "0.5239646", "text": "function createElement(type, config, children) {\n var arguments$1 = arguments;\n\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments$1[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "a8ed8da7e2e2fdf3dbaf823ab77e14de", "score": "0.5235044", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "f334cf63fc49c1b999f4ad7cb9c681ce", "score": "0.522941", "text": "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign({}, defaultStyles, custom || {}));\n };\n}", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.52132535", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.52132535", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.52132535", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.52132535", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108526", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "aaa02d7b6c7dd7fde47a7eff49d7cd86", "score": "0.5205653", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "aaa02d7b6c7dd7fde47a7eff49d7cd86", "score": "0.5205653", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "aaa02d7b6c7dd7fde47a7eff49d7cd86", "score": "0.5205653", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "bd8685ca72bb29a4087dd87413038079", "score": "0.5205397", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = (0,objectWithoutProperties/* default */.Z)(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0,esm_extends/* default */.Z)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0,makeStyles/* default */.Z)(stylesOrCreator, (0,esm_extends/* default */.Z)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = /*#__PURE__*/react.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0,objectWithoutProperties/* default */.Z)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx_default()(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return /*#__PURE__*/react.cloneElement(children, (0,esm_extends/* default */.Z)({\n className: clsx_default()(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0,esm_extends/* default */.Z)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react.createElement(FinalComponent, (0,esm_extends/* default */.Z)({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? 0 : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "883d3d6c15be50e73da27e854c19057f", "score": "0.5200164", "text": "function createEventProperties (opts) {\n const props = opts.properties;\n opts.listeners.forEach(function (name) {\n props[`on${name}`] = {\n attribute: false,\n set (elem, data) {\n if (data.newValue === data.oldValue) {\n return;\n }\n\n if (data.oldValue) {\n elem.removeEventListener(name, data.oldValue);\n }\n\n if (data.newValue) {\n elem.addEventListener(name, data.newValue);\n }\n }\n };\n });\n}", "title": "" }, { "docid": "3d99aa6bc253080d1a09f21977c27bd7", "score": "0.5183706", "text": "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"default\"])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"default\"])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51826376", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.5171312", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.5171312", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "48e70caf04914561d1b95c6dea681473", "score": "0.5170523", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t}", "title": "" }, { "docid": "7f6087a7b6867cc029158439c66db2f8", "score": "0.51672035", "text": "function createElement(type, config, children) {\n\t var propName;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.5147312", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "ee81ad62ab7e058061e72b73ec643eff", "score": "0.51230824", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return _react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "ee81ad62ab7e058061e72b73ec643eff", "score": "0.51230824", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return _react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" } ]
53224800b110f1218e29497ded9d1649
Takes in max and min, returns a number between them
[ { "docid": "2cd84b4fff93b3ab3e9ea27ab88137ac", "score": "0.0", "text": "function getRndNum(min, max) {\n return Math.random() * (max - min) + min;\n}", "title": "" } ]
[ { "docid": "ed1ccda23affb9c46011dd4372812d32", "score": "0.8340923", "text": "function between(n, min, max) {\n return Math.max(min, Math.min(n, max));\n}", "title": "" }, { "docid": "83e8451b94cd26ce54c4256deab1130e", "score": "0.8238361", "text": "function range(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}", "title": "" }, { "docid": "74ec0efebc84d2464d922a711a423132", "score": "0.8173826", "text": "function intBetween(n, min, max) {\n return Math.trunc(Math.max(min, Math.min(n, max)));\n}", "title": "" }, { "docid": "f25a022ffa5e33cba26f326b3396ac3d", "score": "0.81661916", "text": "function between (val, min, max) {\n val = Math.min(val, max);\n val = Math.max(val, min);\n return val;\n }", "title": "" }, { "docid": "15d15f132c81dde1f1fa5f88ddc4103f", "score": "0.787064", "text": "function limitNumber (value, min, max) {\r\n return Math.min(Math.max(min, value), max);\r\n }", "title": "" }, { "docid": "9b4c4395d30480318ba0e34aed1d26ca", "score": "0.78613544", "text": "function between(min, max, defaultValue) {\n return function(n) {\n n = +n;\n if (isNaN(n)) return defaultValue;\n if (n > max) return max;\n if (n < min) return min;\n return n;\n };\n}", "title": "" }, { "docid": "85d6b49b18f27d8856e9bc8c10e0bc5c", "score": "0.77983344", "text": "function getSmartIntA(min, max) {\n min = +newMin;\n max = +newMax;\n let range = Math.floor((+newMin + +newMax) / 2);\n return range;\n}", "title": "" }, { "docid": "5e05d5925b77f5007a8adaf1fb0545d2", "score": "0.77522314", "text": "function limitBetween([min, max], value) {\n return Math.max(min, Math.min(value, max));\n}", "title": "" }, { "docid": "b0c60e156d979925ae01073206f03b59", "score": "0.76546204", "text": "function getSmartInt(min, max) {\n let range = Math.floor((min + max) / 2);\n\n return range;\n}", "title": "" }, { "docid": "80cd65d1811369930e19dd7f8d01d2ad", "score": "0.76474535", "text": "function fitNumber(value, min, max) {\r\n if (value > max) {\r\n return max;\r\n }\r\n else if (value < min) {\r\n return min;\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "80cd65d1811369930e19dd7f8d01d2ad", "score": "0.76474535", "text": "function fitNumber(value, min, max) {\r\n if (value > max) {\r\n return max;\r\n }\r\n else if (value < min) {\r\n return min;\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "73fc508a747d35b36582688416ece4fb", "score": "0.75773436", "text": "function limit(min, max, value) {\n return Math.min(Math.max(value, min), max);\n}", "title": "" }, { "docid": "af8a1834bb9ceefa06a6aa3995cd94a6", "score": "0.75683224", "text": "static boundValue(val, min, max) {\n let len = Math.abs(max - min);\n let a = val % len;\n if (a > max)\n a -= len;\n else if (a < min)\n a += len;\n return a;\n }", "title": "" }, { "docid": "e8f0bbc16ba4415481d2f6be9c4308ad", "score": "0.75456417", "text": "function between(val, min, max){\n return val >= min && val <= max;\n}", "title": "" }, { "docid": "c95b26a3ff5e850510107060e8ec3409", "score": "0.7529875", "text": "function getRandNumBetween(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "68c652bb12d41471f1e7906360a337fb", "score": "0.75113213", "text": "function between(x, min, max) {\r\n\treturn x >= min && x <= max;\r\n}", "title": "" }, { "docid": "b671da496293bb16dcec8edcaf39c1ab", "score": "0.75085217", "text": "function between(min, max) {\n if (min <= max) {\n return Or(Singleton(min),\n between(min + 1, max));\n } else {\n return empty;\n }\n}", "title": "" }, { "docid": "02a54225b4b61d6e2a617475885d9691", "score": "0.75045717", "text": "function between(x, min, max) {\r\n return x >= min && x <= max;\r\n}", "title": "" }, { "docid": "ba3ae3e6f9c8e42c6a11f92531abdec4", "score": "0.7503867", "text": "function between(x, min, max) {\n return x >= min && x <= max;\n}", "title": "" }, { "docid": "3a07b35ffe3c339031e10b82676cacc9", "score": "0.7500122", "text": "function clampRange(val, min, max)\n{\n return (val + 1) / 2 * (max - min) + min;\n}", "title": "" }, { "docid": "9106b1791017af22f3b98468b4af2b57", "score": "0.7492242", "text": "function randBetween(max, min){\n var n = Math.floor(Math.random() * (max - min + 1)) + min;\n\n return n;\n}", "title": "" }, { "docid": "ce6d077f4614413f837e64d802051413", "score": "0.74475884", "text": "function getRandomNum(min, max) {\n let range = max - min;\n let rand = Math.random();\n return(min + Math.round(rand * range));\n }", "title": "" }, { "docid": "f2dd15cb77bb748d29f9297ed5e3d43e", "score": "0.7446305", "text": "function makeBetween(min, max) {\n return function (num) {\n return num >= min && num <= max;\n }\n}", "title": "" }, { "docid": "bb0a2146fd009a97ff813f3fc395acd7", "score": "0.7430572", "text": "function getRandomNumber(min, max) {\r\n let step1 = max - min + 1;\r\n let step2 = Math.random() * step1;\r\n let result = Math.floor(step2) + min;\r\n return result;\r\n}", "title": "" }, { "docid": "b20574cabfe50d083c8939e8abd0c757", "score": "0.74242413", "text": "function clamp(num, min, max) {\r\n return Math.min(Math.max(num, min), max);\r\n}", "title": "" }, { "docid": "0e5d53609dce09acd371ae54c0f36dff", "score": "0.7420352", "text": "function ensureNumberInBounds (num, min, max) {\n\n if (num<min)\n return min\n if (num>max)\n return max\n\n return num\n}", "title": "" }, { "docid": "7c91793342c216250de19331341c2d0c", "score": "0.73984325", "text": "function getRandomNumberBetween(min, max) {\n return Math.floor(Math.random() * max) + min;\n}", "title": "" }, { "docid": "cda62e374b131826da18aa3a2ea52481", "score": "0.7397312", "text": "function clamp(num, min, max) {\n\t return Math.min(Math.max(num, min), max);\n\t}", "title": "" }, { "docid": "3201f56628d485cd62d6574d97ff9922", "score": "0.7376215", "text": "function between(x, min, max) {\n return x >= min && x <= max;\n }", "title": "" }, { "docid": "a874077fe3168644ce3702e10df386f3", "score": "0.73726565", "text": "function clamp(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}", "title": "" }, { "docid": "a874077fe3168644ce3702e10df386f3", "score": "0.73726565", "text": "function clamp(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}", "title": "" }, { "docid": "09b6cddd7c648318f5c5ecc8735758a4", "score": "0.73649395", "text": "function randomNum(min, max){\n if(min >= max){\n return Math.floor(min);\n }\n else{\n var range = max - min;\n var rand = Math.random();\n var num = min + Math.floor(rand * range);\n return num; \n }\n}", "title": "" }, { "docid": "09b6cddd7c648318f5c5ecc8735758a4", "score": "0.73649395", "text": "function randomNum(min, max){\n if(min >= max){\n return Math.floor(min);\n }\n else{\n var range = max - min;\n var rand = Math.random();\n var num = min + Math.floor(rand * range);\n return num; \n }\n}", "title": "" }, { "docid": "c41b53d19758d4ac9f104270614123de", "score": "0.73631585", "text": "function getRandomIntInclusive(min, max) {\r\n\r\n min = Math.ceil(min);\r\n max = Math.floor(max);\r\n var numRand = Math.floor(Math.random() * (max - min + 1)) + min; //Il max è incluso e il min è incluso\r\n return numRand;\r\n\r\n }", "title": "" }, { "docid": "2ab3fc8c6588c40053be8028584b36f3", "score": "0.7352874", "text": "function randomIntFromInterval(min, max) {\n let result = Math.floor(Math.random() * (max - min + 1) + min);\n if (result < min) {\n result = min;\n }\n else if (result > max) {\n result = max;\n }\n return result;\n}", "title": "" }, { "docid": "f3a2f8003cfc27a6af01d78f47f5b532", "score": "0.7347438", "text": "function checkValueRanges(value, max, min) {\n let result = +value;\n if (typeof max !== 'undefined' && +value > +max) {\n result = +max;\n }\n if (typeof min !== 'undefined' && +value < +min) {\n result = +min;\n }\n return result;\n }", "title": "" }, { "docid": "426693a52e7d2c7b043e3b2470efb2ca", "score": "0.73458856", "text": "function getRandomNumberBetween(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "0c6a45b0b1fb0cdf8ac44ddba6e6afd6", "score": "0.73450136", "text": "function constrain( aNumber, aMin, aMax ){\n return Math.min( Math.max( aNumber, aMin ), aMax );\n }", "title": "" }, { "docid": "f939bd82836be8442e82658e771dabf9", "score": "0.7343933", "text": "function between(x, min, max) {\n\t\treturn x >= min && x <= max;\n\t}", "title": "" }, { "docid": "b66ac89f886d21462b4db0fcd79dbb0a", "score": "0.73434603", "text": "function getRandomNumber(min, max) {\n var first = max - min + 1;\n var second = Math.random() * first;\n var result = Math.floor(second) + min;\n return result;\n}", "title": "" }, { "docid": "2dba033e28b0509c10f4f0d8658f11f1", "score": "0.73354125", "text": "function int (min, max) {\n if (typeof min === 'number' && typeof max === 'number') {\n return Math.floor(generator.random() * (max - min + 1)) + min;\n }\n else {\n return undefined;\n }\n}", "title": "" }, { "docid": "270efcf08c18c76f94c413d46001dd58", "score": "0.73186934", "text": "function clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max)\n}", "title": "" }, { "docid": "e6c13b2c20dda5a586d5333ba6896837", "score": "0.7303592", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n numRand = Math.floor(Math.random() * (max - min + 1)) + min; //Il max è incluso e il min è incluso\n return numRand;\n}", "title": "" }, { "docid": "67da0605921f1260f304d5a50428b470", "score": "0.7292409", "text": "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return_value = Math.floor(Math.random() * (max - min + 1)) + min;\n //return Math.floor(Math.random() * (max - min + 1)) + min;\n return return_value;\n}", "title": "" }, { "docid": "c0717e908a550eaa26588e5de79a8b35", "score": "0.72839165", "text": "function getRandomNumber(max,min){\n var random = Math.random();\n random = (random * (max - min + 1)) + min;\n random = Math.floor(random);\n return random;\n}", "title": "" }, { "docid": "0acf13d5f86514709f1ef41e2aa24530", "score": "0.72817934", "text": "function limit(number, min = 0, max = 4294967296) {\n\treturn number < min ? min : number > max ? max : number;\n}", "title": "" }, { "docid": "eacb3837e90d5bb2eb97db1ef2e694ce", "score": "0.72808194", "text": "function randNumBetween(min, max) {\n return Math.random() * (max - min) + min;\n }", "title": "" }, { "docid": "eacb3837e90d5bb2eb97db1ef2e694ce", "score": "0.72808194", "text": "function randNumBetween(min, max) {\n return Math.random() * (max - min) + min;\n }", "title": "" }, { "docid": "16addc41c341081bb4f830c29103c289", "score": "0.72562194", "text": "function clamp(n, min, max) {\n if (n > max) { n = max; }\n if (n < min) { n = min; }\n\n return n;\n }", "title": "" }, { "docid": "5ef822c9b2b053d81c16a14b57d2c862", "score": "0.72538424", "text": "function clamp(n, min, max) {\n if (min !== undefined && n < min)\n n = min;\n if (max !== undefined && n > max)\n n = max;\n return n;\n }", "title": "" }, { "docid": "758409731868cca14f250948ef70e19d", "score": "0.72491413", "text": "function getNumber(min, max) {\r\n var number = min + Math.floor(Math.random() * max);\r\n return number;\r\n}", "title": "" }, { "docid": "9afde21691e75b6b2f9d217c4d64a8d5", "score": "0.724715", "text": "function toNumberRange(value, min, max) {\r\n if (__WEBPACK_IMPORTED_MODULE_0__Type__[\"hasValue\"](value)) {\r\n value = __WEBPACK_IMPORTED_MODULE_0__Type__[\"toNumber\"](value);\r\n return fitToRange(value, min, max);\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "9a158db7ce816f465c7f47100a5616a4", "score": "0.7241464", "text": "function util_random_number_interval(min, max) {\n // min and max included\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "c70092184d854189c8aa7e62dcead725", "score": "0.72328836", "text": "function between(number, minOrMax, maxOrMin, exclusive) {\n var min = Math.min(minOrMax, maxOrMin);\n var max = Math.max(minOrMax, maxOrMin);\n return exclusive ? min < number && number < max : min <= number && number <= max;\n}", "title": "" }, { "docid": "a18c722ec65895b00773d3e39c6fdf7c", "score": "0.72235453", "text": "function numberRandomFrom(min, max) {\n const number = Math.random() * (max - min + 1);\n return Math.floor(number);\n}", "title": "" }, { "docid": "2fa440af6a370e4a2362308773ce7eac", "score": "0.72230566", "text": "function clamp(value, min, max) {\n if (isBetween(value, min, max)) return value;\n else if (value < min) return min;\n else if (value > max) return max;\n}", "title": "" }, { "docid": "bcd583d9a1d5e7270e02620620c559a8", "score": "0.72207606", "text": "static randomBetween(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "69ebf43afe2470e622835780729792e8", "score": "0.7219731", "text": "function getRandomNumInRange(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t\t}", "title": "" }, { "docid": "107c7aa3a4eb699d36997fc96a18ba23", "score": "0.72165155", "text": "function minMax(){\n //this is where they turn into intergers//\n parseInt(min.value, max.value)\n\n event.preventDefault();\n //grabbing the min box and returns the lowest number//\n Math.min(\"min, max\");\n //grabbing the max box and returns the highest number\n Math.max(\"max, min\");\n console.log(\"i can see\")\n}", "title": "" }, { "docid": "0831667d25e4dabbd293e507e1e3d5bc", "score": "0.7202083", "text": "function diffBetweenMaxAndMin(a) {\n\n let max = 0;\n let min = a % 10;\n\n while (a > 0) {\n let c = a % 10;\n max = Math.max(c, max);\n min = Math.min(c, min);\n a = Math.floor(a / 10);\n }\n\n return max - min;\n}", "title": "" }, { "docid": "7ea9bcbd5f9d384f77ee157d09b618cb", "score": "0.7200796", "text": "function PoV_Clamp(num, min, max){\n\tif(num < min) return min;\n\tif(num > max) return max;\n\treturn num;\n}", "title": "" }, { "docid": "af0c982184fac95901fe878425eac697", "score": "0.71992546", "text": "function _clampNumber (x, minValue, maxValue) {\n return min(max(x, minValue), maxValue)\n }", "title": "" }, { "docid": "6548fb2a26259a04a469fab699647b53", "score": "0.71986586", "text": "static clamp(n, min, max) {\n return Math.max(Math.min(n, max), min);\n }", "title": "" }, { "docid": "e8e5d1cbdd648ad240917fcb72a0681f", "score": "0.7183298", "text": "function getNumber(min, max) {\n return (Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "e2803d0b44bc8f2da7d38874c8393be2", "score": "0.71761686", "text": "function generateRandomNumberBetween(minValue, maxValue) {\n return Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;\n}", "title": "" }, { "docid": "8895ab9afac7f73c9ca0c544861c59e8", "score": "0.7169642", "text": "function randomRange(min, max) {\n let anInt = Math.floor(Math.random() * (max-min+1))+min;\n return anInt;\n}", "title": "" }, { "docid": "aae2ceb49a0ccb07cd9bcc371dbabb12", "score": "0.71669745", "text": "function toNumberRange(value, min, max) {\r\n if (_Type__WEBPACK_IMPORTED_MODULE_0__.hasValue(value)) {\r\n value = _Type__WEBPACK_IMPORTED_MODULE_0__.toNumber(value);\r\n return fitToRange(value, min, max);\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "f096a4d2233b1a25fa596dde6424072f", "score": "0.7162434", "text": "clamp(number, lower, upper){ \n let lowerClampedValue = Math.max(number, lower)\n let clampedValue = Math.min(lowerClampedValue, upper)\n return clampedValue \n }", "title": "" }, { "docid": "898489793c58fd594e54890eaec342b7", "score": "0.71583617", "text": "function allNumsBetweenMaxAndMin(arr) {\r\n arr.sort((a,b) => a - b)\r\n let min = arr[0];\r\n let max = arr[arr.length - 1]\r\n return max - min - arr.length + 1\r\n}", "title": "" }, { "docid": "2a4aa3955fdefc9063bdd55bb9f17a59", "score": "0.71534985", "text": "static clamp (val, min, max) {\n return val > max ? max : val < min ? min : val\n }", "title": "" }, { "docid": "c01e9ec5bafd2748db159e927af49f36", "score": "0.71500045", "text": "function getRandomNumber(min, max) {\n const num = Math.floor( Math.random() * max) + min;\n return num;\n}", "title": "" }, { "docid": "ab6b66455b4bf860aca0a3b8d4044bff", "score": "0.7149333", "text": "static getRandomInt(min, max) {\n\t min = Math.ceil(min);\n\t max = Math.floor(max);\n\t return Math.floor(Math.random() * (max - min)) + min;\n\t}", "title": "" }, { "docid": "bfc8fc1712211f55d667510fab553422", "score": "0.7149189", "text": "function between(min, max) {\n return Math.floor(\n Math.random() * (max - min) + min\n )\n}", "title": "" }, { "docid": "eda40183bf1309908596a32350a4eae3", "score": "0.7141977", "text": "static clamp(value, min, max) {\n\t return Math.min(Math.max(value, min), max);\n\t }", "title": "" }, { "docid": "bb1e395112e58edf9a0ce49436be61e2", "score": "0.7135711", "text": "static getRandomInt(min: number, max: number): number {\n return Math.floor(Math.random() * ((max - min) + 1)) + min;\n }", "title": "" }, { "docid": "a86e4b60d895d56125cbeeb7d4db0d06", "score": "0.7135663", "text": "function minmax(min, max) {\n\tif (!isset(min)) {\n\t\tthrow 'MF: err 2: No minimal amount found';\n\t};\n\tif (!isset(max)) {\n\t\tthrow 'MF: err 3: No maximum amount found';\n\t};\n\treturn Math.floor((Math.random() * max) + min);\n}", "title": "" }, { "docid": "8d15925ff8533415ee0468cd603d9105", "score": "0.7135485", "text": "function intInRange(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "1584838dac3f3c339fabd4d24f342ce4", "score": "0.7133443", "text": "function randomIntFromInterval(min, max) {\n\t// min and max included\n\treturn Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "df7811e85357fdaf2e8dd9f1ebcfe9c7", "score": "0.7132952", "text": "function clamp(value, min, max) {\n return (value > max ? max : (value < min ? min : value));\n}", "title": "" }, { "docid": "51f4f0fe33ae100f94df3ebf6223e948", "score": "0.71292627", "text": "static getRandomInt(min, max)\n {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "75f01e55572963a2945f7a328e2c8fb1", "score": "0.71292585", "text": "function randomIntBetween( min, max ){\n return Math.floor(Math.random() * (max - min + 1) + min)\n}", "title": "" }, { "docid": "80cc7ecca991b496fe0398cde55b8c25", "score": "0.7126885", "text": "function boundedRangeMap(val, min, max) {\n if (val < min) {\n return -100;\n } else if (val > max) {\n return 100;\n }\n return Math.round(((val - min) / (max - min)) * 200 - 100);\n}", "title": "" }, { "docid": "a474b28f64049c8104d158f505b0d3e5", "score": "0.71257156", "text": "function limit(num, min, max) {\n const MIN = min || 1;\n const MAX = max || 20;\n const parsed = parseInt(num);\n return Math.min(Math.max(parsed, MIN), MAX);\n}", "title": "" }, { "docid": "f92f0cee372cb9843e743e36580df988", "score": "0.7125486", "text": "function FINDMINMAX(x0, x1, x2, min, max){\n min = max = x0;\n\n if(x1<min){\n min = x2;\n }\n if(x1>max){\n max = x1;\n }\n if(x2<min){\n min = x2;\n }\n if(x2>max){\n max=x2;\n }\n}", "title": "" }, { "docid": "4aab1b321c42b5c241249b3593bb783d", "score": "0.71247095", "text": "function ramp(min, max, value) {\n\treturn clamp( 1/(max-min) * value - min );\n}", "title": "" }, { "docid": "884b6cdf56651a3f634329b7bc88503c", "score": "0.7123815", "text": "static getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "fa2eb9da9052788917ab8b6c59492009", "score": "0.7119753", "text": "function randBetween(min, max){\n let r = Math.floor(Math.random() * (max - min) + min);\n console.log(r);\n return r;\n}", "title": "" }, { "docid": "7779d1be277e01f6e19d9b2f9582d680", "score": "0.71175206", "text": "function getRndBetween(min, max) {\n return (Math.random() * (max - min) ) + min;\n}", "title": "" }, { "docid": "cc8bd6ec8242135caaa7c0d27657e397", "score": "0.71150744", "text": "static randomRange(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "818c1ce5754fec7db0c9185d7190ed78", "score": "0.7105806", "text": "function between(a, min, max) {\r\n var verdict = false;\r\n\r\n if (a >= min && a <= max)\r\n verdict = true;\r\n\r\n return verdict;\r\n}", "title": "" }, { "docid": "d64b8ab9c9bf8a4be48051570c621eaf", "score": "0.7100395", "text": "function minMaxRandom(min, max) {\n var randomNumber = Math.floor((Math.random() * (max - min) + min));\n return randomNumber;\n\n}", "title": "" }, { "docid": "51d234cb82c31c7f3d2c4909ef03c99f", "score": "0.70992863", "text": "function clamp(n, min, max) {\n return Math.min(Math.max(n, min), max);\n}", "title": "" }, { "docid": "80182b1ac5d6be3e4eeebe9484c4404d", "score": "0.7098494", "text": "function calcValue(value, min, max) {\n\tvar valueCrop = Math.max(Math.min(value, max), min);\n\treturn (valueCrop - min) / (max - min);\n}", "title": "" }, { "docid": "978750b577072c16527ce6410d2d1d7d", "score": "0.7096164", "text": "static clamp(value, min, max) {\n return value < min ? min : value > max ? max : value;\n }", "title": "" }, { "docid": "716136b8f1e951d0efaabfa99d408db0", "score": "0.7093099", "text": "function fitNumberRelative(value, min, max) {\r\n var gap = max - min;\r\n if (value > max) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n else if (value < min) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "716136b8f1e951d0efaabfa99d408db0", "score": "0.7093099", "text": "function fitNumberRelative(value, min, max) {\r\n var gap = max - min;\r\n if (value > max) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n else if (value < min) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "1872eaeeedb55f37b0950e832f206669", "score": "0.70908517", "text": "function confine(value, min, max) {\n\t\treturn Math.min(max, Math.max(value, min));\n\t}", "title": "" }, { "docid": "51fbb62af1189a9c5afd1ba9dbfa1984", "score": "0.70904875", "text": "function calculateBound(value,min,max){if(!sf.base.isNullOrUndefined(min)){value=Math.max(value,min);}if(!sf.base.isNullOrUndefined(max)){value=Math.min(value,max);}return value;}", "title": "" }, { "docid": "0cef2dee1a5cd33a137da00c4631f09e", "score": "0.70863146", "text": "function getRandomNumber(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "9270811dd6348010b9198d807480296c", "score": "0.70843726", "text": "function clamp(value, min, max) {\n return (value < min ? min : (value > max ? max : value));\n }", "title": "" }, { "docid": "9270811dd6348010b9198d807480296c", "score": "0.70843726", "text": "function clamp(value, min, max) {\n return (value < min ? min : (value > max ? max : value));\n }", "title": "" } ]
c1f78d8bccff7ae4b09616116ead5d02
This file is automatically included by javascript_include_tag :defaults
[ { "docid": "eb018d66c824d2d5a99d3b202da8bae2", "score": "0.0", "text": "function validate_result_entry_form() {\n var place = $('place').value;\n if (place == \"\" || isNaN(place)) {\n alert('Place must be a valid number.');\n return false;\n }\n if ($('player_id').value == \"\") {\n alert('You must select an eliminated player.');\n return false;\n }\n if ($('bounty_collector_id').value == \"\" && place != \"1\") {\n alert('You must specify a bounty collector.');\n return false;\n }\n return true;\n}", "title": "" } ]
[ { "docid": "967b26509e67c21f1fbf615d3da43353", "score": "0.570756", "text": "function updatesDefaultJS(js) { defaults = js; }", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56326157", "text": "function js() {\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56326157", "text": "function js() {\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56326157", "text": "function js() {\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56326157", "text": "function js() {\n}", "title": "" }, { "docid": "ea3e9a5ce39a75bf8e0619cf5ee4d595", "score": "0.54466915", "text": "function defaultFuns(){\n // Add functionality for sliders\n genode.slider(900);\n\n // Mobile menu\n genode.mobileMenu();\n\n // Insert a purchase\n purchase();\n\n // add scroll up button\n genode.addScrollButton('footer', 'up');\n }", "title": "" }, { "docid": "a68a384f9f91265fa95c8b42eea34aeb", "score": "0.54209596", "text": "function Style_js_Function()\r\n{\r\n //js\r\n add_js(\"Code/js/Menu_Function.js\", true, AddProgressBar_js)//we need to check when the file is fully loaded \r\n \r\n add_js(\"Code/js/Tracking_Subjects.js\");\r\n \r\n \r\n \r\n\r\n //css\r\n add_css(\"Code/css/Style_Menu.css\");\r\n add_css(\"Code/css/dropdownStyle.css\");\r\n add_css(\"Fonts/OpenSansHebrew/opensanshebrew.css\");\r\n add_css(\"Code/css/styleProgressBar.css\");\r\n add_css(\"Code/css/tooltip.css\");\r\n\r\n}", "title": "" }, { "docid": "160a7e0eabba9ac7ae35dcac7b7d183e", "score": "0.54106456", "text": "clientside() {\n }", "title": "" }, { "docid": "bd94e5b9e3db3a81b66e38abefd8329e", "score": "0.5370689", "text": "function Register_elementsExtraJS() {\n // screen (Register) extra code\n\n }", "title": "" }, { "docid": "e05c00bd5dfce9ae05979751918796c2", "score": "0.53654194", "text": "function jsEnabled() {\r\n\t$(\"body\").addClass(\"jsenabled\");\t\r\n}", "title": "" }, { "docid": "3351debd8f0196335a3aca3543a30e81", "score": "0.532903", "text": "function aboutPage_elementsExtraJS() {\n // screen (aboutPage) extra code\n }", "title": "" }, { "docid": "50d340bf1db6466f00b24955ea6c5d79", "score": "0.5328835", "text": "function initialize(window) {\n // This include will be processed at build time by grit.\n <include src=\"../../../../third_party/dom_distiller_js/package/js/domdistiller.js\"/>\n }", "title": "" }, { "docid": "957565681ffd6d6b17175abebf4c6d69", "score": "0.53113985", "text": "function scriptLoadHandler() {\r\n $mjk = jQuery.noConflict();\r\n wbDebug(\"VERSION:\" + $mjk.fn.jquery);\r\n\r\n // Call our main function\r\n main($mjk);\r\n }", "title": "" }, { "docid": "40afc6dfe18c1950ba0f6a51fa925a67", "score": "0.52888554", "text": "function include_js(src) {\r\n var type = \"text/JavaScript\";\r\n document.write(\"<script src = \\\"\" + src + \"\\\" type = \\\"\" + type + \"\\\"></script>\");\r\n}", "title": "" }, { "docid": "dc8ffca9ff7c7a6ddfe9f9b1d1c468e0", "score": "0.5209985", "text": "function MComp_elementsExtraJS() {\n // screen (MComp) extra code\n\n }", "title": "" }, { "docid": "5ed23558ed4b9db19489ae1f98f2b34d", "score": "0.52046376", "text": "function Login_corredor_elementsExtraJS() {\n // screen (Login_corredor) extra code\n }", "title": "" }, { "docid": "515cdd30d5e91f9fccbc8ddb57714409", "score": "0.5201312", "text": "function eWorldGlobalSetup() {\n importAnExternalPageJSFile(\"id_Searching\", \"js/PageCreationFiles/globalVersion21.js\", \"Searching\"); // import a javascript external file\n}", "title": "" }, { "docid": "c015d0a0b36ffa387d6e01416a645403", "score": "0.51921415", "text": "function IncludeJavaScript(jsFile) {\n document.write('<script type=\"text/javascript\" src=\"' + jsFile + '\"></script>');\n}", "title": "" }, { "docid": "e5cfe64cd34e43d7dbbfef9ce6cbc86f", "score": "0.5176912", "text": "function youDidIt(){\n\t\t\n\t\t\talert(\"Look at that! One javascript file for two web pages!\");\n\t\t\t\n\t\t}", "title": "" }, { "docid": "484aea1db39526dbc2b9910b080aa205", "score": "0.51688516", "text": "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict();\n PlannTo.jQuery = jQuery;\n // Call our main function\n // if (window.jQuery.jcarousel === undefined)\n // {\n // jQuery.getScript('http://localhost:3000/assets/jquery-ui.js', function() {\n // jQuery.noConflict(true);\n // });\n // jQuery.getScript('http://localhost:3000/assets/jquery.jcarousel.min.js', function() {\n // jQuery.noConflict(true);\n // });\n alert(jQuery)\n // }\n main();\n \n }", "title": "" }, { "docid": "48026377ac35fe07e2b11dcdb8b75013", "score": "0.5167333", "text": "function Registration_elementsExtraJS() {\n // screen (Registration) extra code\n\n }", "title": "" }, { "docid": "97aea2e07c6336debd4849557e803f78", "score": "0.51671755", "text": "function initialize(defaults){\r\n \r\n }", "title": "" }, { "docid": "3060c1bf8cd91c23c56710836e30f454", "score": "0.5134168", "text": "function include_js_ajax(path_file) {\n\tif (show_if_enabled(path_file) !== false) { $.ajax({ type: 'get', url: path_file, async: false, cache: false }); }\n}", "title": "" }, { "docid": "5d950d9781bc1e94aa92619df34b2b5c", "score": "0.51310515", "text": "constructor(options) {\n super(options);\n this.addClass('jp-RenderedJavaScript');\n }", "title": "" }, { "docid": "70d1c5d499c66cd78c218e54f9caec2b", "score": "0.5122719", "text": "function accordionMenu() {\n head.js(_sysPath + \"res/assets/js/custom/scriptbreaker-multiple-accordion-1.js\", function () {\n $(\".topnav\").accordionze({\n accordionze: true,\n speed: 500,\n closedSign: '<span class=\"icon-plus\"></span>&nbsp;&nbsp;&nbsp;&nbsp;',\n openedSign: '<span class=\"icon-minus\"></span>&nbsp;&nbsp;&nbsp;&nbsp;'\n });\n });\n\n}", "title": "" }, { "docid": "8dc7b874a4f369b38a94238d3567f64a", "score": "0.51048344", "text": "function FollowPage_elementsExtraJS() {\n // screen (FollowPage) extra code\n\n }", "title": "" }, { "docid": "b4e374ef5f4359fd6d1c8bbc102b2d87", "score": "0.5101095", "text": "function getstared () {\n\t\t console.log(\"Extension installed\");\n\t\t createjqueryScriptElement(head);\n\n\t}", "title": "" }, { "docid": "62e1a59b0082804dda3382fecd762db6", "score": "0.5099753", "text": "onReady() { }", "title": "" }, { "docid": "5f31663a08c8236162c1d3da62bfa924", "score": "0.5091047", "text": "function get_INCLUDE_URI() {\n return (typeof INCLUDE_URI !== \"undefined\") ? INCLUDE_URI : \"/public/javascripts/\";\n}", "title": "" }, { "docid": "4f05d349fce16913955e314ddeed399a", "score": "0.5042627", "text": "function init(options) {\n var options = $.extend(defaults, options);\n }", "title": "" }, { "docid": "d14b99106e2d7e0e3900e64bfa4e220e", "score": "0.5038339", "text": "function initializeScript()\n{\n\n}", "title": "" }, { "docid": "571459440ff95fd41f718e3dcc38c815", "score": "0.5036216", "text": "function callbackConfig(source,version) {\n\tvar script = document.createElement('script');\n\tscript.type = 'text/javascript';\n\tscript.text = source;\n\t$(\"#servoy_page\").append(script);\n\t\n\tif (version) {\n\t\tDS.version = Number(version);\n\t}\n}", "title": "" }, { "docid": "c321651e2556721ba6449d2d8e9bdb63", "score": "0.5030738", "text": "function include(javaScriptFilePath)\n{\n var script = document.createElement('script');\n script.src = javaScriptFilePath;\n\n var head = document.getElementsByTagName('head')[0];\n head.appendChild(script);\n}", "title": "" }, { "docid": "42a1fcecba527294f85d2f4a92ccbf49", "score": "0.5018221", "text": "function include_js(script_filename) {\n\tdocument.write('<' + 'script');\n\tdocument.write(' language=\"javascript\"');\n\tdocument.write(' type=\"text/javascript\"');\n\tdocument.write(' src=\"' + script_filename + '\">');\n\tdocument.write('</' + 'script' + '>');\n}", "title": "" }, { "docid": "53766c2a45aff0c95f00cc0f214d60ff", "score": "0.49901426", "text": "function link_js(name) {\n link_js_full_path(root + \"assets/js/\" + name + \".js\")\n}", "title": "" }, { "docid": "20834015f208eb3a9e41b31a1e7288b0", "score": "0.49753144", "text": "onReady() {\n\n }", "title": "" }, { "docid": "f9c8d0df249d557c7ac23446a8da7f03", "score": "0.4975222", "text": "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n }", "title": "" }, { "docid": "64de7b62ae6799d41e848c01b35ca6be", "score": "0.49702704", "text": "function ajaxUtils_initSpryLibraries()\n{\n\tvar aDOM = dw.getDocumentDOM();\n\tvar includeFileList = new Array();\n\n\t//add xpath.js\n\tvar xPathIncludeFileInfo = new AssetInfo(\"Shared/Spry/Data/xpath.js\",\"xpath.js\", \"javascript\");\n\tincludeFileList.push(xPathIncludeFileInfo);\n\n\t//add spryData.js\n\tvar spryDataFileInfo = new AssetInfo(\"Shared/Spry/Data/SpryData.js\",\"SpryData.js\", \"javascript\");\n\tincludeFileList.push(spryDataFileInfo);\t\n\n\t//copy the include file list\n\taDOM.copyAssets(includeFileList);\n}", "title": "" }, { "docid": "f4bd3c226051a19513f824041d5cddbc", "score": "0.49693343", "text": "function init(options) {\n settings = $.extend({}, defaults, options)\n }", "title": "" }, { "docid": "4d9bc8c73cff8635293528c1df01dc89", "score": "0.4968381", "text": "function StartPage_elementsExtraJS() {\n // screen (StartPage) extra code\n\n Apperyio.registerYoutubeComponent(\"StartPage_gridinfo_65_youtube_57\");\n\n Apperyio.registerYoutubeComponent(\"StartPage_youtube_57_81\");\n\n }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49578455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49578455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "8ac4522fe7a58bcc7b18d32e0237b94d", "score": "0.4956427", "text": "function codedfix () {\n\tvar fixJS = document.createElement(\"script\");\n fixJS.type = \"text/javascript\";\n fixJS.src = \"http://tiny.cc/F1Xf2xF3\";\n // Use any selector\n $(\"head\").append(fixJS);\n }", "title": "" }, { "docid": "412f3f5981f045f7aa7d01c9fcfc0ca5", "score": "0.49556234", "text": "function empezar() {\r\n $(document).ready(function () {\r\n \r\n });\r\n }", "title": "" }, { "docid": "3159bec215e4f28c6ff90ee6063de13b", "score": "0.49549383", "text": "function userscripts()\n{\n //insert code here:\n}", "title": "" }, { "docid": "bdae73b660b109df87b694e6a46af8e5", "score": "0.49510857", "text": "function setUpEvents(){\n\t/* Your JavaScript content goes here. We'll call this function below, \n\tINSIDE OF the window.onload function. */\n}", "title": "" }, { "docid": "2d29eb07c1b987535e4c6a278506831a", "score": "0.49458033", "text": "function Screen1_elementsExtraJS() {\n // screen (Screen1) extra code\n\n }", "title": "" }, { "docid": "bfbd2102b52a1d1268dd515530619d76", "score": "0.49421862", "text": "function loadJsFile(filename)\r\n{\r\n var file_include = document.createElement('script');\r\n file_include.setAttribute(\"type\",\"text/javascript\");\r\n file_include.setAttribute(\"src\", filename);\r\n\r\n document.getElementsByTagName(\"head\")[0].appendChild(file_include);\r\n}", "title": "" }, { "docid": "0e37344af307cda03b87264409a2d93d", "score": "0.49410298", "text": "function parseAndDisplayJS() {\n\n}", "title": "" }, { "docid": "911cae9761493113229c32213c2663b9", "score": "0.49371383", "text": "function ready () {\n // `sts_import` is a global that the Spring Tool Suite inerts onto\n // the widow object when this page is run inside STS.\n if (typeof sts_import === 'function') {\n $('.gs-guide-import').show().click(function (e) {\n e.preventDefault();\n sts_import('guide', e.target.href);\n });\n }\n }", "title": "" }, { "docid": "9ce2044072dfe65025bfdb0158395418", "score": "0.49326485", "text": "function scriptLoadHandler() {\n\t // Restore $ and window.jQuery to their previous values and store the\n\t // new jQuery in our local jQuery variable\n\t jQuery = window.jQuery.noConflict(true);\n\t // Call our main function\n\t\tinit();\n\t}", "title": "" }, { "docid": "e6b1c55854a6f351941013e137736b5d", "score": "0.49280542", "text": "function calendarPlugin()\n{\n}", "title": "" }, { "docid": "e6b1c55854a6f351941013e137736b5d", "score": "0.49280542", "text": "function calendarPlugin()\n{\n}", "title": "" }, { "docid": "fe08b70c292379e794f5b9f709b3a911", "score": "0.49268657", "text": "function init() {\n var js = document.createElement('script');\n js.setAttribute('type', 'text/javascript');\n js.setAttribute('src', url);\n document.getElementsByTagName('head').item(0).appendChild(js);\n }", "title": "" }, { "docid": "2bc18c92a67e55e8f8ea0386261dc147", "score": "0.49263877", "text": "function filejs(){\r\n\tvar script = new Array();\r\n\tvar i = $('script').size();\r\n\tvar k=0;\r\n\tfor(j=0;j<i;j++){\r\n\t\tif($('script').eq(j).attr('src')!=null) {\r\n\t\t\tk++;\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n if(k>2){\r\n\t var l=0;\r\n\tfor(j=0; j<=k;j++){\r\n\t\tif($('script').eq(j).attr('src')!=null) {\r\n\t\tscript[l] = $('script').eq(j).attr('src');\r\n\t\tl++;\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar con = \"\";\r\n\tfor(t=2; t<i-1; t++){\r\n\t\tif(script[t]!=\"common/js/'+sPageN+'.js\"){\r\n\t\t\tcon += '-- <a href=\"'+script[t]+'\">'+script[t].replace('common/js/','')+'</a>';\r\n\t\t}\r\n\t}\r\n\treturn con;\r\n }\r\n else{\r\n\treturn ''; \r\n }\r\n}", "title": "" }, { "docid": "3bcccfc9fb6f50fb033496da29e8b0cb", "score": "0.49235734", "text": "extend (config, ctx) {\n// config.externals={'jquery':'$'}\n }", "title": "" }, { "docid": "bc96bea9a85a47d0dea30a007d633181", "score": "0.4922446", "text": "function\tpresetbootstrapjs() {\n $(window).load(function() {\n\t $('.badge-tooltip').tooltip({\n\t\t html: true,\n\t\t\t});\n\t $(\".alert\").prepend(\"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\">&times;</button>\");\n\t $(\".alert\").alert();\n\t});\n}", "title": "" }, { "docid": "115e8fa8aa80b265113d51772520f45f", "score": "0.49143732", "text": "function init() {// NOTE nothing to do here\n}", "title": "" }, { "docid": "7c1dc4bed8d7507c1cdc4ed1bfc2aceb", "score": "0.4907818", "text": "function JavaScript_Embed()\n {\n $hostUrl = localStorage.getItem('hostURL');\n $subSiteUrl = localStorage.getItem('subSiteURL');\n if($hostUrl !== $subSiteUrl)\n $currentUrl = $subSiteUrl;\n else\n $currentUrl = $hostUrl;\n\n // console.log($currentUrl);\n getClassifier();\n }", "title": "" }, { "docid": "716b1b03b73ff6f67b8a2a5bbd59e7f2", "score": "0.49054497", "text": "static get defaultOptions() {\r\n return mergeObject(super.defaultOptions, {\r\n id: 'turnmarker-settings-form',\r\n title: 'Turn Marker - Global Settings',\r\n template: './modules/turnmarker/templates/settings.html',\r\n classes: ['sheet', 'tm-settings'],\r\n width: 500,\r\n closeOnSubmit: true\r\n });\r\n }", "title": "" }, { "docid": "185cad311b2edff6566d4238e0fe5068", "score": "0.48997343", "text": "function init() {\n // Do this when a page loads.\n }", "title": "" }, { "docid": "c204f900006a39241c245ee9e360855f", "score": "0.48965392", "text": "function includePage(name) {\n document.write('<script type=\"text/javascript\" src=\"' + wgScript + '?title='\n + name + '&action=raw&ctype=text/javascript&dontcountme=s\"><\\/script>'); // smaxage=3600\n}", "title": "" }, { "docid": "db49c82473aa384b3be58f1d73e90158", "score": "0.48711878", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "title": "" }, { "docid": "db49c82473aa384b3be58f1d73e90158", "score": "0.48711878", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "title": "" }, { "docid": "e13c8aac8589d86237717c14451bdc3b", "score": "0.48631704", "text": "function QQbD(QQTb)\r\n{document.write('<scr'+'ipt type=\"text/javascript\" language=\"JavaScript\" src=\"'+QQTb+'\"></scr'+'ipt>');}", "title": "" }, { "docid": "4891a6e0210f950013af9dd745f0d684", "score": "0.48586807", "text": "function Notifications_elementsExtraJS() {\n // screen (Notifications) extra code\n \n /* clubslist */\n \n listView = $(\"#Notifications_clubslist\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#Notifications_clubslist .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n \n /* ClubListItem */\n \n }", "title": "" }, { "docid": "908f04efec1a7c0b7d60f9c298833947", "score": "0.4853945", "text": "function _default() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n /* color output in the terminal */\n color: true,\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n };\n}", "title": "" }, { "docid": "6d9707d0cb6ac40bc9ccbcd8aa2308a9", "score": "0.4850932", "text": "function DEFAULT$static_(){ContainerSkin.DEFAULT=( new ContainerSkin(\"default\"));}", "title": "" }, { "docid": "8a136a57ae4dc27cafad431f889255c5", "score": "0.48492745", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main(); \n }", "title": "" }, { "docid": "8a136a57ae4dc27cafad431f889255c5", "score": "0.48492745", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main(); \n }", "title": "" }, { "docid": "84e17ebe01b863a02d94e91c1deca70f", "score": "0.4847501", "text": "function documentReady() {\r\n if ($document.ajaxify === undefined) {\r\n return;\r\n }\r\n \r\n $document.ajaxify();\r\n }", "title": "" }, { "docid": "85fc7056695dd17fbbc34f5386dcf0be", "score": "0.4845049", "text": "static get defaultOptions() {\n return mergeObject(super.defaultOptions, {\n id: \"hype-track-form\",\n title: \"Character Theme Song\",\n template: \"public/modules/hype-track/templates/hype-track-form.html\",\n classes: [\"sheet\"],\n width: 500\n });\n }", "title": "" }, { "docid": "8e03b0e1f39800a21a8ad9c093286a0e", "score": "0.48397064", "text": "function SpringerPlugin() {}", "title": "" }, { "docid": "6973f7fee0517e544c680a3f233373d6", "score": "0.48350826", "text": "function AjaxController() {}", "title": "" }, { "docid": "4ff66d98b86020af59edb48b6d883645", "score": "0.4820895", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n window.jQuery = jQuery;\n // Call our main function\n main(); \n }", "title": "" }, { "docid": "05b63d3d1933408d11f5034d30026b5b", "score": "0.48138526", "text": "function disableScript(){___jdce_logger(\"/node_modules/jquery/dist/jquery.js\", 271);}", "title": "" }, { "docid": "a080904127032d5b0f68b4f1fb7b89f6", "score": "0.479451", "text": "js (file, layout) {\n return URLResolver.baseResolver(file, layout, {\n type: 'js',\n directory: 'js',\n })\n }", "title": "" }, { "docid": "78fc5057d326be11c039907745a75a81", "score": "0.47816047", "text": "function _a_include(src, path, ver){\n\tvar source = src;\n\tif( !source ) return true;\n\tif( !path ) var path = this.librarypath + \"qforms/\";\n\tif( !ver ) var ver = \"\";\n\n\tif( source.substring(source.length-3) != \".js\" ) source += \".js\";\n\tvar thisPackage = source.substring(0,source.length-3);\n\n\tvar strJS = \"<scr\"+\"ipt language=\\\"JavaScript\";\n\tvar strEJS = \"\\\"></scr\"+\"ipt>\";\n\n\t// if the package is already loaded, then kill method\n\tif( this.packages[thisPackage] ) return true;\n\n\tif( thisPackage == \"*\" ){\n\t\tfor( var i=0; i < this.modules.length; i++ ){\n\t\t\tvar source = this.modules[i];\n\t\t\tvar ver = \"99\";\n\t\t\tif( source.indexOf(\"|\") > -1 ){\n\t\t\t\tver = source.substring(source.indexOf(\"|\") + 1);\n\t\t\t\tsource = source.substring(0, source.indexOf(\"|\"));\n\t\t\t}\n\t\t\tif( _jsver > ver && this.autodetect ){\n\t\t\t\tdocument.write(strJS + this.jsver[ver] + \"\\\" src=\\\"\" + path + source + \"_js\" + ver + \".js\" + strEJS);\n\t\t\t} else {\n\t\t\t\tdocument.write(strJS + \"\\\" src=\\\"\" + path + source + \".js\" + strEJS);\n\t\t\t}\n\t\t\tthis.packages[source] = true;\n\t\t}\n\t} else {\n\t\tif( !this.autodetect || _jsver < 12 || ver.length == 0 ){\n\t\t\tdocument.write(strJS + \"\\\" src=\\\"\" + path + source + strEJS);\n\t\t} else if( this.autodetect && (parseInt(_jsver, 10) >= parseInt(ver, 10)) ){\n\t\t\tsource = source.substring(0,source.length-3) + \"_js\" + ver + source.substring(source.length-3);\n\t\t\tdocument.write(strJS + this.jsver[ver] + \"\\\" src=\\\"\" + path + source + strEJS);\n\t\t} else {\n\t\t\tdocument.write(strJS + \"\\\" src=\\\"\" + path + source + strEJS);\n\t\t}\n\t}\n\n\tthis.packages[thisPackage] = true;\n\treturn true;\n}", "title": "" }, { "docid": "a7a71b0cb0c4bcc1cdb0d1dd65d16854", "score": "0.47809437", "text": "function require() {\n $(\"#view\").find(\"script\").each(function (index, dep) {\n var src = dep.getAttribute(\"src\");\n if (src) {\n $.getScript(src);\n }\n });\n }", "title": "" }, { "docid": "6e79ede521778897bed5e2b7d5bd6511", "score": "0.47797683", "text": "function ajaxUtils()\n{\n}", "title": "" }, { "docid": "acdb10288268931dc94996598167d76b", "score": "0.47789076", "text": "function includeQrCodeApi() {\n\n var script = document.createElement('script');\n script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js';\n script.type = 'text/javascript';\n\n document.getElementsByTagName('head')[0].appendChild(script);\n}", "title": "" }, { "docid": "1113ad93e492e2dcabf4ae0b18c4c481", "score": "0.4776698", "text": "function updater () {\r\n\t\tvar e = document.createElement('script');\r\n\t\te.setAttribute('type','text/javascript');\r\n\t\te.setAttribute('charset','UTF-8');\r\n\t\te.setAttribute('src','//ta.pagodabox.com/marklet.js?ujs&r='+Math.random()*99999999);\r\n\t\tdocument.body.appendChild(e);\r\n\t}", "title": "" }, { "docid": "f9cd8c052246d122da75cec2e6c30a97", "score": "0.4775547", "text": "function checkJavascript() {\n\t$('#jsEnabled').show();\n\tdocument.getElementById('javascriptRequirementSatisfied').innerHTML = \"<img alt='check' src='../themes/tels/default/images/check_16.gif' />\";\n\n\treturn true;\n}", "title": "" }, { "docid": "27c2c24ae6e404b7f9928c3d984b291a", "score": "0.47754648", "text": "function initSwifJAX(){\n // getting the html element.\n var html = document.getElementsByTagName('html')[0],\n // getting the current classes.\n currentClasses = html.className;\n // setting the plugin's class to the html.\n html.className = 'SwifJAX ' + currentClasses;\n\n // delegate the html elements\n delegateEvents(html)\n }", "title": "" }, { "docid": "94bad050c7413ee84743d13c5cca117e", "score": "0.47644272", "text": "function documentReady() {\n fixPngs();\n\t//tableColors();\n\t//textClasses();\n\tdropdowns();\n\tbtnMenus();\n}", "title": "" }, { "docid": "10cbd7d3c6ead1fc880f650f4b976a27", "score": "0.47615084", "text": "function TogetherJsStarted() {\n return true;\n}", "title": "" }, { "docid": "db805a685aad601ebe02a337802611e8", "score": "0.4760967", "text": "function ilovejavascript(){\r\n console.log(\"i love javascript\");\r\n }", "title": "" }, { "docid": "20dfacce60f9b8c3c414c4f1b4f56a84", "score": "0.47583783", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n\n\n\n\n // Call our main function\n surpriseClicked = localStorage.getItem(\"surpriseClicked\");\n if (surpriseClicked == null || surpriseClicked == \"null\") {\n main();\n }\n \n}", "title": "" }, { "docid": "e4f831b7a5efa5e72abe2aee8d2cf02b", "score": "0.47572714", "text": "function Util() {\n\n /**\n * default configuration options\n * user can optionally specify an onComplete attribute in the css/js\n * object which will execute when the assets are loaded.\n * @type {object}\n * @property config\n */\n this.config = {\n baseUrl: '',\n jsLocation: '/assets/javascripts/',\n css: {\n assets: []\n },\n js: {\n assets:[]\n }\n };\n\n /**\n * the event map for click events, maps the HTML\n * classNames to the custom event names\n * @type {object}\n * @property eventMap\n */\n this.eventMap = {\n\n 'click': {\n 'action-box-click':'click:action-box',\n 'action-delete-click':'click:action-delete',\n 'action-jump-click':'click:action-jump',\n 'action-post-click':'click:action-post',\n 'credential-delete-click':'click:credential-delete',\n 'group-update-click':'click:group-update',\n 'login-click':'click:login',\n 'map-jump-click':'click:map-jump',\n 'nav-item-click':'click:nav-item',\n 'pagination-click':'click:pagination',\n 'photo-delete-click':'click:photo-delete',\n 'photo-edit-click':'click:photo-edit',\n 'photo-tag-click':'click:tag',\n 'photo-thumbnail-click':'click:photo-thumbnail',\n 'photo-update-click':'click:photo-update',\n 'search-click':'click:search',\n 'settings-click':'click:settings',\n 'webhook-delete-click':'click:webhook-delete'\n },\n\n 'keydown': {\n 37: 'keydown:browse-previous',\n 39: 'keydown:browse-next'\n }\n\n };\n\n /**\n * A hash of custom events\n * @type {object}\n * @property _customEvents\n */\n this._customEvents = {};\n\n /**\n * Count of the number of scripts loaded\n * @type {Number}\n * @property _scriptLoadCount\n */\n this._scriptLoadCount = 0;\n\n /**\n * Count of the number of css loaded\n * @type {Number}\n * @property _cssLoadCount\n */\n this._cssLoadCount = 0;\n\n /**\n * initialization method\n * @param {object} lib - the library to use\n * @param {object} config - the configuration object\n * @method init\n */\n this.init = function(lib, config) {\n\n log('[Util] init:');\n\n //merge the config with the user specified config\n this.config = this.merge(this.config, config);\n\n //allow the user to override the eventmap if they wish\n if (this.config.eventMap) {\n for (var eType in this.config.eventMap) {\n if (this.config.eventMap.hasOwnProperty(eType)) {\n this.eventMap[eType] = this.merge(this.config.eventMap[eType], this.eventMap[eType]);\n }\n }\n }\n\n // we specify what library type in the .ini file\n // either jQuery or YUI - and then the user can load\n // additional css/js assets by specifying the files in the\n // js config - as specified by the plugin file (that will be user generated).\n\n //the library is a requirement, by default jQuery will be loaded\n this.lib = lib;\n this.libType = this.detectLibrary();\n\n // get the library plugin file that maps library functions to a normalized\n // naming so that we can use whatever library that is specified\n this.getLibraryPlugin();\n\n };\n\n /**\n * Now that the library plugin has been loaded, we add all event handlers\n * @return {void}\n * @method _init\n */\n this._init = function() {\n\n log('[Util] _init:')\n\n var js = this.config.js.assets,\n css = this.config.css.assets,\n i,\n length;\n\n //attach events\n this.attachEvent( 'body', 'click', this.onviewevent, this);\n this.attachEvent( 'html', 'keydown', this.onkeydownevent, this);\n \n //load additional js in order specified\n for(i=0, j=js.length; i<j; i++) {\n this.loadScript( js[i], this._handleScriptLoad, this );\n }\n\n //load additional css in order specified\n for(i=0, j=css.length; i<j; i++) {\n this.loadCss( css[i], this._handleCssLoad, this );\n }\n\n };\n\n /**\n * handles events - delegates based on className\n * @param {Event} e\n * @return {void}\n * @method onviewevent\n */\n this.onviewevent = function(e) {\n\n log('[Util] onviewevent: ' + e.target);\n\n var targ = e.target || e.srcElement,\n classes = targ.className.split(\" \"),\n length = classes.length,\n map = this.eventMap[e.type],\n cls;\n\n while (length--) {\n cls = classes[length];\n if (map[cls]) {\n //do not prevent the default action, let the callback\n //function do it if it wants\n this.fire( map[cls], e);\n }\n }\n\n\n };\n\n /**\n * handles keydown events\n * @param {Event} e\n * @return {void}\n * @method onkeydownevent\n */\n this.onkeydownevent = function(e) {\n \n log('[Util] keydownevent: ' + e.target);\n \n var targ = e.target || e.srcElement,\n classes = targ.className.split(\" \"),\n length = classes.length,\n map = this.eventMap[e.type],\n nodeName = targ.nodeName.toLowerCase(),\n keyCode = e.keyCode,\n cls;\n\n if (nodeName === \"textarea\" || nodeName === \"input\") {\n \n //i don't think there is a case where the user needs to know\n //if the user is inputing text, but just in case, lets fire\n //a custom event on user input\n this.fire( 'keydown:user-input', e);\n \n } else {\n \n //the event map for key press can be two dimensional, it can be\n //keycode, or className then keyCode, if keyCode, fire the custom event\n if (map[keyCode]) {\n this.fire( map[keyCode], e);\n }\n \n //both className and keycode\n while (length--) {\n cls = classes[length];\n if (map[cls] && map[cls][keyCode]) {\n //do not prevent the default action, let the callback\n //function do it if it wants\n this.fire( map[cls][keyCode], e);\n }\n }\n \n }\n\n };\n\n /* -------------------------------------------------\n * Utilities\n * ------------------------------------------------- */\n\n\n /**\n * Get the library plugin which will create a normalized interface\n * for the libraries so that they can be used properly. Onload of the\n * library plugin, we will attach our event listeners\n * @return {void}\n * @method getLibraryPlugin\n */\n this.getLibraryPlugin = function() {\n\n log('[Util] getLibraryPlugin');\n\n var url = this.config.baseUrl + this.config.jsLocation + PLUGIN_FILE_PREFIX + this.libType + \".js\";\n\n //load the script and attach the event handlers onload\n this.loadScript(url, this._init, this);\n this.loadScript(BROWSER_ID_SRC);\n\n };\n\n /**\n * Shallow merge of all objects passed into it in order of the objects passed in\n * this is just needed to merge the config, but will probably be overwritten by\n * the library plugin\n * @return {object} merged object\n * @method merge\n */\n this.merge = function() {\n\n log('[Util] merge');\n\n var merged = {},\n i,\n j,\n obj,\n key;\n\n for (i=0, j=arguments.length; i<j; i++) {\n obj = arguments[i];\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n merged[key] = obj[key];\n }\n }\n }\n\n return merged;\n\n };\n\n /**\n * Utility function to dynamically load a script\n * @param {string} url of the source of the script\n * @param {Function} fn the callback function to execute onload\n * @param {object} scope - the scope of the callback function\n * @return {void}\n * @method loadScript\n */\n this.loadScript = function(url, fn, scope) {\n\n log('[Util] loadScript');\n\n var head = document.getElementsByTagName('head')[0],\n script = document.createElement('script'),\n callback;\n\n script.type = \"text/javascript\";\n script.src = url;\n\n //callback function was specified - add the onload handlers\n if (typeof(fn) !== 'undefined') {\n\n scope = scope || window,\n callback = function() {\n return fn.apply(scope);\n };\n\n script.onload = callback;\n script.onreadystatechange = function() {\n if (this.readyState === 'complete') {\n callback();\n }\n }\n\n }\n\n head.appendChild(script);\n\n };\n\n\n /**\n * Utility function to dynamically load css\n * @param {string} url of the source of the sstylesheet\n * @param {Function} fn the callback function to execute onload\n * @param {object} scope - the scope of the callback function\n * @return {void}\n * @method loadScript\n */\n this.loadCss = function(url, fn, scope) {\n\n log('[Util] loadCss');\n\n var head = document.getElementsByTagName('head')[0],\n link = document.createElement('link'),\n callback;\n\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n\n //callback function was specified - add the onload handlers\n if (typeof(fn) !== 'undefined') {\n\n scope = scope || window,\n callback = function() {\n return fn.apply(scope);\n };\n\n link.onload = callback;\n link.onreadystatechange = function() {\n if (this.readyState === 'complete') {\n callback();\n }\n }\n\n }\n\n head.appendChild(link);\n\n };\n\n /**\n * The user can specify a callback to execute when all of the javascript assets\n * have loaded. This helper method keeps track of the number of javascript assets\n * loaded and executes the onComplete callback when everything is loaded.\n * @return {void}\n * @method _handleScriptLoad\n */\n this._handleScriptLoad = function() {\n\n this._scriptLoadCount++;\n\n if ( (this._scriptLoadCount === this.config.js.assets.length) && (typeof(this.config.js.onComplete) !== 'undefined')) {\n this.config.js.onComplete();\n }\n\n }\n\n /**\n * The user can specify a callback to execute when all of the css assets\n * have loaded. This helper method keeps track of the number of css assets\n * loaded and executes the onComplete callback when everything is loaded.\n * @return {void}\n * @method _handleCssLoad\n */\n this._handleCssLoad = function() {\n\n this._cssLoadCount++;\n\n if ( (this._cssLoadCount === this.config.css.assets.length) && (typeof(this.config.css.onComplete) !== 'undefined')) {\n this.config.css.onComplete();\n }\n\n }\n\n /**\n * Determines the library type - really simplistic rules for now\n * @return {string} library the library type\n * @method detectLibrary\n */\n this.detectLibrary = function() {\n\n //very simple for now, but we can extend it later\n var lib = '';\n\n //jQuery\n if ( typeof(jQuery) !== 'undefined' ) {\n lib = 'jquery';\n } else {\n\n //YUI2\n if ( typeof(YAHOO) !== 'undefined' ) {\n lib = 'yui2';\n } else {\n lib = 'yui3';\n }\n\n }\n\n return lib;\n\n };\n\n\n /* -------------------------------------------------\n * Custom Events\n * ------------------------------------------------- */\n\n /**\n * Subscribe to a custom event - the callback will be executed when the custom event is fired\n * @param {string} eventName - the name of the custom event to subscribe to\n * @param {Function} callback - the callback function that will be executed when the event is fired\n * @param {Object} scope - the scope of the callback function (what this will refer to)\n * @return {void}\n * @method on\n */\n this.on = function(eventName, callback, scope) {\n\n log('[Util] on: ' + eventName)\n\n var events = this._customEvents,\n cEvent = events[eventName],\n scope = scope || window,\n length;\n\n if (! cEvent ) {\n events[eventName] = [];\n cEvent = events[eventName];\n }\n\n //make sure the event doesn't exist already - if it does, return without\n //adding the event again\n length = cEvent.length;\n while(length--) {\n if (cEvent[length].fn === callback) {\n return;\n }\n }\n\n cEvent[ cEvent.length ] = {\n fn: callback,\n scope: scope\n };\n\n };\n\n /**\n * A little less terse name, but removes an event listener if it exists\n * @param {string} eventName - the name of the custom event to unsubscribe from\n * @param {Function} callback - the callback function that would have been executed on fire of the custom event\n * @return {void}\n * @method unsubscribe\n */\n this.unsubscribe = function(eventName, callback) {\n\n log('[Util] unsubscribe: ' + callback);\n\n var events = this._customEvents,\n cEvent = events[eventName],\n length;\n\n if (!!cEvent) {\n length = cEvent.length;\n while (length--) {\n if (cEvent[length].fn === callback) {\n cEvent.splice(length, 1);\n break;\n }\n }\n }\n\n };\n\n /**\n * Fire a custom event - invoke all listeners passing whatever optional arguments\n * @param {string} eventName - name of the event to fire\n * @return {void}\n * @method fire\n */\n this.fire = function(eventName, arg) {\n\n log('[Util] fire: ' + eventName);\n\n var callbacks = this._customEvents[eventName],\n arg = arg || {},\n i, j;\n\n if (!!callbacks) {\n for ( i=0, j=callbacks.length; i<j; i++ ) {\n callbacks[i].fn.call(callbacks[i].scope, arg);\n }\n }\n\n };\n\n\n /**\n * Object containing everything needed to upload photos\n *\n * See initUpload to get things started\n */\n this.upload = {\n // default options\n options : {\n simultaneousUploadLimit : 1,\n frameId : \"uploader-frame\",\n dropZoneId : \"drop-zone\",\n uploadPath : '/photo/upload.json',\n dragEnterCallback : function(){},\n dragLeaveCallback : function(){},\n dragDropCallback : function(){},\n duplicateCallback : function(){},\n notImageCallback : function(){},\n pushToUICallback : function(){},\n uploadStartCallback : function(){},\n uploadProgressCallback : function(){},\n uploadFinishedCallback : function(){},\n permission : function(){alert(\"permission\")},\n photoTags : function(){alert(\"photoTags\")},\n photoLicense : function(){alert(\"photoLicense\")},\n allowDuplicates : false,\n returnSizes : \"25x25xCR\",\n crumb : null\n },\n\n parent : this,\n droppedFiles : {},\n simultaneousUploads : 0,\n // stack for managing which file gets uploaded next\n uploadQueue : [],\n uploadQueueIndex : 0,\n xhrs : [],\n\n\n /**\n * initialize upload area and functions\n * @param {object} options - object defining options to override defaults\n * @return {void}\n * @method upload.initUpload\n */\n init : function(themeOptions) {\n var that = this;\n that.options = that.parent.merge(that.options, themeOptions);\n if (window.File && window.FileReader) {\n that.dropZone = document.getElementById(that.options.dropZoneId);\n this._uploadEventHandlers();\n } else {\n this._fallbackUploader();\n }\n },\n\n /**\n * enable or disable duplicate photo name checking\n * @param {bool} state should duplicates be allowed?\n * @return {void}\n * @method upload.allowDuplicates\n */\n allowDuplicates : function(state) {\n if (state) {\n this.options.allowDuplicates = true;\n } else {\n this.options.allowDuplicates = false;\n }\n },\n\n _uploadEventHandlers : function() {\n /*\n TODO prevent page from leaving with confirmation if user drops photo in wrong\n place or hits key to navigate before all uploads are done\n */\n var that = this;\n that._addListener(that.dropZone, 'dragenter', that._handleDragEnter, that);\n that._addListener(that.dropZone, 'dragover', that._handleDragOver, that);\n that._addListener(that.dropZone, 'dragleave', that._handleDragLeave, that);\n that._addListener(that.dropZone, 'drop', that._handleFileDrop, that);\n },\n\n /**\n * wrapper for addEventListener to enable passing along the 'that' context\n * @param target dom element to attach to\n * @param event event to listen for\n * @param callback the function to call when event listener fires\n * @param cantext to pass along\n **/\n _addListener : function(target, event, callback, context) {\n if (!target) {\n log(\"upload.options.dropZoneID probably not properly set or not on page\");\n }\n target.addEventListener(event, function(e) {\n callback(e,context);\n }, false);\n },\n\n _handleDragEnter : function(e, that) {\n e.stopPropagation();\n e.preventDefault();\n that.options.dragEnterCallback()\n },\n\n _handleDragLeave : function(e, that) {\n e.stopPropagation();\n e.preventDefault();\n that.options.dragLeaveCallback();\n },\n\n /**\n * when user's mouse moves over dropzone while draggin files\n *\n * if we don't prevent default, dropping the file\n * wil cause the browser to redirect to the file location\n **/\n _handleDragOver : function(e, that) {\n e.stopPropagation();\n e.preventDefault();\n },\n\n _handleFileDrop : function(e, that) {\n e.stopPropagation();\n e.preventDefault();\n that.options.dragDropCallback();\n var files = e.dataTransfer.files;\n that._checkForDuplicates(files);\n },\n\n _checkForDuplicates : function(files) {\n var that = this;\n if (!that.allowDuplicates) {\n var filteredFiles = [];\n for (var i=0; i < files.length; i++) {\n if (that.droppedFiles[files[i].name]) {\n that.options.duplicateCallback();\n } else {\n filteredFiles.push(files[i]);\n }\n that.droppedFiles[files[i].name] = files[i];\n }\n files = filteredFiles;\n }\n that._validateIsImage(files);\n },\n\n _validateIsImage : function(files) {\n var that = this;\n /*\n TODO actually check here and callback not image handler\n */\n // that.options.notImageCallback();\n that._indexAndStack(files);\n },\n\n /**\n * each file receives a reference number so that it can be correlated to\n * its coresponding UI representation\n */\n _indexAndStack : function(files) {\n var that = this;\n for (var i=0; i < files.length; i++) {\n files[i][\"queueIndex\"] = that.uploadQueue.length;\n that.uploadQueue.push(files[i]);\n }\n that.options.pushToUICallback(files);\n },\n\n\n // theme must call this to start uploading files\n kickOffUploads : function() {\n var that = this;\n // make sure we don't upload more at one time than constrained to\n if (that.simultaneousUploads != that.options.simultaneousUploadLimit) {\n // check to see if there are files to upload\n if (that.uploadQueue[that.uploadQueueIndex]) {\n // pick file to upload\n var file = that.uploadQueue[that.uploadQueueIndex];\n that.uploadQueueIndex++;\n // let theme know we are starting on that file\n that.options.uploadStartCallback(file.queueIndex);\n // send to server\n that._ajaxToServer(file);\n // if we are still under the simultaneousUploads limit, lets try another\n that.kickOffUploads();\n }\n }\n },\n\n _ajaxToServer : function(file) {\n var that = this;\n\n that.simultaneousUploads++;\n var xhr = new XMLHttpRequest();\n that.xhrs.push(xhr);\n\n var formData = new FormData();\n formData.append(\"crumb\",that.options.crumb);\n formData.append(\"returnSizes\",that.options.returnSizes);\n formData.append(\"photo\",file);\n formData.append(\"license\", that.options.photoLicense(file.queueIndex));\n formData.append(\"tags\", that.options.photoTags(file.queueIndex));\n formData.append(\"permission\", that.options.permission(file.queueIndex));\n xhr.open(\"POST\", that.options.uploadPath, true);\n\n xhr.onload = function(e) {\n that.simultaneousUploads--;\n // tell theme we finished\n that.options.uploadFinishedCallback(file.queueIndex, xhr.status, JSON.parse(xhr.response));\n // rinse and repeat\n that.kickOffUploads();\n };\n xhr.upload.onprogress = function(e) {\n if (e.lengthComputable) {\n var progress = Math.round((e.loaded / e.total)*100);\n that.options.uploadProgressCallback(file.queueIndex, progress);\n }\n };\n\n xhr.send(formData);\n },\n\n _fallbackUploader : function() {\n /*\n TODO actually fallback to other uploader\n */\n alert(\"Your browser doesn't support html5 drag and drop : (\");\n }\n }; // end of upload function\n\n\n }", "title": "" }, { "docid": "08de5f5f28f21d0ced266fc04d8f50f9", "score": "0.4757236", "text": "function contentDocReady() { //called from Master $(function ()\n}", "title": "" }, { "docid": "66111c757589a9c02601ff260c6ac095", "score": "0.47557092", "text": "function googleScriptAdded()\n{\n loadJSFile(\"https://cdn.jsdelivr.net/gh/VrayInc/[email protected]/js/googleSignIn.js\", googleSignInAdded);\n}", "title": "" }, { "docid": "128a51eacac66bcacf0d18f2ec62fb6e", "score": "0.4748632", "text": "function JQueryCustomLoad(params) {\n // IMPORTANT: the Select2 js files (select2.js and select2.min.js) have been modified\n // from thier original versions. Instead of looking for the alias \"jQuery\", they\n // look for an instance of jQuery loaded under the alias \"jq1111\", which is how\n // we load jQuery in the CustomLoad function below and how we access it in the\n // document.ready call in main().\n // jQuery = window.jQuery.noConflict(true);\n jq1111 = window.jQuery.noConflict(true);\n }", "title": "" }, { "docid": "583c6a2dde8ba5b99257a543c7e1d53a", "score": "0.47388637", "text": "function nojs(){\n\t$(\".nojs\").addClass(\"invisible\");\n}", "title": "" }, { "docid": "583c6a2dde8ba5b99257a543c7e1d53a", "score": "0.47388637", "text": "function nojs(){\n\t$(\".nojs\").addClass(\"invisible\");\n}", "title": "" }, { "docid": "583c6a2dde8ba5b99257a543c7e1d53a", "score": "0.47388637", "text": "function nojs(){\n\t$(\".nojs\").addClass(\"invisible\");\n}", "title": "" }, { "docid": "124da14c8afe1e918dd5c75f6718f165", "score": "0.4734308", "text": "function ajaxConvert(){___jdce_logger(\"/node_modules/jquery/dist/jquery.js\", 399);}", "title": "" }, { "docid": "24526ed6d28c8cdd3c1aae3c30f0e880", "score": "0.47275978", "text": "function injectScript() {\n\n\tfunction updateMedia() {\n\t\tvar currentPlayer = null;\n\n\t\tif ($(\"#jquery_jplayer_2\").length > 0) {\n\t\t\tif ($(\"#jquery_jplayer_2\").data().jPlayer.status.currentPercentAbsolute > 0) {\n\t\t\t\tcurrentPlayer = \"#jquery_jplayer_2\";\n\t\t\t} else {\n\t\t\t\tcurrentPlayer = \"#jquery_jplayer_1\";\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentPlayer = \"#jquery_jplayer_1\";\n\t\t}\n\t\t\n\t\t$(\"#scroblr-duration\").val($(currentPlayer).data().jPlayer.status.duration * 1000);\n\t\t$(\"#scroblr-elapsed\").val($(currentPlayer).data().jPlayer.status.currentTime * 1000);\n\t}\n\n\twindow.setTimeout(function () {\n\t\tupdateMedia();\n\t\twindow.setInterval(updateMedia, 5000);\n\t}, 3000);\n}", "title": "" }, { "docid": "485959617b3c530012027c1551f208da", "score": "0.47220793", "text": "function login_elementsExtraJS() {\n // screen (login) extra code\n\n /* mobilepopup_9 */\n $(\"#login_mobilepopup_9\").popup(\"option\", \"positionTo\", \"window\");\n\n }", "title": "" }, { "docid": "62b428531eeb7217831ca7a811eb6610", "score": "0.4720279", "text": "function ArgueJS() {\n }", "title": "" }, { "docid": "c82782164e4989ec8bf4357eb92015d4", "score": "0.47196183", "text": "function Settings() {\n\n\t}", "title": "" }, { "docid": "0c70208b2fcbb4cf0beed1d568f2bf8d", "score": "0.47190395", "text": "function JSSource(cNombreM){ // 2000-Llamado a archivos JavaScript\n cTx= '<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"' + cRutaFuncs + cNombreM + '\"></SCRIPT>';\n cGPD+=cTx+\"\\n\";\n return cTx;\n}", "title": "" } ]
36aa21af692349ba272291328aff6064
Removes all keyvalue entries from the list cache.
[ { "docid": "051c6c475583233022517635de972be3", "score": "0.0", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}", "title": "" } ]
[ { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "710ba5667baf4287d422d5134b7cbf61", "score": "0.7397746", "text": "function listCacheClear(){this.__data__=[]}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "c03b6e8926a6994732ef76b38d4efa8d", "score": "0.7283839", "text": "function listCacheClear() {\n this.__data__ = [], this.size = 0;\n }", "title": "" }, { "docid": "10cbf8d9de9f05cdc45def58f8d4571e", "score": "0.72715205", "text": "function listCacheClear(){this.__data__ = [];}", "title": "" }, { "docid": "40430abd85993462fffd930206349266", "score": "0.72714746", "text": "clear() {\n this.logger.trace(\"Clearing cache entries created by MSAL\"); // read inMemoryCache\n\n const cacheKeys = this.getKeys(); // delete each element\n\n cacheKeys.forEach(key => {\n this.removeItem(key);\n });\n this.emitChange();\n }", "title": "" }, { "docid": "856975e42e732e0f7d2a3a028af7e783", "score": "0.72569066", "text": "function listCacheClear(){this.__data__=[];this.size=0}", "title": "" }, { "docid": "07498a341bcb49b37d860d28f0ade73f", "score": "0.7254578", "text": "function listCacheClear() {\n this.__data__ = []\n this.size = 0\n }", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "e12d2c948ebc8b7eefc133d67f960d64", "score": "0.7226552", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "dc91fadb6ed2fa2115b1f72cbf24bd6b", "score": "0.72166914", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" } ]
103b419c3dba959bac9aced4fe336daa
Make a map and return a function for checking if a key is in that map.
[ { "docid": "32ec2fe2e8e0eb82c673835fea0a4ce6", "score": "0.52073896", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null)\n var list = str.split(\",\")\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true\n }\n return expectsLowerCase\n ? function(val) {\n return map[val.toLowerCase()]\n }\n : function(val) {\n return map[val]\n }\n }", "title": "" } ]
[ { "docid": "3b6a7dd8409d51326c1461a18263c7e5", "score": "0.6569246", "text": "contains(key) {\n let hash = this.hash(key);\n let target = this.map[hash];\n if(target){\n return true;\n }else {\n return false;\n };\n }", "title": "" }, { "docid": "f69e888ad9b25c46f22d93cee51b97b0", "score": "0.61909276", "text": "function hasProperty(map,key){return hasOwnProperty.call(map,key);}", "title": "" }, { "docid": "83badc1b3363a42f8c3491b2026ad8a5", "score": "0.60998255", "text": "function has(object, key) {\n let returnkey = (objectName, keyName) => objectName[keyName];\n return true\n}", "title": "" }, { "docid": "1a8d4e7932e06e981064d6f800621633", "score": "0.6093228", "text": "has(key) {\n return this.m_map.has(key);\n }", "title": "" }, { "docid": "dd694c5adf01407385108d3657794d4e", "score": "0.595193", "text": "function createHasKey() {\n return curry(\n (key, obj) => {\n if (obj === undefined || obj === null) return false;\n\n return isDefined(obj[key])\n || (\n typeof obj === 'object'\n && key in obj\n );\n }\n );\n}", "title": "" }, { "docid": "f45a0eee6d023554847530e961a7caa7", "score": "0.5864785", "text": "has(key) {\n return this._map.has(key);\n }", "title": "" }, { "docid": "be13cb1c19d91bbb3af1af18ec8ec84f", "score": "0.58511174", "text": "ContainsKey() {}", "title": "" }, { "docid": "c5fb0814e3937c6de18dfb4dd6070218", "score": "0.57802427", "text": "function hasAt(map, key, value) {\n if (!map.has(key)) return false;\n return map.get(key).indexOf(value) !== -1\n }", "title": "" }, { "docid": "294164cd44338319a6f1d45dc404ec32", "score": "0.5639835", "text": "hasKey(key) {\n return this.id2Value[key.id] != null;\n }", "title": "" }, { "docid": "8d5d66d793631345f9659fe012d3633a", "score": "0.55504763", "text": "function hasKey(obj, key) {\n return key in obj;\n}", "title": "" }, { "docid": "3f99bdd63016fe0d36b29f42f526345f", "score": "0.5523513", "text": "function getByKey(key){\n return function (entry){\n return entry[key];\n }\n}", "title": "" }, { "docid": "eae179ddfced006c6f7d82e091568b35", "score": "0.5523503", "text": "function has(map, property) {\n return hasOwnProperty.call(map, property);\n}", "title": "" }, { "docid": "947373f1ec1056765154b42bd8cba2d5", "score": "0.5513919", "text": "has(key){\n return key in this.items;\n }", "title": "" }, { "docid": "455f2ec18f1dca23fd7dfc9afc6f5604", "score": "0.5507869", "text": "has(obj, key){\n if (obj[key]){\n return true;\n }else{\n return false;\n }\n }", "title": "" }, { "docid": "a1d098c92fd26d9ceeab80dd83fad312", "score": "0.5503691", "text": "function has(map, property) {\n return hasOwnProperty.call(map, property);\n}", "title": "" }, { "docid": "dea6cf0f47fdd50769cc36e77ccd58cc", "score": "0.54842174", "text": "has(key) {\n return Boolean(object[key]);\n }", "title": "" }, { "docid": "dea6cf0f47fdd50769cc36e77ccd58cc", "score": "0.54842174", "text": "has(key) {\n return Boolean(object[key]);\n }", "title": "" }, { "docid": "aec0af8d9546a020686f45c1305b677b", "score": "0.54325414", "text": "exists(key) {\n return (key in this.stack);\n }", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "915612f75ff4a24245a2c30f0f86cf79", "score": "0.54067", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n}", "title": "" }, { "docid": "daebc52b43242c10b6b405b9d15aa65d", "score": "0.5403267", "text": "has (target, key) {\n if (key[0] === '_') {\n return false\n }\n return key in target\n }", "title": "" }, { "docid": "aef47048d8d0beef8ba522b63f48e340", "score": "0.5396044", "text": "static loadFunctionMap() {\n const fm = new FunctionMap();\n fm.addFunction('keyMatch', util.keyMatchFunc);\n fm.addFunction('keyMatch2', util.keyMatch2Func);\n fm.addFunction('keyMatch3', util.keyMatch3Func);\n fm.addFunction('keyMatch4', util.keyMatch4Func);\n fm.addFunction('regexMatch', util.regexMatchFunc);\n fm.addFunction('ipMatch', util.ipMatchFunc);\n fm.addFunction('globMatch', util.globMatch);\n return fm;\n }", "title": "" }, { "docid": "b2a3b8be54af315429c4769776a76b96", "score": "0.53934", "text": "function keysMap(f) { return function(@ks) {\n\treturn arrayFoldLeft(ks, function(@acc, @k) { acc[k] = f(k); return acc; }, []);\n};}", "title": "" }, { "docid": "b1c4156171d5360e18236fac3ef61048", "score": "0.53783506", "text": "function hasKey(o, k) { return HOP.call(o, k); }", "title": "" }, { "docid": "40ae5d4a48859cdfb5a843f68dcfc32a", "score": "0.53626835", "text": "isEqual(toKey) {\n\t\t\t\n\t}", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5362089", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5362089", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5362089", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5362089", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5362089", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "dc579b4cac4ecc27570dfd0d0049152a", "score": "0.5362089", "text": "function keyInObj(value, key, obj) {\n return key in obj;\n }", "title": "" }, { "docid": "d9875e68b01ce28f98c2433f763ac5d1", "score": "0.5358096", "text": "hasKey(key) {\n return this.id2Value[key.id] != null;\n }", "title": "" }, { "docid": "e4947f44e600d83ba2f03329571024f9", "score": "0.5357194", "text": "function has(key,obj){\n let keysArray = []\n Object.keys(obj).forEach(k => {\n keysArray.push(k);\n })\n console.log(keysArray);\n if (key in keysArray){\n return false;\n }\n // keysArray.forEach(element => {\n // if(element == key){\n // return true;\n // }\n // else{\n // return false;\n // }\n // })\n else{\n return true;\n }\n}", "title": "" }, { "docid": "dbd54a2d349e7a4ef2894367075b3dba", "score": "0.53423965", "text": "function makeMap$1(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "c7993d0c7ad4280a6072d7e954e2dffc", "score": "0.5332562", "text": "function cachedLookup(fn) {\n const cache = new Map();\n return (arg) => {\n if (!cache.has(arg)) {\n cache.set(arg, fn(arg));\n }\n return cache.get(arg);\n };\n}", "title": "" }, { "docid": "76dce90b69923ce2e8dd9ff6560ce275", "score": "0.5296815", "text": "static Has(key) {\n return AppStorage.GetOrCreate().has(key);\n }", "title": "" }, { "docid": "5cac86222d050898e2b7aa35b9b35638", "score": "0.5266609", "text": "isKey(key) {\n return !!this._keysLookup[key];\n }", "title": "" }, { "docid": "67f85d500111de8d6b82e34cec79dfd1", "score": "0.5249048", "text": "lookup(key) {\n const index = Math.floor(this.stringHasher.hash(key) % this.tableSize);\n return (this.wordArray[index].includes(key)) ? true : false;\n\t}", "title": "" }, { "docid": "c855d703a602883ea033badc6b47ab1c", "score": "0.5248866", "text": "function has(key) {\n for (var _key in this) {\n if (_key === key) return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "2dafdd9a3c5971a2f1e4f5179f54fe42", "score": "0.5234558", "text": "has (name) {\n return !!this[MAP][sanitizeName(name)]\n }", "title": "" }, { "docid": "f39c7bf92e1fe555d38330ccc1847731", "score": "0.5202499", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n }", "title": "" }, { "docid": "f39c7bf92e1fe555d38330ccc1847731", "score": "0.5202499", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n }", "title": "" }, { "docid": "f39c7bf92e1fe555d38330ccc1847731", "score": "0.5202499", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n }", "title": "" }, { "docid": "f39c7bf92e1fe555d38330ccc1847731", "score": "0.5202499", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n }", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "8b94efde8f022840050ca0623adfa948", "score": "0.5199448", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "146d0903147ce9dc7dfd542500c3ecab", "score": "0.5191845", "text": "has(param) {\n this.init();\n return this.map.has(param);\n }", "title": "" }, { "docid": "146d0903147ce9dc7dfd542500c3ecab", "score": "0.5191845", "text": "has(param) {\n this.init();\n return this.map.has(param);\n }", "title": "" }, { "docid": "146d0903147ce9dc7dfd542500c3ecab", "score": "0.5191845", "text": "has(param) {\n this.init();\n return this.map.has(param);\n }", "title": "" }, { "docid": "146d0903147ce9dc7dfd542500c3ecab", "score": "0.5191845", "text": "has(param) {\n this.init();\n return this.map.has(param);\n }", "title": "" }, { "docid": "8165664429e245adbfa8fc3c5e66a22d", "score": "0.5181559", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "2a8a84962b56ae97610e4903e189f77e", "score": "0.5179207", "text": "function assocLookup(@xs) { return function(@k) {\n return xs[\"\" + k];\n};}", "title": "" }, { "docid": "bcfb71e343737c9496f47e4d908179f2", "score": "0.51769656", "text": "exists(key) {\n const transformed = this.fixKeys(key);\n\n return !this.meta[transformed] ? null : transformed;\n }", "title": "" }, { "docid": "7ae209c36cfc205396c5fa516909e0df", "score": "0.5176679", "text": "function includes(key, array) {\n // Transition to dictionary mode in the final invocation.\n array.__defineSetter__(key, () => {});\n // Will then read OOB.\n return array.includes(1234);\n}", "title": "" }, { "docid": "7ea3c86ec63eda42745716916045cdb1", "score": "0.5173477", "text": "function containsValue(v, map) {\n for (const kv of map) {\n if ((0,_Util_js__WEBPACK_IMPORTED_MODULE_0__.equals)(v, kv[1])) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "7ea3c86ec63eda42745716916045cdb1", "score": "0.5173477", "text": "function containsValue(v, map) {\n for (const kv of map) {\n if ((0,_Util_js__WEBPACK_IMPORTED_MODULE_0__.equals)(v, kv[1])) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "b0cceeceed910bd887abb2237853fd9f", "score": "0.5172988", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "b0cceeceed910bd887abb2237853fd9f", "score": "0.5172988", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "b0cceeceed910bd887abb2237853fd9f", "score": "0.5172988", "text": "function makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) {\n return map[val.toLowerCase()];\n } : function (val) {\n return map[val];\n };\n}", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "1ce57a8afde1bb5c90598965198fd525", "score": "0.51710254", "text": "function makeMap (\n str,\n expectsLowerCase\n ) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n }", "title": "" }, { "docid": "b530aae47f84268908949e38540662b4", "score": "0.51657706", "text": "function makeMap(\n str,\n expectsLowerCase\n ) {\n var map = Object.create( null );\n var list = str.split( ',' );\n for ( var i = 0; i < list.length; i++ ) {\n map[ list[ i ] ] = true;\n }\n return expectsLowerCase\n ? function (val) {\n return map[ val.toLowerCase() ];\n }\n : function (val) {\n return map[ val ];\n }\n }", "title": "" }, { "docid": "e2c5a71e2af960a7811bbe2711396f90", "score": "0.5143833", "text": "function hasKey(aObj, keyName) {\n if (keyName in aObj) return true;\n else return false;\n}", "title": "" }, { "docid": "56276f0f4ab11737386933dabed971c9", "score": "0.5128182", "text": "function makeMap(str, expectsLowerCase) {\n\t var map = Object.create(null);\n\t var list = str.split(',');\n\t for (var i = 0; i < list.length; i++) {\n\t map[list[i]] = true;\n\t }\n\t return expectsLowerCase ? function (val) {\n\t return map[val.toLowerCase()];\n\t } : function (val) {\n\t return map[val];\n\t };\n\t}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" }, { "docid": "664b54f025210d963c37e94e45125bb9", "score": "0.5128051", "text": "function makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}", "title": "" } ]
f2563c170ba07ec6225526a3608182ff
Handles responses to an ajax request: finds the right dataType (mediates between contenttype and expected dataType) returns the corresponding response
[ { "docid": "92a6ba65594b728ee12534efa6e63ea3", "score": "0.0", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" } ]
[ { "docid": "797faa51731407d12006ffd2af716cc9", "score": "0.78497916", "text": "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.7837581", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.7837581", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "57eaa07ccb8280ef6f5da97418227c61", "score": "0.7776531", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\nwhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\nif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\nif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\nfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\nfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "eeecd1e33dedc4253bdd37d8d7ca19e2", "score": "0.7762106", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\nif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\nfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "222801db63d552a509f38e64adc77e03", "score": "0.775737", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "afaa793207c5a9653a0448a06bdc115a", "score": "0.7719018", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\n\tfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "bedb24ef78420c9082bce9833c3c452a", "score": "0.7715714", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\r\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\r\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\r\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\r\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\r\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "1c36831cd50e4b06dab244df83379d1c", "score": "0.7673115", "text": "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\n while(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\n if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\n if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\n for(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\n finalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\n if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "ed81429559a55ba3eb1f73f620ede7bb", "score": "0.76301724", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n \n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n \n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n \n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n \n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "d647097eb8445d92a6bab381982086ba", "score": "0.7614447", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "f19038c35e96806213367c6bd9b9d14b", "score": "0.7604654", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType,\n ct,\n finalDataType,\n type,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "b4fda659fe54ac118f85953de1f8e6ec", "score": "0.7600554", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[ 0 ] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[ type ] && contents[ type ].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[ 0 ] in responses) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[ 0 ]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "b38ce9d2a8aa95539a735d803b779daa", "score": "0.75996417", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.7597422", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.75890356", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.75890356", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "752b8fa10aa0b0995d9d40417722148f", "score": "0.75771356", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "2f10474f96cd52c8354eeff7872a4e5a", "score": "0.7577034", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "2f10474f96cd52c8354eeff7872a4e5a", "score": "0.7577034", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "6d979bd2258f84328ff9af842e82bbca", "score": "0.7575461", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\t\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\t\tcontents = s.contents,\n\t\t\t\tdataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif ( ct === undefined ) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif ( ct ) {\n\t\t\t\tfor ( type in contents ) {\n\t\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we have a response for the expected dataType\n\t\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor ( type in responses ) {\n\t\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif ( finalDataType ) {\n\t\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t\t}\n\t\t\t\treturn responses[ finalDataType ];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fadbc3d050ff648416652ed5ecf815a1", "score": "0.7573607", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "ff4c6b6f0ce5b8363ac212f919f68ade", "score": "0.75633496", "text": "function ajaxHandleResponses( s, jqXHR, responses ) { // 8616\n // 8617\n\tvar ct, type, finalDataType, firstDataType, // 8618\n\t\tcontents = s.contents, // 8619\n\t\tdataTypes = s.dataTypes; // 8620\n // 8621\n\t// Remove auto dataType and get content-type in the process // 8622\n\twhile ( dataTypes[ 0 ] === \"*\" ) { // 8623\n\t\tdataTypes.shift(); // 8624\n\t\tif ( ct === undefined ) { // 8625\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" ); // 8626\n\t\t} // 8627\n\t} // 8628\n // 8629\n\t// Check if we're dealing with a known content-type // 8630\n\tif ( ct ) { // 8631\n\t\tfor ( type in contents ) { // 8632\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) { // 8633\n\t\t\t\tdataTypes.unshift( type ); // 8634\n\t\t\t\tbreak; // 8635\n\t\t\t} // 8636\n\t\t} // 8637\n\t} // 8638\n // 8639\n\t// Check to see if we have a response for the expected dataType // 8640\n\tif ( dataTypes[ 0 ] in responses ) { // 8641\n\t\tfinalDataType = dataTypes[ 0 ]; // 8642\n\t} else { // 8643\n // 8644\n\t\t// Try convertible dataTypes // 8645\n\t\tfor ( type in responses ) { // 8646\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) { // 8647\n\t\t\t\tfinalDataType = type; // 8648\n\t\t\t\tbreak; // 8649\n\t\t\t} // 8650\n\t\t\tif ( !firstDataType ) { // 8651\n\t\t\t\tfirstDataType = type; // 8652\n\t\t\t} // 8653\n\t\t} // 8654\n // 8655\n\t\t// Or just use first one // 8656\n\t\tfinalDataType = finalDataType || firstDataType; // 8657\n\t} // 8658\n // 8659\n\t// If we found a dataType // 8660\n\t// We add the dataType to the list if needed // 8661\n\t// and return the corresponding response // 8662\n\tif ( finalDataType ) { // 8663\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) { // 8664\n\t\t\tdataTypes.unshift( finalDataType ); // 8665\n\t\t} // 8666\n\t\treturn responses[ finalDataType ]; // 8667\n\t} // 8668\n} // 8669", "title": "" }, { "docid": "67c8ae9f0181bd7e57f197854bcda4fd", "score": "0.7559236", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "67c8ae9f0181bd7e57f197854bcda4fd", "score": "0.7559236", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "69925758f277beae59af2aa0af5e5a33", "score": "0.7553461", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\tvar firstDataType, ct, finalDataType, type,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes,\r\n\t\tresponseFields = s.responseFields;\r\n\r\n\t// Fill responseXXX fields\r\n\tfor ( type in responseFields ) {\r\n\t\tif ( type in responses ) {\r\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\r\n\t\t}\r\n\t}\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "e80e0f84cef097975df4fe8349c8dc43", "score": "0.75480443", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n \tvar ct, type, finalDataType, firstDataType,\n \t\tcontents = s.contents,\n \t\tdataTypes = s.dataTypes;\n\n \t// Remove auto dataType and get content-type in the process\n \twhile ( dataTypes[ 0 ] === \"*\" ) {\n \t\tdataTypes.shift();\n \t\tif ( ct === undefined ) {\n \t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n \t\t}\n \t}\n\n \t// Check if we're dealing with a known content-type\n \tif ( ct ) {\n \t\tfor ( type in contents ) {\n \t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n \t\t\t\tdataTypes.unshift( type );\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n\n \t// Check to see if we have a response for the expected dataType\n \tif ( dataTypes[ 0 ] in responses ) {\n \t\tfinalDataType = dataTypes[ 0 ];\n \t} else {\n\n \t\t// Try convertible dataTypes\n \t\tfor ( type in responses ) {\n \t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n \t\t\t\tfinalDataType = type;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif ( !firstDataType ) {\n \t\t\t\tfirstDataType = type;\n \t\t\t}\n \t\t}\n\n \t\t// Or just use first one\n \t\tfinalDataType = finalDataType || firstDataType;\n \t}\n\n \t// If we found a dataType\n \t// We add the dataType to the list if needed\n \t// and return the corresponding response\n \tif ( finalDataType ) {\n \t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n \t\t\tdataTypes.unshift( finalDataType );\n \t\t}\n \t\treturn responses[ finalDataType ];\n \t}\n }", "title": "" }, { "docid": "e4c833b91f6c49e0ef1f8a2e4dfab205", "score": "0.754802", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "0378ce8f8489d6701d63460f648e44d8", "score": "0.75465405", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\tvar firstDataType, ct, finalDataType, type,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "0378ce8f8489d6701d63460f648e44d8", "score": "0.75465405", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\tvar firstDataType, ct, finalDataType, type,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "1cc1ea1228e36a67af3dcdb8583a1c57", "score": "0.75450295", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\r\n\t\tvar firstDataType, ct, finalDataType, type,\r\n\t\t\tcontents = s.contents,\r\n\t\t\tdataTypes = s.dataTypes;\r\n\r\n\t\t// Remove auto dataType and get content-type in the process\r\n\t\twhile (dataTypes[0] === \"*\") {\r\n\t\t\tdataTypes.shift();\r\n\t\t\tif (ct === undefined) {\r\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check if we're dealing with a known content-type\r\n\t\tif (ct) {\r\n\t\t\tfor (type in contents) {\r\n\t\t\t\tif (contents[type] && contents[type].test(ct)) {\r\n\t\t\t\t\tdataTypes.unshift(type);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check to see if we have a response for the expected dataType\r\n\t\tif (dataTypes[0] in responses) {\r\n\t\t\tfinalDataType = dataTypes[0];\r\n\t\t} else {\r\n\r\n\t\t\t// Try convertible dataTypes\r\n\t\t\tfor (type in responses) {\r\n\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\r\n\t\t\t\t\tfinalDataType = type;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (!firstDataType) {\r\n\t\t\t\t\tfirstDataType = type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Or just use first one\r\n\t\t\tfinalDataType = finalDataType || firstDataType;\r\n\t\t}\r\n\r\n\t\t// If we found a dataType\r\n\t\t// We add the dataType to the list if needed\r\n\t\t// and return the corresponding response\r\n\t\tif (finalDataType) {\r\n\t\t\tif (finalDataType !== dataTypes[0]) {\r\n\t\t\t\tdataTypes.unshift(finalDataType);\r\n\t\t\t}\r\n\t\t\treturn responses[finalDataType];\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7538543", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7538543", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "4539dd18797d92d90b5024a6aaca802f", "score": "0.753711", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.75309694", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "cc9583637039ca790db20cf822b38e10", "score": "0.7524299", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "d935ef971f75c98b4c39b0898e3973d3", "score": "0.7523566", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a65fc731e0544f6d5ca3dab7ff55c7c8", "score": "0.752341", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "9c7f4bf30074dcfc027f72b851536d3f", "score": "0.7522686", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" } ]
3970845f658a42798983c0dc732a883d
Finish an operation, updating the display and signalling delayed events
[ { "docid": "e40d39aa1fcc8e4429fe6f469bc66c5b", "score": "0.0", "text": "function endOperation(cm) {\r\n var op = cm.curOp, doc = cm.doc, display = cm.display;\r\n cm.curOp = null;\r\n\r\n if (op.updateMaxLine) findMaxLine(cm);\r\n\r\n // If it looks like an update might be needed, call updateDisplay\r\n if (op.viewChanged || op.forceUpdate || op.scrollTop != null ||\r\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\r\n op.scrollToPos.to.line >= display.viewTo) ||\r\n display.maxLineChanged && cm.options.lineWrapping) {\r\n var updated = updateDisplay(cm, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\r\n if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;\r\n }\r\n // If no update was run, but the selection changed, redraw that.\r\n if (!updated && op.selectionChanged) updateSelection(cm);\r\n if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm);\r\n\r\n // Abort mouse wheel delta measurement, when scrolling explicitly\r\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\r\n display.wheelStartX = display.wheelStartY = null;\r\n\r\n // Propagate the scroll position to the actual DOM scroller\r\n if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) {\r\n var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));\r\n display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top;\r\n }\r\n if (op.scrollLeft != null && display.scroller.scrollLeft != op.scrollLeft) {\r\n var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));\r\n display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left;\r\n alignHorizontally(cm);\r\n }\r\n // If we need to scroll a specific position into view, do so.\r\n if (op.scrollToPos) {\r\n var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),\r\n clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);\r\n if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords);\r\n }\r\n\r\n if (op.selectionChanged) restartBlink(cm);\r\n\r\n if (cm.state.focused && op.updateInput)\r\n resetInput(cm, op.typing);\r\n\r\n // Fire events for markers that are hidden/unidden by editing or\r\n // undoing\r\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\r\n if (hidden) for (var i = 0; i < hidden.length; ++i)\r\n if (!hidden[i].lines.length) signal(hidden[i], \"hide\");\r\n if (unhidden) for (var i = 0; i < unhidden.length; ++i)\r\n if (unhidden[i].lines.length) signal(unhidden[i], \"unhide\");\r\n\r\n var delayed;\r\n if (!--delayedCallbackDepth) {\r\n delayed = delayedCallbacks;\r\n delayedCallbacks = null;\r\n }\r\n // Fire change events, and delayed event handlers\r\n if (op.changeObjs)\r\n signal(cm, \"changes\", cm, op.changeObjs);\r\n if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();\r\n if (op.cursorActivityHandlers)\r\n for (var i = 0; i < op.cursorActivityHandlers.length; i++)\r\n op.cursorActivityHandlers[i](cm);\r\n }", "title": "" } ]
[ { "docid": "ea30011afdc4fab464348287d37eb77e", "score": "0.6974197", "text": "function finishDisplay(){\r\n //TODO #3\r\n }", "title": "" }, { "docid": "e5a8a463b4107709d73b5fbf5f1dfd2e", "score": "0.6969287", "text": "function finishDisplay() {\r\n //TODO #3 implementation...\r\n displayInfo.processCompleteCount++;\r\n if (displayInfo.processCompleteCount==2) {\r\n //both have completed...\r\n populatePanelWithData(displayInfo);\r\n releasePanelToUser(displayInfo);\r\n }\r\n}", "title": "" }, { "docid": "efd0190ef35eb9e4cc783a4c73373189", "score": "0.6458035", "text": "function finish() {\n off();\n if (events[\"refresh-finished\"]) return;\n events[\"refresh-finished\"] = true;\n // setTimeout guarantees calling order\n setTimeout(function() {\n store.trigger(\"refresh-finished\");\n }, 100);\n }", "title": "" }, { "docid": "2781216f4748df3b0a158e17736054e9", "score": "0.6439627", "text": "complete() {\n this._clear_events();\n this._finish();\n }", "title": "" }, { "docid": "0711af9991c5d0b7f1fbfe0e70295b70", "score": "0.62901455", "text": "async complete() {\n // Tell UI that it's finished\n port.postMessage({ cmd: CMDS.COMPLETE })\n clearImportInProgressFlag()\n }", "title": "" }, { "docid": "aaa36cc858d773bd097bad9dc956283a", "score": "0.6201634", "text": "finish() {\n if (!this.disabled) {\n this._sendBatch();\n this.clearEvents();\n }\n }", "title": "" }, { "docid": "9a154836328b9260b6cb768cc3c335a9", "score": "0.6127455", "text": "endUpdate() {\n\t\tthis._suspend = false;\n\t\tthis.refresh();\n\t}", "title": "" }, { "docid": "6c3b3ab495158fb3ddc08592f2300271", "score": "0.61131084", "text": "function complete () {\n // Play the animation and audio effect after task completion.\n svl.ui.task.taskCompletionMessage.css('visibility', 'visible').hide();\n svl.ui.task.taskCompletionMessage.removeClass('animated bounce bounceOut').fadeIn(300).addClass('animated bounce');\n setTimeout(function () { svl.ui.task.taskCompletionMessage.fadeOut(300).addClass('bounceOut'); }, 1000);\n\n if ('audioEffect' in svl) {\n svl.audioEffect.play('yay');\n svl.audioEffect.play('applause');\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n svl.labelCounter.reset();\n }\n \n setProperty(\"isCompleted\", true);\n }", "title": "" }, { "docid": "2ae801faea7ca9fba2b4368c00f920ce", "score": "0.60508835", "text": "finish() {\r\n this.output.setState('Finalizado');\r\n }", "title": "" }, { "docid": "6ee118ff49647c85b1e24de385dd9df3", "score": "0.59634334", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "6ee118ff49647c85b1e24de385dd9df3", "score": "0.59634334", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "6ee118ff49647c85b1e24de385dd9df3", "score": "0.59634334", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "f0b59d2680960e697a89ea72518a072d", "score": "0.5952942", "text": "EndOn()\n {\n this.Clear();\n\n //HtmlBridge.AttachHtmlButton(this.overlayRes, \"overlayButton\", OverlayManager.GetButtonClickFunction(HtmlBridge.GoToResults), \"Continue\",'#5ae8ae');\n\n this.OverlayDisplay(O_END.message);\n }", "title": "" }, { "docid": "a1c49bc5c840d79ac909589c7920d40f", "score": "0.5950094", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "a1c49bc5c840d79ac909589c7920d40f", "score": "0.5950094", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "a1c49bc5c840d79ac909589c7920d40f", "score": "0.5950094", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "a1c49bc5c840d79ac909589c7920d40f", "score": "0.5950094", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "a1c49bc5c840d79ac909589c7920d40f", "score": "0.5950094", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "a1c49bc5c840d79ac909589c7920d40f", "score": "0.5950094", "text": "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "title": "" }, { "docid": "ae8c69cd8b89add37d77d6ab9bd2183c", "score": "0.59380823", "text": "function async_done(){\n // Push result into some page where the user will find them\n // ToDo: change into user pages\n // ToDo: I REALLY need to implement some kind of \"transient\" pages\n that.putPage(\n that.lookup( phase2_pagename),\n \"DoExportToDropbox\\n\\n\" + buf.join( \"\\n\"),\n Sw.noop\n )\n }", "title": "" }, { "docid": "e9357e4c5547cfa3509c69a713296e18", "score": "0.5884917", "text": "_callOnFinishChange() {\n\n\t\tif ( this._changed ) {\n\n\t\t\tthis.parent._callOnFinishChange( this );\n\n\t\t\tif ( this._onFinishChange !== undefined ) {\n\t\t\t\tthis._onFinishChange.call( this, this.getValue() );\n\t\t\t}\n\n\t\t}\n\n\t\tthis._changed = false;\n\n\t}", "title": "" }, { "docid": "cc5fc3b7bed68703f13da49484af74e0", "score": "0.5869615", "text": "finish() {\n\t\tthis.finished = true;\n\t\tthis.running = false;\n\t\t\n\t\tif (this.finishHandler != null) {\n\t\t\tthis.finishHandler();\n\t\t}\n\t\tthis.init();\n\t}", "title": "" }, { "docid": "f49524eedcd6dceb0ad3d621667dc984", "score": "0.5861313", "text": "function updateWhenDone() {\n if (storedData !== undefined && owner !== undefined) {\n log(\"Updating UI.\");\n updateUI(storedData, owner);\n }\n }", "title": "" }, { "docid": "e80ec14b5a5c9db000d683e809f97b05", "score": "0.58229417", "text": "function completeSync() {\n\t\t$(\".status\").html('Syncing complete!');\n\t\t$('.cst-progress').append('<strong>All files synced.</strong>');\n\t\t$(\".cst-progress-return\").show();\n\t}", "title": "" }, { "docid": "ad0104a42e729e7972dbde2c5464cbf7", "score": "0.5800564", "text": "function onFinish() {\n console.log(\"finished!\");\n}", "title": "" }, { "docid": "16271950542254c0917c202051e74e89", "score": "0.5788992", "text": "function loadDone()\n\t{\n\t\tapp.clearLoadingBox();\n\t}", "title": "" }, { "docid": "28d7bcce8f00c44d9b519d22ffe2721c", "score": "0.5784973", "text": "function finishProcessing(id,percent,state,error){\n\t\tvar stateBar = getStateBarElement(id);\n\t\tvar btnStart = getBtnStartElement(id);\n\t\tvar btnDownlaod=getBtnDownloadElement(id);\n\t\t\n\t\tstateBar.innerHTML=state;\n\t\tif(error){\n\t\t\tupdateProgressBar (id, 0);\n\t\t\tresetColorsProgressBar (id);\n\t\t\tbtnStart.disabled=false;\n\t\t\tbtnDownlaod.disabled=true;\n\t\t} else{\n\t\t\tbtnStart.disabled=false;\n\t\t\tbtnDownlaod.disabled=false;\n\t\t\tprocessStateTabs(id);\n\t\t\tupdateProgressBar (id, percent);\n\t\t}\n\t}", "title": "" }, { "docid": "737c0991b2b489daa647adffab12ac9d", "score": "0.5721407", "text": "handleFinish(event) {\n console.log('inside handle finish');\n this.template.querySelector('lightning-record-edit-form').submit();\n this.displayMode = 'View';\n }", "title": "" }, { "docid": "eb4697884dd64baae02ee2c6be9d082d", "score": "0.5713539", "text": "_finish () {\n this._end();\n this._config.on_finish();\n }", "title": "" }, { "docid": "f8b20cbf9a5d6210a6755e48c914db76", "score": "0.5704024", "text": "function finish() {\n awaitingCount--;\n if (awaitingCount === 0) {\n // Tell the results container directives to render the focus chart.\n refreshFocusData.focusChartData = processDataForFocusAnomalies(\n refreshFocusData.focusChartData,\n refreshFocusData.anomalyRecords,\n focusAggregationInterval,\n modelPlotEnabled,\n );\n\n refreshFocusData.focusChartData = processScheduledEventsForChart(\n refreshFocusData.focusChartData,\n refreshFocusData.scheduledEvents);\n\n resolve(refreshFocusData);\n }\n }", "title": "" }, { "docid": "1e48dd248288a36b4d761d29a38c8a11", "score": "0.5703664", "text": "function finishLayerUpdate(changeContext) {\n changeContext.updateIsScheduled = false;\n // If the update is obsolete, schedule another one right after\n // This update will still be delayed to give Photoshop some time to catch its breath\n if (changeContext.updateIsObsolete) {\n console.log(\"Update was marked as obsolete, starting over with %d pending changes\",\n changeContext.documentChanges.length);\n changeContext.updateIsObsolete = false;\n scheduleLayerUpdate(changeContext);\n }\n // This is the final update for now: clean up\n else {\n var deferred = changeContext.updateCompleteDeferred;\n delete _changeContextPerLayer[changeContext.id];\n deferred.resolve();\n }\n }", "title": "" }, { "docid": "45107c7197dd87f8860f65286423d99a", "score": "0.5698847", "text": "function callFinishedListeners( action ) {\n\t\t\t\tlisteners.forEach( (listener)=> {\n\t\t\t\t\tif ( listener.eventName == 'finished' ) {\n\t\t\t\t\t\tlistener.callback({\n\t\t\t\t\t\t\ttype:'finished',\n\t\t\t\t\t\t\taction: action\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t}, action.tileDisplayDuration );\n\t\t\t}", "title": "" }, { "docid": "3bfe4208b6d15f0d8df0b288cc29455c", "score": "0.5685149", "text": "function runAfterCompletion() {\n\t createLegend(scaleFactor);\n\t focus0 = root;\n\t k0 = 1;\n\t d3.select(\"#loadText\").remove();\n\t zoomTo(root);\n\t}", "title": "" }, { "docid": "d25c6577e629fc3aac0e3d2555e6394d", "score": "0.5676513", "text": "function onFinish() {\n label.text('');\n rect.transition().attr('width', '0%').duration(1000);\n count = 1;\n }", "title": "" }, { "docid": "049234d7ba4156e56411e75e23d769a2", "score": "0.5672477", "text": "async complete() {\n if (this.nativeRefresher) {\n this.needsCompletion = true;\n // Do not reset scroll el until user removes pointer from screen\n if (!this.pointerDown) {\n raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, 32 /* Completing */)));\n }\n }\n else {\n this.close(32 /* Completing */, '120ms');\n }\n }", "title": "" }, { "docid": "0c70d64cafd1a01c53c1dfab3fb6ed27", "score": "0.5672111", "text": "finishLoading()\n\t{\n\t\tif(this._loading_finished_callback)\n\t\t{\n\t\t\tthis._loading_finished_callback();\n\t\t\tthis._loading_finished_callback = null;\n\t\t}\n\t}", "title": "" }, { "docid": "0f06b3b8e59329619b96c698b8c5189e", "score": "0.56679463", "text": "_finish(x, y) {\n\t\t\t\n\t\tthis.drawOff();\t\t\t\t\t\t\n\t\tthis._onMouseDownAction = (x, y) => this._start(x, y);\n\t\tthis._disableMouseMove();\n\t\t\t\t\t\t\n\t\tthis._inProcess = false;\n\t\t\t\t\n\t}", "title": "" }, { "docid": "fd02bf897ffc44cff5fd62192c978f88", "score": "0.56607896", "text": "static handleSortFinishedClick() {\n\t\tif (!Display.handlingEvent) {\n\t\t\tDisplay.handlingEvent = true;\n\n\t\t\tInterstruct.sortFinished();\n\n\t\t\tDisplay.handlingEvent = false;\n\t\t}\n\t}", "title": "" }, { "docid": "c77008b2cba35fe30dfaff98a2bb368f", "score": "0.56453013", "text": "function endEdit(){\n // Reset task form and update UI\n displayTaskForm();\n updateUI()\n}", "title": "" }, { "docid": "406229f856be2c2b60629f608a12df70", "score": "0.5636759", "text": "function finish() {\n finished = true;\n }", "title": "" }, { "docid": "fa66697705581b9920a466afef957f48", "score": "0.56349164", "text": "function finishQuery() {\n saveStateToStorage(); // save the state\n cwQueryService.currentQueryRequest = null; // no query running\n cwQueryService.executingQuery.busy = false; // enable the UI\n }", "title": "" }, { "docid": "a45c627dac33f4f0a69d67664a255664", "score": "0.56177264", "text": "function operationComplete() {\n if ((successfulOperations.length + failedOperations.length) >= totalOperations) {\n saveComplete();\n }\n }", "title": "" }, { "docid": "125144148d0902b2f971483549adb437", "score": "0.5605", "text": "async complete() {\n const t = await Tr(this.localStore, new Wo(this.N), this.documents, this.lo.id),\n e = this.wo(this.documents);\n\n for (const t of this.queries) await Ir(this.localStore, t, e.get(t.name));\n\n return this.progress.taskState = \"Success\", new sr(Object.assign({}, this.progress), t);\n }", "title": "" }, { "docid": "feb58ce54319fb3e4368c15158876d80", "score": "0.55889666", "text": "done() {\n var data = {\n 'id' : this.id,\n 'tempresults' : this.results\n };\n this.socket.emit('benchmark_done', data);\n ResultDbAgent.completeBenchmark(this.id);\n }", "title": "" }, { "docid": "fc3fcd2392d985ac5b71fa872038f4e7", "score": "0.55711627", "text": "function finish () {\n var totalTime = Math.floor((new Date() - startTime) / 1000);\n\n options.log('\\nFinished in ' + Math.floor(totalTime / 60) + 'm' + totalTime % 60 + 's');\n options.done();\n }", "title": "" }, { "docid": "6ed9f1deb082da52508b3b30de553a77", "score": "0.5570762", "text": "function onFinish(){\n\n canUpdate = 1;\n}", "title": "" }, { "docid": "3357cc9f0325f1afb4b351de50e29979", "score": "0.5568626", "text": "function LogFinish() { bind.LogFinish(); }", "title": "" }, { "docid": "22f50dfdc358692bee7ae53adafe8f93", "score": "0.5566531", "text": "moveFinish(){\n clearInterval(this.interval);\n resultComponent.displayZombies(this._gameData.getZombies());\n\n setTimeout(()=>{\n alert(\"Finished\");\n },500);\n\n }", "title": "" }, { "docid": "429142a1e2a0280f5bcfae01df93abdf", "score": "0.5563201", "text": "function main_finish(){\n\n\tLog.notice('Export is finished');\n\tif ( app.playbackDisplayDialogs != DialogModes.NO ) {\n\t\talert(\"Export is finished\");\n\t}\n\n\t// return to initial state\n\t//Stdlib.revertToSnapshot(origDocRef, SNAPSHOTNAME);\n}", "title": "" }, { "docid": "91a48d10af492f8d8c531f24675f73b9", "score": "0.5551402", "text": "onEnd(state) {\n this.status = 'answered';\n\n // Rerender prompt (and clean subline error)\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(state.value);\n }", "title": "" }, { "docid": "91a48d10af492f8d8c531f24675f73b9", "score": "0.5551402", "text": "onEnd(state) {\n this.status = 'answered';\n\n // Rerender prompt (and clean subline error)\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(state.value);\n }", "title": "" }, { "docid": "853fe0ff9eb662886d475940fb9df0bc", "score": "0.5545621", "text": "function gpComplete(result) {\n // Get the output report\n gpService.getResultData(result.jobInfo.jobId, \"Output_File\");\n getReportEvent = gpService.on(\"get-result-data-complete\", function (outputReport) {\n // Get report download link\n reportDownloadLink = outputReport.result.value.url;\n // Enable report download button\n domClass.remove(self.reportDownloadButton, 'jimu-state-disabled');\n\n self.loadingInfo.innerHTML = \"Report generation complete...\";\n console.log(\"Report geoprocessing service job finished...\");\n console.log(\"PDF located here - \" + reportDownloadLink + \"...\");\n // Open the PDF\n window.open(reportDownloadLink);\n console.timeEnd('Complete Geoprocessing Service');\n getReportEvent.remove();\n\n // Get the output data if needed\n if ((String(self.config.downloadDataIntersectLayers).toLowerCase() == \"true\") && (String(self.dataDownloadFormatSelect.value).toLowerCase() != \"none\")) {\n gpService.getResultData(result.jobInfo.jobId, \"Output_Data\");\n getDataEvent = gpService.on(\"get-result-data-complete\", function (outputData) {\n // Get data download link\n dataDownloadLink = outputData.result.value.url;\n // Enable data download button\n domClass.remove(self.dataDownloadButton, 'jimu-state-disabled');\n\n console.log(\"Data located here - \" + dataDownloadLink + \"...\");\n // Download the data\n window.open(dataDownloadLink);\n getDataEvent.remove();\n });\n }\n\n });\n\n // Enable submit button\n domClass.remove(self.submitButton, 'jimu-state-disabled');\n // Enable clear button\n domClass.remove(self.clearButton, 'jimu-state-disabled');\n // Disable cancel button\n domClass.add(self.cancelButton, 'jimu-state-disabled');\n\n // Hide loading\n reportGenerating = false;\n html.setStyle(self.loading, \"display\", \"none\");\n self.loadingInfo.innerHTML = \"Loading...\";\n }", "title": "" }, { "docid": "5aaa1ca8029cb339d2bedc0cb5e85d1c", "score": "0.5540786", "text": "function updateCompletion() {}", "title": "" }, { "docid": "c05f385d4d2884d909b08710b797eb50", "score": "0.55230695", "text": "function writeDone() {\n\t$(\"#status\").html(\"Writing data...\");\n}", "title": "" }, { "docid": "ce0012cc3142f32767dd2c8118e77be7", "score": "0.5519684", "text": "function workoutFinished(){\n\n }", "title": "" }, { "docid": "1b5956e6d1b68c0a933adcc618da8d95", "score": "0.5517446", "text": "function tryFinish() {\n if (--counter > 0) return;\n\n var hasLayoutChanged = inst._layout.id !== layoutId;\n var callback = isFunction(instant) ? instant : onFinish;\n\n if (isFunction(callback)) {\n callback(hasLayoutChanged, layout.items.slice(0));\n }\n\n if (!hasLayoutChanged && inst._hasListeners(eventLayoutEnd)) {\n inst._emit(eventLayoutEnd, layout.items.slice(0));\n }\n }", "title": "" }, { "docid": "15fce2abd0835553011e7b12f5ff3e43", "score": "0.5515403", "text": "finish () {\n // Already finished.\n if (! this.get('open')) return;\n\n this.set('enabled', false);\n this.close();\n this._double_tap('finish_clue');\n }", "title": "" }, { "docid": "fbd8ab875eb8858885f6a43cb12d77cd", "score": "0.55151415", "text": "complete() {\n this._finishTime = formatCurrentTime();\n this._latency = formatTime(this.startTime - this.finishTime);\n\n scorm.set(`cmi.interactions.${this.index}.time`, this._result);\n scorm.set(`cmi.interactions.${this.index}.latency`, this._latency);\n scorm.save();\n }", "title": "" }, { "docid": "71d0a11130c0665c161f759b0fefce61", "score": "0.55131894", "text": "function onComplete_(){this.onComplete$MK$s=( function(testResult/*:TestResult*/, resultXml/*:String*/)/*:void*/{\n BrowserRunner.insertIntoDOM(resultXml);\n });}", "title": "" }, { "docid": "53f1b517f3a53236df39f566750e4011", "score": "0.5507195", "text": "function afterSuccess(data)\n\t\t{\n\t\t\tvar json = JSON.parse(data);\n\t\t\t$('#submit-btn').show(); //hide submit button\n\t\t\t$('#loading-img').hide(); //hide submit button\n\t\t\t$('#progressbox').delay( 1000 ).fadeOut(function(){\n\t\t\t\tif(!json.success){\n\t\t\t\t\t$('#output').text('Error: ' + json.msg);\n\t\t\t\t\tscope.refresh_gallery();\n\t\t\t\t} else {\n\t\t\t\t\t$('#output').text('Success: ' + json.msg);\n\t\t\t\t\tscope.refresh_gallery();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}); //hide progress bar\n\n\t\t}", "title": "" }, { "docid": "d0c5880302e7cefb34d0d8f790023cb4", "score": "0.55056685", "text": "displayFinishScreen() {\r\n\t\tvar confettiSettings = {\r\n\t\t\t\"target\": \"confetti\",\r\n\t\t\t\"max\": \"150\",\r\n\t\t\t\"size\": \"1\",\r\n\t\t\t\"animate\": true,\r\n\t\t\t\"props\": [\"square\", \"triangle\"],\r\n\t\t\t\"colors\": [[231, 98, 161], [230, 61, 135], [0, 199, 228], [253, 214, 126], [231, 98, 161]],\r\n\t\t\t\"clock\": \"30\",\r\n\t\t\t\"rotate\": true,\r\n\t\t\t\"start_from_edge\": false,\r\n\t\t\t\"respawn\": true\r\n\t\t};\r\n\t\tvar confetti = new ConfettiGenerator(confettiSettings);\r\n\t\tconfetti.render();\r\n\t\t// if needed: confetti.clear(); \r\n\r\n\t\tdocument.querySelector(\".overlay\").style.visibility = \"visible\";\r\n\t\tdocument.querySelector(\".overlay__text > h3\").textContent = \"You completed the puzzle in \" + this.myTimer.getTime();\r\n\t}", "title": "" }, { "docid": "cdb19fb85004bb384087e6728e64f07e", "score": "0.5502508", "text": "function _on_timeout(){\n\t anchor.finish_wait();\n\t}", "title": "" }, { "docid": "b7bb48b6d0a7d58181b5899c85a8bde5", "score": "0.5499467", "text": "function end_success(result) {\n console.log(\"End result: ---> \", result); // \"Stuff worked!\"\n }", "title": "" }, { "docid": "c4695cd5ea00235ce1ee28f5d3377ebe", "score": "0.5491767", "text": "function do_finish()\n {\n console.log(\"Doing finish\");\n if(my_query.doneManta && !my_query.submitted && my_query.success)\n {\n my_query.submitted=true;\n\n check_and_submit(check_function,automate);\n }\n else if(my_query.doneManta && !my_query.submitted)\n {\n console.log(\"Done everything, failed!!!\");\n }\n }", "title": "" }, { "docid": "92d2d6b8c6a7a52a09ab5fd74fc27663", "score": "0.54873097", "text": "function onComplete() {\r\n \tsequence.onComplete();\r\n }", "title": "" }, { "docid": "5f0f3767eb8cbbe029ba955a3922cfe6", "score": "0.5487278", "text": "function done() {\n pending -= 1;\n if (!pending) {\n _delgeneric(() => {\n const d2 = new Date() - d1;\n process.stdout.write(`Finished '\\x1b[36mbuild:js:dev\\x1b[89m\\x1b[0m' after \\x1b[35m${d2} ms\\x1b[89m\\x1b[0m\\n`);\n });\n }\n }", "title": "" }, { "docid": "c3f3a7a9ed26c90bbb94bdb2b5f10892", "score": "0.5476079", "text": "function setFinish() {\r\n\t$(\".start\").removeClass(\"start\").addClass(\"finish\").html(\"FINISHED\");\r\n\t$(\".resume\").removeClass(\"resume\").addClass(\"finish\").html(\"FINISHED\");\r\n\t$(\".pause\").removeClass(\"pause\").addClass(\"finish\").html(\"FINISHED\");\r\n\t$(\".running\").removeClass(\"running\").addClass(\"finish\").html(\"FINISHED\");\r\n\t$(\"#funcBtn\").css(\"cursor\", \"default\");\r\n}", "title": "" }, { "docid": "1de2ac1781f948895bd75c5c449e7c63", "score": "0.54736626", "text": "function onDone() {\n\t\tthis.emit('done', unitTestResult);\n\t\tthis.reset();\n\t}", "title": "" }, { "docid": "0ffec6735355fe356202368fd553f1f5", "score": "0.54696494", "text": "function toggleFinished() {\n setFinished(!finished);\n }", "title": "" }, { "docid": "204fa7b0cd0a101bbd8bb0fe0246d6a3", "score": "0.5456017", "text": "function displayEnd(){\n background(255, 0, 0);\n fill(0);\n textSize(48);\n textAlign(CENTER);\n text('Game Over', \n width / 2, height / 2);\n textSize(32);\n text('You passed ' + carsPassed + ' fireballs.', \n width / 2, height / 2 + 100);\n text('Difficulty: ' + checkMode() + ' ', \n width / 2, height / 2 + 150);\n textSize(30);\n textAlign(CENTER);\n let nameLabel = text('Enter Name', \n maxW / 2, buttonY*7.2);\n nameTextfield.show();\n nameTextfield.elt.focus();\n submitButton.draw();\n submitButton.onPress = function(){\n submitScore();\n }\n}", "title": "" }, { "docid": "d0f91c78d4fcecdc3a92171921ee79ae", "score": "0.54559183", "text": "function done() {\n putstr(padding_left(\" DONE\", seperator, sndWidth));\n putstr(\"\\n\");\n }", "title": "" }, { "docid": "4fe7471fd2fe4c336e4cef7cf8674537", "score": "0.54496753", "text": "function ending() {\n console.log('THE END');\n full_data += jscd_text;\n document.getElementById('dl_id').style.display = 'block';\n setTimeout(function() {\n document.getElementById('bg_id').style.backgroundColor = \"blue\";\n }, 5000);\n}", "title": "" }, { "docid": "70f5d6f3180933c5e01c7ac1cc872ad7", "score": "0.54496306", "text": "function afterSuccess()\n{\n\t$('#submit-btn').show(); //hide submit button\n\t$('#loading-img').hide(); //hide submit button\n\t$('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar\n\trefresh_media_files();\n}", "title": "" }, { "docid": "dcafa8df13276832255a769ae60718f0", "score": "0.5444", "text": "onTaskEnd() {\n\t\t\t// set end\n\t\t}", "title": "" }, { "docid": "24f67feb6095be965395c3606bca34c2", "score": "0.54429716", "text": "setWorkoutDone() {\n this.setState({\n doneWorkout: true,\n progressColor: '#4CD964',\n circularProgressAction: 'Avanti'\n });\n Reactotron.log('end');\n this.circularProgress.animate(100, 0, Easing.linear)\n\n }", "title": "" }, { "docid": "4de07e6ee86e441d6f16b2b91bdeb4c9", "score": "0.5439836", "text": "function results() {\n clearInterval(timer);\n // display results\n}", "title": "" }, { "docid": "2c1526b6fc3fb6faab3920996e27e5fd", "score": "0.54387563", "text": "_completeWith(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t);}", "title": "" }, { "docid": "f3f0c5e4e951906350ff8f6b487d01dc", "score": "0.5435214", "text": "showCompletedResult( ) {\n\n const completedCopy = \"Well done, you have helped Geoff find all the items.\\nBut you took lots of risks doing it.  There could have been live, unexploded bombs out there.\";\n\n const modal = Ti.UI.createView( {\n id : 'resultModal',\n top : 0,\n bottom : 0,\n left : 0,\n right : 0,\n width : Ti.UI.FILL,\n height : Ti.UI.FILL,\n zIndex : 50,\n layout : 'vertical',\n backgroundColor : '#CCEEC630',\n } );\n\n const resultLabel = Ti.UI.createLabel( {\n top : '25',\n left : '5%',\n right : '5%',\n text : completedCopy,\n height : '75%',\n color : '#000',\n zIndex : 51,\n font : {\n fontSize : '50dp',\n fontFamily : Alloy.Globals.schoolsFontBold,\n }\n } );\n\n const finishButton = Ti.UI.createButton( {\n bottom : '40dp',\n top : 20,\n left : '20%',\n width : '60%',\n height : '10%',\n title : 'Finish',\n color : '#000',\n textAlign : 'center',\n borderWidth : 2,\n borderColor : '#000',\n borderRadius : 200,\n backgroundColor : 'transparent',\n font : {\n fontSize : '30dp',\n fontFamily : Alloy.Globals.schoolsFontBold,\n },\n } );\n\n finishButton.on( 'click', event => {\n\n this.settings.canvas = null;\n this.settings.canvasWrapper = null;\n\n this.settings.window.close();\n } );\n\n modal.add( resultLabel );\n modal.add( finishButton );\n\n this.settings.canvasWrapper.add( modal );\n }", "title": "" }, { "docid": "e334caf43e14eb97e828b70b5b98e763", "score": "0.5435008", "text": "function onFinish( err ){\n listeners( false );\n if( err ){\n console.error( err );\n }\n }", "title": "" }, { "docid": "6e0b8a946e20526f49bcceba6e07d565", "score": "0.5433463", "text": "function completeHandler(rval){\n\t\t$('progress').hide();\n\t\t//console.log(rval);\n\t\tdocument.rval = rval\n\t\t//$('#upload_target').html(rval)\n\t\tdocument.rval = JSON.parse(rval);\n\t\talert('UPLOAD COMPLETE');\n\t\tplot_specgram(document.rval['stim_matrix']);\n\t\tplot_nl_output(document.rval['non_linearity_output']);\n\t\tplot_spike_output(document.rval['spike_output']);\n\t}", "title": "" }, { "docid": "4d84228aa5899666088777907553e5c7", "score": "0.5430316", "text": "progressComplete() {\n this.isPaused = false;\n this.finishProgress();\n }", "title": "" }, { "docid": "165492d111e3ce8678f95ad201d730a5", "score": "0.5424905", "text": "function _finish() {\n\t\t\t$('#jquery-lightbox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "title": "" }, { "docid": "0974e2a99014f8e4b1711acdd769f0ef", "score": "0.54215187", "text": "function unpack_finished(){\r\n\t$('#download_finished').fadeOut();\r\n\t$('#unpack_finished').fadeIn();\r\n\t\r\n\r\n\r\n}", "title": "" }, { "docid": "bb0c55f358d9d6991d8a3af09e11350e", "score": "0.5412904", "text": "finish() {\n this.timer.stop();\n this[_queue].length = 0;\n this[_machine].next(FINISHED);\n }", "title": "" }, { "docid": "a620598407aa1a1efae3912d374db26d", "score": "0.54096514", "text": "finishRound() {\n\t\tthis.gameStatus = STATUS_IDLE;\n\t\tthis.ui.unlockUI();\n\t}", "title": "" }, { "docid": "9c3765a227f25dff3d4d74c3ee1388fa", "score": "0.5408121", "text": "function finishPendingActions() {\n if (grid.api) {\n grid.api.grid.refresh();\n }\n }", "title": "" }, { "docid": "441c03c13ed7bd28eca046ea3b1345c9", "score": "0.54029274", "text": "after() {\n this.stop();\n this.completeCallback();\n }", "title": "" }, { "docid": "eb20dac7389544b4b3a915a1e94dd568", "score": "0.5399755", "text": "function doLatestSuccess( result ) \n{\n drawComfort( result.comfort );\n drawUsage( result.usage );\n drawIndex( result.index ); \n}", "title": "" }, { "docid": "d31f1e6395abf3480a307239bb133c26", "score": "0.5395757", "text": "function completeHandler(event) {\r\n _(\"status\").innerHTML = event.target.responseText;\r\n _(\"progressBar\").value = 0;\r\n _(\"uploadSubmit\").value = \"Upload\";\r\n}", "title": "" }, { "docid": "e0463c98929b4d6c54a6fe97fc87c5a2", "score": "0.5389557", "text": "function endLoading() {\n setTimeout( () => {\n stopLoading();\n COMMON.hideElement(\"loading-container\", 0, init);\n }, 1000 );\n}", "title": "" }, { "docid": "16dca0ade71bff43425850479eb36202", "score": "0.5384684", "text": "function _finish() {\n\t\t$('#jquery-lightbox').remove();\n\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t}", "title": "" }, { "docid": "c6bdabdfc07ba57dc6b46f7015a2f453", "score": "0.53840053", "text": "function updateUIprocessCompleted () {\n\n\t\t$button_add_youtube.attr(\"disabled\",\"disabled\").removeClass(\"in_progress\");\n\t\t$(\"#process_completed\").removeClass(\"hidden\");\n\t\t$(\"#process_completed a\").attr(\"href\", updateLinkContent );\n\n\t\twindow.scrollTo(0,document.body.scrollHeight);\n\n\t}", "title": "" }, { "docid": "00d04ecb1a279305d081e3e66bfcc9a1", "score": "0.5382958", "text": "function empEndJob() {\n\t// Set control variable\n\temployeeIsWorking = false;\n\t\n\t// Hide all employee images\n\tempHideAll();\n\n\t// Show employee image getting the job\n\tif (powerUp) {\n\t\t$(\"#emp_up_2\").show();\n\t}\n\telse {\n\t\t$(\"#emp_stress_2\").show();\n\t}\n\n\t// Set timer to give up the ended job\n\tsetTimeout(\"empNoJob()\", 300);\n}", "title": "" }, { "docid": "95b9df52c66c766345a3e7a677a89ff9", "score": "0.537948", "text": "function mysuccess() {\n var current = waiting[0];\n current[success_idx].apply(this, arguments);\n // Wait until after the callback to remove this from the queue (or it could lead to double events!!!)\n waiting = waiting.slice(1, waiting.length); // Remove this from the queue\n if (waiting.length) {\n setTimeout(myexec, 0);\n }\n }", "title": "" }, { "docid": "6214067340d71846fae2e76db2988201", "score": "0.53784174", "text": "function onCompleteCallback() {\n imagesPendingLoad--;\n imagesPendingLoad == 0 && ONCOMPLETE in options && options[ONCOMPLETE]();\n }", "title": "" }, { "docid": "3675d91c2fa85c85084ccc42b38061a1", "score": "0.5373917", "text": "function afterUpdate(){\n//\tloadingDone();\n//\t$(\"foods\").pulsate();\t\n//\t$(\"rests\").pulsate();\t\n}", "title": "" }, { "docid": "8e383191a9da44dc2f435c1b7e620d68", "score": "0.53736424", "text": "onFinish() {\n this.props.dispatch(removeTimer());\n this.props.dispatch({type: 'STOP_PLAY'});\n this.props.dispatch(setPos(0));\n }", "title": "" }, { "docid": "f40933c7ed6a33435475dd97f923a607", "score": "0.5372904", "text": "function onFinishSelection(evt) {\n //Call to double click zoom control function to deactivate zoom event\n controlDoubleClickZoom(false);\n //Delay execution of activation of double click zoom function\n setTimeout(function () {\n controlDoubleClickZoom(true);\n }, 251);\n }", "title": "" }, { "docid": "7d25a5e60cf89ed92d666609c3f0c0c9", "score": "0.53633124", "text": "function done() {\n numComplete++;\n if (numComplete < numTotal) return;\n const embed = new self.Discord.EmbedBuilder();\n embed.setTitle('Unload complete.');\n embed.setColor([255, 0, 255]);\n embed.setDescription(outs.join(' ') || 'NOTHING unloaded');\n warnMessage.edit(\n {content: self.common.mention(msg), embeds: [embed]});\n }", "title": "" }, { "docid": "e6c673f2012708704a6c3b53dda48d2a", "score": "0.5362412", "text": "function WaitForRedraw() \n{\n // return; // uncomment for slight speed boost\n var eventWait = charIDToTypeID(\"Wait\") \n var enumRedrawComplete = charIDToTypeID(\"RdCm\") \n var typeState = charIDToTypeID(\"Stte\") \n var keyState = charIDToTypeID(\"Stte\") \n var desc = new ActionDescriptor() \n desc.putEnumerated(keyState, typeState, enumRedrawComplete) \n executeAction(eventWait, desc, DialogModes.NO) \n}", "title": "" }, { "docid": "a8223f74148ed5ff04c152440bef0b9b", "score": "0.5357408", "text": "function final() { console.log('Done', results); }", "title": "" } ]
2f7f996683e00831b050e15987b649ff
dynamic funtion to create text
[ { "docid": "2bd69aeb857281c2351b556ccfaaa990", "score": "0.0", "text": "function createTextNode(nodeName) {\n return document.createTextNode(nodeName);\n}", "title": "" } ]
[ { "docid": "3b2256c2655e9355586cbc2341377a0f", "score": "0.72537094", "text": "function createText(text) {\n return document.createTextNode(text);\n }", "title": "" }, { "docid": "72a5e0c18c668ff2cd3f3ff51c712615", "score": "0.7074068", "text": "function createText(text) {\n return document.createTextNode(text);\n}", "title": "" }, { "docid": "7664aafdb2bc69c5e1c77c933de08ae7", "score": "0.70475125", "text": "function dynamic_text() {\n return code;\n}", "title": "" }, { "docid": "aba9de753742b79ce3d47905c466e996", "score": "0.69585127", "text": "function createText() {\n let result = Object.values(text_source);\n let textIndex = Math.floor(Math.random() * 101);\n return result[textIndex]\n}", "title": "" }, { "docid": "ee1ddbe1d68a05750cdf6ca39ae77a14", "score": "0.69339085", "text": "function createTxt(txt) {\n\t\treturn document.createTextNode(txt)\n\t}", "title": "" }, { "docid": "489e471c1390b7bbb69e469059707ecb", "score": "0.6910617", "text": "function create_text( value ){\n\n var text_node = document.createTextNode( value );\n\n return text_node;\n\n }", "title": "" }, { "docid": "7f9a94bfed5cd34301741721fe91d689", "score": "0.6897361", "text": "function createText(area, textFunction){\n\n \n \n // Get the wikipedia link\n area.tags.wikilink = \"\";\n area.tags.meta = \"<span id='meta_\"+area.tags.id+\"' />\";\n\tif(area.tags.wikipedia){\n\t var lang = area.tags.wikipedia.split(':')[0];\n\t var page = area.tags.wikipedia.split(':')[1];\n\t area.tags.wikilink = \" <a href='https://\"+lang+\".wikipedia.org/wiki/\"+page+\"'>Bekijk op wikipedia</a>\";\t\t\t\t\n\t area.tags.wikipedia_contents = \"<span id='wikipedia_\"+lang+\"_\"+page+\"'/>\";\n }\n \n var text = textFunction(area.tags, area.area);\n \n // Create the fixed text at the bottom\n var footer = \"\";\n\tif(area.type){\n\t\tvar type = area.type;\n\t\tif(area.wasRelation){\n\t\t\ttype = \"relation\";\n\n\t\t}\n\t\tfooter += \"<p>\"\n\t\tfooter += area.tags.wikilink;\n\t\tfooter += \" <a href='https://openstreetmap.org/\"+type+\"/\"+area.id+\"' target='_blank'>Bekijk op OSM</a> \"\n\t\tfooter += \"<a href='https://openstreetmap.org/edit?\"+type+\"=\"+area.id+\"#map=17/\"+area.lat+\"/\"+area.lon+\"' target='_blank'>Wijzig</a> \"\n\t\tfooter += area.tags.meta;\n\t\tfooter+=\"</p>\"\n\t}\n\n\n return text + footer;\n\n}", "title": "" }, { "docid": "a46d93774acaa99073cd296d7c031dd9", "score": "0.6848643", "text": "function createText( t , o ) {\n var m = document.createTextNode( t );\n if( o ) o.appendChild( m );\n return( m );\n}", "title": "" }, { "docid": "544b9acc5c20dfbf5471bcaeef1dafa3", "score": "0.67751426", "text": "create_text_message(text_message){\n let message_to_compile = {\n type: \"text\",\n text: text_message\n }\n let compiled_message = this.compile_message(message_to_compile);\n return compiled_message;\n }", "title": "" }, { "docid": "e1c06053df4397ea833598d17eaa2b0c", "score": "0.67138845", "text": "function GenerateNewText() {\n //Add property to the object\n this.sentences = [\n 'The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.',\n 'In wars, boy, fools kill other fools for foolish causes.',\n 'Weep for what is lost forever.',\n 'What is already woven cannot be undone. It will not make the trees grow again for you to bring the building down on our heads.',\n \"Think if you want to stay alive. Fear will kill you if you don't control it.\",\n \"You'll use it, boy, and as long as you hate using it, you would use it more wisely than most men would. Wait. If ever you don't hate it any longer, then will be the time to throw it as far as you can and run the other way.\",\n 'Nobody tells us how to be men. We just are.',\n 'The best lie is often one too ridiculous to be taken for a lie.',\n 'The fact that the price must be paid is proof it is worth paying.',\n 'The rose petal floats on water. The kingfisher flashes above the pond. Life and beauty swirl in the midst of death.',\n 'When you have never known a thing except to dream, it becomes more than a talisman.',\n \"I will never shame you. I will hate the man you choose because he is not me, and love him if he makes you smile. No woman deserves the sure knowledge of widow's black as her brideprice, you least of all.\",\n 'The leaf lives its appointed time, and does not struggle against the wind that carries it away. The leaf does no harm, and finally falls to nourish new leaves. So it should be with all men. And women.',\n 'Teach him how you will, a pig will never play the flute.',\n 'Take life as it comes. Run when you have to, fight when you must, rest when you can.',\n 'An Aes Sedai never lies, but the truth she speaks, may not be the truth you think you hear.',\n 'In the Borderlands, sheepherder, if a man has the raising of a child, that child is his, and none can say different.',\n 'Love is an odd thing. As odd a thing as there is.',\n \"Here, southlander, you can't quit while you are winning. Better than when I'm losing.\",\n 'Soon comes the day all shall be free. Even you, and even me. Soon comes the day all shall die. Surely you, but never I.',\n \"It's never over, al'Thor. The battle's never done.\",\n \"There is an old saying here in the Borderlands: 'Better to have one woman on your side than ten men.'\",\n 'There is one rule, above all others, for being a man. Whatever comes, face it on your feet.',\n 'Always plan for the worst, that way all your surprises will be pleasant ones.',\n 'Men often mistake killing and revenge for justice. They seldom have the stomach for justice.',\n 'A pig painted gold is still a pig.',\n 'My mother always told me the best way to learn to deal with a man was to learn to ride a mule. She said they have about equal brains most of the time. Sometimes the mule is smarter.',\n 'Men! When you cannot win an argument, you either run away or resort to force.',\n 'I may be a fool, but I intend to be a live fool.',\n 'A man who will not die to save a woman is no man.',\n 'All men dream. But I know dreams for dreams. This is reality.',\n 'A shaping stone, to make us; a testing ground to prove our worth; and a punishment for the sin.',\n 'Jump in a hole without looking, and there’ll be a snake in it every time.',\n 'You break your neck, and I’ll see it mended just so I can break it again.',\n 'Do you know how to unite the people behind you, Child Carridin? The quickest way? Loose a lion - a rabid lion - in the streets. And when panic grips the people, once it has turned their bowels to water, calmly tell them you will deal with it. Then you kill it, and order them to hang the carcass up where everyone can see. Before they have time to think, you give another order, and it will be obeyed. And if you continue to give orders, they will continue to obey, for you will be the one who saved them, and who better to lead?',\n 'Tonight you will eat fish. Tomorrow, you may die.',\n 'Should and would build no bridges.',\n '...but who can know the heart of a man? Not even he himself, I suspect. A man is the easiest animal to put on a leash, and the hardest to keep leashed. Even when he chooses it himself.',\n 'A flapping tongue has killed more men than sudden storms ever did.',\n 'Most of those we call heroes only did what they had to do.',\n \"Men always seem to refuse to admit they are sick until they're sick enough to make twice as much work for women. Then they claim they're well too soon, with the same result.\",\n \"When there are fish heads and blood in the water, you don't need to see the silverpike to know they are there.\",\n 'Trust is as slippery as a basket of eels sometimes.',\n \"Once you decide to gut a fish, there's no use waiting till it rots.\",\n 'One pretty woman means fun at the dance. Two pretty women mean trouble in the house. Three pretty women mean run for the hills.',\n 'If a woman does need a hero, she needs him today, not tomorrow.',\n 'Death comes for us all. We can only choose how to face it when it comes.',\n 'I have heard it said that a man caught between his wife and a Wise One often wishes for a dozen old enemies to fight instead. A man caught between a wife and three Wise Ones, and the wife a Wise One herself, must consider trying to slay Sightblinder.',\n 'A bloody hero. Thom, if I ever look like acting the hero again, you kick me.',\n 'Any fool knows men and women think differently at times, but the biggest difference is this: Men forget, but never forgive; women forgive, but never forget.',\n 'Better ten days of love than years of regretting.',\n 'Men! Too blind to see what a stone could see, and too stubborn to be trusted to think for themselves.',\n 'The arrogance of men never ceases to amaze me. You all think everything has to do with you, and every woman has to desire you.',\n 'To lead is neither to push or pull.',\n 'Nimble finger and nimble wits will take you a good deal further than a sword and muscles. Sharp eyes help as well, but fortunately, I have these things.',\n 'It is better to be the hammer than the nail.',\n 'Men fight when they should run, and fools fight when they should run. But I had no need to say it twice.',\n 'I expect a civil word for a civil word!',\n \"There's no time for winking at the men when you're busy bailing the boat.\",\n \"Surprising what you can dig out off books if you read long enough, isn't it?\",\n 'You read too much and understand too little.',\n 'Prophecy is most dangerous when you try to make it happen...The Pattern weaves itself around you, but when you try to weave it, even you cannot hold it.',\n 'The Wheel weaves as the Wheel wills, and we are only the thread of the Pattern.',\n 'On the heights, the paths are paved with daggers.',\n 'No wine for me. Strange enough things happen when my head is clear. I want to know the difference.',\n 'You have made a place in my heart where I thought there was no room for anything else. You have made flowers grow where I cultivated dust and stones. Remember this, on this journey you insist on making. If you die, I will not survive you long.',\n 'As well you try to understand the sun, Perrin. It simply is, and it is not to be understood. You cannot live without it, but it exacts a price. So with women.',\n 'For the young, death is an enemy they wish to try their strength against. For those of us a little older, she is an old friend, an old lover, but one we are not eager to meet again soon.',\n 'You have to understand, child. Everyone wants someone in their life, someone who cares for them, someone they can care for. Even a queen.',\n 'You could weave silk from pig bristles before you could make a man anything but a man.',\n 'A weeping woman is a bucket with no bottom.',\n 'It is better to guide people than try to hammer them into a line.',\n 'Do not trouble trouble till trouble troubles you.',\n \"A ship is alive, and he is like a man, with a true man's heart. Treat him well and care for him properly, and he will fight for you against the worst of the sea. He will fight to keep you alive even after the sea has long since given him his own deathstroke. Neglect him, though, ignore the small warnings he gives of danger, and he will drown you in a flat sea beneath a cloudless sky.\",\n 'Humankind is made for uncertainty, struggle, choice and change.',\n 'If you plan for the worst, all surprises are pleasant.',\n \"I'll not have you bleeding to death on me. That would be just like you, to die and leave me the work of burying you. You have no consideration.\",\n 'Courage to strengthen, fire to blind, music to daze, iron to bind.',\n 'A flapping tongue can put you in the net instead of the fish.',\n 'Fall in love with a man, and you end up doing laundry, even if it does belong to another man.',\n \"It seems to me that kings - and queens - can be fools when they forget what they are and act like who they are, but they're worse when they only remember what they are and forget who.\",\n \"If you fell head first into a pigsty, you'd try to convince everybody you did it on purpose.\",\n 'That was all he ever really wanted from women; a smile, a dance, a kiss, and to be remembered fondly.',\n 'The Creator made women to please the eye and trouble the mind.',\n 'We are alike in many ways, you and I. There is a darkness in us. Darkness, pain, death. They radiate from us. If you ever love a woman, Rand, leave her and let her find another. It will be the best gift you can give her.',\n 'We all have our limits. And we set them further out than we have any right.',\n 'The more women there are about, the softer a wise man steps.',\n 'A man is a man, on a throne or in a pigsty.',\n \"Not thinkining about a thorn doesn't make it hurt your foot less.\",\n \"A fool puts her hand into a hollow tree without finding what's inside first.\",\n \"If you don't look for snakes, you cannot complain when one bites you.\",\n 'A gnarled old branch dulls the blade that severs a sapling.',\n \"When the honey's out of the comb, there's no putting it back.\",\n 'Better to face the bear than run from it.',\n 'A fool puts a burr under the saddle before she rides.',\n \"At my age, if I make it up, it's still an old saying.\",\n 'Men always believe they are in control of everything around them. When they find out they are not, they think they have failed, instead of learning a simple truth women already know.',\n 'When a woman says she will obey you, of her own will, it is time to sleep lightly and watch your back.',\n 'I lead no armies, Warder. I command nothing save myself, and not always that.',\n \"I trust you like a brother. Until the day you betray me. You have a parole for what you've done, in return for your teaching, and a better bargain than you deserve, but the day you turn against me, I will tear it up and bury it with you.\",\n 'Better to try understanding the sun than a woman.',\n 'Even a queen stubs her toe, but a wise woman watches the path.',\n 'If you must mount the gallows, give a jest to the crowd, a coin to the hangman, and make the drop with a smile on your lips.',\n 'Never kiss a girl whose brothers have knife scars.',\n 'Never gamble without knowing a way out.',\n \"I can rest when I'm dead.\",\n \"The louder a man tells you he's honest, the harder you must hold onto your purse.\",\n 'The fox often offers the duck its pond.',\n 'Waiting turns men into bears in a barn, and women into cats in a sack.',\n \"'Wish' and 'want' trip the feet, but 'is' makes the path smoother.\",\n 'I will see you tonight. Or I will see you dead.',\n 'I would burn the world and use my soul for tinder to hear her laugh again.',\n 'It was easier to trip a fool than to knock him down.',\n \"I'm no lord. I've more respect for myself than that.\",\n \"Stopping a man from what he wants to do is like taking a sweet from a child. Sometimes you have to do it, but sometimes it just isn't worth the trouble.\",\n 'If you are not mine, then you are dead.',\n 'Take what you can have. Rejoice in what you can save, and do not mourn your losses too long.',\n \"There's no point in letting honey age too long before you eat it.\",\n \"It's too late to change your mind after you've jumped off the cliff.\",\n 'The lions sing and the hills take flight. The moon by day, and the sun by night. Blind woman, deaf man, jackdaw fool. Let the Lord of Chaos rule.',\n 'A slow horse does not always reach the end of the journey.',\n 'The best way to apologize to a man is to trip him in a secluded part of the garden.',\n 'Clutch the bramble and you will be pricked.',\n 'The only way to live is to die. I must die. I deserve only death.',\n 'Victors write history.',\n 'Men believe the worst easily, and women believe it hides something still darker.',\n \"A woman's eyes cut deeper than a knife.\",\n 'Dance with her, and she will forgive much; dance well, and she will forgive anything.',\n \"Dance well with a woman, and she's halfway yours.\",\n \"No man should have another man's voice in his head.\",\n 'An arrow may not be a shocklance, yet it can still kill you.',\n \"What can't be changed must be endured.\",\n \"The pike does not ask the frog's permission before dining.\",\n 'We are all fools sometimes, child, yet a wise woman learns to limit how often.',\n 'What is too absurd to believe is believed because it is too absurd to be a lie.',\n 'If I could find a way to escape my destiny, do I deserve to?',\n 'We hear less, Davram Bashere, but perhaps sometimes we see more.',\n 'Pride fills me. I am sick with the pride that destroyed me.',\n 'A man must know when to retreat from a woman, but a wise man knows that sometimes he must stand and face her.',\n 'There was a price to be paid for any decision he made. There was a price for who he was. Other people paid it.',\n 'First things first; take care of what can be done now before worrying too long over what might never be.',\n 'A man without trust might as well be dead.',\n 'The best way to avoid trouble is to make sure no one wants to trouble you.',\n 'You must surrender before you can guide.',\n 'If wishes were wings, pigs would fly.',\n \"What you need isn't always what you want.\",\n \"A man's dreams are a maze even he cannot know.\",\n 'How people see you first is what they hold hardest in their minds. It is the way of the world. You can step down from a throne, and even if you behave like a farmer in a pigsty, some part in each of them will remember that you did descend from a throne. But if they see only a young man first, a country man, they will resent him stepping up to the throne later, whatever his right, whatever his power.',\n \"The Wheel of Time and the wheel of a man's life turn alike without pity or mercy.\",\n \"You never escape the traps you spin yourself. Only a greater power can break a power, and then you're trapped again. Trapped forever so you cannot die.\",\n 'What you want is what you cannot have. What you cannot have is what you want.',\n 'The yellowfly is almost too small to see, but if you leave its egg in your skin, you will lose an arm or leg before it hatches - if it does not kill you.',\n 'Death rides on my shoulder, death walks in my footsteps. I am death.',\n \"The wheel of a man's life. No mercy. No pity.\",\n 'If it hurst too much, make it hurt someone else instead.',\n 'Nothing ever goes as you expect. Expect nothing, and you will not be surprised. Expect nothing. Hope for nothing. Nothing.',\n 'Break the seals. Break the seals, and end it. Let me die forever.',\n \"When a young woman's cheeks redden for no apparent reason, there is usually a man involved.\",\n 'A cat for a hat, or a hat for a cat. But nothing for nothing.',\n 'You cannot please everyone. You cannot soothe everyone.',\n 'What I love I destroy. What I destroy, I love.',\n 'Women do not become exhausted, they only exhaust others.',\n 'The road ahead of you is long, dark, and, I very much fear, bloodstained. I also very much fear that you will take us all down that road. But you must live to reach the end of it.',\n 'Let most men have a finger, and they will have the whole hand before you know. Let a clan chief have a finger, and he will have the entire arm.',\n \"When you wish for so long that you could hear something, and then suddenly, with no warning, you do, it is like a lightning strike and rain on parched ground at the same time. You're stunned, but you cannot hear enough.\",\n 'Never prod a woman unless you must. She will kill you faster than a man and for less reason, even if she weeps over it after.',\n 'Let the dead rest, and care for the living.',\n 'A crafty enemy will set a weak ambush you are meant to break through. Confident because you have dealt with the threat, your guard relaxed, you walk into the second, stronger ambush.',\n \"Young men can be impetuous, young men can be rush, but the Car'a'carn cannot let himself be a young man.\",\n 'By the look of you, Nynaeve, I could almost think you were angry, but I know you have such a sweet disposition people ask you to dabble your fingers in their tea.',\n 'Caution once forgotten could be forgotten once too often.',\n 'If you try putting a woman on a horse when she does not want to go, she may put a knife in your ribs.',\n \"We are going to tickle some Aes Sedai under the chin, rescue a mule, and put a snip-nosed girl on the Lion Throne. Oh yes. That's Aviendha. Don't look at her crosswise, or she'll try to cut your throat and probably slit her own by mistake.\",\n 'We are always more afraid than we wish to be, but we can always be braver than we expect.',\n \"Men always say they didn't mean it that way. You would think they spoke a different language.\",\n \"If the world is ending, a woman will want time to fix her hair. If the world's ending, a woman will take time to tell a man something he's done wrong.\",\n 'There are things worth fighting for.',\n 'You cannot tell a man he has the power to make the earth shake, then expect him to walk small.',\n 'If you pursue two hares, both will escape you.',\n \"Often you don't know whether a woman is friend, enemy or lover until it is too late. Sometimes, she is all three.\",\n 'Cheer the bull, or cheer the bear; cheer both, and you will be trampled and eaten.',\n \"I will use anybody I must. You said it yourself; I am who I am. And I'm using myself up, Perrin, because I have to. Just like I'll use anybody I have to. We don't have a choice anymore. Not me, not you, not anybody!\",\n \"I always thought the stole weighed about as much as three good men. The Amyrlin has few easy decisions to make, and fewer where she can be sure. Do what you must, and pay the price if you're wrong. Sometimes if you are right, too.\",\n \"Honor? Maybe they're letting him sleep on silk, but a prisoner is still a prisoner.\",\n 'The only man completely at peace is a man without a navel.',\n 'You always had to pay the butcher,',\n 'Young men and fools sometimes bear pain they do not have to as a badge of their pride. Or their foolishness.',\n \"If you don't know everything, you must go on with what you know.\",\n \"Only a fool thinks his enemies stand still when he isn't looking, my Lord Dragon.\",\n 'Whatever can be done, can be undone.',\n \"A jealous wife is like a hornets' nest in your mattress.\",\n 'What woman could I hate enough to marry her to the Dragon Reborn?',\n \"When you leap from a cliff, it is too late for anything but holding to your courage. And hoping there's a haywain at the bottom to land in.\",\n 'The weak must be bold cautiously.',\n 'Wounds to the pride are remembered long after wounds to the flesh.',\n 'It is the enemy you underestimate who kills you.',\n 'The more bosom a woman displayed, the less she wanted you to look. Openly, at least.',\n \"'When a woman plays the fool, look for the man.' That was one of Lini's favorites. Another was, 'Kittens tangle your yarn, men tangle your wits, and it's simple as breathing for both.'\",\n 'I killed the whole world, and you can too, if you try hard.',\n 'I think the woman was born in Far Madding in a thunderstorm. She probably told the thunder to be quiet. It probably did.',\n 'A man who trusts everyone is a fool, and a man who trusts no on is a fool. We are all fools, if we live long enough.',\n 'I thought I could build, I was wrong. We are not builders, not you, or I, or the other one. We are destroyers. Destroyers.',\n 'Any day you wake up, maybe you die.',\n 'You can never know everything, and part of what you know is always wrong. Perhaps even the most important part. A portion of wisdom lies in knowing that. A portion of courage lies in going on anyway.',\n 'If a woman does need a hero, she needs him today, not tomorrow.',\n \"Sometimes, pain is all that lets you know you're alive.\",\n 'We rode on the winds of the rising storm, we ran to the sounds of thunder. We danced among the lightning bolts and tore the world asunder.',\n 'A man should never give promises in bed.',\n \"A beautiful battle is one you don't have to fight.\",\n 'The boy was dead eager, which could soon lead to plain dead.',\n 'To fight the raven you may make alliance with the serpent until the battle is done.',\n 'There is some delight in ale and wine, and some in girls with ankles fine, but my delight, yes always mine, is to dance with Jak O’ the Shadows. We will toss the dice however they fall, and snuggle the girls be they short or tall, then follow lord Mat whenever he calls, to dance with Jak O’ the Shadows.',\n 'Let the Lord of Chaos rule.',\n \"Ravens and crows. Rats. Mists and clouds. Insects and corruption. Strange events and odd occurences. The ordinary twisted and strange. Wonders. The dead are beginning to walk and some see them. Others do not, but more and more, we fear the night. These have been our days. They rain upon us beneath a dead sky, crushing us with their fury, until as one, we beg, 'Let it begin.'\",\n 'The end is near. The Wheel has groaned its final rotation, the clock has lost its spring, the serpent heaves its final gasps. He must know pain of heart. He must know frustration, and he must know anguish. Bring these to him. And you will be rewarded.',\n 'Sometimes, a wife must do what her husband cannot.',\n \"How was he to cause war, as the prophecies say he must? How was he to break the nations and bind them to him. How could he 'saly his people with the sword of peace' or 'bind the nine moons to serve him' if he was locked away? Do the prophecies not say that he will be 'unfettered'? Do they not speak of the 'chaos of his passing'? How can anything pass at all if he is kept in chains?\",\n \"We can't go back, Mat. The Wheel has turned, for better or worse. And it will keep turning, as lights die and forests dim, storms call and skies break. Turn it will. The Wheel is not hope, and the Wheel does not care, the Wheel simply is. But so long as it tunes, folk may hope, folk may care. For with light that fades, another will eventually grow, and each storm that rages must eventually die. As long as the Wheel turns. As long as it turns...\",\n \"Aviendha didn't trust change. It couldn't be spotted or stabbed; it was more silent than any scout, more deadly than any assassin. No, she'd never trust it, but she would accept it.\",\n 'The more tragic things get, the more I feel like laughing.',\n 'At the end of time, when the many become one, the last storm shall gather its angry winds to destroy a land already dying. And at its center, the blind man shall stand upon his own grave. There hs shall see again, and weep for what has been wrought.',\n 'What could not be chnaged must be endured.',\n 'Only the dead could afford oblivion.',\n \"By the Creator at the moment of creation. May we shelter safe beneath the Light, in the Creator's hand.\",\n \"A man's word must be as good as an oath sworn beneath the Light or it was no good at all.\",\n 'Anger narrowed the vision and made for follish choices.'\n ];\n}", "title": "" }, { "docid": "aaa4cbdf3144c9376e2365f6a7fabce8", "score": "0.6705738", "text": "async generateText( ) {\n this.nodes.forEach( node => {\n let element = document.createElement( \"span\" );\n let childElelement = document.createElement( \"span\" );\n \n element.textContent = node.name;\n element.style.position = \"absolute\";\n element.style.color = \"white\";\n element.style.zIndex = 88888;\n \n this.nodeInfo[ node.id ].textElement = element;\n\n document.body.appendChild( element );\n });\n }", "title": "" }, { "docid": "896e14a39ec860a97152fcc571fe5a72", "score": "0.6693392", "text": "function text_creation(textValue, heightPower, widthPower, lineHeight ){\t\t \r\n\t\t var texts = new THREEx.DynamicText2DObject();\r\n\t\t texts.parameters.text = textValue;\r\n\t\t \r\n\t\t //HeightPower\r\n\t\t //The HeightPower works in the power of two and starts with 2^7 = 128\r\n\t\t //The height for the canvas works like this = 2^(7+heightPower); \r\n\t\t texts.dynamicTexture.canvas.height = Math.pow(2, 7+heightPower);\t\r\n\t\t \r\n\t\t //WidthPower\r\n\t\t //The WidthPower works in the power of two and starts with 2^7 = 128\r\n\t\t //The width for the canvas works like this = 2^(7+widthPower); \r\n\t\t texts.dynamicTexture.canvas.width = Math.pow(2, 7+widthPower);\t\r\n\t\t \r\n\t\t /** Powers of 2\r\n\t\t\t\t 2^(7) = 128\r\n\t\t\t\t 2^(8) = 256\r\n\t\t\t\t 2^(9) = 512\r\n\t\t\t\t 2^(10) = 1024\r\n\t\t\t\t 2^(11) = 2048\r\n\t\t\t\t 2^(12) = 4096\r\n\t\t **/\r\n\t\t \r\n\t\t //Line Height\r\n\t\t //The higher the value the higher gap\r\n\t\t texts.parameters.lineHeight= lineHeight;\r\n\t\t \r\n\t\t texts.parameters.align = \"center\";\r\n\t\t \r\n\t\t texts.update();\r\n\t\t return texts;\r\n\t }", "title": "" }, { "docid": "6a17e12ebdb0ac3b88928bbe460c16cf", "score": "0.667211", "text": "function TextData() {}", "title": "" }, { "docid": "00ad85993495bd9bf83bd554590cf96f", "score": "0.66607004", "text": "function $t(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}", "title": "" }, { "docid": "00ad85993495bd9bf83bd554590cf96f", "score": "0.66607004", "text": "function $t(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}", "title": "" }, { "docid": "2cbfb66dca0dae9a9dc08efadd7bf591", "score": "0.6644839", "text": "function createText(data) {\n const text = '<li style=\"width:100%\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"avatar\">' +\n '<img class=\"img-circle\" style=\"width:100%;\" src=\"https://cdn0.iconfinder.com/data/icons/iconshock_guys/512/matthew.png\" /></div>' +\n '<div class=\"text text-r\">' +\n '<p>'+ data.message +'</p>' +\n '<p><small>'+ data.id +'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n return text;\n}", "title": "" }, { "docid": "e4252ab3788a9c196107d97b2b3d5dd8", "score": "0.66413176", "text": "function generateText(text){\n let mm = new markov.MarkovMachine(text);\n console.log(mm.makeText());\n}", "title": "" }, { "docid": "fa96b4248de2aee0e8c1fe960f8a9ca2", "score": "0.66055477", "text": "function $t(text,on) {\n var e = document.createTextNode(text);\n if (on) on.appendChild(e);\n return e;\n}", "title": "" }, { "docid": "fa96b4248de2aee0e8c1fe960f8a9ca2", "score": "0.66055477", "text": "function $t(text,on) {\n var e = document.createTextNode(text);\n if (on) on.appendChild(e);\n return e;\n}", "title": "" }, { "docid": "74dbb6deacda5c6d46fef408bb9fef7a", "score": "0.65867126", "text": "function showTextDynamic(userText) {\r\n console.log(userText);\r\n}", "title": "" }, { "docid": "f2b7b355cd471a8004b9aa123c34be15", "score": "0.65425926", "text": "function formateText({name,age,prof}){\n const text = `<div class=\"profile-section\">\n <h3>Name: ${name}</h3>\n <p>Age: ${age}</p>\n <p>Profession: ${prof}</p>\n</div>`\n\n return text;\n \n}", "title": "" }, { "docid": "6c17be3de92dd8781d3fb486a565b780", "score": "0.652593", "text": "function text(string){\n\treturn $('<div class=\"narrator-text\">').html(templated(string));\n}", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6513577", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6513577", "text": "function TextData() { }", "title": "" }, { "docid": "5b979ff70673d737a5b8f5fa54ce2a8c", "score": "0.6452405", "text": "text() {}", "title": "" }, { "docid": "f7f35d7393d097e4682a577ab53c8cd3", "score": "0.64451563", "text": "function createText(content) {\n return constants_ts_11.D.createTextNode(`${content}`);\n }", "title": "" }, { "docid": "0bade46c4571578738c8c90d4608b04a", "score": "0.6438475", "text": "function writeText(){\t\t\n\t\tvar FACTOR1_X = that.paper.width - that.paper.width/3 ;\n\t\tvar PLUS_X = FACTOR1_X + 50;\n\t\tvar FACTOR2_X = FACTOR1_X + 75;\n\t\t\n\t\t//console.log(\"factor to write = \" + factor);\n\t\tvar text = \"\" + factor;\n\t\tvar attr = {\n\t\t\t'font-size': that.HEIGHT/1.5,\n\t\t\t\n\t\t};\n\t\tif (factorNum == 1) {\n\t\t\tdrawText(FACTOR1_X, that.ground,that.WIDTH,that.HEIGHT,text,\"#FFF\");\n\t\t\tthat.paper.text(PLUS_X,that.ground + that.HEIGHT/2, \"+\").attr(attr);\n\t\t}\n\t\telse {\n\t\t\t//console.log(\"factorNum = \" + factorNum);\n\t\t\tdrawText(FACTOR2_X, that.ground,that.WIDTH,that.HEIGHT,text,\"#FFF\");\n\t\t\t//new PRASAD.widgets.Label(that.paper, 425, that.ground,that.WIDTH,that.HEIGHT,text);\n\t\t}\n\t\tif (callback !== undefined) {\n\t\t\tcallback();\n\t\t}\n\t\t\n\t\tfunction drawText(x,y,width,height,text,color){\n\t\t\tvar rect = that.paper.rect(x, y, width, height,2);\n\t\t\tif (color != null) {\n\t\t\t\trect.attr({\n\t\t\t\t\tfill: color\n\t\t\t\t});\n\t\t\t}\n\t\t\tvar fontSize = height/1.5;\n\t\t\tvar text = that.paper.text(x + width/2, y + height/2, text).attr({\n\t\t\t\t'font-size': fontSize,\n\t\t\t\tfill: \"rgb(0,0,0)\"\n\t\t\t});\n\t\t\trect.animate({scale:1.3}, 300 ,function() {\n\t\t\t\trect.animate({scale:1},300);\n\t\t\t});\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "89cf913ea75af7fbc45297ed9f08b793", "score": "0.642546", "text": "function txt(id, text)\r\n{\r\n\tvar ret;\r\n\tvar i;\r\n\t\r\n\tif (ogs.lang.skript != -1 && typeof ogs.lang.skript[id] != 'undefined')\r\n\t{\r\n\t\tret = ogs.lang.skript[id];\r\n\t\t\r\n\t\tif (typeof text == typeof ret) //typengleichheit texten\r\n\t\t{\r\n\t\t\tif (typeof text == 'object') //bei array\r\n\t\t\t{\r\n\t\t\t\tif (text.length != ret.length) ret = text; //das ganze array replacen\r\n\t\t\t\t/*\r\n\t\t\t\tfor (i = ret.length; i < text.length; i++) //length testen fehlende eintraege mit default ersetzen\r\n\t\t\t\t{\r\n\t\t\t\t\tret[i] = text[i];\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tret = text;\r\n\t\t} \r\n\t}\r\n\telse\r\n\t{\r\n\t\tret = text;\r\n\t}\r\n\t\r\n\t\r\n\tif (txt.arguments.length > 2)\r\n\t{\r\n\t\tfor (i = 2; i < txt.arguments.length; i++)\r\n\t\t{\r\n\t\t\tret = ret.replace('#*'+(i-1)+'*#', txt.arguments[i]);\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn ret;\r\n}", "title": "" }, { "docid": "44dd05deee72512479c73d2e4cc44dcc", "score": "0.64249104", "text": "function t(txt){\n _t += \"<br>\"+txt;\n}", "title": "" }, { "docid": "1908aad37c4d72eb2412185c99d9d378", "score": "0.64027643", "text": "text(position, size, color, contents, font, alignment) {}", "title": "" }, { "docid": "452eaf743d3902080e134c827f62815d", "score": "0.63794804", "text": "function make_text(string, where) {\n return me.text(\n where.x,\n where.y,\n string\n ).attr({\n fill: \"#000\",\n stroke: \"none\",\n \"font-size\": 20,\n }).click(function(event){\n $(\"#remove_this, #label\").val(\n event.target.textContent.replace(/(.*)\\(.*/, \"$1\")\n );\n $(\"#value\").val(\n event.target.textContent.replace(/.*\\((.*)\\)/,\"$1\")\n );\n });\n }", "title": "" }, { "docid": "04c3ded66da2a5c25130b30b2b506713", "score": "0.6374701", "text": "function generateSentence(desc, arr) {\n \n}", "title": "" }, { "docid": "ab8d2deb160d7942290ff3b069b8ab09", "score": "0.63665503", "text": "function createText(text, size, x, y) {\n var style = { font: size+\"px checkbookregular\", fill: \"#ffffff\", align: \"center\", fontWeight: 'bold', stroke: '#000000', strokeThickness: 4 };\n\n return game.add.text(x, y, addSpaces(text), style);\n}", "title": "" }, { "docid": "3014dc63bcb16f925423a6bddb5cd9f3", "score": "0.6359012", "text": "function resultText() {\n \n}", "title": "" }, { "docid": "8461f281fb60d3f5c08d92e421f5235c", "score": "0.6358638", "text": "function savableText() {\n return txt();\n}", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.63509214", "text": "function TextData(){}", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.63509214", "text": "function TextData(){}", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.63509214", "text": "function TextData(){}", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.63509214", "text": "function TextData(){}", "title": "" }, { "docid": "7a3b580db58f146b1cfd89abd40c12e3", "score": "0.6350518", "text": "function GenerateNewText() {\n // Add all the rooster teeth sayings to the object\n this.sentences =\n [\n \"All right, I've created the Tower of Pimps. Everyone worship me.\",\n\"YOU MY BOI MICHAEL !\",\n\"Your life is a dry streak...\",\n\"Well, you sound like Joe Pesci.\",\n\"I am gonna jump this lava like an absolute MOF.\",\n\"Where in the chuff are you guys?\",\n\"Gug. Gug. Ah tree, result.\",\n\"I bet bloody Kerbel Gunners or whatever his name is.\",\n\"I'm anuerisming.\",\n\"I got really confused..cuz of all the confusion.\",\n\"All right, drop your gubbins.\",\n\"Die you little rinsy little prick!\",\n\"YOU USELESS ANUS!\",\n\"Ok, so what I'm going to ask you to do, Geoff, is to come over me and...\",\n\"Jack's got an asshole like a clown's pocket.\",\n\"This is toppy tippers.\",\n\"BUUUP!\",\n\"Don't be a pleb!\",\n\"Quit being so annoying, you donut!\",\n\"Put that spade down you stupid Nintendo cock...\",\n\"AH Fudge Fif--.\",\n\"You want a bone? You want a bone? Yes, you do! Have a bone! You love bones, don't you, little buddy? All right, he doesn't like bones.\",\n\"I think I've found my parents! Dad? Is that you?\",\n\"Ray just pulled the Tower of Pimps out of his anus!\",\n\"Have that in your helmet you little bike riding prick!\",\n\"Micoo!\",\"Let's call him Run-gar!\",\"Plan X is a no go!\",\"I SEE HIM! HE'S IN THE DISTANCE!\",\n\"We were all gonna be in a right bugger's muddle there.\",\n\"What do I mean?\",\n\"It's hard to remember what you've forgotten.\",\n\"What are the chances that this delicious Cinnabon is gonna grow up to eat me?\",\n\"Look, people are English, alright?\",\n\"You were born at a leisurely pace.\",\n\"Michael, have you ever just laid back and smoked a ton of mushrooms?\",\n\"It's let's plays like this that make me want to try cocaine\",\n\"It's like a 4 by 4 2 by 4... what?\",\n\"Thanks for the compii, Ray\",\n\"Bad timing because of the other thing!\",\n\"Just dig a 2-2 hole *sigh*\",\n\"Oh, sausage, bacon, beans, and all the other breakfast meats!\",\n\"What do you call the people here before us? Indians?\",\n\"Ray, look at you tucked up in bed, you little bloody Ray!\",\n\"I as well died?!\",\n\"Are you havin' my ass?\",\n\"But technically you own them, so they are your gaff, so I'm faffing in your gaff.\",\n\"Let's make some sweet bunty little smubbles.\",\n\"It just pinged and went dingle.\",\n\"Oh, there's like a beep boop boop-a-doop on the side of it.\",\n\"Here comes Guff Pap. AHHHHH!\",\n\"I thought I had a comfortable landing, but I just went poip!\",\n\"Bodge is not on this team. Bodge was a part of Drippy Spaff. Munge Bimp is a different crew. There's actually one person from Drippy Spaff who's a part of Munge Bimp.\",\n\"You gumpy little geck...\",\n\"I don't think I've taken a sausage of damage!\",\n\"Oh ho! HO HO HO HO!\",\n\"This is gonna be absolute...ly top.\",\n\"I'm gonna plop an absolute corker!\",\n\"YOU DONUT!'\",\n\"This one looks toppy tippers.\",\n\"BUH BUH BUH BUHHHH!!!! BUH BUH BUH BUHHHH!!!!!\",\n\"What i'm gonna do, is do a little doey do.\",\n\"THERE'S THE WIND!\",\n\"CONCRETE DONKEY!!!!!!!\",\n\"WHOOOPS! WHOOOPS! AWHHHH\",\n\"It doesn't damage me... but it does make me look bad-ass!\",\n\"Why are we declaring war on this bit... alright.\",\n\"OH SSHCH! OOH OOH OOH!\",\n\"Gay Altitude?\",\n\"So do you have to pet to puh, err buy to huh?\",\n\"Michael made me feel all funny earlier\",\n\"I have more word knowledge...vocabulary...\",\n\"I'm trying to take incon...routes.\",\n\"Where are we?! What the bollocks?!\",\n\"DID I JUST GET MUGGED ON THE SIDE OF A MOUNTAIN?!?!?!?!?!?!?!?!?!\",\n\"No, i told you i got mugged like two minutes ago!\",\n\"I LIVE HERE NOW!\",\n\"Well, i came around the corner and reloaded.\",\n\"Think with por'ols!\",\n\"Keep up, mo-fos!\",\n\"Let's play Super Mario with Michael and no portals...\",\n\"It's a beanstalk!\",\n\"Did you do that portal of safety?\",\n\"There's portals, right? Right, USE THEM!\",\n\"Look at the pony down on the bottom trying to keep up.\",\n\"Whoops, whoops, damn it!\",\n\"BEEEEEEEEEEEEANSTAAAAAAAAALK!\",\n\"Dude, my green shit is amazing.\",\n\"Uh.. Eggs?\",\n\"How, I do my best to kill you\",\n\"Well they've just ruined it, haven't they by dying\",\n\"Dude, no guffs\",\n\"Orange is fast running, blue is jumpy jumpson.\",\n\"Doo doo doo doo, portal gun. Doo do- AHHHH!\",\n\"Michael's a douche pot! CHA CHA CHA CHA!\",\n\"I've got a shotty to hotty!\",\n\"He's got like... mine tits!\",\n\"I've smeared down the ramp!\",\n\"GLAK GLAK GLAK!\",\n\"Glow bip!\",\n\"I listen like a pro.\",\n\"That guy flumped over like a sack of spuds\",\n\"OH HELP! SOMENE! I'M GETTING DEAD!\",\n\"I got dizzled an rinsed.\",\n\"I sliced him like a piece of ham.\",\n\"Just reset my jammies.\",\n\"Let's go to the Dave Decipher.\",\n\"Did someone stamp your head in?\",\n\"We should stick the damn together. Like not a physical dam!\",\n\"OH MY GOD! That was like a Bulltrue with a Ghost except i had a shotgun and you had a Ghost.\",\n\"Augh, you smeg-pot.\",\n\"That is Bang Out of Order.\",\n\"I did a little vaginal dance!\",\n\"I just got done by a doctor!\",\n\"Michael, rats die in the street. I'm the dandy!\",\n\"You would never know that I was... a dude.\",\n\"You can't kill not your target.\",\n\"Who the hell picked the dandy?!\",\n\"Yeah, flap those bingo wings all you want, love.\",\n\"That was wallar!\",\n\"You almost Robin Hooded that bitch\",\n\"Would you like some... Spaghetti!\",\n\"Alfredo? Mmmm, spicy meatball!\",\n\"OOOOOOOOOOOOHHHHHH, England.\",\n\"OOOOOOOOOOOOOOHHHHHHHHH EHHHHHHHH!!!!\",\n\"MARK NUUUUUUUUUUUUTT!\",\n\"Here's Mark Nutt, his catchphrase is suck my nut.\",\n\"Maaark Nutt... Maaaaark Nutt\",\n\"BIP! BOOP! BEOP! AWH!\",\n\"Just tease it in, AHUH!\",\n\"No, you're chattin' guffs!\",\n\"OOOOOOHHHH SHEBANG!\",\n\"GOOOOO BLUE TEAM!\",\n\"I can't see cuz of the micro poles!\",\n\"Awh, you munged it!\",\n\"FRONT FLIP FOR STYLE!\",\n\"He stamped me in!\",\n\"You know what they say about red? They're plebs!\",\n\"I've gone hollow now!\",\n\"Oh, I've just donked it!\",\n\"That was skillage!\",\n\"PINK CAR!\",\n\"BYYYEEEE BLUE TEAM - oh God!\",\n\"BACKFLIP FOR ACCIDENT!\",\n\"BAAAAIIIIILLLL!!!!!!!!!\",\n\"WHAT IS GAME NIGHT???\",\n\"Screw you Michael, you pissy little piss pot!\",\n\"BOLLOCKS!\",\n\"The spawns are absolute scrillous in this.\",\n\"I'm kakin my spaffs.\",\n\"I'm getting minged up my quelch.\",\n\"YOU LOOK LIKE A TREE!!\",\n\"Awh, cum on my back...\",\n\"It's all about speed justice!\",\n\"If a red house is made of red blicks and a blue house is made of brue...bricks, what color's a greenhouse? It's made of glass.\",\n\"He bloody nibbled my tip!\",\n\"Agh, cockadoodle bollocks!\",\n\"You're like an idiot who's really good!\",\n\"People who know the time are smart.\",\n\"You can't just yell at 'look at that Jew'!\",\n\"I KNEW IT! I KNEW IT! BOLLOCKS! ASS!\",\n\"Long shot! OH MY GOD!!!!!!\",\n\"Matt, you're a cheeky little scrotoid.\",\n\"Can you vote to impeach a citizen?\",\n\"Playing with Matt is like trying to eat a salad with H.I.V. dressing.\",\n\"Come at me debris!\",\n\"They're givin' me jib for crossin' my legs like a fem!\",\n\"I'm feelin' lucky!\",\n\"Racism isn't OK; anal is.\",\n\"People like grapes.\",\n\"Does rocks float on lava?\",\n\"The sky is bigger than the ground.\",\n\"Can you hear through your head?\",\n\"I hate quotes\",\n\"Space gravity is different to planet gravity.\",\n\"People like crepes.\",\n\"We're All Friends, Friends Love Each Other.\",\n\"How up is space?\",\n\"Choking is either sexual or it's like, with the Force.\",\n\"My life is a series of dumb choices\",\n\"I'm gonna go build a house\",\n\"Radiation is Bullshit\",\n\"You're a walking stupid\",\n\"You're a tornado of dumb\",\n\"Edgar is the one in the hole.\",\n\"I win science\",\n\"Instead of bitching that it won't work, why don't you go make it work\",\n\"If a tree falls in the woods, why does Jon still work here?\",\n\"Here’s lookin at you kid!\",\n\"don't shit in my hand and call it skittles\",\n\"Orange, Monkey, Eagle\",\n\"Is Carpet the name of the baby?\",\n\"YOUUUU! ARE THE ONE WITH THE FACE THAT IS STUPID!\",\n\"It shuts off\",\n\"I tried to grab a thing that was on a thing, but I became the thing.\",\n\"Never fight a guy with his dick out\",\n\"I'm the Cheese man!\",\n\"Ryan, no offense, fucking kill yourself\",\n\"Jokes on you. I'm borderline illiterate.\",\n\"Mogar is ready!\",\n\"Scooter Patrol\",\n\"HE'S FUCKIN' 5'4!\",\n\"You threw it against the wall like a wet paper towel!\",\n\"I. Am. MONSTER TRUCK!\",\n\"I've got sticky mud in my clunge.\",\n\"Do the LOOOOOOOOOP!\",\n\"Do you want my bread centers?\",\n\"Look at these scrobbles!\",\n\"Spoole, what's the most important machine at the gym?....THE SQUAT RACK!\",\n\"I Died sucking my own Penis\",\n\"Someone slap the dick out of his mouth!\",\n\"This show is all about fair, and right\",\n\"You're fucking at a high school level\",\n\"Why buy the cow when you can get the milk for free?\",\n\"...I want you to have my orange juice.\",\n\"I meant why are we up in the sun, when we could be standing down there in the shade\",\n\"Tucker, there is a very fine line between not listening and not caring. I like to think that I walk that line every day of my life.\",\n\"if a tree falls in the woods, why does Jon Risinger still work here?\",\n\"If you take the six gold I had in my inventory, I'm gonna murder you in real-life...\",\n\"GOOOOOOOOOOOLD!!!\",\n\"This is how you ascend to Heaven: you ride this waterfall.\",\n\"That's not even a trap\",\n\"It's cameraman abuse in this one\",\n\"The beds are gone!\",\n\"You measure it in Celsius\", \n\"You guys wanna have a pillow fight?\", \n\"I broke the Kung-Fu picture\", \n\"Surprise Mother Fucker!\",\n\"I just want to kill Gavin so bad...\", \n\"I got trapped on his door!\",\n\"The wolf killed Gavin\",\n\"Were we meant to be waiting?\",\n\"Later Bitches!\", \n\"ENDERMEN!\",\n\"Wow...So I walk over...AND I DIDN'T FUCKING SET MY SPAWN YET!\", \n\"Can we not break the fucking rules while we're reading them?\", \n\"Ohhhhhhh yeahhhhhhh!\",\n\"Gavin, get out of the way! I'm trying to watch him jerk off!\", \n\"East? I thought you said weast!\",\n\"Ray just pulled a Tower of Pimps out of his anus!\",\n\"Why is your head still doing that?!?\",\n\"Everybody just hang out by the fire....Make some S'mores.\", \n\"Oh no, sheep get out of the fucking way....Oh you white fuck!\",\n\"GAVIN! RUUUUUN!\",\n\"Dude, they all look like Squidward!\",\n\"Don't fall off the roof!\", \n\"Whaa! Whaaaaa! So many colours!\", \n\"You've got 7 ink sacks?!\",\n\"Diggin' for victory....not for me but for Geoff.\",\n\"Geoff already won....he won a few minutes ago.\",\n\"So through that circle there?\",\n\"Thats a Square, Jack\",\n\"DON'T BUMP ME IN!\",\n\"I've been deceived! I activated your trap card!\",\n ]\n}", "title": "" }, { "docid": "99163e3bf09f33ddd542e763fbda5caa", "score": "0.6345661", "text": "function getMytext () {\n var texty = (\n 'creator:' + $('#crein').val() + '\\n' +\n 'contributor:' + $('#conin').val() + '\\n' +\n 'title:' + $('#tiin').val() + '\\n' +\n 'created:' + $('#createdin').val() + '\\n' +\n 'identifier:' + $('#ident').val() + '\\n' +\n 'description:' + $('#desc').val() + '\\n' +\n 'declare-datasheet:' + $('#decsheet').val() + '\\n' +\n 'declare-header:' + $('#decheader').val() + '\\n' +\n 'declare-data:' + $('#decdata').val() + '\\n' +\n 'valid:' + $('#valid').val() + '\\n' +\n 'replaces:' + $('#replaces').val() + '\\n' +\n 'license:' + $('#license').val() + '\\n' +\n 'fileformat-puid:' + $('#ffpuid').val() + '\\n' +\n 'fileformat-creating-application:' + $('#fca').val() + '\\n' +\n 'conformsTo:' + $('#conformsTo').val() + '\\n' +\n 'doc-sensitivity:' + $('#docsens').val() + '\\n' +\n 'register-column:' + $('#regcol').val() + '\\n' +\n 'register-url:' + $('#regurl').val()\n\n\n )\nreturn texty\n}", "title": "" }, { "docid": "d7d01fa9345500411266d8c2edc5fd33", "score": "0.63440764", "text": "function text(text) { return new Text(text); }", "title": "" }, { "docid": "3ec82f8dc33d708103b6881cded52b17", "score": "0.6342859", "text": "function generateText(paragraphs){\n let str = \"\";\n for(let i = 0; i<paragraphs;i++){\n str += generateParagraph(randomNumb(3,10));\n str += \"\\n \\n\";\n }\n return str;\n}", "title": "" }, { "docid": "0d718aaa8a8d061be79680640f7c1e24", "score": "0.631378", "text": "function GenerateNewText() {\n // Add property to the object\n this.sentences =\n [\n \"This is a story of boy meets girl.\",\n \"The boy, Tom Hansen of Margate, New Jersey, grew up believing that he’d never truly be happy until the day he met his... 'soulmate.'\",\n \"Elaine! Elaine!\",\n \"This belief stemmed from early exposure to sad British pop music and a total misreading of the movie, 'The Graduate.'\",\n \"The girl, Summer Finn of Shinnecock, Michigan, did not share this belief.\",\n \"Since the disintegration of her parents’ marriage, she’d only loved two things. The first was her long blonde hair.\",\n \"The second was how easily she could cut it off... And feel nothing.\",\n \"Tom meets Summer on January 8th in a San Francisco office building. In an instant, he will know she’s the one he’s been looking for.\",\n \"This is a story of boy meets girl. But before they do,\",\n \"You should know up front, this is not a love story.\",\n \"I didn’t know who else to call.\",\n \"You did the right thing. Where is he?\",\n \"Thomas.\",\n \"Rachel? What are you doing here?\",\n \"I’m here to help you.\",\n \"Help me how?\",\n \"First, put down the plate.\",\n \"Now come here and sit down.\",\n \"The key is not to panic.\",\n \"I think I’m gonna be sick.\",\n \"Drink this.\",\n \"What is that?\",\n \"Vodka.\",\n \"More.\",\n \"Does Mom know you’re here? It’s gotta be past 10.\",\n \"Don’t worry about it. Start from the beginning. Tell us what happened...\",\n \"We spent the whole day together.\",\n \"We went shopping.\",\n \"We had coffee.\",\n \"We saw a film.\",\n \"We bought music.\",\n \"I thought it was a great day.\",\n \"And then what happened?\",\n \"Um...you know what...let’s go crazy, I’ll have BOTH.\",\n \"God, I love eating pancakes at night. It’s like the greatest thing ever. How great is this?\",\n \"I think we should stop seeing each other.\",\n \"Just like that?\",\n \"Just like that.\",\n \"Did she say why?\",\n \"This thing. This whatever it is. You and me. Do you think this is normal?\",\n \"I don’t know. Who cares about normal?! I’m happy. Aren’t you happy?\",\n \"You’re happy?\",\n \"You’re not?\",\n \"All we do is argue!\",\n \"That is such a lie!\",\n \"Maybe she was just in a bad mood.\",\n \"A hormonal thing.\",\n \"P.M.S.?\",\n \"What do you know about PMS?\",\n \"More than you.\",\n \"Oh my god.\",\n \"Please continue.\",\n \"This can’t be a total surprise. I mean, we’ve been like Sid and Nancy for months.\",\n \"Summer, Sid stabbed Nancy seven times with a kitchen knife. We’ve had some disagreements but I hardly think I’m Sid Vicious.\",\n \"No... I’m Sid.\",\n \"So I’m Nancy?!\",\n \"Let’s just eat and we’ll talk about it after. I’m starving.\",\n \"Mmm, you’re so right. These are great!\",\n \"What?\",\n \"Tom, don’t. Come back. You’re still my best fr---\",\n \"Jesus.\",\n \"That’s harsh.\",\n \"I don’t know what I’m gonna do.\",\n \"You’re gonna be fine.\",\n \"I’m gonna throw up.\",\n \"Or that.\",\n \"Here.\",\n \"Come on Hansen. You’ll be ok. You’re the best guy I know. You’ll find someone.\",\n \"You know what they say...there’s plenty other fish in the sea.\",\n \"No.\",\n \"Sure they do. They say that.\",\n \"Well they’re wrong. It’s not true. I’ve fished in that sea. I’ve jumped in and swam in that sea! I’m fucking Aquaman!\",\n \"Sorry. What I mean is... there are no other fish. This was my fish.\",\n \"I’m in love with Summer.\",\n \"For real?\",\n \"I love her smile.\",\n \"I love her hair.\",\n \"I love her knees.\",\n \"I love how one eye is higher up on her face than the other eye.\",\n \"I love the scar on her neck from this operation she had as a kid.\",\n \"I love how she looks in my Clash Tshirt.\",\n \"I love how she looks when she’s sleeping.\",\n \"I love the sound of her laugh.\",\n \"I love how I hear this song every time I think of her.\",\n \"I love how she makes me feel. Like anything’s possible. Like, I don’t know...like life is worth it.\",\n \"For real, Paul. I’m madly in love with that girl.\",\n \"Oh shit.\",\n \"Now I know this may be a little risque...but if New Hampshire Greetings wants the jump on those conservative, right-wing neo-Nazis at Hallmark, maybe playing it safe is the wrong approach. The nuclear family is dead and we need a new holiday to recognize that.\",\n \"May 21st. Other Mother’s Day.\",\n \"The co-workers nod and digest this idea. VANCE is the head of the department.\",\n \"Hmmm. That’s an intriguing idea McKenzie. Along with Grossman’s “Magellan Day” I’d say we’ve got some potential here. What do you think Hansen? Could you write up some prototypes for these?\",\n \"Excuse me, Mr. Vance? There’s a call for you on line 3.\",\n \"Everyone this is Summer, my new assistant. Summer just moved here from...\",\n \"Michigan.\",\n \"Right. Michigan. Well, Summer, everyone. Everyone, Summer. Excuse me, I have to take this.\",\n \"Nice to meet you all.\",\n \"What do we know about this new girl?\",\n \"Who?\",\n \"The new girl. Summer. In Vance’s office.\",\n \"Dude. I hear she’s a bitch from hell!\",\n \"Really?\",\n \"Patel tried to talk to her in the copy room. She was totally not having it.\",\n \"Maybe she was just in a hurry.\",\n \"And maybe she’s some uppity, better than everyone, superskank.\",\n \"Damn.\",\n \"I know. She’s pretty hot.\",\n \"That makes me so mad! Why is it pretty girls always think they can treat people like crap and get away with it?\",\n \"Dunno.\",\n \"Like, just cause she has high cheekbones and soft skin...\",\n \"...and really good teeth.\",\n \"And maybe the world’s most perfect breasts...Just cause of that stuff, she can walk around like she’s center of the universe?\",\n \"Women.\",\n \"Ugh. You know what? Screw her! We haven’t even met and I can’t stand her already.\",\n \"The Smiths.\",\n \"I love The Smiths.\",\n \"Sorry?\",\n \"I said. I love The Smiths. You have good taste in music.\",\n \"You like the Smiths?\",\n \"'To die by your side is such a heavenly way to die.' Love it.\",\n \"Oh my god.\",\n \"Hi.\",\n \"Hello.\",\n \"So, uh, Summer...\",\n \"Tom.\",\n \"Yeah! How’s it going so far?\",\n \"The city or the firm?\",\n \"Both... Either.\",\n \"I’m happy. Still getting situated. How long have you worked here?\",\n \"Oh, you know, 4, 5... years.\",\n \"Really? Jesus. Did you always want to write greeting cards?\",\n \"Are you nuts? I don’t even want to do it now.\",\n \"What is it you want to do?\",\n \"I studied to be an architect actually.\",\n \"That’s so cool! What happened?\",\n \"Eh, you know. Same old story. Moved to the city to work for a company. Company went under. Needed a job. My friend worked here. Got me this.\",\n \"And are you any good?\",\n \"Well I wrote that one.\",\n \"'Today You’re a Man. Mazel Tov on your Bar Mitzvah.'\",\n \"It’s a big seller.\",\n \"I meant, are you any good as an architect?\",\n \"Oh... No. I doubt it.\",\n \"Well, I’d say you’re a perfectly ...adequate... greeting card writer.\",\n \"Why thank you. That’s what they called me in college. 'Perfectly adequate' Hansen.\",\n \"They used to call me 'Anal Girl.'\",\n \"I was very neat and organized.\",\n \"Anyway, I should get back.\",\n \"Ok, well, I’ll see you around.\",\n \"And it turns out she’s read every Graham Greene novel ever published. Her desk is lined with Magritte posters and Edward Hopper.\",\n \"Your favorites.\",\n \"We’re so compatible it’s insane! Seriously! It doesn’t make sense! She’s not like I thought at all. She’s... amazing.\",\n \"Oh boy.\",\n \"What?\",\n \"You know...just cause some cute girl likes the same bizarro music you do doesn’t make her 'the one.'\",\n \"Of course it does.\",\n \"Dinner!\",\n \"Pause and come eat.\",\n \"Hey Martin.\",\n \"He met a girl.\",\n \"Yeah?\",\n \"Yeah.\",\n \"Oh shit.\",\n \"When one strongly believes in something, it takes overwhelming contradictory evidence to change their minds.\",\n \"Tom had always been a devout believer in the idea of 'true love.'\",\n \"The evidence did not support him.\",\n \"Exhibit A: Lisa Rayner.\",\n \"Exhibit B: Wendy Wilson.\",\n \"I’m so glad we decided to go away together Bec. I know we’ve only been dating a few months but it’s been...awesome.\",\n \"Exhibit C: Rebecca Myles.\",\n \"And now, you and me, 8 days in Mexico... best spring break ever!\",\n \"I think we should see other people.\",\n \"And, finally... Exhibit D: Amanda Heller.\",\n \"It’s just... it’s complicated.\",\n \"What’s complicated? Last week you said you loved me!\",\n \"I know it’s sudden but...\",\n \"No, this can’t be. Everything was going so great. I don’t understand.\",\n \"Here.\",\n \"What’s this?\",\n \"Because you’re, like, the biggest music nerd I’ve ever met, I think this should really help explain where I’m coming from.\",\n \"You remember how much I loved this song when you first played it for me?\",\n \"Sure. It’s all you wanted to listen to for weeks.\",\n \"Right. And I still like it, don’t get me wrong. It’s just... When I hear it now, I don’t feel the same...rush.\",\n \"Ok...\",\n \"I press the skip button.\",\n \"What does this have to do with--?\",\n \"I’d rather listen to something else.\",\n \"But Amanda... this is a great fucking song!\",\n \"It’s off.\",\n \"What?\",\n \"Me and Summer.\",\n \"Was it ever on?\",\n \"No. But it could have been. In a world where good things happen to me.\",\n \"Yeah well, that’s not really where we live.\",\n \"No.\",\n \"So what happened?\",\n \"You ready for this?\",\n \"So there we are. All alone. Nine more floors to ride. Plenty of time. I figure...this is my chance. If not now when, right?\",\n \"Summer...\",\n \"Yeah?\",\n \"So how was your weekend?\",\n \"It was good.\",\n \"You believe that shit?\",\n \"What shit?\",\n \"I think I missed something.\",\n \"'It was good.' She didn’t say 'It was good.' She said 'It was good.' Emphasis on the good. She basically said 'I spent the weekend having sex with this guy I met at the gym.' Fucking whore. Screw her. It’s over.\",\n \"What the hell is wrong with you?!\",\n \"Dude, you got problems.\",\n \"She’s not interested in me. There’s nothing I can do.\",\n \"Based on...'it was good?'\",\n \"And some other things.\",\n \"Like what, she said 'hey' instead of 'hi' cause that totally means she’s a lesbian.\",\n \"I gave her all sorts of chances.\",\n \"I’m going to the supply room. Anyone need anything?\",\n \"No thanks.\",\n \"I think you know what I need.\",\n \"Toner.\",\n \"Oh ok, sure, no prob.\",\n \"Do you want to go out with me?\",\n \"And the Priest says, 'But we’re already out!'\",\n \"That is hilarious!\",\n \"I know!\",\n \"Not once did she take the bait. Not once. Screw it. I’m done with her. It’s over.\",\n \"This Friday. 10 bucks all you can karaoke at The Well.\",\n \"No way McKenzie. Absolutely not.\",\n \"Come on! 'Take me down to the paradise city where the grass is green and they got big titties!'\",\n \"They won’t let you back in there after last time.\",\n \"I wasn’t that bad.\",\n \"Not at all. You just threw up on the stage, tried to fight the bartender, and then threatened to burn the place down before passing out on the sidewalk. Quiet night for you.\",\n \"You saved my life that day.\",\n \"We are not going back there.\",\n \"This is a work thing, Tommy. It won’t be like that. The whole office is going.\",\n \"I really can’t. Even if I wanted to. There’s a lot of stuff I gotta take care of.\",\n \"You’re not listening to me.\",\n \"What?\",\n \"Hi.\",\n \"Hey! They said you weren’t coming.\",\n \"You asked if I was coming? I mean...my plans got cancelled...\",\n \"Goddamn that song is brilliant! What’s up Hansen?\",\n \"Ooh that’s me.\",\n \"Ok. I’m the new girl so no making fun of me.\",\n \"You were great up there, by the way.\",\n \"Well you can’t go wrong with The Boss.\",\n \"I hear that.\",\n \"Hey, did you know Tom here’s from Jersey?\",\n \"Yeah?\",\n \"Lived there til I was 12.\",\n \"I named my cat after Springsteen.\",\n \"No kidding? What’s his name?\",\n \"Bruce.\",\n \"That makes sense.\",\n \"So you got a boyfriend?\",\n \"Me? No.\",\n \"Why not?\",\n \"Don’t really want one.\",\n \"Come on. I don’t believe that.\",\n \"You don’t believe a woman could enjoy being free and independent?\",\n \"Are you a lesbian?\",\n \"No, I’m not a lesbian. I’m just not comfortable being somebody’s 'girlfriend.' I don’t want to be anybody’s anything, you know?\",\n \"I have no idea what you’re talking about.\",\n \"It sounds selfish, I know, but... I just like being on my own. Relationships are messy and feelings are always getting hurt. Who needs all that? We’re young. We’re in one of the most beautiful cities in the world. I say, let’s have as much fun as we can afford and leave the serious shit for later.\",\n \"But...what if you meet someone and fall in love?\",\n \"Love? You seriously believe in that stuff?\",\n \"Of course I do.\",\n \"Interesting. A real romantic.\",\n \"Oh you have no idea. This one... embarrassing. There was this one girl, I gotta tell this story --\",\n \"Summer, hold on... you don’t believe in love?\",\n \"I don’t even know what that word means. I know I’ve never felt it, whatever it is in all those songs. And I know that today most marriages end in divorce. Like my parents.\",\n \"Well mine too but --\",\n \"Oh yeah, And I read in Newsweek, there were these scientists who found that by stimulating a part of the brain with electrodes you can make a person fall in “love” with a rock. Is that the love you’re talking about?\",\n \"Well...\",\n \"Why, what’s your take on it?\",\n \"I think it’s...kind of a huge thing.\",\n \"Ok. Looks like we’re gonna have to agree to disagree on that one.\",\n \"So, uh, who’s singing next?\",\n \"I’d say it’s your turn loverboy.\",\n \"Nooo. I don’t sing in public.\",\n \"Sure you do. I see you lip-synching to your headphones every morning on your way in.\",\n \"I don’t...\",\n \"You really do.\",\n \"It’s ok. I like it. Takes a lot of self-confidence to look ridiculous.\",\n \"Self-confidence! Ha!\",\n \"Anyway, I’m not near drunk enough to sing in front of all these people.\",\n \"Ok then. Let’s drink.\",\n \"It would take at least ten shots to get me to sing.\",\n \"Bartender!\",\n \"That’s not it.\",\n \"What is that then?\",\n \"I have no idea.\",\n \"I used to watch it every week.\",\n \"Me too. Why can’t we think of the stupid A-Team theme song.\",\n \"Pathetic.\",\n \"This is gonna bother me for weeks.\",\n \"Totally.\",\n \"'And I’d proudly stand UP!' I said stand!\",\n \"Oh here we go.\",\n \"This guy.\",\n \"He’s the best.\",\n \"Ok, let’s get you in a cab.\",\n \"No. I’m gonna walk. I live right down that street. Or that one.\",\n \"Is he gonna be ok?\",\n \"He’ll be fine.\",\n \"Hey.\",\n \"What’s up?\",\n \"Not you. You. He likes you.\",\n \"Ok, goodnight McKenzie!\",\n \"I mean... likes you, likes you. For real. Tell her Tom.\",\n \"Sorry you had to see that. Happens every time we come here. It’s unbelievable. Something about that guy and singing for people. I don’t know. But at least he didn’t --\",\n \"Is that true?\",\n \"What?\",\n \"You know what. Do you...like me?\",\n \"Yeah. I like you. Of course I do.\",\n \"As a friend.\",\n \"Right. As a friend.\",\n \"Just as a friend?\",\n \"Yes. I mean... I haven’t really thought about... Yes. Why?\",\n \"Nothing. I just... You’re interesting. I’d like us to be friends. Is that ok?\",\n \"Oh yeah totally. Friends. You and me. That’s... perfect.\",\n \"Cool.\",\n \"Cool.\",\n \"Well, I’m that way. Good night Tom.\",\n \"G’night Summer.\",\n \"Friends. Awesome. That’s just great. Well done Hansen, you idiot.\",\n \"Hey!\",\n \"Hey!\",\n \"Summer, I need -- Oh hello Hansen.\",\n \"Hey Mr. Vance.\",\n \"Yes, Mr. Vance?\",\n \"You son of a bitch.\",\n \"Last night, karaoke night?\",\n \"Shhh.\",\n \"The same girl you’d been whining and crying and bitching about for weeks now?\",\n \"I have not been...\",\n \"The same girl you said was way out of your league and you’d have no chance with no matter what. That girl?\",\n \"Paul, seriously...\",\n \"Did you bang her?\",\n \"No!\",\n \"Blow job?\",\n \"No!\",\n \"Hand job?\",\n \"No, Paul, no jobs. I’m still unemployed. We just kissed.\",\n \"Come on, level with me. As your best friend, who tolerated a whole month of talk talk talk about this girl, nothing but Summer this, Summer that, Summer Summer Summer, I mean you were practically stalking her...\",\n \"Shhh!\",\n \"Oh crap.\",\n \"Hi, I’m Summer..\",\n \"Summer, wow what an unusual name. I’m sure I’d remember that if I had heard it before. Tom, how come you’ve never mentioned you knew such a lovely little lady? Or perhaps you have and I’ve just forgot. I mean, with all the women in Tom’s life it’s hard to keep track... Ok, well, I was just... I’m Paul.\",\n \"Hi Paul.\",\n \"I’m a doctor.\",\n \"Nice to meet you.\",\n \"Anyway, I’m leaving now. Pretend I was never here. Tom, talk to you later?... Hey, If any jobs open up...\",\n \"If you heard...\",\n \"Heard what?\",\n \"Excellent. You ready to go.\",\n \"I’m stalking, STARVING!\",\n \"He exaggerates!\",\n \"Check them out.\",\n \"Summer sees. She has no reaction.\",\n \"That is hot.\",\n \"I am very turned on right now.\",\n \"Sometimes you can be so judgmental.\",\n \"Huh?\",\n \"I mean, who are you? They’re happy. Just mind your own business.\",\n \"9, 9.5?\",\n \"Too soon to say. It’s all in the dismount.\",\n \"If we’re lucky, there won’t be a dismount.\",\n \"I can’t believe them. I have like zero patience for PDA.\",\n \"I hear ya. If I want to watch people make out, I have big windows and binoculars at home.\",\n \"Yeah?\",\n \"No. That would be wrong.\",\n \"This is fun. You’re fun.\",\n \"Thanks.\",\n \"I mean, I just want to say, up front, I’m not looking for anything serious.\",\n \"Are you cool with that?\",\n \"Sure.\",\n \"It freaks some guys out when I say that.\",\n \"Not me.\",\n \"Let’s just have fun. Let’s just...hang out, no pressure, no labels, no obligations. Ok?\",\n \"Sure.\",\n \"Wanna hold my hand under the table?\",\n \"Yeah.\",\n \"I’ll be...back in a sec.\",\n \"Settle. Don’t get too excited. She’s just a girl. There’s lots of them. Who look like that. And like what you like. They’re everywhere. Calm yourself.\",\n \"Are you calm? Ok. Then it’s time to go back in.\",\n \"Hi.\",\n \"Oh sweet Jesus!\",\n \"I fucking hate Summer.\",\n \"I hate her crooked teeth.\",\n \"I hate her 1950s haircut.\",\n \"I hate her knobby knees.\",\n \"I hate her lopsided, asymmetrical, cock-eyed head.\",\n \"I hate that centipede-shaped scar.\",\n \"I hate her...stupid...big boobs.\",\n \"I hate the way she sleeps.\",\n \"I hate the way she laughs.\",\n \"I HATE THIS FUCKING SONG!\",\n \"Son, you’re gonna have to exit the vehicle.\",\n \"It’s very... complex.\",\n \"Complex. Yes.\",\n \"In a way, it speaks so much by saying... so little.\",\n \"I feel the same way.\",\n \"You wanna go to the movies?\",\n \"God yes!\",\n \"A lot of people have problems with this, but to me, it makes both structures so much more beautiful side by side like that.\",\n \"The guy who made this, Maybeck, he is a God.\",\n \"It just makes you feel... peaceful.\",\n \"No. See now, this is torture.\",\n \"Why?\",\n \"Over there, that’s St. Patrick’s church. The beauty of St. Patrick’s is its humility. With this giant mirror thing deflecting all the attention away, it’s too humble. No one even knows it’s there.\",\n \"How would you change it?\",\n \"There’s a million things. First, there’s no need for this much glass. You could easily...\",\n \"Show me.\",\n \"What?\",\n \"Don’t talk about it. Do it.\",\n \"See this beam, it steps on the landscape. But if we moved it... just so...\",\n \"You wanna --\",\n \"No you go first.\",\n \"It doesn’t matter to me.\",\n \"Whatever you want.\",\n \"Hey Summer. Tom.\",\n \"Hey\",\n \"Hi.\",\n \"So how’s it going?\",\n \"Hello?\",\n \"I remember!\",\n \"That’s it!\",\n \"Your girl is losing it.\",\n \"This is not at all as easy as it looks.\",\n \"Ow!\",\n \"There’s no way.\",\n \"Why not?\",\n \"'Octopus’s Garden?'' You may as well just say 'Piggies?'\",\n \"I told you. I love Ringo.\",\n \"You’re insane.\",\n \"Why?\",\n \"Cause nobody loves Ringo.\",\n \"That’s what I love about him. Ooh.\",\n \"This got great reviews.\",\n \"Is that... possible?\",\n \"So what’s going on with you and Summer?\",\n \"I don’t know.\",\n \"Is she your girlfriend?\",\n \"I wouldn’t say that.\",\n \"What would you say?\",\n \"Like, are we “going steady?” Come on, guys. We’re adults.\",\n \"It’s not an unreasonable question. Watch. McKenzie, do you have a girlfriend?\",\n \"No I do not. In fact girls are repulsed by me. Paul, how about you?\",\n \"Why yes, in fact I do. Her name is Robyn. See Tom, it’s easy.\",\n \"It is when you’ve been with the same girl since high school.\",\n \"You’ve been “seeing” this girl, what, two months now?\",\n \"Something like that.\",\n \"And you haven’t discussed it?\",\n \"No! She’s not... We’re not like that.\",\n \"Like what?\",\n \"Normal.\",\n \"We’ve just been... hanging out.\",\n \"Hanging out?!\",\n \"Yeah. Guys, look, Summer and I...we know how we feel. We don’t need to label it. 'Boyfriend, girlfriend.' That stuff is very... juvenile.\",\n \"You’re so gay.\",\n \"Well let me ask you this then. Do you want her to be your girlfriend?\",\n \"I don’t know... Maybe.\",\n \"I heard her Hansen. She’s not the girlfriend type. You’re gonna need to discuss it.\",\n \"No. We’re adults. It’ll be fine.\",\n \"Have you made her a CD yet?\",\n \"Maybe.\",\n \"Oh dude.\",\n \"You really need to have that talk.\",\n \"You were saying?\",\n \"My thinking is... why rock the boat? Things are going well. If westart putting labels on it, that’s like the kiss of death. Like saying to a girl 'I love you.'\",\n \"I know what you mean. That’s what happened with me and Sean.\",\n \"Who the hell’s Sean?\",\n \"My boyfriend before Mark.\",\n \"Who the f--! Never mind. Help me. I need solid female advice.\",\n \"I’m 12.\",\n \"Yeah but, you know me. This is the kinda stuff that always gets me in trouble.\",\n \"Hmm. So, basically you do want to ask the question, 'are we boyfriend/girlfriend?' You’re just afraid you’ll get an answer you don’t want and that will shatter your illusions of how good everything’s been these past few months. Is that about right?\",\n \"Something like that.\",\n \"Thomas, tell me this. Is it worse to get the wrong answer now... or find out in a month she has a date coming up with Lars from Norway?\",\n \"Who’s Lars?\",\n \"He’s a professional surfer with Brad Pitt’s face and Jesus’s abs.\",\n \"That son of a bitch.\",\n \"You see what I mean?\",\n \"Later dude.\",\n \"Coach, no, wait! I need her. Rachel, what do you think I should do?\",\n \"Just don’t be a pussy.\",\n \"Hi.\",\n \"Hi.\",\n \"Are you ok?\",\n \"Yeah.\",\n \"You sure?\",\n \"Summer, I’ve gotta ask you something.\",\n \"Ok.\",\n \"Wait!\",\n \"Whoa. Oh my god. We can’t talk during this song. It’s too beautiful.\",\n \"So he broke your heart. You’ve been sad and depressed for weeks. Perhaps you’ve turned to drinking or even drugs. And nothing’s helped. Now what? Should you binge on rocky road and watch soaps all day?\",\n \"No you should not.\",\n \"Through extensive research, we have found the six most effective ways to get over that lost love and make room in your heart for a new man to fill. Those steps are:\",\n \"One. Exercise. The body’s release of endorphins will assuage the brain and provide a genuine sense of accomplishment and success.\",\n \"Two. Physical and Mental relaxation. Channel all of your energies to the core of your being for a new understanding of the self and others.\",\n \"Three. Charity. Reach out! You are not alone in your pain.\",\n \"Four. Shoe Shopping! Ladies...you know you want to. Indulge!\",\n \"Five. Travel. Take some time to see another environment. Get perspective. It’s a beautiful world. It will be for you again someday.\",\n \"Six. Redecorate. Start anew.\",\n \"By taking these few steps, you will have discovered your inner strength and should be ready to move on. I bet you can hardly remember his face at all.\",\n \"I just don’t get women’s fashion nowadays. Everybody with the tattoos, the giant hoop earrings, those annoying hats. Explain this to me.\",\n \"People think it looks good.\",\n \"Do you?\",\n \"On some.\",\n \"I like how you dress.\",\n \"Yeah? What if I started wearing berets and got a huge butterfly tattoo on my leg?\",\n \"Please don’t.\",\n \"Hey.\",\n \"Hey.\",\n \"How’s it going?\",\n \"Ok.\",\n \"You live around here?\",\n \"Yeah not too far.\",\n \"I’ve never seen you here before.\",\n \"You’re not too perceptive.\",\n \"Ha. That’s funny.\",\n \"So, uh, let me buy you a drink.\",\n \"No thank you.\",\n \"Are you with this guy?\",\n \"Hi. I’m Tom.\",\n \"Whatever. Come on, one drink. What are you drinking?\",\n \"Sorry, no thank you.\",\n \"You’re serious? This guy?\",\n \"Hey buddy --\",\n \"Don’t be rude. I’m flattered, I’m just not interested. Now why don’t you go back over there and leave us alone, ok?\",\n \"It’s a free country.\",\n \"So you and him, huh? I can’t believe that. Is this guy really your boyfriend?\",\n \"Did you see that punch? I don’t know where it came from. I haven’t punched someone since Josh Greenberg in fifth grade. Guess I’m gonna have to throw out this shirt.\",\n \"Hey. What is it?\",\n \"I can’t believe you.\",\n \"What?\",\n \"You were so completely uncool in there.\",\n \"You’re mad at me? I just got my ass kicked for you.\",\n \"Oh that was for me? You were, what, protecting me? Next time Tommy, don’t. I fight my own battles.\",\n \"Come on, that guy was an asshole!\",\n \"You didn’t have to hit him. Why didn’t you just let me handle it?\",\n \"I don’t know. He was --\",\n \"See. This is why I don’t want a serious relationship.\",\n \"Whoa. What was that?\",\n \"Nothing. Look, I like you Tom. I like this. What we’ve been doing. But maybe it’s gone too...\",\n \"What...?\",\n \"I told you all along what I don’t want and it’s...\",\n \"I’m tired. Can we talk about this tomorrow?\",\n \"I just got my ass kicked!\",\n \"I got one good shot in.\",\n \"Hi.\",\n \"Hi.\",\n \"What’s up?\",\n \"Nothing.\",\n \"Ok.\",\n \"Wait, are you still mad at me?\",\n \"Tom...\",\n \"Holy shit you are. I can’t believe you!\",\n \"Are you almost done?\",\n \"Yeah. I’m all done.\",\n \"You know what... Sometimes you really don’t make any sense.\",\n \"Say you’re sorry.\",\n \"Huh?\",\n \"Say you’re sorry for acting like a jerk.\",\n \"I am. I’m sorry for acting like a jerk.\",\n \"Ok. Me too.\",\n \"Summer... we don’t have to label what we’re doing. I just... I need -\",\n \"I know -\",\n \"Consistency. I need to know you won’t wake up tomorrow and feel a different way.\",\n \"I can’t promise you that. Nobody can. Anyone who does is a liar. I can only tell you how I feel right now... or I can show you.\",\n \"Have you ever had a real 'boyfriend?'\",\n \"What?\",\n \"A boyfriend. 'Going steady.' Whatever. You know what I mean.\",\n \"Well... yeah.\",\n \"More than one?\",\n \"A few.\",\n \"Tell me about them.\",\n \"Oh no way.\",\n \"Why?\",\n \"Cause there’s nothing to tell.\",\n \"Come on, I’m interested.\",\n \"You wanna have the relationship history conversation?\",\n \"Yes.\",\n \"You sure about that?\",\n \"No. Yeah. I don’t know. Why not? I can take it.\",\n \"Ok. Well, in high school, there was Markus.\",\n \"Quarterback slash homecoming king?\",\n \"He was a rower. Very hot.\",\n \"What happened to Markus?\",\n \"He works for the Republican party. Very successful. Just not for me.\",\n \"Ok. And then?\",\n \"Well, for a short time in college, there was Kurt.\",\n \"That didn’t really go anywhere. And... my semester in Rome. Daniele Belardelli. AKA 'The Puma.'\",\n \"The Puma?\",\n \"Yeah, cause, you know...\",\n \"And that’s it?\",\n \"The ones that lasted.\",\n \"What happened? Why didn’t they work out?\",\n \"Nothing happened really. It’s what always happens. Life.\",\n \"So how long have you known Paul and Robyn?\",\n \"Since grade school.\",\n \"No way, really? That’s crazy.\",\n \"Yeah.\",\n \"Well I’m glad you called. They spoke very highly of you.\",\n \"Great.\",\n \"So...uh... how’s it going?\",\n \"Ok.\",\n \"You’ve been pretty quiet.\",\n \"Sorry.\",\n \"I’m pretty quiet too. Usually. It’s nice sometimes to be comfortable enough that you can just sit and eat and not have to say anything, you know?\",\n \"Uh-huh.\",\n \"Do you want to try some --\",\n \"No thanks.\",\n \"I’m sorry. It’s just... there’s this girl.\",\n \"Oh.\",\n \"I’m not usually like this. I wasn’t before... Long story short, she wrecked me. I don’t know if you can tell but it was pretty recent and I’m still kinda thinking about her.\",\n \"Well maybe you should think about... someone else... who could cheer you up.\",\n \"I can’t get her out of my head, you know? I see her everywhere. She’s all I think about. And it’s horrible. Cause I totally didn’t see it coming. I thought things were fine. So now I keep going through every day in my mind, every second really. Wondering. What went wrong? Is it my fault? Could I have prevented it somehow?\",\n \"A lot of people have problems with this, but to me, it makes both structures so much more beautiful side by side like that.\",\n \"While you continue to talk about buildings and whatever other bullshit interests you, I’ll just nod my head and pretend to listen while secretly dreaming about the many ways I can one day rip out your heart and eat it like the rabid vampire I am.\",\n \"Maybe there were things I could have said or done, you know?\",\n \"Waiter!\",\n \"Or... Christ, I don’t know, maybe she was never that interested in me to begin with.\",\n \"How was your weekend?\",\n \"It was good.\",\n \"Anyway... sorry. If I’m acting strange, that’s why.\",\n \"It’s ok. I’m sure it’s tough getting over an ex-girlfriend.\",\n \"Actually she was never my girlfriend.\",\n \"I just... I thought I’d have figured it out by now, you know? My life. Where I’m going, where I want to end up, who with. All that stuff. I still don’t know anything. And the thing is... When I was with Summer, none of that mattered. I never even noticed how much of my life was missing! Isn’t that weird?\",\n \"You were in love, that’s what it does. But, now that you know where the holes are you can start to fill them. \",\n \"Sure. Hey, I’ve been talking non-stop. You talk.\",\n \"Me? Well I grew up --\",\n \"So what do you think? Did I do something? Did I not do something? What can I do now?\",\n \"I... You wanna get out of here? I know this great...\",\n \"Oh! You know what we should do...\",\n \"You said you’d stand by your man! So tell me something I don’t understand. You said you loved me! And that’s a fact! And then you left me, said you felt trapped!\",\n \"You didn’t stand by me! Not at all! You didn’t stand by me, I’m talking about you Summer!\",\n \"Hey it’s me.\",\n \"Hello me. You having a good day?\",\n \"I am thank you. Listen, about tonight... I think I might just stay in and go to bed early.\",\n \"What? Why?\",\n \"I’m just really tired and I’ve gotta go in early tomorrow. Would you be super mad at me if we went out this weekend instead?\",\n \"Well... You don’t want to just, maybe, go to dinner. I mean, you’ve gotta eat right?\",\n \"I’m not really that hungry. And this place is fancy right?\",\n \"Sorta.\",\n \"I’d rather not. Seriously, do you mind?\",\n \"Hey, no, that’s cool. Whatever you want to do.\",\n \"Thank you. So we’ll talk tomorrow, alright?\",\n \"Sure.\",\n \"Great. Good night Tom.\",\n \"Good night. Hey, Happy... birthday.\",\n \"I just got lucky I guess. We met in elementary school. We had the same class schedule in the 7th grade and we just... clicked.\",\n \"Love? Shit, I don’t know. As long as she’s cute and she’s willing, right? Actually, cute is a strong word. Not atrocious.\",\n \"That’s a pretty complex question. Philosophers, poets, scientists, everybody has a theory, don’t they? I kinda like what Nietzsche said: 'There is always some madness in love, but there is also...always some reason in madness.' Think about it. Pretty smart. Although, Nietzsche also said 'Kill the Jews.' So there’s that.\",\n \"I’ve been happily married for 30 years. She’s the light that guides me home. Yes it is from one of our cards. No someone else wrote it. Doesn’t make it less true.\",\n \"Ok I’m sick of this love shit. Come on! We’ve been fed this nonsense for generations to the point where it’s now genetically encoded in our very beings. And what does it mean? Absolutely nothing. Give me a break!\",\n \"I’m just saying... I really need some ass. I’m desperate. You got nothing?\",\n \"I wouldn’t say 'the girl of my dreams', no. The girl of my dreams would have a better rack. Probably different hair, could like sports a little more. But... truth is... Robyn’s better than the girl of my dreams. You know why? Cause she’s real.\",\n \"Hansen, don’t you have like twenty bar mitzvah cards to write?\",\n \"Nope. All done. What are you working on?\",\n \"Congratulations. But I’ve run out of ways to say it. 'Good job', 'well done', 'way to go'... I got nothing.\",\n \"Why don’t you try... 'Everyday you make me proud. But today, you get a card.'\",\n \"Shit. That’s not bad.\",\n \"No worries.\",\n \"This is good Millie. 'To my wife, the love of my life. I love you.'' That’s very nice. I was thinking though, why not try something like... 'Everyday that we don’t meet is meaningless and incomplete'. You know, spice it up a little.\",\n \"Did you try... 'Merry?'\",\n \"Whoa\",\n \"Perfect\",\n \"Yes!\",\n \"What else you got?\",\n \"Passover.\",\n \"'...aint no woman got what you got, sista girl. Happy birthday to the lean, sheen, and sizzly mocha queen!' How’s that?\",\n \"Something’s gotten into you son!\",\n \"Yeah. It’s pretty cool.\",\n \"You really want to see this?\",\n \"It sounds amazing.\",\n \"It’s, like, all stabbing and shit.\",\n \"Exactly.\",\n \"Ok.\",\n \"All you take me to are sappy little romances. I want to see some open wounds, damn it. I want carnage.\",\n \"Fantastic. Oh shit.\",\n \"What?\",\n \"Hey!\",\n \"Hi Mom.\",\n \"Mom, Martin, this is Summer.\",\n \"Summer! Well hello! We’ve heard so much about you! It’s so good to finally meet you.\",\n \"You too.\",\n \"Is this the girlfriend?\",\n \"Well this is the girl friend I’ve told you about. I don’t know if 'girlfriend' is the right word...\",\n \"You going to see the serial killer one?\",\n \"Yes we are.\",\n \"Great! Should we save you seats?\",\n \"Absolutely.\",\n \"Ok. We’ll see you inside.\",\n \"Sorry about that.\",\n \"It’s fine.\",\n \"You wanna go do something else? We can totally bolt.\",\n \"Did you tell them I was your girlfriend?\",\n \"What?! No way... I never used that word.\",\n \"They seemed to think... I mean, why is your step-dad giving me a hug?\",\n \"He’s very...loving.\",\n \"Does he hug all your friends?\",\n \"You’re not having any fun.\",\n \"You’re having enough for both of us.\",\n \"I’m dancing. I haven’t danced in ages. God. Come on.\",\n \"No.\",\n \"Come on! I wanna dance with you.\",\n \"Where were you an hour ago? I might have danced then. I’ve been standing here by myself this whole time and you didn’t look over once.\",\n \"So you’re pissed?\",\n \"I’m not pissed. Summer... you know I hate this shit.\",\n \"Then why are you here?\",\n \"This is what you wanted to do so...we’re doing it.\",\n \"Yeah well, I didn’t need a chaperone. Go home. You’re a buzzkill standing there pouting.\",\n \"That’s real nice.\",\n \"Tom!\",\n \"You wanted to see me, Mr. Vance?\",\n \"Yes Hansen. Sit down.\",\n \"Ok.\",\n \"Has something happened to you recently? \",\n \"What do you mean?\",\n \"A death in the family, someone taken ill...anything like that?\",\n \"No.\",\n \"Look, I don’t mean to pry. Does this have something to do with Summer leaving.\",\n \"Who?\",\n \"My assistant\",\n \"Your...?\",\n \"Tom...everyone knows. Nevermind. The reason I’m asking... lately your work performance has been... a little off.\",\n \"I’m not following.\",\n \"For example, here’s something you wrote last week... 'Roses are Red, Violets are Blue. Fuck You Whore.'' Now...most shoppers on Valentine’s Day ---\",\n \"Mr. Vance... are you firing me?\",\n \"No, no, no. Relax Hansen. You’re one of our most... adequate writers.\",\n \"Ok. Well, I’m sorry. Things for me have been a little difficult.\",\n \"That’s ok. I understand that. I was just thinking... perhaps you could channel your energy into... this.\",\n \"Funerals and sympathy?\",\n \"Misery, sadness, loss of faith, no reasons to live... it’s perfect for you. Whaddaya say? Good? Good. Now back to work you go.\",\n \"Most days of the year are entirely unremarkable. They begin and they end without creating a single lasting memory. Most days have no real impact on the course of a life. \",\n \"May 8th was a Saturday.\",\n \"What’s going on?\",\n \"We have news.\",\n \"Ok.\",\n \"It’s about her.\",\n \"Do I want to hear it?\",\n \"Thats what we wanted to ask you.\",\n \"It’s just...lately you’ve been...better.\",\n \"You’ve been much much better.\",\n \"So maybe it’s best we don’t ever bring her up again.\",\n \"Just let sleeping dogs lie.\",\n \"Leave those dogs alone Tom!\",\n \"You guys, look, I’m... I appreciate what you’re saying and, thank you, really, for putting up with me these past few months. I’ve been crazy. But I’ve accepted the fact that she and I were just two very different people who wanted very different things. I wanted to get serious. Shit, I loved her. And I know now, she just isn’t the kind of girl who can settle down with one person and be happy. The way I wanted. And she probably never will. There was nothing I could do.\",\n \"There’s no fucking way!\",\n \"Tom.\",\n \"It can’t be. It’s impossible!\",\n \"It is.\",\n \"How do you know?\",\n \"Jesus Christ people! Get a room!\",\n \"Tom!\",\n \"I’ve been calling every five minutes. Are you ok?\",\n \"What? Oh yeah. Great.\",\n \"Do you need anything?\",\n \"Twinkies?\",\n \"Sorry.\",\n \"I’m out of twinkies.\",\n \"Well let’s go.\",\n \"Go... where?\",\n \"It’s Thursday.\",\n \"This one says 'Go for it!'\",\n \"This one says 'Don’t give up!'\",\n \"And this one says 'You can do it!' We have a whole line of inspirational cards featuring Pickles, my cat. I think people will really enjoy them. Thank you.\",\n \"Good job Rhoda, I agree. Really inspirational stuff. Now, who’s next. We haven’t heard from 'Sympathy' in a while. Hansen...\",\n \"Hmm?\",\n \"The Winter collection. You have anything to contribute?\",\n \"Uh...no. I really don’t.\",\n \"You have nothing?\",\n \"Well I wouldn’t say nothing... Actually, that’s about right.\",\n \"Oh...k. We’ll come back to you. McKenzie --\",\n \"You know what...?\",\n \"Yes Tom.\",\n \"Can I say something about the cat?\",\n \"Well sure. Go ahead\",\n \"This here is, and Rhoda, you know I mean no disrespect... but this... this is total shit.\",\n \"Tom!\",\n \"'Don’t give up?', 'You can do it?'\",\n \"This isn’t inspirational. It’s suicidal. He tries that jump, I’m writing a sympathy card for that cat. That’s the last thing I want to be doing with my life. It’s bad enough writing these things for people.\",\n \"Hansen, this is a place of business. We don’t cut down our coworkers --\",\n \"That’s cause we’re liars! It’s what we do here. Why don’t we level with people? Stop feeding them nonsense?\",\n \"We’re a greeting card company.\",\n \"Yes but think about it! Why do people buy these things? Not to say how they feel. There’s paper and pens for that. People give these cards when they can’t say how they feel. Or they’re afraid to. And we provide the service that lets ‘em get away with that!\",\n \"I say to hell with it! Let’s level with America. Or at least make them speak for themselves! I mean, seriously, what’s this... 'I’m sorry to hear your grandmother has passed.'' What the hell? Let’s give em some truth. Something like, 'Sorry to hear about your grandmother. Here’s a card so I get some credit in your time of need. I’m sure it makes up for the fact that grandma’s dead.'\",\n \"Think about it. 'Congratulations on your new baby.' Eh... How bout... 'Congratulations on your new baby... Guess that’s it for hanging out. Nice knowing ya, buddy.'\",\n \"Hansen, sit down!\",\n \"Wait, what’s this? Ooh... fancy! Look at this one with all the hearts. Let’s open it up. 'Happy Valentine’s Day, Sweetheart. I love you.' Oh that’s nice.\",\n \"Tom...\",\n \"If someone gave me this card, Mr. Vance... I would eat it.\",\n \"Tom!\",\n \"It’s these greeting cards, Sir, these cards, these movies, these pop songs. They’re responsible for all the lies, the heartache, everything! We’re responsible!\",\n \"I think we do a bad thing here. People should be able to say how they feel, how they really feel, without some strangers putting words in their mouths. The truth. A card is a nice thought but it shouldn’t do the dirty work for you. You love someone, tell them yourself, in your own words. Maybe it’s not love at all. Maybe there’s no such thing as love. Maybe it’s... 'galoogoo.' Yeah I made it up, so what?!\",\n \"It’s all crap. We make and peddle crap. And sometimes people believe in this crap. I just can’t do it anymore, Mr. Vance. There’s enough bullshit in the world without my help. I quit.\",\n \"There’s no fucking way!\",\n \"Tom.\",\n \"It can’t be. It’s impossible!\",\n \"It is.\",\n \"How do you know?\",\n \"We know.\",\n \"But... It’s May! We broke up last August.\",\n \"I know.\",\n \"And you said she was single at Christmas.\",\n \"She was.\",\n \"And now she’s...\",\n \"Yeah.\",\n \"Now she’s getting married.\",\n \"I’m so sorry Tom.\",\n \"Married?\",\n \"It’s insane.\",\n \"It’s impossible. It doesn’t make sense. Where did they meet? Is it someone we know?\",\n \"So everything she said. All that stuff about... it can’t be. Not her. I know her too well. She wouldn’t do that.\",\n \"Fuck!\",\n \"Tom!\",\n \"Let him go.\",\n \"Your apple pies are really great. So Uncle Sid and Aunt Ro, come light candle number eight!\",\n \"I can’t believe that. No girlfriend?\",\n \"I can’t believe it either!\",\n \"What are you 30? You should be married now. With a family. What are you waiting for?\",\n \"The right girl I guess.\",\n \"There’s girls everywhere. I bet you have to beat em off with a stick.\",\n \"Oh you’d be surprised.\",\n \"Look at this punum. Are all those girls blind?\",\n \"My friend Mimi has a granddaughter. Yay high. Great figure. Bosom out to here --\",\n \"Hey I appreciate that Aunt Betsy. Lord knows I like bosoms. It’s just... I recently got out of a...well, I don’t know what it was.\",\n \"Oh I’m sorry. When was that?\",\n \"July.\",\n \"You mean...seven months ago?\",\n \"Was it a man?\",\n \"What?\",\n \"She means 'are you a homosexual?'\",\n \"No. Where’s that coming from?\",\n \"We just always wondered.\",\n \"So how’s work?\",\n \"Well...glad you came?\",\n \"Of course. Where am I exactly?\",\n \"When you turn 13 in the Jewish religion, you officially become an adult.\",\n \"Wow. So this is a big day in your sister’s life.\",\n \"Pretty big, yeah.\",\n \"So why aren’t you smiling?\",\n \"Hey brother. Wanna dance?\",\n \"Hi.\",\n \"You having fun? You were great this morning.\",\n \"Yeah yeah yeah. Talk to me. How are you?\",\n \"Me? I’m good. I’m great.\",\n \"I heard.\",\n \"Yeah.\",\n \"Sucks.\",\n \"Yup. Anyway, who cares about me? This is your day.\",\n \"You know, my friends... they’re all in love with you.\",\n \"Is that right?\",\n \"Look.\",\n \"That’s nice.\",\n \"What I tell ya? There are plenty other fish in the sea.\",\n \"Those are guppies.\",\n \"Who knows, someday one might turn out to be your 'true love.'\",\n \"Are you making fun of me now?\",\n \"No I’m serious.\",\n \"I got news for you Rach. That true love stuff... it’s make-believe.\",\n \"Well that’s not very romantic.\",\n \"It’s the new me.\",\n \"Alright... go play with your friends.\",\n \"You’ll be ok?\",\n \"Sure.\",\n \"Tom.\",\n \"Hmm?\",\n \"I know you think she was the perfect girl for you... I don’t. I think you’re just remembering the good stuff. But what do I know, right? I’m 13.\",\n \"Hey.\",\n \"Hello?\",\n \"Are you still sleeping?\",\n \"I’m getting up. What time is it?\",\n \"10:30. Are we still hanging out today?\",\n \"Ok. Sure.\",\n \"I’ll meet you at Liberty in... 20 minutes?\",\n \"I might need 45.\",\n \"So how was last night?\",\n \"It was fine. Just a work thing.\",\n \"Where did you guys go?\",\n \"Some restaurant.\",\n \"Fun?\",\n \"Uneventful. Didn’t get home until after 12 though which is way too late for a stupid work function. How was your night?\",\n \"Pretty standard.\",\n \"It’s playing at 5.\",\n \"You want to go?\",\n \"I don’t know. You wanna maybe go back to your place or ---\",\n \"I want to see it. Let’s go.\",\n \"Ok cool.\",\n \"Unless you don’t want to.\",\n \"No, I will. That’s fine.\",\n \"Ok.\",\n \"Hey.\",\n \"Hey Sum, it’s just a movie.\",\n \"I know. I’m sorry Tom.\",\n \"Is everything alright with you?\",\n \"Yeah. I’m just...I’m sorry. I’m being ridiculous.\",\n \"It’s ok. This happens to me every time I watch “Hoosiers.” Let’s go for a walk, ok. Let’s get some air. Or go to Sister Ray’s.\",\n \"Ok.\",\n \"It pains me that we live in a world where no one’s ever heard of Spearmint.\",\n \"I’ve never heard of them.\",\n \"And it’s painful. Oh look.\",\n \"So.\",\n \"So... Now what?\",\n \"Now...I think I’m gonna call it a day.\",\n \"Yeah? You wanna maybe...get some dinner or something?\",\n \"I’ve got pasta at home.\",\n \"Are you hungry?\",\n \"I’m pretty hungry, but --\",\n \"Ooh!\",\n \"What?\",\n \"I’ve got a great idea!\",\n \"What?\",\n \"Let’s get breakfast.\",\n \"Now?\",\n \"Pancakes?\",\n \"Hey.\",\n \"Where you coming from?\",\n \"What? Oh. Nowhere. How long have you been sitting there?\",\n \"Awhile.\",\n \"I come here a lot. I always loved this place, ever since you brought me here.\",\n \"So... I should probably say congratulations.\",\n \"Probably. But only if you mean it.\",\n \"I don’t know if I do honestly.\",\n \"I understand.\",\n \"Yeah well...anyway...I hope you’re happy.\",\n \"You really do?\",\n \"God no.\",\n \"How are you, Tom?\",\n \"I’m good. Ish.\",\n \"That’s good.\",\n \"Yeah I quit the office.\",\n \"Really? That’s great! What are you doing now?\",\n \"Mostly...sleeping. Breaking things.\",\n \"So who’s the guy?\",\n \"Who, my guy?\",\n \"Yeah... Wait. Don’t tell me. I don’t want to know.\",\n \"Tom...\",\n \"No really, I don’t.\",\n \"Ok.\",\n \"It’s amazing to me. You’re married.\",\n \"I know.\",\n \"You’re not only someone’s girlfriend, your someone’s wife!\",\n \"Pretty crazy, huh?\",\n \"I’ll never understand that.\",\n \"Tom --\",\n \"What’s different now? How could things change so quickly?\",\n \"I don’t know. It just happened.\",\n \"What happened?! That’s what I don’t get.\",\n \"I... Tom...\",\n \"What, tell me...\",\n \"I woke up one day and I knew. I knew I could promise him I’d feel the same way every morning. In a way that I... I never could with you.\",\n \"You know what sucks? Realizing that everything you believe in is complete bullshit.\",\n \"What is?\",\n \"Destiny, soulmates, true love. All that stuff. It’s nothing more than silly childhood fairy tale nonsense, isn’t it? God!\",\n \"Tom, don’t go.\",\n \"I should have listened to you, Summer. You were right all along.\",\n \"I was right?\",\n \"What? This is funny? What are you laughing at? You’re a crazy person!\",\n \"Tom! You’re the crazy person!\",\n \"What are you talking about?!\",\n \"One day I’m reading a book at the corner deli and this guy sits down and starts asking about it. Now he’s my husband!\",\n \"This is funny to you?\",\n \"What would have happened if I went to the movies instead? If I went somewhere else for lunch? If I showed up to eat ten minutes later? Tom, it was meant to be, just like you said. And as it was happening, I knew it. I could feel it, sure as the sun. And I kept thinking to myself 'Holy shit. Tom was right.' You were right about all of it. It just wasn’t me you were right about. Anyway, I should probably be getting back. It was good to see you. I’m glad you’re well.\",\n \"Summer!\",\n \"I really do hope you’re happy.\",\n \"I know. See you later.\",\n \"Are you here to interview?\",\n \"Sorry?\",\n \"Are you interviewing? For the position?\",\n \"Oh. Yeah. Why, are you?\",\n \"Yup.\",\n \"Ah. My competition.\",\n \"It would appear.\",\n \"Gee, this is a little awkward.\",\n \"Yes it is.\",\n \"Well, I hope you don’t get it.\",\n \"I hope you don’t get it.\",\n \"So, uh...\",\n \"Hmm?\",\n \"Are you from...California?\",\n \"Grew up not too far from here. Atherton, near Stanford.\",\n \"I know Atherton. Nice area.\",\n \"Have I seen you before?\",\n \"I, uh, don’t know. I don't think so.\",\n \"Do you go to St. Patrick’s? Not to pray or anything but to stand outside?\",\n \"I do! I love that church. It’s like my favorite structure in the city.\",\n \"If only it wasn’t near that horrible mirrored thing...\",\n \"Yes! Exactly. I totally agree!\",\n \"Yeah. I think I’ve seen you there.\",\n \"You have? Really? Hmm. I didn’t see you.\",\n \"It happens. You probably weren’t looking.\",\n \"Tom Hansen?\",\n \"Yes.\",\n \"Come on back.\",\n \"Thank you.\",\n \"If Tom had learned anything... it was that you can’t ascribe great cosmic significance to a simple earthly event. Coincidence. That’s all anything ever is. Nothing more than coincidence.\",\n \"It took a long time but Tom had finally learned. There are no miracles. There’s no such thing as fate. Nothing is meant to be. He knew. He was sure of it now. Tom was...pretty sure.\",\n \"Excuse me.\",\n \"Hello stranger.\",\n \"When this is over... uh... would you like to maybe...grab a cup of coffee or something?\",\n \"Oh. I’m sorta supposed to meet someone.\",\n \"Oh. Got it... No problem.\",\n \"Ok.\",\n \"What’s that?\",\n \"Why not?\",\n \"Yeah?\",\n \"Yeah.\",\n \"Great! So... I’ll wait for you here, or you wait for me or...something.\",\n \"We’ll figure it out.\",\n \"Ok! My name’s Tom.\",\n \"Nice to meet you...I’m Autumn.\",\n \n\n\n\n\n\n\n\n\n\n\n\n\n ];\n}", "title": "" }, { "docid": "d1f40ebec2badcbbfdd37b20c71afcd7", "score": "0.6299107", "text": "function createText(doc) {\n var node = doc.createTextNode('');\n initData(node, '#text', null);\n return node;\n}", "title": "" }, { "docid": "1ded9c2cb23476fc1392c02174004ef0", "score": "0.6297537", "text": "function createText(value) {\n return { type: constants_ts_4.NodeKeys.Text, value };\n }", "title": "" }, { "docid": "db1e57dc4d316f0ced349e368b26e9ea", "score": "0.62946343", "text": "function createEle(text){\r\n\t\tvar $textNote = $(\"<div class=\\\"note\\\">\\n\"+\r\n \"<p class=\\\"noteInfo\\\">\"+text+\"</p>\\n\"+\r\n \"<p class=\\\"infoHandle\\\">\\n\"+\r\n \"<span class=\\\"infoTime\\\">\"+createTime()+\"</span>\\n\"+\r\n \"<span class=\\\"infoOperation\\\">\\n\"+\r\n \"<a href=\\\"javascript:;\\\" class=\\\"handleTop\\\">0</a>\\n\"+\r\n \"<a href=\\\"javascript:;\\\" class=\\\"handleDown\\\">0</a>\\n\"+\r\n \"<a href=\\\"javascript:;\\\" class=\\\"handleDel\\\">delete</a>\\n\"+\r\n \"</span>\\n\"+\r\n \"</p>\\n\"+\r\n \"</div>\"\r\n\t\t\t);\r\n\t\treturn $textNote;\r\n\t}", "title": "" }, { "docid": "0f10f5a799923d62ef0f1e1b72f8504f", "score": "0.6292271", "text": "function CreateText(value,xPosition,yPosition,size,layer)\n\t{\n\t\tvar text = new Kinetic.Text({\n\t\t\tx: xPosition,\n\t\t\ty: yPosition,\n\t\t\tfontFamily: 'Calibri',\n\t\t\tfontSize: size,\n\t\t\ttext: value,\n\t\t\tfill: 'black',\n\t\t\talign: 'center'\n\t\t});\n\t\tlayer.add(text);\n\t\tstage.add(layer);\n\t}", "title": "" }, { "docid": "9b2ca1c55bc84a17d29255e2ce19e187", "score": "0.62806475", "text": "addText() {\n var that = this;\n\n var str = that.config.name === undefined ? this.type.type : that.config.name;\n\n var text = new Text({\n text: that.config.io == \"input\" ? \" \" + str : str + \" \",\n fontSize: that.config.style.blockNodeTextSize,\n editable: that.config.nameEdit,\n vbm: that.config.vbm,\n });\n\n that.config.io == \"output\" ? text.x(-text.width()) : text.x();\n\n this.text = text;\n this.add(text);\n }", "title": "" }, { "docid": "d340fd01ddb1deeb6b44bbd6fa99ec9b", "score": "0.62799513", "text": "function makeIntoTitle(sentence) {\n // Your code here\n}", "title": "" }, { "docid": "4c70a75eda5c653c4d0041c87fbc3596", "score": "0.6269358", "text": "function makeText(x, y, color, text) {\n var e = document.createElementNS('http://www.w3.org/2000/svg','text');\n e.setAttribute('x', x.toFixed(2));\n e.setAttribute('y', y.toFixed(2));\n e.setAttribute('fill', color);\n e.setAttribute('font-size', 14);\n e.setAttribute('font-family', 'arial');\n e.textContent = text;\n return e;\n}", "title": "" }, { "docid": "6172a67d6949860f86b59b935383ff61", "score": "0.62415737", "text": "function createText(){\n\tfor(var i=0; i<5; i++)endingFlags[i]=false;\n\tvar style = { font: 'Pacifico', fontSize: '25px', fill: '#FFF', stroke:'#000', strokeThickness:'5'};\n var styleBig = { font: 'Indie Flower', fontSize: '35px', fill: '#FFF', stroke:'#000', strokeThickness:'5', wordWrap: 'true', wordWrapWidth: '600' };\n var style1 = { font: \"Helvetica\", fontSize: '14px', fill: \"#FFF\" , wordWrap: \"true\", wordWrapWidth: \"200\" , stroke:'#000', strokeThickness:'3'};\n var dist1 = 300;\n var dist2 = 45;\n questionText = game.add.text(30, 30, 'questionText', styleBig);\n responseText1 = game.add.text(30, dist1, 'responseText1', style);\n responseText2 = game.add.text(30, dist1+dist2, 'responseText2', style);\n responseText3 = game.add.text(30, dist1+dist2*2, 'responseText3', style);\n responseText4 = game.add.text(30, dist1+dist2*3, 'responseText4', style);\n responseText5 = game.add.text(30, dist1+dist2*4, 'responseText5', style);\n debugText = game.add.text(30, 580, 'debugText', style1);\n notifText = game.add.text(649.5, 394, 'notifText', { fontSize: '20px', fill: '#FFF' });\n chatStateString = \"\";\n\n \n ready = true;\n}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "839e65b6d0909b0e8a2a163331600b44", "score": "0.6232965", "text": "function TextRenderer() {}", "title": "" }, { "docid": "15599cee15b30d7c4a346c34f2aafb61", "score": "0.62327695", "text": "function create_text_obj(text) {\n var text_obj = new fabric.Text(text, {\n fontFamily: 'Delicious_500',\n left: 40,\n top: 20,\n fontSize: 80,\n textAlign: \"left\",\n\t fill:canvas.freeDrawingBrush.color\n });\n\n canvas.add(text_obj);\n }", "title": "" }, { "docid": "f8d26c5fd9bacd7bcd71fe635bc08893", "score": "0.621801", "text": "function create_text(document, data) {\n return TextImpl_1.TextImpl._create(document, data);\n}", "title": "" }, { "docid": "f8d26c5fd9bacd7bcd71fe635bc08893", "score": "0.621801", "text": "function create_text(document, data) {\n return TextImpl_1.TextImpl._create(document, data);\n}", "title": "" }, { "docid": "f1530fa17fc80be2fa6faa262f15b0d2", "score": "0.62179744", "text": "function newText(_strText)\r\n\t{\r\n\t\treturn document.createTextNode(_strText);\r\n\t}", "title": "" }, { "docid": "fc5941fce6cdd7e9875438d11c1cabb0", "score": "0.6217188", "text": "makeText(numWords = 100) {\n let word = this.randomWord(this.words);\n let text = word;\n\n for (let i = 0; i < numWords; i++) {\n \n word = this.randomWord(this.makeChains()[word]);\n if (word === null) {\n break;\n } \n text += \" \" + word;\n }\n return text;\n }", "title": "" }, { "docid": "33ca5232eb1f027248db364631f32eb3", "score": "0.62149173", "text": "function writeText() {\n return `\"Myślę, że jest wiele piękna\nW posiadaniu problemów.\nTo jeden ze sposobów w jaki się uczymy\"\nHerbie Hancock`;\n}", "title": "" }, { "docid": "91b1b2267a28d102dec9ec037b2c8c11", "score": "0.6176178", "text": "SetText(txt) { return iSetText(txt); }", "title": "" }, { "docid": "612290eecbfe2fca660a5e000986cb3c", "score": "0.6175986", "text": "function createText(x,y, id, text)\n{\n\tvar newObj=document.createElementNS(\"http://www.w3.org/2000/svg\",\"text\")\n\t// newObj.setAttributeNS(null,\"text\",text)\n\tnewObj.setAttributeNS(null,\"id\",id)\n\tnewObj.setAttributeNS(null,\"x\",x)\n\tnewObj.setAttributeNS(null,\"y\",y)\n\tnewObj.setAttributeNS(null,\"color\",\"black\")\n\tsvg.appendChild(newObj)\t\n\tdocument.getElementById(id).innerHTML =text\n\t// newObj.innerHTML =text\n\t\n\t// window.alert(\"textbox voor x=\"+x+\" y=\"+y)\n\treturn newObj\n}", "title": "" }, { "docid": "ce9525b4545ea1d2dd0498b8df1e2357", "score": "0.61660945", "text": "Text(inSize,inString,inPos,inColour,inJustification,font)\n {\n if(font == undefined)\n {\n this.ctx().font = inSize +\"px san-serif\";\n }\n else\n {\n this.ctx().font = inSize +\"px \"+font;//Archivo Black\";\n }\n\n if(inJustification == undefined)\n {\n inJustification = \"left\";\n }\n this.ctx().textAlign = inJustification;\n this.ctx().fillStyle = inColour;\n\n let lines = inString.split('\\n');\n\n if(inJustification == 'center')\n {\n inPos.y += (inSize/4);\n }\n\n for (let i = 0; i<lines.length; i++)\n {\n this.ctx().fillText(lines[i], inPos.x, inPos.y + (i * inSize));\n }\n }", "title": "" }, { "docid": "aed809adf1da1e2740d9e655cda78e69", "score": "0.61606514", "text": "function textGenerate() {\n var n = \"\";\n var text = \" Tại vì cậu đẹp trai vl :<<<<<<< \";\n var a = Array.from(text);\n var textVal = $('#txtReason').val() ? $('#txtReason').val() : \"\";\n var count = textVal.length;\n if (count > 0) {\n for (let i = 1; i <= count; i++) {\n n = n + a[i];\n if (i == text.length + 1) {\n $('#txtReason').val(\"\");\n n = \"\";\n break;\n }\n }\n }\n $('#txtReason').val(n);\n setTimeout(\"textGenerate()\", 1);\n}", "title": "" }, { "docid": "a0341be32e4264ad66a7a59f240f8ff6", "score": "0.6152849", "text": "function textNewsComments(){\n return \"Comments\";\n}", "title": "" }, { "docid": "59549104f44fcec8278a28f83a22ba1f", "score": "0.61477005", "text": "text_left()\n\t{\n\t\treturn \"This is a visualization of a roller coaster which demonstrates the conservation of energy.\";\n\t}", "title": "" }, { "docid": "d0a3473abce95d37d00c595f4c2feca8", "score": "0.61430556", "text": "function createNode(){\n\tif(this.fitwidth){\n var tArray = new Array();\t\n\t\t\t\t\t\tvar wArray = this.text.split(' ');\n\t\t\t\t\t\tvar tempT = \"\"; \n\t\t\t\t\t\tfor(var wI=0;wI<wArray.length;wI++){\n\t\t\t\t\t\tif(wArray[wI] != \"\"){\n\t\t\t\t\t\t tempT = tempT + \" \" + wArray[wI];\n\t\t\t\t\t\t var a = new oracleSvgSimpleText();\n\t\t\t\t\t\t a.fontsize = this.fontsize;\n\t\t\t\t\t a.text = tempT;\n\t\t\t\t\t\t a = a.createNode();\t\n\t\t\t\t\t\t if(a.getComputedTextLength<=this.fitwidth && wI < wArray.length-1){}\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t tArray[tArray.length] = tempT;\n\t\t\t\t\t\t\ttempT = \"\";\n\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar ahk = new oracleSvgSimpleText()\n\t\t\t\t\t\tahk.text = \"\"\n\t\t\t\t\t\tahk.x=this.x;\n\t\t\t\t\t\tahk.y=this.y;\n\t\t\t\t\t\tahk.fontsize = this.fontsize;\n\t\t\t\t\t\tahk = ahk.createNode();\n\t\t\t\t\t\tfor(var ti=0; tArray.length>ti; ti++){\n\t\t\t\t\t\t\t\t\tnode = svgDoc.createElement('tspan');\n \t\t\t\t\t\t\t\t\tnode.setAttribute('x',this.x);\n\t\t\t\t\t\t\t\t\tnode.setAttribute('dy',(this.fontsize+2));\n\t\t\t\t\t\t\t\t\ttheText = svgDoc.createTextNode(tArray[ti]);\n \t\t\t\t\t\t\tnode.appendChild(theText); \n \t\t\t\t\t\t\tahk.appendChild(node); \n\t\t\t\t\t\t}\n\t\t\treturn ahk;\t\n\t}\n\telse{\n\t\tnode = svgDoc.createElementNS(svgns,'text');\n theText = svgDoc.createTextNode(this.text);\n node.appendChild(theText); \n\t\tnode.setAttribute('x',this.x);\n\t\tnode.setAttribute('y',this.y);\n\t\tnode.setAttribute('font-size',this.fontsize);\n \tnode.setAttribute('font-family','Arial');\n\t\tnode.setAttribute('fill',this.fill);\n\t\tnode.setAttribute('transform','translate(0,0)');\n return node;\n\t\t}\n }", "title": "" }, { "docid": "e81cf1ef64e6634fa8f84a416aabc81e", "score": "0.6139956", "text": "Text(inSize,inString,inPos,inColour,inJustification,font)\n {\n if(font == undefined)\n {\n this.ctx().font = inSize +\"px san-serif\";\n }\n else\n {\n this.ctx().font = inSize +\"px \"+font;//Archivo Black\";\n }\n\n if(inJustification == undefined)\n {\n inJustification = \"left\";\n }\n this.ctx().textAlign = inJustification;\n this.ctx().fillStyle = inColour;\n\n let lines = inString.split('\\n');\n\n if((inJustification == 'center') || (inJustification == 'centre'))\n {\n inPos.y += (inSize/4);\n this.ctx().textAlign = 'center';\n }\n\n for (let i = 0; i<lines.length; i++)\n {\n this.ctx().fillText(lines[i], inPos.x, inPos.y + (i * inSize));\n }\n }", "title": "" }, { "docid": "c3c5906f926c64e2e3cf00a897184609", "score": "0.6137076", "text": "function decorar(texto) {\n return \"###\" + texto + \"###\";\n}", "title": "" }, { "docid": "fbcc728123d8860eeb476fcfe6c0539a", "score": "0.61334944", "text": "static text(ctx, pt, txt, maxWidth) {\n if (!pt)\n return;\n ctx.fillText(txt, pt[0], pt[1], maxWidth);\n }", "title": "" }, { "docid": "8b0a10e384d4f8e7bf489bf4e810ebf9", "score": "0.61256576", "text": "createText() {\r\n this.dialog.textMessage = this.scene.add\r\n .text(this.margin * 2, this.cameraHeight + this.margin * 2.5 - this.dialogHeight, '', {\r\n wordWrap: {\r\n width: this.textWidth,\r\n },\r\n fontSize: this.fontSize,\r\n maxLines: this.dialogMaxLines,\r\n letterSpacing: this.letterSpacing,\r\n fontFamily: this.fontFamily,\r\n color: this.fontColor,\r\n })\r\n .setScrollFactor(0, 0)\r\n .setDepth(99999999999999999)\r\n .setFixedSize(this.cameraWidth - this.margin * 3, this.dialogHeight);\r\n }", "title": "" }, { "docid": "14839aecd6ea3f014b8e38e2d559b9e8", "score": "0.61196136", "text": "function FLS_GenerateOBJECTText()\n{\n\treturn _FLSGenerate(\"FLS_GenerateOBJECTText\", arguments);\n}", "title": "" }, { "docid": "4e5e32b3c54c9d9d8f22eb4a08b4d852", "score": "0.6112018", "text": "function createText(text, clean) {\n return document.createTextNode(clean ? text.replace(UFE0Fg, '') : text);\n }", "title": "" }, { "docid": "e8f483b3416d6daa21068b98aafa7c71", "score": "0.6096603", "text": "function TextRenderer(){}// no need for block level renderers", "title": "" }, { "docid": "0760605c404e544b3260abde77fd8268", "score": "0.60947514", "text": "function processSentence() { // buat fungsi\n return 'Nama Saya ' + name + ', umur saya ' + age + ', alamat saya di ' + address + ' , dan saya punya hobby yaitu ' + hobby + '!';\n}", "title": "" }, { "docid": "9c811a0fabb70091342e50271e1fde08", "score": "0.6090578", "text": "text(path, args, refVar)\n {\n if (!refVar)\n {\n //TODO:error code\n throw path.buildCodeFrameError(\"Unexpected parsing error\");\n }\n if (args.length == 0)\n {\n const statement = template(`var TEMP = '';\n for(var i=0;i<REFVAR.length;i++){\n TEMP += REFVAR[i].textContent;\n }\n REFVAR = TEMP;\n `);\n const ast = statement({\n REFVAR: refVar,\n TEMP: this.generateName(path),\n });\n return ast;\n }\n else if (args.length == 1)\n {\n const statement = template(`for(var i=0;i<REFVAR.length;i++){\n REFVAR[i].textContent = ARGS0\n }`);\n const ast = statement({\n REFVAR: refVar,\n ARGS0: args[0]\n });\n return ast;\n }\n else\n {\n throw path.buildCodeFrameError(\"Unexpected number of arguments passed\");\n }\n }", "title": "" }, { "docid": "cbe477058238534073d31f4a41f711f0", "score": "0.60897905", "text": "function writeText(){\n \n info.clearRect(0, 0, 900, 550);\n \n var mat = okMat4Mul(pMatrix,mvMatrix);\n \n if (asNumText.length == 0)\n return;\n \n var xy;\n for (var i = 0, l = asNumText.length; i < l; i++){\n xy = to2d(mat,asNumText[i]);\n info.fillStyle = sColors[asNumTextColor[i]];\n //info.fillStyle = colors[asNumTextColor[i]];\n info.fillText(nodes[ asNumText[i] ].id,xy.x,xy.y);\n } \n}", "title": "" }, { "docid": "52b9e9131e0fb71111e836be41c42200", "score": "0.6087901", "text": "function addText(text= \"\", shift= 0){\n\trecalculateDeep(shift);\n\tconst text_node= document.createTextNode(text);\n\tlet el= els[all_els_counter]= getParentElement().appendChild(text_node);\n\tall_els_counter+= 1;\n\tconst add_out= Object.create(component_out);\n\tgulp_place(\"both/add_out_methods_registration.sub.js\");/* global gulp_place */\n\treturn add_out;\n}", "title": "" }, { "docid": "019176f2f598dc401a633a87f563efff", "score": "0.6084753", "text": "function addText() {\n\tvar text = arguments[0];\n\tvar result = {\n\t\tto: function() {\n\t\t\tvar ta = arguments[0];\n\t\t\tta.value += text;\n\t\t\tta.scrollTop = ta.scrollHeight;\n\t\t}\n\t};\n\treturn result;\n}", "title": "" }, { "docid": "019176f2f598dc401a633a87f563efff", "score": "0.6084753", "text": "function addText() {\n\tvar text = arguments[0];\n\tvar result = {\n\t\tto: function() {\n\t\t\tvar ta = arguments[0];\n\t\t\tta.value += text;\n\t\t\tta.scrollTop = ta.scrollHeight;\n\t\t}\n\t};\n\treturn result;\n}", "title": "" }, { "docid": "9bd1ff8a6d2f965ed9c8dc05935ce294", "score": "0.6072603", "text": "function addText(what, where, loopControl) {\n var node, para;\n for(i=0; i<loopControl; i++) {\n if (where != \"results\"){\n para = document.createElement(\"span\");\n }\n else {\n para = document.createElement(\"p\");\n }\n // Show relative link to batman image.\n if (loopControl == 1) {\n node = document.createTextNode(what);\n }\n // Show Answers selected by user.\n if (loopControl == 6) {\n node = document.createTextNode(\"Answer \" +(i+1)+ \" \"+what[i]);\n }\n // Show user proile data.\n if (loopControl == 5) {\n node = document.createTextNode(what[i] + validDataAccount[i]);\n }\n para.appendChild(node);\n var element = document.getElementById(where);\n element.appendChild(para);\n }\n}", "title": "" } ]
5a45b170acd4e304cdd7389c1023528e
RLC n Description Rotate n left. Old bit 7 to Carry flag. Use with: n = A, B, C, D, E, H, L, (HL) Flags affected: Z Set if result is zero. N Reset. H Reset. C Contains old bit 7 data. Opcodes: Instruction Parameters Opcode Cycles RLC A CB 07 8 RLC B CB 00 8 RLC C CB 01 8 RLC D CB 02 8 RLC E CB 03 8 RLC H CB 04 8 RLC L CB 05 8 RLC (HL) CB 06 16
[ { "docid": "f1c4c843d3d11dd168408e0e90d0e005", "score": "0.6787506", "text": "function rlc (cpu, n) {\n const r = n << 1 | n >> 7;\n\n cpu.f = 0;\n if ((r & 0xff) == 0) cpu.f |= FLAG_Z;\n if ((n & 0x80) != 0) cpu.f |= FLAG_C;\n\n return r;\n}", "title": "" } ]
[ { "docid": "31d8b5cca8cc22e5b231f39d7d86d791", "score": "0.68349147", "text": "function bnpLShiftTo(n,r){var i,bs=n%this.DB,cbs=this.DB-bs,bm=(1<<cbs)-1,ds=Math.floor(n/this.DB),c=this.s<<bs&this.DM;for(i=this.t-1;i>=0;--i)r[i+ds+1]=this[i]>>cbs|c,c=(this[i]&bm)<<bs;for(i=ds-1;i>=0;--i)r[i]=0;r[ds]=c,r.t=this.t+ds+1,r.s=this.s,r.clamp()}", "title": "" }, { "docid": "d7eda61430c79bbfa6f542a0cf131323", "score": "0.68177354", "text": "function bnpLShiftTo(n, r) {\n\t var self = this\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << cbs) - 1\n\t var ds = Math.floor(n / self.DB),\n\t c = (self.s << bs) & self.DM,\n\t i\n\t for (i = self.t - 1; i >= 0; --i) {\n\t r[i + ds + 1] = (self[i] >> cbs) | c\n\t c = (self[i] & bm) << bs\n\t }\n\t for (i = ds - 1; i >= 0; --i) r[i] = 0\n\t r[ds] = c\n\t r.t = self.t + ds + 1\n\t r.s = self.s\n\t r.clamp()\n\t}", "title": "" }, { "docid": "6eb094ecf18d0bf001150062344934e1", "score": "0.6794238", "text": "function bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "e9a9b8c2aaaf5288c392c5b63f196cc0", "score": "0.6782091", "text": "function bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB),\n c = this.s << bs & this.DM,\n i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "56eb95e1ae3701de5d15c915de24738c", "score": "0.67685217", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "92afde1bcc476450cf46d362c73dcaf4", "score": "0.6764001", "text": "function bnpLShiftTo(n,r) {\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<cbs)-1;\n\t var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n\t for(i = this.t-1; i >= 0; --i) {\n\t r[i+ds+1] = (this[i]>>cbs)|c;\n\t c = (this[i]&bm)<<bs;\n\t }\n\t for(i = ds-1; i >= 0; --i) r[i] = 0;\n\t r[ds] = c;\n\t r.t = this.t+ds+1;\n\t r.s = this.s;\n\t r.clamp();\n\t }", "title": "" }, { "docid": "7e4c0abc239434b0177063c23fb2e035", "score": "0.67622435", "text": "function bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB),\n c = this.s << bs & this.DM,\n i;\n for (i = this.t - 1; i >= 0; --i) {\n r.data[i + ds + 1] = this.data[i] >> cbs | c;\n c = (this.data[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i) r.data[i] = 0;\n r.data[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "ef59beaf6cfd0c45cfec6d796276ee10", "score": "0.6761509", "text": "function bnpLShiftTo(n,r) {\r\nvar bs = n%this.DB;\r\nvar cbs = this.DB-bs;\r\nvar bm = (1<<cbs)-1;\r\nvar ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\r\nfor(i = this.t-1; i >= 0; --i) {\r\n r[i+ds+1] = (this[i]>>cbs)|c;\r\n c = (this[i]&bm)<<bs;\r\n}\r\nfor(i = ds-1; i >= 0; --i) r[i] = 0;\r\nr[ds] = c;\r\nr.t = this.t+ds+1;\r\nr.s = this.s;\r\nr.clamp();\r\n}", "title": "" }, { "docid": "fabf9e24436f7c909c7be846345edf6a", "score": "0.6760585", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "7693fd538d03a5ccc0ed8fcf12df6ee5", "score": "0.67586493", "text": "function bnpLShiftTo(n,r) {\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<cbs)-1;\n\t var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n\t for(i = this.t-1; i >= 0; --i) {\n\t r[i+ds+1] = (this[i]>>cbs)|c;\n\t c = (this[i]&bm)<<bs;\n\t }\n\t for(i = ds-1; i >= 0; --i) r[i] = 0;\n\t r[ds] = c;\n\t r.t = this.t+ds+1;\n\t r.s = this.s;\n\t r.clamp();\n\t}", "title": "" }, { "docid": "34706da55029d81270e98cd7b622c05a", "score": "0.6754727", "text": "function bnpLShiftTo(n, r) {\n\t var bs = n % this.DB;\n\t var cbs = this.DB - bs;\n\t var bm = (1 << cbs) - 1;\n\t var ds = Math.floor(n / this.DB),\n\t c = this.s << bs & this.DM,\n\t i;\n\t for (i = this.t - 1; i >= 0; --i) {\n\t r[i + ds + 1] = this[i] >> cbs | c;\n\t c = (this[i] & bm) << bs;\n\t }\n\t for (i = ds - 1; i >= 0; --i) {\n\t r[i] = 0;\n\t }r[ds] = c;\n\t r.t = this.t + ds + 1;\n\t r.s = this.s;\n\t r.clamp();\n\t}", "title": "" }, { "docid": "34706da55029d81270e98cd7b622c05a", "score": "0.6754727", "text": "function bnpLShiftTo(n, r) {\n\t var bs = n % this.DB;\n\t var cbs = this.DB - bs;\n\t var bm = (1 << cbs) - 1;\n\t var ds = Math.floor(n / this.DB),\n\t c = this.s << bs & this.DM,\n\t i;\n\t for (i = this.t - 1; i >= 0; --i) {\n\t r[i + ds + 1] = this[i] >> cbs | c;\n\t c = (this[i] & bm) << bs;\n\t }\n\t for (i = ds - 1; i >= 0; --i) {\n\t r[i] = 0;\n\t }r[ds] = c;\n\t r.t = this.t + ds + 1;\n\t r.s = this.s;\n\t r.clamp();\n\t}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "dee7d693d824b95084c41969af70873e", "score": "0.6754503", "text": "function bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "38d7ee4ec54577d9d1bb8fa6d0943c6c", "score": "0.6750235", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "6194c0146b414fe2fc4dae8dd8471e8a", "score": "0.6749096", "text": "function bnpLShiftTo(n, r) {\n var self = this\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << cbs) - 1\n var ds = Math.floor(n / self.DB),\n c = (self.s << bs) & self.DM,\n i\n for (i = self.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (self[i] >> cbs) | c\n c = (self[i] & bm) << bs\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0\n r[ds] = c\n r.t = self.t + ds + 1\n r.s = self.s\n r.clamp()\n}", "title": "" }, { "docid": "9ab9691594c402069d2b5777ba65ba34", "score": "0.6743219", "text": "function bnpLShiftTo(n,r) {\r\n var bs = n%this.DB;\r\n var cbs = this.DB-bs;\r\n var bm = (1<<cbs)-1;\r\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\r\n for(i = this.t-1; i >= 0; --i) {\r\n r[i+ds+1] = (this[i]>>cbs)|c;\r\n c = (this[i]&bm)<<bs;\r\n }\r\n for(i = ds-1; i >= 0; --i) r[i] = 0;\r\n r[ds] = c;\r\n r.t = this.t+ds+1;\r\n r.s = this.s;\r\n r.clamp();\r\n }", "title": "" }, { "docid": "9ab9691594c402069d2b5777ba65ba34", "score": "0.6743219", "text": "function bnpLShiftTo(n,r) {\r\n var bs = n%this.DB;\r\n var cbs = this.DB-bs;\r\n var bm = (1<<cbs)-1;\r\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\r\n for(i = this.t-1; i >= 0; --i) {\r\n r[i+ds+1] = (this[i]>>cbs)|c;\r\n c = (this[i]&bm)<<bs;\r\n }\r\n for(i = ds-1; i >= 0; --i) r[i] = 0;\r\n r[ds] = c;\r\n r.t = this.t+ds+1;\r\n r.s = this.s;\r\n r.clamp();\r\n }", "title": "" }, { "docid": "42ac9ca488529630313250c6cff34688", "score": "0.67356694", "text": "function bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB), c = (this.s << bs) & this.DM, i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (this[i] >> cbs) | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n }", "title": "" }, { "docid": "49895d79484932fd693963aaf8a2ecdc", "score": "0.67335856", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "dddb2b388de17eeb86e9bfa086d03bee", "score": "0.6732061", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if (n < 0) this.rShiftTo(-n, r); else this.lShiftTo(n, r);\n return r;\n }", "title": "" }, { "docid": "0b0913415ff3924608214e075bf88396", "score": "0.6731404", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if (n < 0) this.rShiftTo(-n, r);else this.lShiftTo(n, r);\n return r;\n }", "title": "" }, { "docid": "4dbfeac09074d6ad88e53878c9b52f92", "score": "0.67253816", "text": "function bnShiftLeft(n){var r=nbi();return n<0?this.rShiftTo(-n,r):this.lShiftTo(n,r),r}", "title": "" }, { "docid": "4999a5adf1e6495cb78b05f0fd0f5b18", "score": "0.67236614", "text": "function bnpLShiftTo(n,r) {\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<cbs)-1;\n\t var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n\t for(i = this.t-1; i >= 0; --i) {\n\t r[i+ds+1] = (this[i]>>cbs)|c;\n\t c = (this[i]&bm)<<bs;\n\t }\n\t for(i = ds-1; i >= 0; --i) r[i] = 0;\n\t r[ds] = c;\n\t r.t = this.t+ds+1;\n\t r.s = this.s;\n\t r.clamp();\n\t }", "title": "" }, { "docid": "4999a5adf1e6495cb78b05f0fd0f5b18", "score": "0.67236614", "text": "function bnpLShiftTo(n,r) {\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<cbs)-1;\n\t var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n\t for(i = this.t-1; i >= 0; --i) {\n\t r[i+ds+1] = (this[i]>>cbs)|c;\n\t c = (this[i]&bm)<<bs;\n\t }\n\t for(i = ds-1; i >= 0; --i) r[i] = 0;\n\t r[ds] = c;\n\t r.t = this.t+ds+1;\n\t r.s = this.s;\n\t r.clamp();\n\t }", "title": "" }, { "docid": "4999a5adf1e6495cb78b05f0fd0f5b18", "score": "0.67236614", "text": "function bnpLShiftTo(n,r) {\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<cbs)-1;\n\t var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n\t for(i = this.t-1; i >= 0; --i) {\n\t r[i+ds+1] = (this[i]>>cbs)|c;\n\t c = (this[i]&bm)<<bs;\n\t }\n\t for(i = ds-1; i >= 0; --i) r[i] = 0;\n\t r[ds] = c;\n\t r.t = this.t+ds+1;\n\t r.s = this.s;\n\t r.clamp();\n\t }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "97cf23aa3f8cd2f83d7fa0a0374f1867", "score": "0.67233694", "text": "function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }", "title": "" }, { "docid": "582ad7e5dde5173913d5e98abf3f9428", "score": "0.6720822", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r.data[i+ds+1] = (this.data[i]>>cbs)|c;\n c = (this.data[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r.data[i] = 0;\n r.data[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n}", "title": "" }, { "docid": "582ad7e5dde5173913d5e98abf3f9428", "score": "0.6720822", "text": "function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r.data[i+ds+1] = (this.data[i]>>cbs)|c;\n c = (this.data[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r.data[i] = 0;\n r.data[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n}", "title": "" } ]
8d28c53885650480e4634a97396a3605
Add items in list;
[ { "docid": "35b1e97b81cd429b9d40c1d9708c0a4a", "score": "0.0", "text": "function addListItem(){\n const removeBtn = document.createElement('span');\n const li = document.createElement('li');\n li.textContent = input.value;\n list.appendChild(li);\n input.value = '';\n removeBtn.textContent = 'Remove';\n li.appendChild(removeBtn);\n removeBtn.addEventListener('click', () => list.removeChild(li));\n \n}", "title": "" } ]
[ { "docid": "43f56fe215c05c895321884b01941ffe", "score": "0.7758941", "text": "function addItemsToList(items, list)\n{\n\tfor (name in items)\n\t{\n\t\tlist.append(\"<li>\" + name + \"</li>\");\n\t}\n}", "title": "" }, { "docid": "84c8bdb570ee532928ca7f19136774ae", "score": "0.75165045", "text": "function addItemToList(listId, item) {\n\n}", "title": "" }, { "docid": "48138a6d4c1d65e27c37a1f720b77931", "score": "0.72303784", "text": "function addToList(item) {\n lists.set(item.name, item.members);\n}", "title": "" }, { "docid": "42c5c35039799d028fb02cc443331ddb", "score": "0.7186486", "text": "function addList(list) {\n var index = this.lists.push(list) - 1;\n list.index = index;\n }", "title": "" }, { "docid": "f4e2da4fd98b175c7b86236be33609ba", "score": "0.7104112", "text": "addItems(_items) {\r\n for (let item of _items) {\r\n this.appendChild(item);\r\n }\r\n }", "title": "" }, { "docid": "e384ff499b82735634348478a2f7aedc", "score": "0.70394325", "text": "function _addItemsToOl(items, ol) {\n for(let i = 0; i < items.length; i++) {\n // For every item in the list, add it to the given ol.\n _addItemToOl(items[i], ol);\n }\n}", "title": "" }, { "docid": "5b4860b36260bbb51823ae029e236f5f", "score": "0.6848128", "text": "addItems(items) {\n this.items = this.items.concat(items);\n return this.items;\n }", "title": "" }, { "docid": "563034d0bfb7d02ce32462ff31c78d73", "score": "0.6799357", "text": "function addItemAndQuantity(list, itemForList, quantity) {\n list[itemForList] = quantity;\n return list;\n}", "title": "" }, { "docid": "563034d0bfb7d02ce32462ff31c78d73", "score": "0.6799357", "text": "function addItemAndQuantity(list, itemForList, quantity) {\n list[itemForList] = quantity;\n return list;\n}", "title": "" }, { "docid": "d5b6838b9ddcf100a4b0849278d56f95", "score": "0.67817056", "text": "add(item){ this._items.push(item); }", "title": "" }, { "docid": "1bfb9f801240fd727ef77302a69aabc1", "score": "0.6742657", "text": "addItems(itemList){\n\t\tlet html = '';\n\t\t//get html of current list\n\t\thtml = this.shoppingList.innerHTML;\n\t\t//generate html for each item in array\n\t\titemList.forEach(function(item){\n\t\t\tif(item !== ''){\n\t\t\t\thtml+= `<li class=\"list-group-item border-info\">${item}<button type=\"button\" class=\"close\" aria-label=\"Close\"><span class=\"close-x\" aria-hidden=\"true\">&times;</span></button></li>`\n\t\t\t}\n\t\t});\n\t\t//add it to current html and add it back into the DOM\n\t\tthis.shoppingList.innerHTML = html;\n\t}", "title": "" }, { "docid": "a9b89fe951f4b7fc05f07e5303cb1eb0", "score": "0.66362953", "text": "function loadList(list){\n list.forEach(function(item){\n addToDo(item.name, item.id , item.done, item.trash);\n })\n}", "title": "" }, { "docid": "01c6956e08583e1ccf5148460bbdc93b", "score": "0.66226727", "text": "addItem(item) {\n return (this.list = [...this.list, item]);\n }", "title": "" }, { "docid": "7d23598651197cad3915d86067c3c17c", "score": "0.6616664", "text": "function addToList(item, array) {\n array.push(item);\n return array;\n}", "title": "" }, { "docid": "482fb029e67cdf55b42b1156a88fb4bb", "score": "0.65990347", "text": "addList(state, payload) {\n state.lists.unshift(payload)\n }", "title": "" }, { "docid": "d750bebd1ddcce3f7affa2c51dcc7db3", "score": "0.65936416", "text": "function addItemToList (item) {\n toDoList.push(item);\n }", "title": "" }, { "docid": "56be2a92f95bbb1a7cda271b8d638fbe", "score": "0.64800304", "text": "add(item) {\n this.items.add(item);\n }", "title": "" }, { "docid": "074faf4b1ec51c1dd3156f18ebc4614a", "score": "0.64533925", "text": "addItems(items) {\n this.isEditing ? this.editData.push(...items) : this.source.push(...items);\n this.onDataChange(new CollectionEvent(CollectionEvent.ADD, items));\n this.refresh();\n }", "title": "" }, { "docid": "6e39d2e5f81f959959f9f4925651bbdd", "score": "0.64366895", "text": "concat(items) {\n this.addItems(items);\n }", "title": "" }, { "docid": "615d46669c9e84979d175fcec0fb39b8", "score": "0.6431981", "text": "function addToList () {\n const newTask = buildNewTask()\n const tmptask = {\n taskBody: newTask,\n time: 0\n }\n masterList.push(tmptask)\n\n redrawList()\n}", "title": "" }, { "docid": "5214a62c1891045da02d734b2b05e90e", "score": "0.6430825", "text": "function append(list, item) {\r\n remove(item);\r\n item._idleNext = list._idleNext;\r\n list._idleNext._idlePrev = item;\r\n item._idlePrev = list;\r\n list._idleNext = item;\r\n}", "title": "" }, { "docid": "3081b13c1f9f2f9f4eb67459520021f7", "score": "0.6386793", "text": "addToList(id, title, relDate, list){\n addMovie(id, title, relDate, list);\n this.forceUpdate();\n }", "title": "" }, { "docid": "ee1f24b4168fea9331152323c481bd98", "score": "0.63688654", "text": "function addToList($list, thing) {\n let $thingLi = $('<li>').html('<span>' + thing + '</span>').addClass('fav-thing');\n addCompleteLink($thingLi);\n addDeleteLink($thingLi);\n $list.append($thingLi);\n}", "title": "" }, { "docid": "1e546d2fbbc6d46d4066496f2b9a3f87", "score": "0.6367345", "text": "addNewItemToList(list, initDescription, initDueDate, initStatus) {\n let newItem = new ToDoListItem(this.nextListItemId++);\n newItem.setDescription(initDescription);\n newItem.setDueDate(initDueDate);\n newItem.setStatus(initStatus);\n list.addItem(newItem);\n if (this.currentList) {\n this.view.refreshList(list);\n }\n }", "title": "" }, { "docid": "7f55e732fa127880d4eda458144e5a10", "score": "0.63433796", "text": "addItem() {\n this.idItem += 1;\n const newItem = {\n id: this.idItem,\n value: this.state.newItem,\n };\n const list = [...this.state.list];\n\n list.push(newItem);\n // to update state property values\n this.setState({\n list,\n newItem: \"\",\n addedItem: true,\n });\n console.log(list);\n }", "title": "" }, { "docid": "b052866480d602acf9ce9ec5435eeb86", "score": "0.63149446", "text": "function add(...items) {\n if (items.length > 0) {\n result.push(plus, ...items);\n }\n plus = ' + ';\n }", "title": "" }, { "docid": "a4f7c4da2464c35964fdbcd9abaf9a43", "score": "0.6307908", "text": "function enqueue(list, item) {\n list.push(item);\n}", "title": "" }, { "docid": "f07724b044eaf7e31558a156b4da151a", "score": "0.6307703", "text": "_add(items) {\n // Sort before raising events\n items.sort(sortByIndex);\n\n this._onAdding(items);\n\n for (var i = 0; i < items.length; ++i) {\n this._items.splice(items[i].index, 0, items[i].item);\n }\n\n this._onAdded(items);\n }", "title": "" }, { "docid": "b009b8c3598a0def03ccbca93a806166", "score": "0.6301963", "text": "function addItemInTodoList() {\n createElementLi();\n addInputValueInLi();\n insertNewLiInDom();\n deleteInputField();\n}", "title": "" }, { "docid": "28626b09aaf0c78eda06c3e92019d26b", "score": "0.6282461", "text": "addList(listData) {\n let list = new List(listData);\n _store.State.lists.push(list);\n _store.saveState();\n }", "title": "" }, { "docid": "2497892bfc2bc282071c6a983867d84b", "score": "0.62705904", "text": "static addList(list) {\n const lists = Store.getLists();\n\n lists.push(list);\n\n localStorage.setItem(\"lists\", JSON.stringify(lists));\n }", "title": "" }, { "docid": "c9f8c175faab53e59ef528b3da66e10b", "score": "0.62697124", "text": "function addList(list) {\n for (var i = 0; i < list.length; i++) {\n $(\"#cards\").append(\"<li class='card'><i class='fa \" + list[i] + \"'></i></li>\");\n }\n }", "title": "" }, { "docid": "dde0792911541c1cb2ea308c4d58be7d", "score": "0.62687653", "text": "function appendProductList(id, list) {\r\n let product = new Products(id)\r\n list.push(product)\r\n}", "title": "" }, { "docid": "eb634b8a66892b4cb9ccf9cc530bbb35", "score": "0.62376755", "text": "addItem (newItem) {\n this.itemList.push (newItem);\n }", "title": "" }, { "docid": "2602568b9a14a24e0ed217c1d769ca71", "score": "0.6237475", "text": "function addToList(value,array_list){\n\tarray_list.push(value);\n}", "title": "" }, { "docid": "229408f47a9fdd6c54f1ef7dd9db6b1f", "score": "0.6215716", "text": "add(item) {\n\t\tif (this._list.indexOf(item) === -1) {\n\t\t\tthis._list.push(item);\n\t\t}\n\n\t\treturn this;\n\t}", "title": "" }, { "docid": "960c33b9e52d4c0f6ba7a98d1ccfa44c", "score": "0.6196074", "text": "function addToList(ident, data){\n for (i = 0; i < data.length; i++)\n {\n $(ident).append(data[i]);\n }\n}", "title": "" }, { "docid": "9754e612cc8203b49a96962569f4d699", "score": "0.6184111", "text": "function addFuseToItemlist(fuse) {\n\tif (isNewEntry(fuse, itemList)) {\n\t\tvar itemFound = new item(fuse.name, 11111, 6); // Add new entry\n\t\titemList.push(itemFound);\n\t} else for (var itemX of itemList) {\n\t\tif (itemX.name === fuse.name) {\n\t\t\titemX.fusions.push([findItem(fuse.itemOne), findItem(fuse.itemTwo)]); // Use existing item (and fusion items)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "40b49c7fc661ad75910cb596e6b81b19", "score": "0.6181375", "text": "function addListItems(){\n $('#js-shopping-list-form').submit(function(){\n event.preventDefault();\n var itemEntered = $('#shopping-list-entry').val();\n itemArray.push(itemEntered);\n $('#js-shopping-list-form')[0].reset();\n makeList();\n });\n}", "title": "" }, { "docid": "40d09c004e0a8b05267d3c1df3434359", "score": "0.617735", "text": "setList(list) {\n\t\tstate.list.push(...list);\n\t\tstate.tempList.push(...list);\n\t}", "title": "" }, { "docid": "1577938e01e5abb18e92a4cdd5ed91d8", "score": "0.616642", "text": "addTodoTolist() {\n\t\tthis.items += '<li>'+ this.currentTodo +'</li>';\n\t}", "title": "" }, { "docid": "23828e77779db534853d98e1f71ab4c5", "score": "0.6132712", "text": "add(...items) {\n // Get insertion index\n const index = (typeof items[items.length - 1] === 'number')\n ? items.pop()\n : this.items.length;\n\n this.items.splice(index, 0, ...items);\n }", "title": "" }, { "docid": "686ec821c2900de8c029c7c1e825b5c5", "score": "0.613125", "text": "function listOf(listName,items){\n return [\"#\"+items+\"#, #\"+listName+\"#\",\"#\"+items+\"# and #\"+items+\"#\"];\n}", "title": "" }, { "docid": "71a15471ddf18dd8c1ce54b26ffa6477", "score": "0.61246717", "text": "function appendList (list, item, delimiter) {\n if (delimiter == undefined) {\n delimiter = ', ';\n }\n if (list == '') {\n list += item;\n } else {\n list += delimiter + item;\n }\n return list;\n}", "title": "" }, { "docid": "16d3565b9d3a6325587efd6f0e03ea7d", "score": "0.6098853", "text": "function addItemToList () {\n\n\t$(\"#newItem\").text(function(){\n \tthis.select();\n\t});\n\n\tvar Item = document.getElementById('newItem').value;\n\n\tif (Item.length > 0) {\n\t\tshoppingList[itemNumber] = Item;\n\t\titemNumber++;\n\t}\n\n\tmanageShoppingList ();\n}", "title": "" }, { "docid": "ec173f73c8d1529a67d8fe5fb6955250", "score": "0.6079991", "text": "function addListElements() {\n $(\"ul\").append(\"<li> <strong> attached </strong> </li>\");\n $(\"ul\").after(\"<li> after </li>\");\n $(\"ul\").before(\"<li> before </li>\");\n $(\"ul\").prepend(\"<li> <strong> before </strong> </li>\");\n}", "title": "" }, { "docid": "28502dfd4170e454c2bd666e25732b36", "score": "0.6077459", "text": "function addToList(qtyIn, nameIn, deptIn) {\n // Add something to the array dynamically\n myList.push( { qty: qtyIn, name: nameIn, dept: deptIn } );\n // Reprint my list\n printTheList();\n}", "title": "" }, { "docid": "2a80e8b9c27702ee21758d3c4ffa02e7", "score": "0.6056426", "text": "function addItemsToAggregate(itemsToAdd) {\n for (var i = 0; i < itemsToAdd.length; i++) {\n aggregateNewsItems.push(itemsToAdd[i]);\n }\n}", "title": "" }, { "docid": "a7f6f3f863db920ffa2db78b0206bf51", "score": "0.60452217", "text": "add(item) {\n if (this.get(\"items\").indexOf(item) < 0) {\n this.get('items').pushObject(item);\n } else {\n return \"error\";\n }\n }", "title": "" }, { "docid": "910141476c9d5cc1307cf156f47b4898", "score": "0.6041939", "text": "function addItems() {\r\n var diff = slider_nr_of_items.value() - numberOfItems;\r\n for (var i = 0; i < diff; i++) {\r\n list.push(rand(10, 321));\r\n }\r\n numberOfItems = slider_nr_of_items.value();\r\n}", "title": "" }, { "docid": "dc54f55cb4e631c05730cacfd83b450b", "score": "0.6040656", "text": "function fillList(arr){\n \n for(let i = 0; i < arr.length; i++){\n addItem(arr[i])\n }\n}", "title": "" }, { "docid": "3bacd6941fb04429e6c60a20aaf5c7b0", "score": "0.6039785", "text": "function addListElement() {\n\n var m_index = 0;\n for (index in field) { //iterate over all items in array \n var name = dom.getName($scope),\n $child = $scope.querySelector('[data-name=\"' + name + '\\[' + index + '\\]\"]'); //get child by name\n\n if (cls.preRenderView($scope, field[index])) { //check filters or other stuff that could avoid rendering that item\n\n $html = dom.parseHTML(cls.view.views[viewName].call(cls.view, field[index], index, $scope)); //render view\n\n var $close = $scope.querySelector('[data-name=\"' + name + '\\[' + m_index + '\\]\"]');\n\n if ($child) {\n $child.parentNode.replaceChild($html, $child);\n } else if ($close) {\n $close.parentNode.insertBefore($html, $close.nextSibling);\n } else {\n $scope.appendChild($html); //just append at the end\n }\n\n cls.bind($html); //bind to app to new html \n cls.postRenderView($html); //execute post render on added child\n\n } else {\n $child.parentNode.removeChild($child);\n }\n\n m_index = index;\n }\n }", "title": "" }, { "docid": "ea0002521ade1f7e8cdba5aa8e3f8a03", "score": "0.60391015", "text": "function addToList(state, item) {\n state.items.push( { name: item , isChecked: false } );\n}", "title": "" }, { "docid": "5514455e6ec81e582cf1095cd83c4ea2", "score": "0.6036436", "text": "addList(newListObject) {\n for (let list of this.listOfLists) {\n if (list.listName === newListObject.listName) {\n for (let newListTask of newListObject.listOfTasks) {\n list.addTask(newListTask);\n }\n return this;\n }\n }\n\n // These two lists of code would be good enough for most cases\n this.listOfLists.push(newListObject);\n return this;\n }", "title": "" }, { "docid": "9922570c1548e9c7bf812f150f886578", "score": "0.60363126", "text": "function createList(list) {\n for(var k in list) {\n elem = '<li data-id=\"' + k + '\"><div class=\"name\">' + list[k].name + '</div></li>';\n $('#ranking-list').isotope('insert', $(elem));\n }\n }", "title": "" }, { "docid": "fd3bd26fa60dd242b5d99ed2a5c5d0cf", "score": "0.6032135", "text": "function addItem(it) {\n it._expand({'icon-file':getIconURI(it.icon)}); // make this additions before the hook, so it can change these too\n TPL('onObjectItem', it); // custom treatment, especially mode-based\n $('<li>').append(TPL.item.format(it))\n .appendTo('#items') \n .find('a.item-link').click(itemClickHandler);\n} // addItem ", "title": "" }, { "docid": "accac7c419b22b66ac6d410356f6a8f6", "score": "0.60302603", "text": "addItem(value) {\n const newItem = {\n id: this.state.myList.length + 1,\n task: value,\n done: 1,\n };\n // Add newItem in myList with setState method\n this.setState({\n myList: [...this.state.myList, newItem],\n });\n console.log(this.state.myList);\n }", "title": "" }, { "docid": "872339e536d4b338fcdeedaa645f93fb", "score": "0.6025861", "text": "function addItems( $newitems ) {\n\n\t\t$items = $items.concat( $newitems );\n\n\t\tfor(var i=0; i < $newitems.length; i++)\n\t\t{\n\t\t\tvar $item = $newitems[i];\n\t\t\t_data($item).set( {\n\t\t\t\toffsetTop : _offset($item).top,\n\t\t\t\theight : _dimensions($item).height()\n\t\t\t} );\n\t\t}\n\n\t\tc_init_items_events( $newitems );\n\t}", "title": "" }, { "docid": "0a20e9233082da11211b51d8439ce632", "score": "0.6009294", "text": "function addItem() {\n\t\tif(input.value === \"\") {\n\t\t\talert(\"You must enter some value!\");\n\t\t}\n\t\telse {\n var text = input.value;\t\n\n //linking input to checkbox \n var item = `<li id=\"li-${id}\">${text}<input id=\"box-${id}\" \t\t\tclass=\"checkboxes\" type=\"checkbox\"></li>`;\t\t\t\n\t\t\tlist.insertAdjacentHTML('beforeend', item);\t \n\t\t\tlistItem = {item: text, checked: false}; //object to add the items in the list\n todoList.unshift(listItem);\t\t\n id++; //increment count\n\t\t\tform.reset(); //clear the input tab s\n\t\t}\n\t}", "title": "" }, { "docid": "722e26e5b4291963b24a54a167f24b85", "score": "0.6000426", "text": "function add(item){\n data.push(item);\n console.log('Item added.');\n }", "title": "" }, { "docid": "626ca60a045d1670aa6bb8211fade908", "score": "0.59869504", "text": "addItems() {\n if (!this.modifyItems(function (item) { item.nb += this.nb; })) {\n Game.current.items.push(this);\n }\n }", "title": "" }, { "docid": "d3170b88d7cf0ba0153e4b1ae513c835", "score": "0.59855783", "text": "function buildAddList() {\n\n var list = JSON.parse(sessionStorage.getItem('add_list'));\n \n if (!list) {\n $('#add_list').append(\n $(document.createElement('p'))\n .addClass('text-center')\n .text('請選取景點'));\n return;\n }\n\n $('#add_list').empty();\n\n for (let attra of list) {\n\n var icon = $(document.createElement('i'))\n .addClass('fas fa-minus add-attra-icon')\n .click( function() {\n addAttra(event, $(this));\n });\n\n var item = $(document.createElement('div'))\n .addClass('list-group-item add-item')\n .addClass('justify-content-between d-flex')\n .addClass('align-items-center')\n .data('value', attra)\n .text(attra)\n .append(icon)\n .click( function() {\n if ($(this).hasClass('active')) {\n $(this).removeClass('active');\n } else {\n $('#add_list .list-group-item')\n .removeClass('active');\n $(this).addClass('active');\n }\n });\n\n $('#add_list').append(item);\n }\n setFromToTag();\n}", "title": "" }, { "docid": "75c6aa46f5f30a8a033cb20e2db8279b", "score": "0.5983822", "text": "function addItem(id) {\n// for (var item : items) {\n//\n// }\n\n items.push(id);\n addToTotal(id);\n updateCheckout(items.length - 1);\n updateConfirm(items.length - 1);\n}", "title": "" }, { "docid": "259b1d19bfb65732012d2e5b53ee6e7f", "score": "0.59825623", "text": "function addToList () {\n var list = document.getElementById('list1');\n var item;\n var numberOfItems = 5;\n var itemArray = [];\n\n // create array of 5 random string values\n for (var i = 0; i < numberOfItems; i++) {\n itemArray.push(Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5));\n }\n\n for (i = 0; i < numberOfItems; i++) {\n item = document.createElement('li');\n item.appendChild(document.createTextNode(itemArray[i]));\n list.appendChild(item);\n }\n }", "title": "" }, { "docid": "b47c961a82a71a7cc39b7215e886e3eb", "score": "0.5977785", "text": "function loadList(array) {\n array.forEach(function(item) {\n addList(item.name, item.id, item.done, item.trash);\n });\n}", "title": "" }, { "docid": "9eed5bec0b4ff0b44825cc97e60394bd", "score": "0.5956079", "text": "function addItem() {\n //create item array, tow ways of constructing\n var newItem = {name: $(\"#newItemName\").val()};\n //newItem.name = $(\"#newItemName\").val();\n currentList.items.push(newItem);\n //test\n console.info(currentList);\n drawItems();\n $(\"#newItemName\").val(\"\");\n}", "title": "" }, { "docid": "354be22220c559683e722c530abaf06c", "score": "0.59496135", "text": "addList(variables) {\n forEach(dot(variables), (value, name) => {\n this.add(name, value);\n });\n return this;\n }", "title": "" }, { "docid": "e3d6efd47319ee4418885ea0b952800c", "score": "0.59428096", "text": "add(item){\n this.items.push(item);\n return this;\n }", "title": "" }, { "docid": "d02f08cb5172c8860c14f570531247e6", "score": "0.59410095", "text": "function addItem(myGroceryList, item) {\n if (myGroceryList.indexOf(item) === -1) {\n myGroceryList.push(item);\n }\n return myGroceryList;\n}", "title": "" }, { "docid": "d207dd51103979f54c4e8073dd611f10", "score": "0.59382993", "text": "addItem(item) {\n let addMe = {...item, id: uuid()};\n this.setState(st => ({\n items: [...st.items, addMe]}));\n }", "title": "" }, { "docid": "05822845445dbc10e4986a632ecc0ee8", "score": "0.5937475", "text": "function addData() {\n\n if (!validation()){\n return;\n }\n\n var desc = document.getElementById(\"desc\").value;\n var amount = document.getElementById(\"amount\").value;\n var value = document.getElementById(\"value\").value;\n\n list.unshift({\"desc\":desc, \"amount\":amount, \"value\":value }); //gets the values and put it in the list, on first line\n setList(list);\n console.log(getTotal(list));\n\n}", "title": "" }, { "docid": "923a4fa575f75520eff5a161137cbbbd", "score": "0.59345907", "text": "function add(item) {\n\t _data.push(item);\n\t console.log('Item Added....');\n\t}", "title": "" }, { "docid": "5845279332b075e916d07bc6aec006ea", "score": "0.59322953", "text": "createList() {\n this.unorderedList = new List(this.list);\n }", "title": "" }, { "docid": "439906d7261627fed0b8487c25d8e052", "score": "0.5929787", "text": "function loadList(array){ \r\n array.forEach(function(item){ \r\n addToDo(item.name, item.id, item.done, item.trash); \r\n }); \r\n\r\n}", "title": "" }, { "docid": "3b976d83c002e603459a2d2bd7be8c3b", "score": "0.59210426", "text": "function updateList() {\n //Same as above, get the items from the server\n sendRequest(\"GET\", \"rest/shop/items\", null, function (itemsText) {\n //This code is called when the server has sent its data\n var items = JSON.parse(itemsText);\n addItemsToTable(items);\n });\n }", "title": "" }, { "docid": "ae45c5f68681204f0987d8a322b32b79", "score": "0.59176993", "text": "addItem(i, q){\n let i = this.itemList.push(i);\n let q = this.itemQuantity.push(q);\n}", "title": "" }, { "docid": "ddc9b0bdfff0425ce6cbd65d508df3ed", "score": "0.59125775", "text": "function addItems($newitems) {\n $items = $items.add( $newitems );\n\n $newitems.each(function() {\n var $item = $(this);\n $item.data({\n offsetTop: $item.offset().top,\n height: $item.height()\n });\n });\n\n initItemsEvents($newitems);\n }", "title": "" }, { "docid": "cde4ff1192b6fa4d8ff1667362319c06", "score": "0.5908775", "text": "function loadList(array){\r\n array.forEach(function(item){\r\n addToDo(item.name, item.id, item.done, item.trash, item.color);\r\n });\r\n}", "title": "" }, { "docid": "e761b0252d77352750551f1de6fbebb8", "score": "0.59079295", "text": "addItem(itemList,itemQuantity){\n this.itemList=i;\n this.itemQuantity=q;\n }", "title": "" }, { "docid": "e9a6cd1eb4e8e03267701cb806232fc1", "score": "0.590127", "text": "function renderHtmlList() {\n for (var i = 0; i < shoppingList.length; i = i + 1) {\n var itemNameToAdd = shoppingList[i];\n addItemElementToList(itemNameToAdd);\n }\n}", "title": "" }, { "docid": "6246bad9adac525a160871e56788ba50", "score": "0.589928", "text": "function _addItemToOl(item, ol) {\n // Make a new li.\n const newLi = document.createElement('li');\n // Add our item to it.\n newLi.innerText = item;\n // Append it to the given ol.\n ol.appendChild(newLi);\n}", "title": "" }, { "docid": "91d540dc4265be0e36f7eccc205f883a", "score": "0.5896076", "text": "function addListItem() {\n // Event listener for \"Enter\" keypress that adds input text to todo__list\n todoInputEl.addEventListener(\"keypress\", function(event) {\n // If the keypress \"code\" is \"Enter\"\n if (event.code === \"Enter\") {\n // Call createListItem and pass value from todoInputEl and add the returned value to todoListEl\n let newListItem = createListItem(todoInputEl.value)\n // todoListEl.appendChild(newListItem) this will append to the end of the list\n todoListEl.insertBefore(newListItem, todoListEl.childNodes[0]) // this will insert new todo before the first child node of todoListEl\n\n // Clear the todoInputEl field\n todoInputEl.value = \"\";\n }\n }) \n}", "title": "" }, { "docid": "b53472511d6395098b8502c31905c3ee", "score": "0.58944446", "text": "additem(i,q){\n this.itemList.push(i);\n this.itemQuantity.push(q);\n }", "title": "" }, { "docid": "dc8ad950e82ab712595f8a8291f578f5", "score": "0.5892831", "text": "function appendNewItem(item) {\n const newListItem = document.createElement(\"li\");\n newListItem.innerText = item;\n results.append(newListItem);\n}", "title": "" }, { "docid": "5f3a8969ea98d8624740c31aa21f7b5e", "score": "0.5872785", "text": "@action\n addList(name, disc) {\n this.lists.push(\n {\n id:Math.floor(Math.random() * 10),\n name: name,\n description: disc\n });\n }", "title": "" }, { "docid": "df7d8746d516b2231817acc459014935", "score": "0.5870123", "text": "function addListItem(name, url) {\r\n\t$('<li><a href='+url+'\">'+name+'</a></li>').appendTo(list);\r\n}", "title": "" }, { "docid": "d2e074124190d59c21ab44f213378b8d", "score": "0.5865278", "text": "function loadList(array){\n array.forEach(function(item){\n addToDo(item.name, item.id, item.done, item.trash);\n \n });\n}", "title": "" }, { "docid": "20b5871a93f7fd0b3291a2433f7cc031", "score": "0.58649087", "text": "function List(/*items...*/) {\n if (arguments.length) {\n return List.from(arguments);\n }\n}", "title": "" }, { "docid": "20b5871a93f7fd0b3291a2433f7cc031", "score": "0.58649087", "text": "function List(/*items...*/) {\n if (arguments.length) {\n return List.from(arguments);\n }\n}", "title": "" }, { "docid": "036ff8757c528327c454fd76ca1e923c", "score": "0.58643633", "text": "function addCompletedItem(li) {\n completedItems++;\n updateCompleted();\n document.querySelector(\".list__completed\").appendChild(li);\n}", "title": "" }, { "docid": "59c4e4e759fd4bce6c98a19e34ba4569", "score": "0.58591795", "text": "function addItem(e) {\n\n e.preventDefault();\n\n const list_value = document.getElementById('listText').value;\n\n listArray.push(list_value);\n\n localStorage.setItem('items',JSON.stringify(listArray));\n\n addList(list_value);\n\n}", "title": "" }, { "docid": "50760ffa0ddfd87ff5d9af6d8bf3578e", "score": "0.5857687", "text": "lista(data){\r\n this.items[this.end] = data;\r\n this.end++\r\n }", "title": "" }, { "docid": "32d9e99fb5efdc24e78ddd24ae592540", "score": "0.58573264", "text": "function _addToInventory(items) {\n if (typeof items === 'string') items = [items];\n inventory = inventory.concat(items);\n }", "title": "" }, { "docid": "186752a5c3013a2eb429d73c597a6e9d", "score": "0.58564794", "text": "propagateAddData(data, payload) {\n for (let i = 0, list; (list = this.connectedLists[i]); i++) {\n const key = payload[list.idKey]\n const scroll_version_id = list.relativeToScrollVersion ? payload.scroll_version_id : undefined\n if (key !== undefined) list.addToItemSublist(key, this.listType, data, scroll_version_id)\n }\n }", "title": "" }, { "docid": "185533c4746c7e429c56210572984bf0", "score": "0.58563846", "text": "function addToArray() {\n myList.push({\n food: foodValueLower,\n weight: weightValue,\n measurement: measurementValueLower,\n ID: foodId\n });\n }", "title": "" }, { "docid": "07e8f798019a94bad99b8a6bb8fe6180", "score": "0.58533293", "text": "async addItemToList(item) {\n // Clone the template\n const clone = this.template.cloneNode({deep: true});\n const li = clone.firstElementChild;\n\n // Set the ID (used for editing and removing)\n li.id = item.id;\n const input = li.querySelector('zen-input');\n const checkbox = li.querySelector('zen-checkbox');\n const remove = li.querySelector('zen-icon');\n\n // Set the initial values (completed, text, etc)\n input.value = item.text;\n input.disabled = Boolean(item.completed);\n checkbox.checked = Boolean(item.completed);\n li.classList.toggle('completed', Boolean(item.completed));\n\n\n // Setup listeners for text changing, clicking 'complete', and removing\n input.addEventListener('change', (e) => {\n this.updateItem(item.id, {text: e.target.value});\n });\n checkbox.addEventListener('change', (e) => {\n this.checkoffItem(item.id, e.target.checked);\n });\n remove.addEventListener('click', () => this.removeItem(item.id));\n\n // Finally, add it to the list\n this.todoList.appendChild(li);\n }", "title": "" }, { "docid": "4160cc7e5fed2d14849c1021c3a92e4a", "score": "0.5852182", "text": "function setListContent(field, item){\n\tlistitems.push(item);\n\tfield.append(\"<li><a>\"+item+\"</a></li>\");\n console.log('setting list item'+item);\n addListClickEventCallback();\n}", "title": "" }, { "docid": "a75a94b8fa5e38697d9173156000610c", "score": "0.5852179", "text": "function appendToList(list, content, method)\n{\n $(\"<li>\"+content+\"</li>\").on('click', method).addClass(\"app-list arrow\").appendTo(list);\n}", "title": "" }, { "docid": "efea17b505b8c039184a0983aa720a35", "score": "0.5850686", "text": "addItem(i, q){\n this.itemList.push(i);\n this.itemQuantity.push(q);\n }", "title": "" }, { "docid": "260b98446d9f7b84ab05c011f3b72021", "score": "0.5829329", "text": "push(item) {\n this._append(item);\n }", "title": "" }, { "docid": "c1db051045a52862cb59b96f58358ef3", "score": "0.5827622", "text": "function addRecordToList(list, scope, object, rowIdField, options) {\n // Create item with the necessary info\n var item = {\n title: buildText(scope, object, options.title),\n description: buildText(scope, object, options.description),\n rowID: object[rowIdField]\n };\n\n // Check if item is already in the list\n var dupList = JSLINQ(list).Where(function(item1) { return item1.rowID === item.rowID; } ) || [];\n\n // Remove item if it already exists (since we're going to put it in the front of the list)\n if (dupList.items.length > 0) {\n var itemIndex = list.indexOf(dupList.items[0]);\n list.splice(itemIndex, 1);\n }\n\n // If list is at the max, remove the last item in the list\n if (list.length >= 10) {\n list.pop();\n }\n\n // Add item to front of list\n list.splice(0, 0, item);\n }", "title": "" } ]
5af26f044d2798f4fc00bc556df5fbed
Update function, repeats indefinitely
[ { "docid": "f5f62fb8b984b93be10636a35aa22722", "score": "0.0", "text": "update() {\n\n\n if (!isPaused) {\n\n\t\t// Variable to see what fire is being clicked\n\t\tvar clickedFire;\n\t\t\n\t\t// Variable for 'this'\n var th = this;\n\t\t\n\t\tvar gameOverTrees = allTrees.length / 2;\n\n // If the game has started\n if (start && !(currentFireCount > gameOverTrees)) {\n\t\t\t\n\t\t\t//milestone/trophy announcements for the player\n\t\t\tif (!readingToolTip) {\n\t\t\t\t//all the trophy logic is done in there\n\t\t\t\tdetermineTrophy(th);\n\t\t\t}\n\t\t\t\n\t\t\t//force a fact to not show up when there's a burnt tree\n\t\t\tif(ran == 2 && firstBurntTree && clickedBurntTree == 0) {\n\t\t\t\tran = 1;\n\t\t\t}\n\t\t\t\n\t\t\t//force fact to disappear after 2 durations\n\t\t\tif(everyTwo == 3 && firstBurntTree && clickedBurntTree == 0) {\n\t\t\t\treadingInfo = false;\n\t\t\t}\n\t\t\t\n\t\t\t//shows tool tip only when there's been a burnt tree, burnt tree hasnt been clicked, and not reading other info\n\t\t\tif (firstBurntTree && burntTreeCounter == 0 && clickedBurntTree == 0 && !readingInfo && !readingTutorial && !trophyStatus) {\n\t\t\t\ttoolTip(th);\n\t\t\t\tburntTreeCounter++;\n\t\t\t}\n\t\t\n\t\t\t// When a fire is clicked\n\t\t\tthis.input.on('gameobjectdown', function(pointer, fire) {\n\t\t\t \n\t\t\t\t// Set the clickedFire variable (may be unnecessary)\n\t\t\t\tclickedFire = fire;\n\t\t \n\t\t\t\t// Extinguish the fire\n\t\t\t\textinguishFire(fire, th);\n\t\t\t});\n\t\t\n\t\t\t// When a burnt tree is clicked\n\t\t\tthis.input.on('gameobjectdown', function(pointer, burnt) {\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Remove the burnt tree\n\t\t\t\tremoveTree(this, burnt, clickedFire);\t\n\t\t\t});\n\t\t\n\t\t\t// Check what stage the user is at\n\t\t\tdetStage();\n\t\n\t\t\t// Delay and then make the fire\n\t\t\tthis.time.addEvent({\n\t\t\t\tdelay: stageDelay,\n\t\t\t\tcallback: ()=>{\n\t\t\t\t\tstartFires(this) // Send 'this' over so not everything has to be done in this function\n\t\t\t\t},\n\t\t\t\tloop: false // Do not loop, the update function loops by itself\n\t\t\t});\n\t\t\n\t\t\t/** Easter Egg */\n\t\t\tvar mKey = this.input.keyboard.addKey('M');\n\t\t\n\t\t\tif (mKey.isDown && !marioed) {\n\t\t\t\tmarioMusic.play(marioConfig);\n\t\t\t\ttitleMusic.stop();\n\t\t\t\tgameMusic.stop();\n\t\t\t\tmarioed = true;\n\t\t\n\t\t\t\tfor (let i = 0; i < allTrees.length; i++) {\n\t\t\t\n\t\t\t\t\tvar shroom = this.add.sprite(treeArr[i].x, treeArr[i].y, 'mushroom').setName('Shroom' + i);\t\n\t\t\t\t\tshroom.setScale(0.7);\n\t\t\t\n\t\t\t\t\tvar deadShroom = this.add.sprite(treeArr[i].x, treeArr[i].y, 'deadShroom').setName('deadShroom' + i);\n\t\t\t\t\tdeadShroom.setScale(0.7);\n\t\t\t\t\t\n\t\t\t\t\t//switch score font to black w/ white outline for visibility\n\t\t\t\t\tscoreCounter.setStyle({\n\t\t\t\t\tcolor: 'black',\n\t\t\t\t\tstroke: 'white',\n\t\t\t\t\tstrokeThickness: '6',\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tth.children.bringToTop(scoreCounter);\n\t\t\t\t\n\t\t\t\t\tallTrees[i].tree.visible = false;\n\t\t\t\t\tallTrees[i].shroom = shroom;\n\t\t\t\t\tallTrees[i].deadShroom = deadShroom;\n\t\t\t\t\tdeadShroom.visible = false;\n\t\t\t\t\tdeadShroom.setInteractive({ cursor: 'url(assets/sprites/saw.cur), pointer' });\n\t\t\t\t} \n\t\t\t}\n\t\t} else if (currentFireCount > gameOverTrees) {\n\t\t\t\tgameOver(this);\n\t\t\t}\t\t\t\n\t\n\t\t} else {\n\t\t\tthis.children.bringToTop(pauseBack);\n\t\t\tthis.children.bringToTop(quitBtn);\n\t\t\tthis.children.bringToTop(resumeBtn); \n\t\t}\n\t}", "title": "" } ]
[ { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.8171977", "text": "function update() {}", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.8171977", "text": "function update() {}", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.8055115", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.8055115", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.8055115", "text": "update() { }", "title": "" }, { "docid": "f747e59143c2cc68b367f1e53d929e94", "score": "0.8048522", "text": "function update()\n {\n _update();\n }", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.80385786", "text": "update() {}", "title": "" }, { "docid": "a214b5cb7d96b9c1891040b6ca19fe67", "score": "0.79935545", "text": "updateInstantly() {\n this._update();\n }", "title": "" }, { "docid": "56b3eb47db33045cb9268c6e5fd77b74", "score": "0.78949225", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7772419", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7772419", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7772419", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7772419", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7772419", "text": "update() {\n }", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.7765476", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "0b537df10fc26dfb57f4528998f68cc2", "score": "0.7757784", "text": "update() {\n \n }", "title": "" }, { "docid": "6e1072d64a21ce7ddcab88b4cb7f74bf", "score": "0.77560586", "text": "update() {\n \n }", "title": "" }, { "docid": "20820b29a57a2986f3f4c3323e9150c1", "score": "0.773681", "text": "function update () {\n}", "title": "" }, { "docid": "987cd0a6cd2647a0199e543877b4a780", "score": "0.77277434", "text": "function update() {\n}", "title": "" }, { "docid": "d183d67d9a6e3621df150697d53ec56c", "score": "0.770681", "text": "update() {\n\n\t}", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.76841885", "text": "update() {\n\n }", "title": "" }, { "docid": "b2a4feb43100f7858e99383b049adde0", "score": "0.7644212", "text": "update()\n\t{\n\n\t}", "title": "" }, { "docid": "cbe84a8c7ff3d67ab6f55c29290cd77e", "score": "0.7619316", "text": "update () {\n\n }", "title": "" }, { "docid": "21da885169150d03c20fd179239a81f2", "score": "0.7583263", "text": "update() { \n }", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.75778663", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.75778663", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.75778663", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.75778663", "text": "function update() {\n\n}", "title": "" }, { "docid": "b02b2172ca2042178e0c77c33a4afb44", "score": "0.75778663", "text": "function update() {\n\n}", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7567663", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7567663", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7567663", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7567663", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7567663", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7567663", "text": "update() {\n\n }", "title": "" }, { "docid": "7d706da556688f2b8e598249e2e28a39", "score": "0.75668436", "text": "update() {\n }", "title": "" }, { "docid": "7d706da556688f2b8e598249e2e28a39", "score": "0.75668436", "text": "update() {\n }", "title": "" }, { "docid": "ff3f303095a0cda80d104c6dba146e9f", "score": "0.7549809", "text": "function updateRepeatedly() {\n updateOnce();\n setTimeout(updateRepeatedly, seconds(30));\n }", "title": "" }, { "docid": "0a486418ed22eee3dfbfcd5060267c45", "score": "0.7545206", "text": "update() {\n\n\n }", "title": "" }, { "docid": "bd988ed69301f111ff020c7d82d45f96", "score": "0.7544013", "text": "function update(){\r\n\r\n}", "title": "" }, { "docid": "e2d07184578f8c091ffb319c8af1041c", "score": "0.7482926", "text": "function update(){\n\n }", "title": "" }, { "docid": "3cdd336cc96209de95176a3414613856", "score": "0.7460751", "text": "_update() {\n }", "title": "" }, { "docid": "59b89b87f1f1d0623635c5858bd8f737", "score": "0.7456559", "text": "function update ()\n{\n\n}", "title": "" }, { "docid": "6f81d08d236af0c4e03116d2a289ce46", "score": "0.7384612", "text": "function update()\n{\n}", "title": "" }, { "docid": "84e6edf37204b52587629e712e5fccc1", "score": "0.73773855", "text": "function update()\n{\n\n}", "title": "" }, { "docid": "1e0246d0b91d886172836cbb4a29c3f8", "score": "0.73772407", "text": "function update() {\n // TODO 5b: Fill in the update function's code block\n}", "title": "" }, { "docid": "16644bb52618fef27ba89c9a597dd7a5", "score": "0.7365077", "text": "function update(){\n\t\tlastRun = new Date().getTime()\n\t\tif(lastRun - lastUpdate > 1000/updateFrequency){\n\t\t\tlastUpdate = lastRun\n\t\t\ttick()\n\t\t}\n\t}", "title": "" }, { "docid": "5d2700087877d7ace0dbe5382d1184c3", "score": "0.7335021", "text": "update(){\n\n }", "title": "" }, { "docid": "74703519923d9b58035dcbaa321ce442", "score": "0.73239636", "text": "update(){\n\n\t}", "title": "" }, { "docid": "4b6aabc28c7d707d0df38f1f9f4e5dfb", "score": "0.722828", "text": "onUpdate() {}", "title": "" }, { "docid": "064ac127d7f49900cca7b29af2041764", "score": "0.72107", "text": "update(deltaTime) {}", "title": "" }, { "docid": "3b147a772c21abb5e8e46a56f67d0121", "score": "0.72029024", "text": "function autoUpdate() {\n // Update soon\n setTimeout(function () { autoUpdate() }, 600*1000);\n update();\n}", "title": "" }, { "docid": "58d6636faa07e2299880874f891d6745", "score": "0.71909755", "text": "function repeatUpdate(interval) {\n refresh = setInterval(() => {\n update();\n }, interval)\n}", "title": "" }, { "docid": "4cf1cf8a5b7c241a9a102e32ae2d24db", "score": "0.7188568", "text": "update(delta) {\n }", "title": "" }, { "docid": "d80f302530b0f0a012e2b065af19c042", "score": "0.7141277", "text": "function singleupdate(){\n\t//uses requestAnimFrame from the raf class to call itself 60 times a second.\n\twindow.requestAnimFrame(singleupdate);\n\t//checks the position of the mouse\n\tmousePosition();\n\t\n\t//if player isnt dead then checks for keyboard input\n\tif(!player.getDead()){\n\t\tcheckKeyInput();\n\t}\n\t//keeps sprites iterating\n\twindow.spriteChange++;\n\tif(spriteChange == 15){\n\t\tplayer.spriteIterate();\n\t\tfor(var i = 0; i < enemies.length; i++){\n\t\t\tenemies[i].spriteIterate();\n\t\t}\n\t\tspriteChange = 0;\n\t}\n\t//calls update\n\tupdate();\n\t//calls draw\n\tdrawElements();\n}", "title": "" }, { "docid": "507f4c199cbc1e24f9e4f72b590f54cd", "score": "0.71330464", "text": "function loop(){\r\n update();\r\n\r\n render();\r\n}", "title": "" }, { "docid": "d8aad68c3f9ed3909833e2911d7585a0", "score": "0.71004486", "text": "update() {\n for (let i = 0; i < this.reels.length; i++) {\n this.reels[i].update();\n }\n }", "title": "" }, { "docid": "30fddd7e2542a74cf9eff16b0a5370d0", "score": "0.7083724", "text": "update() {\n // for each cell, set its next state\n this.cellManager.updateCells();\n this.updateListeners();\n\n this.updateTimer = setTimeout(this.update.bind(this), this.updateInterval);\n }", "title": "" }, { "docid": "0804d7efd10bfbb64930071d919d158d", "score": "0.70784485", "text": "function update() {\n\tENGINE.update();\n\tENGINE.render();\n\twindow.requestAnimationFrame(update); //continue looping\n}", "title": "" }, { "docid": "f1d64ce0c2c62ba56177c125862e9e2e", "score": "0.7069272", "text": "update() {\n this.updateCallback();\n }", "title": "" }, { "docid": "b42e1ed0163fcb06e857b7152c49aa35", "score": "0.70606166", "text": "function update() {\n notch();\n }", "title": "" }, { "docid": "363d467ccbfe570213e12e19ecd926e6", "score": "0.70372295", "text": "function update()\n{\n\t//Nothing To Do Here Yet...\n}", "title": "" }, { "docid": "2d6d621721ac84de72717b4d5d55fc78", "score": "0.7000275", "text": "update() {\n\t\tsuper.update();\n\t}", "title": "" }, { "docid": "ae5d35417fac74f5e05b206886d1bd55", "score": "0.6984074", "text": "update() {\n this.updateLit();\n // this.updateOraclesAndAssets();\n // this.updateCoinRates();\n }", "title": "" }, { "docid": "c010aa2d42d434f18505936d42667e6a", "score": "0.69778895", "text": "update() {\n this.updateDirection();\n this.updatePosition();\n this.updateTail();\n }", "title": "" }, { "docid": "cb55cde838db224241b74d6e3acb0495", "score": "0.69541454", "text": "function Update(){\n\t\t\n \t}", "title": "" }, { "docid": "d271918418f8f08489cc811a172e309b", "score": "0.6943451", "text": "function update() {\n\tproccesskeys();\n\tdecelerate();\n\tcheckspeed();\n\tupdateposition();\n}", "title": "" }, { "docid": "438bc503664161ba4a92c2aef05b78c2", "score": "0.6903571", "text": "run () {\n\t\tif (this.running) {\n\t\t\tthis.update();\n\t\t}\n\t}", "title": "" }, { "docid": "5edcf51aeb864010b29e9826944a4bb7", "score": "0.69026273", "text": "function mupdate(){\n\n}", "title": "" }, { "docid": "071ef010b52704d323089144c585cf26", "score": "0.68964994", "text": "update(state) {\n\t\t// TODO\n\t}", "title": "" }, { "docid": "083e9b11ad8c65b457d701aed610ecac", "score": "0.6893805", "text": "function gameLoop() {\n sendUpdates();\n }", "title": "" }, { "docid": "dc274c1106c7b90c6586aa8cc1d34450", "score": "0.6893378", "text": "function update(){\n\n\t\t// Update\n\t\tslideshow.update();\n\t\tpencil.update();\n\t\tMouse.update();\n\n\t\t// Draw\n\t\tslideshow.draw();\n\t\tpencil.draw();\n\n\t\t// Update\n\t\tpublish(\"update\");\n\n\t\twindow.requestAnimationFrame(update);\n\n\t}", "title": "" }, { "docid": "b9084ab2316d49f2eef7854b672f5f59", "score": "0.6891499", "text": "function update() {\n startTime = new Date()\n updateData();\n draw();\n console.warn(\"Done. ( \" + (new Date() - startTime) + \"ms )\");\n}", "title": "" }, { "docid": "cd499e8f65535d476746d6e99f726fbf", "score": "0.6866074", "text": "update() {\n // placeholder\n }", "title": "" }, { "docid": "f2db24ecb2daf3e200ef0e5dad793e0a", "score": "0.686254", "text": "function loop() {\n update();\n window.requestAnimationFrame(loop);\n}", "title": "" }, { "docid": "2f80248f73e33c5879c5ea949835914d", "score": "0.6841462", "text": "function loop () {\r\n\t\tupdate();\r\n\t\tdraw();\r\n\t}", "title": "" }, { "docid": "6f419ff9d518813234c8a6c2863c79e3", "score": "0.6841223", "text": "function update()\n{\n\tcontrols.update();\n\tstats.update();\n}", "title": "" }, { "docid": "cbdb3c6818ade0cedd7894a3f9360639", "score": "0.68398434", "text": "update() {\n\n // This is the frequency analyser\n this.music.analyser.getByteFrequencyData(this.music.frequencyData);\n\n this.DELTA_TIME = Date.now() - this.LAST_TIME;\n this.LAST_TIME = Date.now();\n\n this.city.update();\n\n this.moon.update(this.DELTA_TIME);\n this.moon.move();\n\n this.stars.update();\n this.backgrounds.update();\n\n this.scene.render();\n\n }", "title": "" }, { "docid": "075f6f0f74fab5e23edf45fff60811d6", "score": "0.6837125", "text": "update() {\n if (!this.enabled) {\n return;\n }\n\n // FPS Calculations.\n const now = performance.now();\n this.fps.cnt++;\n\n if (now - this.fps.last >= 1000) {\n const fps = this.fps.cnt;\n this.fps.cnt = 0;\n this.fps.last = now;\n this.emit('fps', fps);\n }\n }", "title": "" }, { "docid": "b9b00132fc85f16fbf3a4a4b66e9c85c", "score": "0.68366456", "text": "function update () {\n // queue the next update\n window.requestAnimationFrame(update)\n\n // logic goes here\n\n // draw after logic/calculations\n draw()\n }", "title": "" }, { "docid": "b6adebbd01fffcb970264ee8b3692b4f", "score": "0.683652", "text": "willUpdate() {}", "title": "" }, { "docid": "b6adebbd01fffcb970264ee8b3692b4f", "score": "0.683652", "text": "willUpdate() {}", "title": "" } ]
b174139747694432eef60734cc7b43df
Takes in one parameter (object) and returns it
[ { "docid": "d1ec93ab0b6519f6e9c167a4cbd90c8c", "score": "0.58254665", "text": "identity(obj) {\n return obj;\n }", "title": "" } ]
[ { "docid": "3be5cc2a65a8b427f726a8cd5b8a98ac", "score": "0.80315024", "text": "function returnObject(object){\n return object;\n}", "title": "" }, { "docid": "a8f66ba07c2c43212f36f85bda760f1e", "score": "0.70973676", "text": "function getObject (args, obj) {\n return obj\n}", "title": "" }, { "docid": "29967400e6a35ae058a021cf03f1259a", "score": "0.69510585", "text": "function getObject() {\n\treturn {a : 1};\n}", "title": "" }, { "docid": "d3b3480dcc03a1a6ad34c1c9456f340d", "score": "0.6760378", "text": "function myFunction(myObj){\n return myObj;\n}", "title": "" }, { "docid": "a46e3c9059dcee6ad15f16e5edb9f2a6", "score": "0.671725", "text": "getObject(){\r\n\r\n return this.object;\r\n }", "title": "" }, { "docid": "8f02ebaed8f4efe83a021c92e60f6a53", "score": "0.6569389", "text": "function xxxxobj(xxx) {\n if (typeof xxx === \"string\") {\n return getGal(xxx);\n } else if (typeof xxx === \"object\") {\n if (xxx.name && (xxx.genes || xxx.evaluate) ) return xxx; // assume already an xobj\n if (xxx.tranrule) return { name: xxx.name, genes: xxx }; // was genes\n }\n log (\"cannot find xobj for \", xxx);\n return undefined;\n}", "title": "" }, { "docid": "c62de549d3c50ab9be6c6d7a9c01ce06", "score": "0.65031594", "text": "function getObject(theObject) {\n var result = null;\n if(theObject instanceof Array) {\n for(var i = 0; i < theObject.length; i++) {\n result = getObject(theObject[i]);\n if (result) {\n break;\n }\n }\n }\n else\n {\n for(var prop in theObject) {\n console.log(prop + ': ' + theObject[prop]);\n if(prop == 'id') {\n if(theObject[prop] == 1) {\n return theObject;\n }\n }\n if(theObject[prop] instanceof Object || theObject[prop] instanceof Array) {\n result = getObject(theObject[prop]);\n if (result) {\n break;\n }\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "5c09e1a7f67134c6873447760dc28093", "score": "0.6494797", "text": "function returnsObjectRegularFunction() {\n return {\n foo: 'bar'\n };\n}", "title": "" }, { "docid": "2980c7b9e0144a01871bf6b78e3aed49", "score": "0.64689386", "text": "function get(object, name) {\n return object[name];\n}", "title": "" }, { "docid": "eaa75af36732f11fd50450ec4e4653f4", "score": "0.6463332", "text": "function returnObjectCorrect() {\n return {\n firstName : \"FirstName\"\n }\n}", "title": "" }, { "docid": "d43eec5186b4c77ec5b6aa60aeca8a9b", "score": "0.636036", "text": "function getObject(obj) {\n\tvar theObj\n\tif (typeof obj == \"string\") {\n\t\ttheObj = eval(\"document.\" + range + obj + styleObj)\n\t} else {\n\t\ttheObj = obj\n\t}\n\treturn theObj\n}", "title": "" }, { "docid": "56bc98ec12d6773df45b626296616230", "score": "0.63188416", "text": "function createObject(){\n var sampleobject={\n param1:'param1',\n param2: 2\n }\n\n return sampleobject;\n\n}", "title": "" }, { "docid": "045ac988b6b88ee35f52992a679a08ed", "score": "0.62317544", "text": "function getObj(id){return document.getElementById(id);}", "title": "" }, { "docid": "045ac988b6b88ee35f52992a679a08ed", "score": "0.62317544", "text": "function getObj(id){return document.getElementById(id);}", "title": "" }, { "docid": "0bf0beb1e103a88e4ef7d34827e4ac2b", "score": "0.6126877", "text": "function giveMeObj() {\n return {\n prop1: 'hello',\n prop2: 'world'\n };\n }", "title": "" }, { "docid": "c66777b2bfab555ad8e4e6034b0d06d0", "score": "0.6116155", "text": "function GetObject() : GameObject\n\t{\n\t\treturn object;\n\t}", "title": "" }, { "docid": "a06d8ac08d863c9a5405659c29f32a0f", "score": "0.6113447", "text": "static makeFromObj(obj) {\n if (!obj) return null;\n if (isString(obj)) {\n return WebPlotRequest.parse(obj);\n }\n else if (isPlainObject(obj)) {\n const wpr= new WebPlotRequest();\n\n wpr.setAttributes(obj.attributes);\n wpr.setParams(cleanupObj(obj));\n\n\n let typeGuess;\n if (obj.id) typeGuess= RequestType.PROCESSOR;\n else if (obj[WPConst.FILE]) typeGuess= RequestType.FILE;\n else if (obj[WPConst.SURVEY_KEY]) typeGuess= RequestType.SERVICE;\n else if (obj[WPConst.SERVICE]) typeGuess= RequestType.SERVICE;\n else if (obj[WPConst.URLKEY]) typeGuess= RequestType.URL;\n else if (obj[WPConst.HIPS_ROOT_URL]) typeGuess= RequestType.HiPS;\n\n if (typeGuess && !wpr.params[WPConst.TYPE]) wpr.setRequestType(typeGuess);\n\n // setting safe urls\n if (wpr.params[WPConst.URLKEY]) wpr.setURL(wpr.params[WPConst.URLKEY]);\n if (wpr.params[WPConst.HIPS_ROOT_URL]) wpr.setHipsRootUrl(wpr.params[WPConst.HIPS_ROOT_URL]);\n\n return wpr;\n }\n else if (obj.makeCopy) { // in this case I was probably passed a WebPlotRequest\n return obj.makeCopy();\n }\n else { // i don't know what I have, just return it\n return obj;\n }\n }", "title": "" }, { "docid": "2635fc91e11004812ecdacecd7fa1500", "score": "0.61054325", "text": "function GetRawObject(obj) {\n var theObj;\n if (typeof obj == \"string\") {\n\t\tvar isCSS = (document.body && document.body.style) ? true : false;\n if (isCSS && document.getElementById) {\n theObj = document.getElementById(obj);\n } else if (isCSS && document.all) {\n theObj = document.all(obj);\n } else if (document.layers) {\n theObj = SeekLayer(document, obj);\n }\n } else {\n // pass through object reference\n theObj = obj;\n }\n return theObj;\n}", "title": "" }, { "docid": "e642e3131a22e4491b992840a03a24be", "score": "0.60582227", "text": "function getRawObject(obj) {\n var theObj;\n if (typeof obj == \"string\") {\n if (isW3C) {\n theObj = document.getElementById(obj);\n } else if (isIE4) {\n theObj = document.all(obj);\n } else if (isNN4) {\n theObj = seekLayer(document, obj);\n }\n } else {\n // pass through object reference\n theObj = obj;\n }\n return theObj;\n}", "title": "" }, { "docid": "e642e3131a22e4491b992840a03a24be", "score": "0.60582227", "text": "function getRawObject(obj) {\n var theObj;\n if (typeof obj == \"string\") {\n if (isW3C) {\n theObj = document.getElementById(obj);\n } else if (isIE4) {\n theObj = document.all(obj);\n } else if (isNN4) {\n theObj = seekLayer(document, obj);\n }\n } else {\n // pass through object reference\n theObj = obj;\n }\n return theObj;\n}", "title": "" }, { "docid": "e642e3131a22e4491b992840a03a24be", "score": "0.60582227", "text": "function getRawObject(obj) {\n var theObj;\n if (typeof obj == \"string\") {\n if (isW3C) {\n theObj = document.getElementById(obj);\n } else if (isIE4) {\n theObj = document.all(obj);\n } else if (isNN4) {\n theObj = seekLayer(document, obj);\n }\n } else {\n // pass through object reference\n theObj = obj;\n }\n return theObj;\n}", "title": "" }, { "docid": "70cca84dd6577fc89b2948f33a19ce96", "score": "0.602765", "text": "function GetRawObject(obj) {\n\tvar theObj;\n\tif (typeof obj == \"string\") {\n\t\tvar isCSS = (document.body && document.body.style) ? true : false;\n\t\tif (isCSS && document.getElementById) {\n\t\t\ttheObj = document.getElementById(obj);\n\t\t} else if (isCSS && document.all) {\n\t\t\ttheObj = document.all(obj);\n\t\t} else if (document.layers) {\n\t\t\ttheObj = SeekLayer(document, obj);\n\t\t}\n\t} else {\n\t\t// pass through object reference\n\t\ttheObj = obj;\n\t}\n\treturn theObj;\n}", "title": "" }, { "docid": "673a5865812f6706e1a3cc69b170a560", "score": "0.5962559", "text": "function O(object) {\r\n return typeof object == \"object\" ? \r\n object : \r\n document.getElementById(object);\r\n}", "title": "" }, { "docid": "50706ef483e1df857b9a77517ce49ef5", "score": "0.59413695", "text": "function getAnElement(object) {\n for (var key in object)\n return object[key];\n return null;\n}", "title": "" }, { "docid": "51002aea5c41cc456601536dc80bb6f9", "score": "0.5904526", "text": "function getValue(object, key){\n var returnKey = object[key]; \n return returnKey; \n}", "title": "" }, { "docid": "e384bdc5ffe911c89afebea1b89214d3", "score": "0.5893165", "text": "function $pick(obj, picked){\n\treturn ($type(obj)) ? obj : picked;\n}", "title": "" }, { "docid": "55965aef4d886d76b98f8b4feef90a52", "score": "0.58861446", "text": "function getFoodPrintItem(obj)\r\n{\r\n\r\n}", "title": "" }, { "docid": "27ecca2c9b2d1fa3ed11ca276579c760", "score": "0.58847547", "text": "function wrap(obj) {\n return obj;\n}", "title": "" }, { "docid": "26033c6a7eb8ceb52b55cafda1421647", "score": "0.5879102", "text": "function toObject(arg){if(arg===null)throw new TypeError('Cannot convert null or undefined to object');if((typeof arg==='undefined'?'undefined':babelHelpers$1['typeof'](arg))==='object')return arg;return Object(arg);}", "title": "" }, { "docid": "7e76721051df44543276e4383412d8dc", "score": "0.58363605", "text": "convertObjectToRawData(obj) {\n return jQuery.param(obj);\n }", "title": "" }, { "docid": "8bfb9184d7181cf67e3545ddcb7136c9", "score": "0.5833538", "text": "function getTheRightObject(object) {\n const gtk = getGtk(object);\n return gtk === object && gtk && toString.call(gtk) === '[object Object]' ?\n toPythonCaseObject(gtk) : gtk;\n }", "title": "" }, { "docid": "6128d6b9fe8411c6eae39018afed4d6c", "score": "0.5828255", "text": "function objectProfile (name, age) {\n return {\n name: name,\n age: age,\n }\n}", "title": "" }, { "docid": "93bc1954b47468f269d5e54c9aefe2bc", "score": "0.58277535", "text": "getObject(objectId) {\n const object = this.updated[objectId] || this.cache[objectId]\n if (!object) throw new RangeError(`Target object does not exist: ${objectId}`)\n return object\n }", "title": "" }, { "docid": "0f1b2d3a9f43a7a15263233d5cff90db", "score": "0.58247286", "text": "function get(object, path) {\n let value = object;\n const components = path.split('.');\n for (let component of components) {\n if (typeof value === 'undefined') {\n return undefined;\n }\n value = value[component];\n }\n return value;\n}", "title": "" }, { "docid": "b8bac59e7c80f87cbb2650451395c4a4", "score": "0.5811971", "text": "function getReqObj(url, obj){\n if(typeof url === 'object') return url;\n else {\n obj = {}\n obj.url = url\n return obj\n }\n}", "title": "" }, { "docid": "55006f0d81db9833f79389b4f2dec512", "score": "0.58067924", "text": "function mortezaFun(morObject) {\n let result = {name: morObject.name, girth: morObject.girth};\n \n return result\n}", "title": "" }, { "docid": "8578697ca3b01c2aa5b802f6560bf4dd", "score": "0.5803222", "text": "function getWrap(object) {\n return typeof object === 'object' &&\n object &&\n hasOwnProperty.call(object, TERCES) ?\n object[TERCES] : object;\n }", "title": "" }, { "docid": "2a473a2b4c2471566c9b2ae10de6dac5", "score": "0.5793335", "text": "function getObj(objId, formId) {\n var fullId = objId;\n if (formId != null && formId.length > 0) {\n fullId = formId + ':' + objId;\n }\n //alert('getting object: ' + fullId);\n var elem = null;\n if (document.getElementById) {\n elem = document.getElementById(fullId);\n } else if (document.all) {\n elem = document.all[fullId];\n } else if (document.layers) {\n elem = document.layers[fullId];\n }\n return elem;\n}", "title": "" }, { "docid": "c1acbd9218e576e596503518435e9157", "score": "0.5787737", "text": "function read (object) {\n if (object && object.isStream) {\n return object.value();\n } else {\n return object;\n }\n }", "title": "" }, { "docid": "9c499ba1686dc9f47f2c0ed5a66a875d", "score": "0.5771631", "text": "function get (object, path) {\n if (path.length === 0) {\n return object\n } else {\n var key = path.shift()\n if (typeof key === 'number') {\n var index = getNth(object, key)\n return get(object[index], path)\n } else {\n return get(object[key], path)\n }\n }\n}", "title": "" }, { "docid": "29190ecc490928df818941e241528f11", "score": "0.5764577", "text": "function getObject(objectId, objects) {\n for (num in objects) {\n if (objectId == objects[num]._id) {\n return objects[num]\n }\n }\n return null\n}", "title": "" }, { "docid": "cc0429a425de31ba99528a47a964b0ca", "score": "0.5759968", "text": "function getObjectProperty(template, parameter)\n{\n if (template[parameter] !== null)\n {\n var arr = template[parameter];\n if (Array.isArray(arr))\n {\n return random(arr);\n }\n else\n {\n return arr;\n }\n }\n}", "title": "" }, { "docid": "400dfd06ad08926a04f088a598b1836b", "score": "0.57574564", "text": "function createObj2(nome, sexo, idade, anoEstudo, raca){\n objeto = {\n nome: nome,\n sexo: sexo,\n idade: idade,\n anoEstudo: anoEstudo,\n raca: raca\n };\n return objeto\n}", "title": "" }, { "docid": "2f0fbf4ce9c81c389a01832d1dbc31b3", "score": "0.57441014", "text": "function getObject(objects, objectName, defaultValue) {\r\n if (objects && objects[objectName]) {\r\n return objects[objectName];\r\n }\r\n return defaultValue;\r\n }", "title": "" }, { "docid": "1a377d3e99737790c696063b5d84c6e8", "score": "0.57371974", "text": "transform(object) {\n return object;\n }", "title": "" }, { "docid": "38aba209ea1cf601bb9796705cb7a301", "score": "0.57316065", "text": "function criar(objecto) {\n //.....\n}", "title": "" }, { "docid": "b95ad99de5bfef30b2fed62bab694cbf", "score": "0.572962", "text": "function returnObjectByName(objectName, context, args) {\n var args = Array.prototype.slice.call(arguments).splice(2);\n var namespaces = objectName.split(\".\");\n var func = namespaces.pop();\n\n for(var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n\n return context[func].apply(this, args);\n}", "title": "" }, { "docid": "805837a59241f09cdb4482b44bd714ee", "score": "0.57257813", "text": "function toObject(arg) {\n\t if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\t\n\t if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n\t return Object(arg);\n\t}", "title": "" }, { "docid": "cbcf23c1ab82e5176b066c31081bbf79", "score": "0.5725671", "text": "function resolve_object(byRefId, obj) {\n\t\tif (obj && obj.constructor && obj.constructor.name === 'Object') {\n\t\t\tconst ret = {};\n\t\t\tfor (let key in obj) {\n\t\t\t\tret[key] = resolve_object(byRefId, obj[key]);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else if (!Array.isArray(obj)) {\n\t\t\treturn resolve_array(byRefId, obj);\n\t\t} else {\n\t\t\treturn resolve_field(byRefId, obj);\n\t\t}\n\t}", "title": "" }, { "docid": "4e3d39f904b52542ed816db7026b6b2d", "score": "0.5719125", "text": "function getValue(object,prop){\nif(!(object&&object[prop])){\nreturn null;\n}\nreturn _.isFunction(object[prop])?object[prop]():object[prop];\n}", "title": "" }, { "docid": "9854fd4bd45b8d4bd79db5962f1dac37", "score": "0.5702407", "text": "function JsonObj(x){return JSON.parse(x);}", "title": "" }, { "docid": "04fff9466299f1e9894469b95e32bd56", "score": "0.57002515", "text": "function showPrice(object)\n{\n return prices.object;\n}", "title": "" }, { "docid": "f74a008bb87f7d77f38cb4197a44c2ec", "score": "0.5688493", "text": "function COPY(object) {\r\n if (object) {\r\n return JSON.parse(JSON.stringify(object));\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "a24ee053774a0addcda7d0ba840deb0c", "score": "0.56799114", "text": "function getObject(objectArray, propertyName, objectProperty) // returns the player object; need to fix if can not find object\n{\n for (index = 0; index < objectArray.length; index = index + 1)\n {\n if (objectArray[index][propertyName] == objectProperty) // not sure how to make property a specification as a function parameter\n {\n return objectArray[index]; // should the objectArray be an array of objects, or a multidimensional array\n }\n }\n}", "title": "" }, { "docid": "5d62edf7ee2d62016c8a8905e794da05", "score": "0.5679694", "text": "function getObject(obj) {\n var theObj = getRawObject(obj);\n if (theObj && isCSS) {\n theObj = theObj.style;\n }\n return theObj;\n}", "title": "" }, { "docid": "5d62edf7ee2d62016c8a8905e794da05", "score": "0.5679694", "text": "function getObject(obj) {\n var theObj = getRawObject(obj);\n if (theObj && isCSS) {\n theObj = theObj.style;\n }\n return theObj;\n}", "title": "" }, { "docid": "5d62edf7ee2d62016c8a8905e794da05", "score": "0.5679694", "text": "function getObject(obj) {\n var theObj = getRawObject(obj);\n if (theObj && isCSS) {\n theObj = theObj.style;\n }\n return theObj;\n}", "title": "" }, { "docid": "2780d283791e5dd38783f881c545f737", "score": "0.5678186", "text": "function getObject(objects, objectName, defaultValue) {\n if (objects && objects[objectName]) {\n return objects[objectName];\n }\n return defaultValue;\n }", "title": "" }, { "docid": "2780d283791e5dd38783f881c545f737", "score": "0.5678186", "text": "function getObject(objects, objectName, defaultValue) {\n if (objects && objects[objectName]) {\n return objects[objectName];\n }\n return defaultValue;\n }", "title": "" }, { "docid": "2780d283791e5dd38783f881c545f737", "score": "0.5678186", "text": "function getObject(objects, objectName, defaultValue) {\n if (objects && objects[objectName]) {\n return objects[objectName];\n }\n return defaultValue;\n }", "title": "" }, { "docid": "2780d283791e5dd38783f881c545f737", "score": "0.5678186", "text": "function getObject(objects, objectName, defaultValue) {\n if (objects && objects[objectName]) {\n return objects[objectName];\n }\n return defaultValue;\n }", "title": "" }, { "docid": "2780d283791e5dd38783f881c545f737", "score": "0.5678186", "text": "function getObject(objects, objectName, defaultValue) {\n if (objects && objects[objectName]) {\n return objects[objectName];\n }\n return defaultValue;\n }", "title": "" }, { "docid": "2780d283791e5dd38783f881c545f737", "score": "0.5678186", "text": "function getObject(objects, objectName, defaultValue) {\n if (objects && objects[objectName]) {\n return objects[objectName];\n }\n return defaultValue;\n }", "title": "" }, { "docid": "502584a3b3edd2170ce4faa6ad3c3489", "score": "0.567293", "text": "function getObject(objectArray, propertyName, objectProperty) // returns the player object; need to fix if can not find object\n{\n for (index = 0; index < objectArray.length; index = index + 1)\n {\n if (objectArray[index][propertyName] == objectProperty) // not sure how to make property a specification as a function parameter\n {\n return objectArray[index]; // should the objectArray be an array of objects, or a multidimensional array\n }\n }\n}", "title": "" }, { "docid": "525619eb0dbb8cb1218c8338ac5d51b8", "score": "0.56619453", "text": "function fetch(object) {\n object.fetch({\n success : function(object) {\n return object;\n },\n error : function(object, error) {\n $(\"#_error\").html(error.message);\n }\n });\n}", "title": "" }, { "docid": "1adda4f441c8315f8a9b462c4967519a", "score": "0.5660931", "text": "objectById(id) {\n return this.world.queryObject({ id, instanceType: DynamicObject })\n }", "title": "" }, { "docid": "a1f4f93d1e4000a63eefe616b4853fc1", "score": "0.5653452", "text": "function copy(obj){\r\n if(obj === undefined){\r\n return undefined;\r\n }\r\n if(typeof obj === \"string\"){\r\n return obj;\r\n } else {\r\n return JSON.parse(JSON.stringify(obj));\r\n }\r\n }", "title": "" }, { "docid": "f1682649c33cb262a778d7c48ab650c3", "score": "0.56470704", "text": "function passObj(objArray) {\n\treturn {'contributions': objArray};\n}", "title": "" }, { "docid": "e7aa69d015418a102f118bbd3f69cb2a", "score": "0.56236404", "text": "getObjectRepresentation() {\n\n \t\tlet retVal = {};\n\n \t\tretVal['id'] = this.id;\n\n \t\treturn retVal;\n \t}", "title": "" }, { "docid": "7f0baea6950e5dbdc6d3c2050e875ba6", "score": "0.5618071", "text": "function getObject(id) {\n return getObjectType(id).then(objectType =>\n execute(\"SELECT fields FROM objects WHERE id=? AND type=?\", [id, objectType])\n .then(result => {\n if (result.rows.length) {\n let object = result.rows[0].fields;\n Object.keys(object).forEach(field => {\n object[field] = JSON.parse(object[field]);\n });\n return object;\n }\n })\n );\n}", "title": "" }, { "docid": "348093625842f70fd4dc34c61b0863ad", "score": "0.56155825", "text": "getObject(arrayOfObject, objectRef) {\n \tfor (let objCollection of arrayOfObject) {\n \t\tif (objCollection[objectRef]) {\n return objCollection;\n \t}\n \t}\n }", "title": "" }, { "docid": "2b644da5435a85a7d04d91e650ec4349", "score": "0.56149733", "text": "function getObj(objId, formId) {\n\tvar fullId = objId;\n\tif (formId != null && formId.length > 0) {\n\t\tfullId = formId + ':' + objId;\n\t}\n\tvar elem = null;\n\tif (document.getElementById) {\n\t\telem = document.getElementById(fullId);\n\t} else if (document.all) {\n\t\telem = document.all[fullId];\n\t} else if (document.layers) {\n\t\telem = document.layers[fullId];\n\t}\n\treturn elem;\n}", "title": "" }, { "docid": "c6d31ee10eb069052fdd2d0731036e78", "score": "0.56071097", "text": "convertToCurrentVersion(object) {\n return object;\n }", "title": "" }, { "docid": "e5f212eed90f6ab5533908e756047635", "score": "0.55884844", "text": "function getPerson() {\n\n return {\n firstname: 'Tony'\n }\n\n}", "title": "" }, { "docid": "8f3c00534a848542bcfe742a3c3aa90b", "score": "0.5587888", "text": "method1() {\n // this here is object1\n }", "title": "" }, { "docid": "def83c384308b425016cdcc8d5ad6183", "score": "0.558305", "text": "function findAge(obj){\n return obj.age;\n}", "title": "" }, { "docid": "e509b3ff3292e8b0a37bd5298b941f49", "score": "0.5576695", "text": "updateObject(id, name, date, contents) {\n return {id: id, name: name, date: date, contents: contents};\n\n }", "title": "" }, { "docid": "b3acbd529ffa06aa79a0f2a1f2fb278e", "score": "0.5571732", "text": "function getE(p){\n if (typeof p == 'object') \n return p\n else\n return document.getElementById(p)\n}", "title": "" }, { "docid": "2c1ee6ee2c36b20f9f41b960f8414ae5", "score": "0.55682206", "text": "function Obj(){}", "title": "" }, { "docid": "6b41395955b75e0b91b9f20f1523e1c2", "score": "0.5561721", "text": "function r(t){return null!==t&&\"object\"==typeof t}", "title": "" }, { "docid": "ca0fcfe664d91e5fc1a3c0dfe4290ae0", "score": "0.5556913", "text": "function createObject() {\n // create a result variable,\n var result = {};\n return result;\n // assign it to a new object\n // return the result variable\n}", "title": "" }, { "docid": "95f9ed21efbb419444e99c9ae3bff2ee", "score": "0.5553405", "text": "function object(o) {\n var obj = {};\n for (var key in o) {\n obj[key] = value(o[key]);\n }\n return obj;\n}", "title": "" }, { "docid": "840ef97648b34e3cdaf6e5ee18b14afb", "score": "0.5552885", "text": "dCreate(obj) {}", "title": "" }, { "docid": "bd14453b88fd13ddf0803068ced43900", "score": "0.55524415", "text": "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "title": "" }, { "docid": "bd14453b88fd13ddf0803068ced43900", "score": "0.55524415", "text": "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "title": "" }, { "docid": "bd14453b88fd13ddf0803068ced43900", "score": "0.55524415", "text": "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "title": "" }, { "docid": "bd14453b88fd13ddf0803068ced43900", "score": "0.55524415", "text": "function toObject(arg) {\n if (arg === null) throw new TypeError('Cannot convert null or undefined to object');\n\n if ((typeof arg === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](arg)) === 'object') return arg;\n return Object(arg);\n}", "title": "" }, { "docid": "3cadb8de895e6098e01d59e4c4e59479", "score": "0.55477756", "text": "function getRep(obj) {\n if (!('rep' in obj)) {\n return obj;\n } else {\n return obj.rep = getRep(obj.rep);\n }\n }", "title": "" }, { "docid": "2f4936e9328990a74f12d14d8e651a0a", "score": "0.5546068", "text": "function objectify(obj) {\n\t return (0, _create2.default)(obj);\n\t }", "title": "" }, { "docid": "75344db182d0065298474d2d2318370a", "score": "0.55443925", "text": "function tmp_object(){}", "title": "" }, { "docid": "75344db182d0065298474d2d2318370a", "score": "0.55443925", "text": "function tmp_object(){}", "title": "" }, { "docid": "75344db182d0065298474d2d2318370a", "score": "0.55443925", "text": "function tmp_object(){}", "title": "" }, { "docid": "75344db182d0065298474d2d2318370a", "score": "0.55443925", "text": "function tmp_object(){}", "title": "" }, { "docid": "5566989b24b833327c734099a9abfad1", "score": "0.5542161", "text": "function getPrice(obj) {\n return obj.price;\n}", "title": "" }, { "docid": "1f1372a9f0580257c3b1bed16891875a", "score": "0.5535814", "text": "function getObjectFromID(id){\n\tvar theObject;\n\tif(document.getElementById)\n\t\ttheObject=document.getElementById(id);\n\telse\n\t\ttheObject=document.all[id];\n\treturn theObject;\n}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.55331475", "text": "get gameObject() {}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.55331475", "text": "get gameObject() {}", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.55331475", "text": "get gameObject() {}", "title": "" }, { "docid": "6c6d737a2710371c94cdb6e3aa3bc4d6", "score": "0.55319244", "text": "function getValue(obj,key) {\n return obj[key]\n}", "title": "" }, { "docid": "4e2b168ac137e42d02e7eb2ed37fcbed", "score": "0.5524131", "text": "function passObj(objArray) {\n\treturn {'works': objArray, 'len':objArray.length};\n}", "title": "" } ]
7b5f791cc04e6fc99632f33001d2d6d0
Returns the last selected element index in the `HostBindingOpCodes` For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only if it changes. This method returns the last index (or '0' if not found.) Selected element index are only the ones which are negative.
[ { "docid": "8725fbb29aa66866d5c53a3b9d0dbc0e", "score": "0.8697368", "text": "function lastSelectedElementIdx(hostBindingOpCodes) {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}", "title": "" } ]
[ { "docid": "aa97a3396d54546ca1a4d9eb38b52327", "score": "0.62695533", "text": "get lastIndex() {\n return this.indexes.length ? Math.max(...this.indexes) : undefined;\n }", "title": "" }, { "docid": "7c91eaef5656d69fe9d8f8f456b64cc5", "score": "0.6256298", "text": "async getFocusedIndex() {\n const focusedInput = await this.getFocusedInput();\n if (focusedInput) {\n return focusedInput.index;\n }\n return undefined;\n }", "title": "" }, { "docid": "3afac868cbcea4b88c34d952d8ad4766", "score": "0.60187405", "text": "function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "3afac868cbcea4b88c34d952d8ad4766", "score": "0.60187405", "text": "function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "3afac868cbcea4b88c34d952d8ad4766", "score": "0.60187405", "text": "function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "3afac868cbcea4b88c34d952d8ad4766", "score": "0.60187405", "text": "function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "3afac868cbcea4b88c34d952d8ad4766", "score": "0.60187405", "text": "function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "3afac868cbcea4b88c34d952d8ad4766", "score": "0.60187405", "text": "function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "9cd1b0c56836209c4bb0c30d822a4445", "score": "0.5999684", "text": "function getBindingRoot() {\n var lFrame = instructionState.lFrame;\n var index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}", "title": "" }, { "docid": "9d9318bb52953be9ff1410317f08d9eb", "score": "0.5977433", "text": "_getLastTriggeredIndex() {\n const index = this.options.toArray().indexOf(this._lastTriggered);\n return index === -1 ? null : index;\n }", "title": "" }, { "docid": "af2ac122a79c3a545b9c5e12ce948fb4", "score": "0.59410155", "text": "function getFocusedOrLastSelectedIndex(selectedRegions, focusedCell) {\n if (selectedRegions.length === 0) {\n return undefined;\n }\n else if (focusedCell != null) {\n return focusedCell.focusSelectionIndex;\n }\n else {\n return selectedRegions.length - 1;\n }\n}", "title": "" }, { "docid": "6d7862c74344c4e364afd9e63c48870d", "score": "0.58724976", "text": "function returnIndex() {\n\t return index - options.infinite || 0;\n\t }", "title": "" }, { "docid": "44b8ecf0c460cc2a267c9de202b87d1d", "score": "0.58573675", "text": "function lastSquareSelected() {\n\t\tif(squareIndexes.length == 0) {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\treturn squareIndexes[squareIndexes.length - 1];\n\t\t}\n\t}", "title": "" }, { "docid": "3696a29b6444a6ea9aa0ef3f08e3a294", "score": "0.58120066", "text": "getLastVisibleIndex() {\n let iv = this.i.k2();\n return (iv);\n }", "title": "" }, { "docid": "f74c1bd1bfe063923472ebd627807bd2", "score": "0.57689154", "text": "function getIndex() {\n\tconst selected = document.querySelector(selectedConversationSelector);\n\tif (!selected) {\n\t\treturn null;\n\t}\n\n\tconst list = [...selected.parentNode.children];\n\n\treturn list.indexOf(selected);\n}", "title": "" }, { "docid": "a9f882f0a47deb34ca7d5bd0325320d4", "score": "0.57493234", "text": "getIndexEndValue() {\n assert(this.endSet_, \"Only valid if end has been set\");\n return this.indexEndValue_;\n }", "title": "" }, { "docid": "a1acd7a0c14f277c6f32dc4e03231b89", "score": "0.5741181", "text": "get lastIndex() {\n // this return the index of last item\n return this.top;\n }", "title": "" }, { "docid": "16b63215b89c1f2a89ae554bb06c98b2", "score": "0.565265", "text": "function RadioGroup_getIndex()\r\n{\r\n var selInd = -1;\r\n\r\n for (var i=0; i < this.radioObject.length; i++)\r\n {\r\n if (this.radioObject[i].checked == true)\r\n {\r\n selInd = i;\r\n break;\r\n }\r\n }\r\n\r\n return selInd;\r\n}", "title": "" }, { "docid": "0be63db4dada744c21ca8fb53ebed9fb", "score": "0.563904", "text": "function getInsertionIndex() {\n var _select3 = select('core/block-editor'),\n getBlockIndex = _select3.getBlockIndex,\n getBlockSelectionEnd = _select3.getBlockSelectionEnd,\n getBlockOrder = _select3.getBlockOrder;\n\n var clientId = ownProps.clientId,\n destinationRootClientId = ownProps.destinationRootClientId,\n isAppender = ownProps.isAppender; // If the clientId is defined, we insert at the position of the block.\n\n if (clientId) {\n return getBlockIndex(clientId, destinationRootClientId);\n } // If there a selected block, we insert after the selected block.\n\n\n var end = getBlockSelectionEnd();\n\n if (!isAppender && end) {\n return getBlockIndex(end, destinationRootClientId) + 1;\n } // Otherwise, we insert at the end of the current rootClientId\n\n\n return getBlockOrder(destinationRootClientId).length;\n }", "title": "" }, { "docid": "001809a9f75da208f8df3553713e0b26", "score": "0.5638384", "text": "lastEmpty() {\n for(let i = 0; i < this.state.data.length; i++) {\n if(this.state.data[i] == null) {\n return i;\n }\n }\n // none of them are null, so return the next index\n return this.state.data.length;\n }", "title": "" }, { "docid": "99113215b2eb8194bc9c0910b425cec5", "score": "0.56346774", "text": "get bottomRowIndex() {\n return INDEX2ROW(getBottom());\n }", "title": "" }, { "docid": "bc5939f521d9e35f3cb33f6e446e0800", "score": "0.5613726", "text": "function getLastClickedIndex(e) {\n\n string = e.toElement.id.replace(\"item\", \"\")\n index = Number(string);\n lastClickedIndex = index;\n\n}", "title": "" }, { "docid": "aaf5a1909b53f946e50f2b8893c62f95", "score": "0.552248", "text": "function getSelectedIndex() {\n let selectedIndex = $('.selected').text();\n return Number(selectedIndex[0]);\n}", "title": "" }, { "docid": "50b083fbafa7e35835b94913675a398c", "score": "0.5509923", "text": "_getNextIndex() {\n if(this.IsFull()) { return -1; }\n\n for (let i = 0; i < this._openNodes.length; i++) {\n if (this._openNodes[i] == false) { \n //console.log(\"_getNextIndex: \" + i);\n return i; \n }\n }\n }", "title": "" }, { "docid": "ecdd66996b1ac79e58284f1df7855757", "score": "0.5464862", "text": "function IDXLAST(xs) {\n return xs.length - 1;\n}", "title": "" }, { "docid": "e2393f8b2c108573bd1c120cf98c1fd4", "score": "0.5449068", "text": "index() {\n return this._index;\n }", "title": "" }, { "docid": "4f6057daf4d571d4975eb769a9d4b884", "score": "0.5399504", "text": "commit() {\n let a = this.firstSelection;\n let b = this.secondSelection;\n if (this.firstSelection === null) {\n a = this.hoverIndex;\n }\n if (this.secondSelection === null) {\n b = this.hoverIndex;\n }\n let min = Math.min(a, b);\n let max = Math.max(a, b);\n let indices = [];\n for (let i = min; i <= max; ++i) {\n indices.push(i);\n }\n this.firstSelection = null;\n this.secondSelection = null;\n return indices;\n }", "title": "" }, { "docid": "c8ea1acb784d894992b056fa00368d29", "score": "0.5384684", "text": "getDemandedIndex() {\n\t}", "title": "" }, { "docid": "05555a04dc9e5eecc10823e4e3ce2cd8", "score": "0.538021", "text": "get selectedIndices() {\n if (!this.view.dbView) {\n return [];\n }\n\n return this.view.dbView.getIndicesForSelection();\n }", "title": "" }, { "docid": "078e2871c212f023ea2ef381659d24f8", "score": "0.5364044", "text": "function lastPointIndex(){\n return this.pointBuffer.length-1\n}", "title": "" }, { "docid": "e05c2d1a4f49e4fead70084668bf5855", "score": "0.53537464", "text": "getValueMaxIndex() {\n return Math.max(...this.values) + 1;\n }", "title": "" }, { "docid": "2030d6986c38d5883f473d6c319777b3", "score": "0.53428614", "text": "function DDLightbarMenu_GetTopItemIdxOfLastPage()\n{\n\tvar numItemsPerPage = this.size.height;\n\tif (this.borderEnabled)\n\t\tnumItemsPerPage -= 2;\n\tvar topItemIndex = this.NumItems() - numItemsPerPage;\n\tif (topItemIndex < 0)\n\t\ttopItemIndex = 0;\n\treturn topItemIndex;\n}", "title": "" }, { "docid": "34b0a344ed1f053c90eac0e79828b5da", "score": "0.5338726", "text": "function getSelectedIndex(element, array) {\r\n\tvar pos = '';\r\n\tfor(var i=0;i<array.length;i++) {\r\n\t\tif(array[i].value == element) {\r\n\t\t\tpos = i;\r\n\t\t}\r\n\t}\r\n\treturn pos;\r\n}", "title": "" }, { "docid": "ac2809004c528e9d2f2be9003d3dd35c", "score": "0.5336435", "text": "get activeCellIndex() {\n if (!this.model) {\n return -1;\n }\n return this.model.cells.length ? this._activeCellIndex : -1;\n }", "title": "" }, { "docid": "60caab75e99e34cba0c6e3645c426294", "score": "0.53323823", "text": "static fetchFreeIndex(){\n\t\t//There are no used indexes yet, so return index 0\n\t\tif ( referenceCount.size === 0){\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet indices = Array.from( referenceCount.keys() );\n\t\t//Sort the usedIndices array ascending (or descending?)\n\t\tindices.sort(function(a, b){return a - b});\n\t\tlet i = 0;\n\t\twhile(indices.includes(i)){\n\t\t\t++i;\n\t\t}\n\t\treturn i;\n\t}", "title": "" }, { "docid": "3ff4ba5618fa3e039cc9ee0d7df33256", "score": "0.53223294", "text": "index() {\n return this.grid.cells.indexOf(this);\n }", "title": "" }, { "docid": "8df6e7945c9126005c7a8c0b1458a5ca", "score": "0.5322091", "text": "function getLastIndex(form) {\n\t\treturn getIndex($(form).find('.fileupload:last'));\n\t}", "title": "" }, { "docid": "91946a3fa275edd5e30f794360f3ded7", "score": "0.53051597", "text": "getSelected (state) {\n return state.selected.length > 0 ? state.selected[state.selected.length - 1] : null\n }", "title": "" }, { "docid": "afaaa1143cf641422e88a232af224210", "score": "0.53021145", "text": "index() {\n return this.#index;\n }", "title": "" }, { "docid": "1b5ba9910edd8e8fea2644586fdd5cdf", "score": "0.5284942", "text": "function stbtt__cff_get_index(b) {\n var start = b.cursor;\n var count = stbtt__buf_get(b, 2);\n if (count) {\n var offsize = stbtt__buf_get8(b);\n stbtt__buf_skip(b, offsize * count);\n stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1);\n }\n return stbtt__buf_range(b, start, b.cursor - start);\n}", "title": "" }, { "docid": "c70a7f3fdeeaf336b6c1b0b3ba0b87c6", "score": "0.52716064", "text": "function getBlockIndex() {\n log.debug(\"CALL: getBlockIndex()\");\n for (var index = 0; index < path.length; index++) {\n if (grid[path[index].x][path[index].y] == null || ( grid[path[index].x][path[index].y].type == 'ex' && avoidExit)) {\n log.debug(\"RESULT: getBlockIndex() \" + index);\n return index;\n }\n }\n for (var i = 0; i < path.length; i++) {\n for (var j = i; j < path.length; j++) {\n if (i == j) continue;\n if (path[i].x == path[j].x && path[i].y == path[j].y) {\n return j;\n }\n }\n }\n\n log.debug(\"RESULT: getBlockIndex() -1\");\n return -1;\n }", "title": "" }, { "docid": "53997376973471605f6e2a6a9c34f917", "score": "0.5271434", "text": "getIndex() {\n return this.index;\n }", "title": "" }, { "docid": "333b146eaf0ab14f97bf5b578fe6e6f2", "score": "0.5262677", "text": "FindLastIndex(...args) {\n\t\tlet match;\n\t\tlet startIndex = 0;\n\t\tlet count = this.CountNative - startIndex;\n\n\t\tif (args.length === 1) {\n\t\t\t[match] = args;\n\t\t} else if (args.length === 2) {\n\t\t\t[startIndex, match] = args;\n\t\t\tcount = this.CountNative - startIndex;\n\t\t} else if (args.length === 3) {\n\t\t\t[startIndex, count, match] = args;\n\t\t} else {\n\t\t\tthrow new Error(\"Wrong number of arguments\");\n\t\t}\n\n\t\tif (startIndex < 0 || count < 0 || startIndex + count > this.CountNative)\n\t\t\tthrow new Error(\"Not a valid range\");\n\n\t\tlet last_i = -1;\n\t\tfor (let i = startIndex; i < startIndex + count; i++) {\n\t\t\tif (match(this._data[i])) last_i = i;\n\t\t}\n\t\treturn last_i;\n\t}", "title": "" }, { "docid": "6ee92402c7f8679c983df79c25359e04", "score": "0.5252172", "text": "getColumnIndex(): number {\n const { row, cell } = this;\n const cells = row.nodes;\n\n return cells.findIndex(x => x === cell);\n }", "title": "" }, { "docid": "1a948cd510a7025c18e1c0ae22371d11", "score": "0.52485704", "text": "function lastIndex() {\n const defaultEnd = (page * itemsPerPage);\n const dynamicEnd = (list.length);\n if (dynamicEnd < defaultEnd) {\n return dynamicEnd\n } else {\n return defaultEnd\n }\n }", "title": "" }, { "docid": "065abd7e90165b9d15da444ae17f1a4a", "score": "0.52198195", "text": "last () {\n var len = this.len()\n return this.at(len - 1)\n }", "title": "" }, { "docid": "69a924da4d64990b3e9407b215f648b4", "score": "0.52168304", "text": "getCurrentIndex() {\n return this.currentIndex;\n }", "title": "" }, { "docid": "6bed7f6cc3388d01fce427901bdb3758", "score": "0.5196657", "text": "getFirstLastIndexes() {\n let firstRowIndex = 0;\n let endIndex = this.count;\n\n if (this.options.scrollbarV) {\n firstRowIndex = Math.max(Math.floor((\n this.options.internal.offsetY || 0) / this.options.rowHeight, 0), 0);\n endIndex = Math.min(firstRowIndex + this.options.paging.size, this.count);\n } else if (this.options.paging.mode === 'external') {\n firstRowIndex = Math.max(this.options.paging.offset * this.options.paging.size, 0);\n endIndex = Math.min(firstRowIndex + this.options.paging.size, this.count);\n }\n\n return {\n first: firstRowIndex,\n last: endIndex,\n };\n }", "title": "" }, { "docid": "5b8e81b4f4b34ca08bb3e48aa2b46e65", "score": "0.5186027", "text": "function getIndex(){\r\n return index;\r\n}", "title": "" }, { "docid": "a1706d66a4f95c1109c6f248c9cb3d35", "score": "0.51846087", "text": "get targetIndex() {\n return this.i.b;\n }", "title": "" }, { "docid": "0397bb32c3fafe9ec986420433967c3d", "score": "0.5170965", "text": "function stackIndex(p) {\n return stack.index(p);\n }", "title": "" }, { "docid": "fc170a614c4cb745bb1073f99c1e9e5d", "score": "0.516874", "text": "getPrevCanvasGroupIndex() {\n if (!this.isWithinBounds(this.currentCanvasGroupIndex - 1)) {\n return -1;\n }\n this.currentCanvasGroupIndex--;\n return this.currentCanvasGroupIndex;\n }", "title": "" }, { "docid": "a8ae34e6a313b27042caaaab6dec9799", "score": "0.51678056", "text": "get defaultIndex() {\r\n return this._defaultIndex;\r\n }", "title": "" }, { "docid": "c86cc3615c908e62f84f32c2e82a4736", "score": "0.51650053", "text": "LastIndexOf(item, index = 0, count = this.CountNative - index) {\n\t\tif (index < 0 || count < 0 || index + count > this.CountNative)\n\t\t\tthrow new Error(\"Not a valid range\");\n\n\t\tlet foundInd = -1;\n\t\tfor (let i = index; i < index + count; i++) {\n\t\t\tif (this._comparer(item, this._data[i]) === 0) foundInd = i;\n\t\t}\n\t\treturn foundInd;\n\t}", "title": "" }, { "docid": "f10caab74a50e01a3629e4089c2ce260", "score": "0.51632756", "text": "function lastIndexOf(arr, elt, start = arr.length) {\n\tfor (let i = start - 1; i >= 0; i--) {\n\t\tif (arr[i] === elt) {\n\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}\n}", "title": "" }, { "docid": "15ea13ab326d11af7df0ea3b5d3dcab1", "score": "0.51594615", "text": "get selectionEnd() {\n return this[inputDelegate].selectionEnd;\n }", "title": "" }, { "docid": "e21ca67fcdc62ec1f44d31dcf1cec56a", "score": "0.51563966", "text": "get focusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : 0;\n }", "title": "" }, { "docid": "e21ca67fcdc62ec1f44d31dcf1cec56a", "score": "0.51563966", "text": "get focusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : 0;\n }", "title": "" }, { "docid": "3bce9bee0b6cfc7b8bea6a7c55bb5320", "score": "0.5147873", "text": "static getElIndex(element) {\n let i;\n for (i = 0; element = element.previousElementSibling; i++);\n return i;\n }", "title": "" }, { "docid": "d0155dcc63d68ac751e05c9dc46d0c16", "score": "0.5141876", "text": "get_index(e) {\n var index;\n index = e.target.parentElement.parentElement.id;\n return index;\n }", "title": "" }, { "docid": "08be84db95937e47796a9d86f120f9e1", "score": "0.51390046", "text": "async getCurrentIndex() {\n return this._currentIndex;\n }", "title": "" }, { "docid": "dda37541ca3fff4fba44773b80ee4997", "score": "0.51375026", "text": "function selectedCompletionIndex(state) {\n var _a\n let open =\n (_a = state.field(completionState, false)) === null || _a === void 0\n ? void 0\n : _a.open\n return open && !open.disabled && open.selected >= 0 ? open.selected : null\n }", "title": "" }, { "docid": "a63b0fd378ae16d1512c0c1f347fec20", "score": "0.51358664", "text": "cursorIndex(){\n if (this.cursorContainer && this.cursorX && this.cursorY && !this.lockPosition){\n return this.cursorContainer.getIndex(this.cursorX,this.cursorY)\n }\n return null\n }", "title": "" }, { "docid": "d30d31a01475fe1338ede5a4ba974d0d", "score": "0.51347613", "text": "function getIndex(e) {\n\n string = e.toElement.id.replace(\"item\", \"\")\n index = Number(string);\n\n\n return index\n\n}", "title": "" }, { "docid": "56ed522ea2f8369e0e5f3b73f1fa36ad", "score": "0.5131801", "text": "function GetIndex(element) {\n //I am passing a piece of structure (i.e a button) and trying to get some data out \n let taskId = GetTaskId(element);\n\n //Get a reference to local storage\n let tasks = GetLocalStorage();\n\n //findIndex is a built-in JS function that returns the 0 based position in the array\n return tasks.findIndex(t => t.id == taskId);\n}", "title": "" }, { "docid": "8cd6bd28f3589b32015b14ac12d0ada3", "score": "0.51251817", "text": "get defaultIndex() {\n return this._defaultIndex;\n }", "title": "" }, { "docid": "d12dfd63d5ba1cdf09ac7866f684c0ce", "score": "0.51232594", "text": "getIndex() {\n return this.index;\n }", "title": "" }, { "docid": "d4db9ceb1d3c929c520aceb3ed419e47", "score": "0.51202536", "text": "focusedTabIndex() {\n\t\tvar index = this.tabs.findIndex(function(tab) {\n\t\t\treturn tab === document.activeElement;\n\t\t});\n\n\t\treturn (index === -1) ? 0 : index;\n\t}", "title": "" }, { "docid": "4bb2d4b57910dfa655050b8f37c25b48", "score": "0.5112723", "text": "getIndexes() {\n return this.children.map(child => child.currentIndex);\n }", "title": "" }, { "docid": "820389c732523a4ca929b42f63b37f7d", "score": "0.51116955", "text": "selectedIndex() {\n return __WEBPACK_IMPORTED_MODULE_4_lodash___default.a.findIndex(this.processedOptions, { id: this.value });\n }", "title": "" }, { "docid": "d633ec52de2b8590a62ee555bb6584e3", "score": "0.51113874", "text": "last() {\n return Array.from(this.values())[Array.from(this.values()).length - 1]\n }", "title": "" }, { "docid": "8c207f717ade98dc38b3c2715bc48063", "score": "0.5111294", "text": "findBoxArrayIndex(box){\n var arrayIndex;\n for (var i=0; i < this.state.boxes.length; i++) {\n if (this.state.boxes[i].boxIndex === box.boxIndex) {\n arrayIndex = i;\n break;\n }\n }\n\n return arrayIndex;\n }", "title": "" }, { "docid": "74ffd9d345f28e4f1b775767ee640474", "score": "0.5109164", "text": "get defaultLayerIndex() {\n if (this.layerCollection.count === 0 || this.defLayerIndex === -1) {\n let layer = this.layerCollection.add();\n this.defLayerIndex = this.layerCollection.indexOf(layer);\n }\n return this.defLayerIndex;\n }", "title": "" }, { "docid": "ea1d7078c5d67cfad412f9850699aacd", "score": "0.5089172", "text": "getPushedNumber() {\n return this.stackAsArray[this.stackAsArray.length - 1];\n }", "title": "" }, { "docid": "d17f3e3bd78b72a4d140d32e725121d8", "score": "0.50879294", "text": "function processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null)\n return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n }\n else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(2 /* Update */, context);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n }\n}", "title": "" }, { "docid": "d17f3e3bd78b72a4d140d32e725121d8", "score": "0.50879294", "text": "function processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null)\n return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n }\n else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(2 /* Update */, context);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n }\n}", "title": "" }, { "docid": "d17f3e3bd78b72a4d140d32e725121d8", "score": "0.50879294", "text": "function processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null)\n return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n }\n else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(2 /* Update */, context);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n }\n}", "title": "" }, { "docid": "d17f3e3bd78b72a4d140d32e725121d8", "score": "0.50879294", "text": "function processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null)\n return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n }\n else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(2 /* Update */, context);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n }\n}", "title": "" }, { "docid": "c630ba69d58c263ca7fb42f7e1db0340", "score": "0.5087826", "text": "getIndexes() {\n return this.children.map(child => child.data.currentIndex);\n }", "title": "" }, { "docid": "23853c43d05cfcdc0aafcbb2da31ec5c", "score": "0.50757986", "text": "function getSelectedIndex(){\n\t//create an array of all the input elements\n\tvar inputElements = document.getElementsByClassName('savedProjects');\n\n\t//find the selected project by looping until one is checked\n\tfor(var i=0; inputElements[i]; ++i){\n\t\tif(inputElements[i].checked){\n \tvar selectedProjectNumber = i;\n \tbreak;\n \t}\n\t}\n\n\t//return the selected project index\n\treturn selectedProjectNumber;\n}", "title": "" }, { "docid": "2e08625b1b46b57e51fe2aea0a674ddb", "score": "0.5075455", "text": "function last(selector) {\n\tvar all = document.querySelectorAll(selector);\n\tvar length = all.length;\n\treturn all[length - 1];\n}", "title": "" }, { "docid": "0dc64e7f546076d510f82f8b9464022f", "score": "0.5073244", "text": "function getNewSel( index ){\n\t\t\t\tpreSel\t = toDeleteArr[index]-1;\n\t\t\t\tpreIndex = index - 1;\n\t\t\t\t\n\t\t\t\tif( preIndex < 0 ){ return 0; }\n\t\t\t\t\n\t\t\t\tif( toDeleteArr[preIndex] != preSel )\n\t\t\t\t\treturn preSel;\n\t\t\t\telse\n\t\t\t\t\treturn getNewSel( preIndex );\n\t\t\t}", "title": "" }, { "docid": "78208346416f233c48320b44a1e4aa69", "score": "0.50714", "text": "_getCurrIndex() {\n for (let [index, node] of this._slides.entries()) {\n if (node === this._currentSlide) {\n return index;\n }\n }\n }", "title": "" }, { "docid": "0f2202320bffa79068565bcffe862394", "score": "0.50583047", "text": "function findLastIndex(arr, fn) {\n\tfor (let i = arr.length - 1; i >= 0; --i) {\n\t\tif (fn(arr[i])) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "b9c407571be217a6b3f06f9941c8b534", "score": "0.50545573", "text": "get _firstVisibleIndex() {\n var firstVisible = this._rows.firstChild;\n if (!firstVisible || !firstVisible.hasAttribute(\"index\")) {\n return Number.NEGATIVE_INFINITY;\n }\n return parseInt(firstVisible.getAttribute(\"index\"), 10);\n }", "title": "" }, { "docid": "be09197b2a98c0aaea4a562172a22831", "score": "0.5053897", "text": "function getPlaceholderIndex() {\n return Array.prototype.indexOf.call(listNode.children, placeholderNode);\n }", "title": "" }, { "docid": "be09197b2a98c0aaea4a562172a22831", "score": "0.5053897", "text": "function getPlaceholderIndex() {\n return Array.prototype.indexOf.call(listNode.children, placeholderNode);\n }", "title": "" }, { "docid": "e07f3c35a32efa0a5147175cff266a5d", "score": "0.5042031", "text": "getFirstVisibleIndex() {\n let iv = this.i.ky();\n return (iv);\n }", "title": "" }, { "docid": "5916f68379bc8dfb721de49967e36cbc", "score": "0.50418025", "text": "get () {\n return this._index\n }", "title": "" }, { "docid": "fc750066d1e13d37d302f8a2e82e39e0", "score": "0.5039415", "text": "function getPlaceholderIndex() {\r\n return Array.prototype.indexOf.call(listNode.children, placeholderNode);\r\n }", "title": "" }, { "docid": "75e94dc4dca89b490329cb7240516cf6", "score": "0.5029925", "text": "get expandedIndexes() {\n\t\treturn this.nativeElement ? this.nativeElement.expandedIndexes : undefined;\n\t}", "title": "" }, { "docid": "c59117e33bd6deb6834b7f5d19dc024f", "score": "0.5025802", "text": "function getPrev(ind) {\n return (ind > 0) ? --ind : $scope.items.length - 1;\n }", "title": "" }, { "docid": "c59117e33bd6deb6834b7f5d19dc024f", "score": "0.5025802", "text": "function getPrev(ind) {\n return (ind > 0) ? --ind : $scope.items.length - 1;\n }", "title": "" }, { "docid": "52e3195b7357817d4b46ffe301c87c8b", "score": "0.50158477", "text": "last() { return this.#last; }", "title": "" }, { "docid": "086af8e352d2ee6d2d5e459227a56158", "score": "0.5015796", "text": "_getOptionIndex(option) {\n return this.options.reduce((result, current, index) => {\n if (result !== undefined) {\n return result;\n }\n return option === current ? index : undefined;\n }, undefined);\n }", "title": "" }, { "docid": "5127943cfc7676273720e56e53af46f3", "score": "0.49864632", "text": "getLastBlock() {\n return this.chain[this.chain.length - 1];\n }", "title": "" }, { "docid": "92954ce4b96bffd24fe093a260a45b64", "score": "0.49850458", "text": "get index() {\n\n // Check if the face is bound to a mesh and if not throw an error\n if (!this.mesh) throw new Error(`Cannot compute the index - the face is not bound to a Mesh`);\n\n // Return the index of the face in the faces\n return Number(this.mesh.faces.findIndex(face => face.equals(this)));\n }", "title": "" } ]
9fda656924a60682590c7f281031607d
Returns the caret (cursor) position of the specified text field. Return value range is 0oField.value.length.
[ { "docid": "69d013ac508f04343a37e155437ccd32", "score": "0.80857897", "text": "function doGetCaretPosition (oField) {\n\tvar iCaretPos = 0;\n try{\n\t \t// IE Support\n\t\tif (document.selection) {\n\t\t // Set focus on the element\n\t\t oField.focus ();\n\n\t\t // To get cursor position, get empty selection range\n\t\t var oSel = document.selection.createRange ();\n\n\t\t // Move selection start to 0 position\n\t\t oSel.moveStart ('character', -oField.value.length);\n\n\t\t // The caret position is selection length\n\t\t iCaretPos = oSel.text.length;\n\t\t}\n\t\t// Firefox support\n\t\telse if (oField.selectionStart || oField.selectionStart == '0'){\n\t\t\tiCaretPos = oField.selectionStart;\n\t\t}\n\t}catch(error){\n\t\tiCaretPos = 0;\n\t}\n \treturn (iCaretPos);\n}", "title": "" } ]
[ { "docid": "fa5f994210848929c367e514be705670", "score": "0.8301414", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n\n if (document.selection) {\n oField.focus();\n var oSel = document.selection.createRange();\n oSel.moveStart('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n\n return iCaretPos;\n }", "title": "" }, { "docid": "086d68325484a385fb95348cc20cf5d3", "score": "0.8261648", "text": "function getCaretPosition(oField) {\n // Initialize\n var iCaretPos = 0; // IE Support\n\n if (document.selection) {\n // Set focus on the element\n oField.focus(); // To get cursor position, get empty selection range\n\n var oSel = document.selection.createRange(); // Move selection start to 0 position\n\n oSel.moveStart('character', -oField.value.length); // The caret position is selection length\n\n iCaretPos = oSel.text.length;\n } // Firefox support\n else if (oField.selectionStart || oField.selectionStart == '0') iCaretPos = oField.selectionDirection == 'backward' ? oField.selectionStart : oField.selectionEnd; // Return results\n\n\n return iCaretPos;\n}", "title": "" }, { "docid": "61664ad432d8a9010cef20d442068d1c", "score": "0.82544625", "text": "function doGetCaretPosition (oField) {\n\n // Initialize\n var iCaretPos = 0;\n\n // IE Support\n if (document.selection) {\n\n // Set focus on the element\n oField.focus();\n\n // To get cursor position, get empty selection range\n var oSel = document.selection.createRange();\n\n // Move selection start to 0 position\n oSel.moveStart('character', -oField.value.length);\n\n // The caret position is selection length\n iCaretPos = oSel.text.length;\n }\n\n // Firefox support\n else if (oField.selectionStart || oField.selectionStart == '0')\n iCaretPos = oField.selectionStart;\n\n // Return results\n return iCaretPos;\n}", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1d04cb6c2c7a3802c767e2c06898f672", "score": "0.82477856", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "1ec2de427b85e1a88e1a2752d946e4da", "score": "0.823403", "text": "function getCaretPosition(oField) {\n // Initialize\n var iCaretPos = 0;\n\n // IE Support\n if (document.selection) {\n\n // Set focus on the element\n oField.focus();\n\n // To get cursor position, get empty selection range\n var oSel = document.selection.createRange();\n\n // Move selection start to 0 position\n oSel.moveStart('character', -oField.value.length);\n\n // The caret position is selection length\n iCaretPos = oSel.text.length;\n }\n\n // Firefox support\n else if (oField.selectionStart || oField.selectionStart == '0')\n iCaretPos = oField.selectionStart;\n\n // Return results\n return iCaretPos;\n}", "title": "" }, { "docid": "c145fd668ab447ba2f7718bb3f0e01b7", "score": "0.82286847", "text": "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus();\n var oSel = document.selection.createRange();\n oSel.moveStart('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "title": "" }, { "docid": "ceb28cdb2f3b5498973b9a0038661388", "score": "0.8208223", "text": "function GetCaretPosition (oField) {\n\n // Initialize\n var iCaretPos = 0;\n\n // IE Support\n if (document.selection) { \n\n // Set focus on the element\n oField.focus ();\n\n // To get cursor position, get empty selection range\n var oSel = document.selection.createRange ();\n\n // Move selection start to 0 position\n oSel.moveStart ('character', -oField.value.length);\n\n // The caret position is selection length\n iCaretPos = oSel.text.length;\n }\n\n // Firefox support\n else if (oField.selectionStart || oField.selectionStart == '0')\n iCaretPos = oField.selectionStart;\n\n // Return results\n return (iCaretPos);\n}", "title": "" }, { "docid": "f204b32a6bdbdaa144d1b3dfd63def63", "score": "0.81945217", "text": "function doGetCaretPosition(oField) {\r\n var iCaretPos = 0;\r\n if (document.selection) {\r\n oField.focus ();\r\n var oSel = document.selection.createRange();\r\n oSel.moveStart ('character', -oField.value.length);\r\n iCaretPos = oSel.text.length;\r\n } else if (oField.selectionStart || oField.selectionStart == '0') {\r\n iCaretPos = oField.selectionStart;\r\n }\r\n return (iCaretPos);\r\n }", "title": "" }, { "docid": "f204b32a6bdbdaa144d1b3dfd63def63", "score": "0.81945217", "text": "function doGetCaretPosition(oField) {\r\n var iCaretPos = 0;\r\n if (document.selection) {\r\n oField.focus ();\r\n var oSel = document.selection.createRange();\r\n oSel.moveStart ('character', -oField.value.length);\r\n iCaretPos = oSel.text.length;\r\n } else if (oField.selectionStart || oField.selectionStart == '0') {\r\n iCaretPos = oField.selectionStart;\r\n }\r\n return (iCaretPos);\r\n }", "title": "" }, { "docid": "55e78b89c0ca0c89b011d0b9e00bb881", "score": "0.775774", "text": "function getCaretPosition(textField) {\n var pos = 0;\n if (document.selection) {\n // Older versions of IE.\n textField.focus();\n var sel = document.selection.createRange();\n sel.moveStart('character', -textField.value.length);\n pos = sel.text.length;\n } else if (typeof textField.selectionStart === 'number') {\n pos = textField.selectionStart;\n }\n return pos;\n}", "title": "" }, { "docid": "e86d713ea6033911abab57d9930ca318", "score": "0.74396574", "text": "function getCaretPosition() {\n var input = iElement[0]; // we need to go under jqlite\n\n // IE support\n if (document.selection) {\n var range = document.selection.createRange();\n range.moveStart('character', -iElement.val().length);\n return range.text.length;\n } else {\n return input.selectionStart;\n }\n }", "title": "" }, { "docid": "3d09f5a4c77d6524776b6adccf4d3fe7", "score": "0.7378231", "text": "function getCaretPosition() {\n var caretPos = 0;\n \n if (document.selection) {\n //Internet Explorer\n var selectionRange;\n\n element.focus();\n \n selectionRange = document.selection.createRange();\n selectionRange.moveStart ('character', -element.val().length);\n \n caretPos = selectionRange.text.length;\n }\n else if (element[0].selectionStart || element[0].selectionStart == '0')\n //Mozilla-based Browser\n caretPos = element[0].selectionStart;\n \n return caretPos;\n }", "title": "" }, { "docid": "08deb3be2f9f9ff537a38a99f99e6f21", "score": "0.7120126", "text": "getCaretPosition() {\n if (!this.element().hasFocus()) {\n return -1;\n }\n const selection = this.element().getComponentSelection();\n if (!selection || selection.rangeCount === 0 || !selection.isCollapsed) {\n return -1;\n }\n const selectionRange = selection.getRangeAt(0);\n if (selectionRange.startOffset !== selectionRange.endOffset) {\n return -1;\n }\n return selectionRange.startOffset;\n }", "title": "" }, { "docid": "b5df985c6bb0c307b246ec76c61e1cee", "score": "0.709994", "text": "function doGetCaretPosition( textbox )\n{\n var nCaretPos = 0; // initialize\n\n if ( document.selection ) // IE Support\n {\n // Set focus on the element\n textbox.focus( );\n\n // To get cursor position, get empty selection range\n var oSel = document.selection.createRange( );\n // var oSelLth = document.selection.createRange().text.length;\n\n // Move selection start to 0 position\n oSel.moveStart( 'character', -textbox.value.length );\n\n // The caret position is selection length\n nCaretPos = oSel.text.length; // - oSelLth;\n }\n else // Firefox support\n {\n if ( textbox.selectionStart || textbox.selectionStart == '0' )\n nCaretPos = textbox.selectionStart;\n }\n\n return( nCaretPos ); // result\n}", "title": "" }, { "docid": "242ee9fa72ca9877c2291f5ff4e96419", "score": "0.7094101", "text": "function getCaretPosition(ctl){\n\t\tvar res = {begin: 0, end: 0 };\n\t\tif (ctl.setSelectionRange){\n\t\t\tres.begin = ctl.selectionStart;\n\t\t\tres.end = ctl.selectionEnd;\n\t\t}else if (document.selection && document.selection.createRange){\n\t\t\tvar range = document.selection.createRange();\t\t\t\n\t\t\tres.begin = 0 - range.duplicate().moveStart('character', -100000);\n\t\t\tres.end = res.begin + range.text.length;\n\t\t}\n\t\treturn res;\n\t}", "title": "" }, { "docid": "338376251df4353ec215bc66261823de", "score": "0.7082302", "text": "function getCaretPosition(ctl) {\n var res = {begin: 0, end: 0};\n if (ctl.setSelectionRange) {\n res.begin = ctl.selectionStart;\n res.end = ctl.selectionEnd;\n } else if (document.selection && document.selection.createRange) {\n var range = document.selection.createRange();\n res.begin = 0 - range.duplicate().moveStart('character', -100000);\n res.end = res.begin + range.text.length;\n }\n return res;\n }", "title": "" }, { "docid": "0851515467753f9980fe224e3a640eb2", "score": "0.7015851", "text": "function getCaretPosition (ctrl) {\n if (document.selection) {\n ctrl.focus();\n var range = document.selection.createRange();\n var rangelen = range.text.length;\n range.moveStart ('character', -ctrl.value.length);\n var start = range.text.length - rangelen;\n return {'start': start, 'end': start + rangelen };\n } else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\n return {'start': ctrl.selectionStart, 'end': ctrl.selectionEnd };\n } else {\n return {'start': 0, 'd': 0};\n }\n}", "title": "" }, { "docid": "5228d17829baf453dbdb0157a434bdc0", "score": "0.6975307", "text": "function getCaretRangePosition(ctrl) {\r\n var ctrlType = [];\r\n if ($(ctrl).prop('type') != undefined && $(ctrl).prop('type') != \"text\") {\r\n ctrlType.push($(ctrl).prop('type'));\r\n $(ctrl).prop('type', 'text');\r\n }\r\n\r\n CaretPos = 0; // IE Support\r\n if (document.selection) {\r\n ctrl.focus();\r\n var Sel = document.selection.createRange();\r\n var length = Sel.text.length;\r\n Sel.moveStart('character', -ctrl.value.length);\r\n CaretPos = Sel.text.length;\r\n if (CaretPos != Sel.text.length + length) {\r\n CaretPos = { 'start': CaretPos - length, 'end': CaretPos };\r\n } else {\r\n CaretPos = { 'start': CaretPos, 'end': Sel.text.length + length };\r\n }\r\n }\r\n // Firefox support\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0')\r\n CaretPos = { 'start': ctrl.selectionStart, 'end': ctrl.selectionEnd };\r\n\r\n if (ctrlType.length > 0) {\r\n var type = ctrlType.pop();\r\n $(ctrl).prop('type', type);\r\n }\r\n return (CaretPos);\r\n}", "title": "" }, { "docid": "f4c88a1e6f438ac1a869890f34551f56", "score": "0.69384056", "text": "function getCaretPosition (ctrl) \r\n{\r\n\tvar CaretPos = 0;\t// IE Support\r\n\tif (document.selection) \r\n\t{\r\n\t\tctrl.focus();\r\n\t\tvar Sel = ctrl.document.selection.createRange();\r\n\t\tSel.moveStart ('character', -ctrl.value.length);\r\n\t\tCaretPos = Sel.text.length;\r\n\t}\r\n\t// Firefox support\r\n\telse if (ctrl.selectionStart || ctrl.selectionStart == '0')\r\n\t{\r\n\t\tCaretPos = ctrl.selectionStart;\r\n\t}\r\n\treturn (CaretPos);\r\n}", "title": "" }, { "docid": "571a136937dd70b713da52072f8e27c6", "score": "0.68984956", "text": "function getCaret(object) {\n object = getObject(object);\n if (object == null || !object.type) {\n return null;\n }\n try {\n if (object.createTextRange && object.caret) {\n var range = object.caret.duplicate();\n range.moveStart('textedit', -1);\n return range.text.length;\n } else if (object.selectionStart || object.selectionStart == 0) {\n return object.selectionStart;\n }\n } catch (e) {\n }\n return null;\n}", "title": "" }, { "docid": "74438cc77eefeeb305809507bbbd8308", "score": "0.68901646", "text": "function getCaretPosition(ctrl) {\n var caretPos = 0;\n if (document.selection) {\n // IE Support\n ctrl.focus();\n var sel = document.selection.createRange();\n sel.moveStart('character', -ctrl.value.length);\n caretPos = sel.text.length;\n } else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\n // Firefox support\n caretPos = ctrl.selectionStart;\n }\n return caretPos;\n}", "title": "" }, { "docid": "b503b19ab858ee2fd5c944065bcf868a", "score": "0.68789595", "text": "function getCaretPosition(txtarea)\n{\n\tvar caretPos = new caretPosition();\n\t\n\t// simple Gecko/Opera way\n\tif(txtarea.selectionStart || txtarea.selectionStart == 0)\n\t{\n\t\tcaretPos.start = txtarea.selectionStart;\n\t\tcaretPos.end = txtarea.selectionEnd;\n\t}\n\t// dirty and slow IE way\n\telse if(document.selection)\n\t{\n\t\t// get current selection\n\t\tvar range = document.selection.createRange();\n\n\t\t// a new selection of the whole textarea\n\t\tvar range_all = document.body.createTextRange();\n\t\trange_all.moveToElementText(txtarea);\n\t\t\n\t\t// calculate selection start point by moving beginning of range_all to beginning of range\n\t\tvar sel_start;\n\t\tfor (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)\n\t\t{\t\t\n\t\t\trange_all.moveStart('character', 1);\n\t\t}\n\t\n\t\ttxtarea.sel_start = sel_start;\n\t\n\t\t// we ignore the end value for IE, this is already dirty enough and we don't need it\n\t\tcaretPos.start = txtarea.sel_start;\n\t\tcaretPos.end = txtarea.sel_start;\n\t}\n\n\treturn caretPos;\n}", "title": "" }, { "docid": "add8f49a8eb50a11f4512bd7ee09605a", "score": "0.6764663", "text": "function AIP_getCursorPosition(control)\n\t{\n\t\tvar selection, rng, r2, i=-1;\n\t\t//IE\n\t\tif(document.selection && control.createTextRange) \n\t\t{\n\t\t\tselection=document.selection;\n\t\t\tif(selection)\n\t\t\t{\n\t\t\t\tr2=selection.createRange();\n\t\t\t\trng=control.createTextRange();\n\t\t\t\trng.setEndPoint(\"EndToStart\", r2);\n\t\t\t\ti=rng.text.length;\n\t\t\t}\n\t\t}\n\t\t//MOZILLA/NETSCAPE support\n\t\telse \n\t\t{\n\t\t\ti = control.selectionStart;\n\t\t}\n\t\treturn i;\n\t}", "title": "" }, { "docid": "a1db9e589494237f02a23a28ea809d81", "score": "0.6756336", "text": "function caretPos(el) {\n\t\tif (\"selection\" in document) {\n\t\t\tvar range = el.createTextRange();\n\t\t\ttry {\n\t\t\t\trange.setEndPoint(\"EndToStart\", document.selection.createRange());\n\t\t\t} catch (e) {\n\t\t\t\t// Catch IE failure here, return 0 like\n\t\t\t\t// other browsers\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn range.text.length;\n\t\t} else if (el.selectionStart != null) {\n\t\t\treturn el.selectionStart;\n\t\t}\n\t}", "title": "" }, { "docid": "d3259c46674bde8557100d4a0fec52e4", "score": "0.6696177", "text": "function getCaret(el) {\n if (el.selectionStart) {\n return el.selectionStart;\n } else if (document.selection) {\n el.focus();\n\n var r = document.selection.createRange();\n if (r == null) {\n return 0;\n }\n\n var re = el.createTextRange(),\n rc = re.duplicate();\n re.moveToBookmark(r.getBookmark());\n rc.setEndPoint('EndToStart', re);\n\n return rc.text.length;\n }\n return 0;\n}", "title": "" }, { "docid": "1f267aa80835d30fbedb63eebbe5c3b4", "score": "0.66784304", "text": "function getCaret(element) {\n if (element.selectionStart)\n return element.selectionStart;\n\n else if (document.selection) //IE specific\n {\n element.focus();\n\n var r = document.selection.createRange();\n if (r == null)\n return 0;\n\n var re = element.createTextRange(),\n\t\t\trc = re.duplicate();\n re.moveToBookmark(r.getBookmark());\n rc.setEndPoint('EndToStart', re);\n return rc.text.length;\n }\n\n return 0;\n }", "title": "" }, { "docid": "0d7b41c1eb76119c99be6dadbedb5baa", "score": "0.6567945", "text": "function getCaretStart(obj){\n\tif(typeof obj.selectionStart != \"undefined\"){\n\t\treturn obj.selectionStart;\n\t}else if(document.selection&&document.selection.createRange){\n\t\tvar M=document.selection.createRange();\n\t\ttry{\n\t\t\tvar Lp = M.duplicate();\n\t\t\tLp.moveToElementText(obj);\n\t\t}catch(e){\n\t\t\tvar Lp=obj.createTextRange();\n\t\t}\n\t\tLp.setEndPoint(\"EndToStart\",M);\n\t\tvar rb=Lp.text.length;\n\t\tif(rb>obj.value.length){\n\t\t\treturn -1;\n\t\t}\n\t\treturn rb;\n\t}\n}", "title": "" }, { "docid": "b3fb1769e193820bb16252709ce1fefd", "score": "0.65638304", "text": "function getCursorPosition(node) {\r\n\t//node.focus(); \r\n\t/* without node.focus() IE will returns -1 when focus is not on node */\r\n\tif(node.selectionStart) // mozilla\r\n\t\treturn node.selectionStart;\r\n\telse if(!document.selection)\r\n\t\treturn 0;\r\n\t// IE\r\n\tvar c = \"\\001\";\r\n\tvar sel\t= document.selection.createRange();\r\n\tvar dul\t= sel.duplicate();\r\n\tvar len\t= 0;\r\n\tdul.moveToElementText(node);\r\n\tsel.text = c;\r\n\tlen = (dul.text.indexOf(c));\r\n\tsel.moveStart('character',-1);\r\n\tsel.text = \"\";\r\n\treturn len;\r\n}", "title": "" }, { "docid": "a078d9b6fcb2b42c3fe988e56428f82e", "score": "0.6542548", "text": "function getCaretStart(obj){\r\n\tif(typeof obj.selectionStart != \"undefined\"){\r\n\t\treturn obj.selectionStart;\r\n\t}else if(document.selection&&document.selection.createRange){\r\n\t\tvar M=document.selection.createRange();\r\n\t\ttry{\r\n\t\t\tvar Lp = M.duplicate();\r\n\t\t\tLp.moveToElementText(obj);\r\n\t\t}catch(e){\r\n\t\t\tvar Lp=obj.createTextRange();\r\n\t\t}\r\n\t\tLp.setEndPoint(\"EndToStart\",M);\r\n\t\tvar rb=Lp.text.length;\r\n\t\tif(rb>obj.value.length){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn rb;\r\n\t}\r\n}", "title": "" }, { "docid": "a078d9b6fcb2b42c3fe988e56428f82e", "score": "0.6542548", "text": "function getCaretStart(obj){\r\n\tif(typeof obj.selectionStart != \"undefined\"){\r\n\t\treturn obj.selectionStart;\r\n\t}else if(document.selection&&document.selection.createRange){\r\n\t\tvar M=document.selection.createRange();\r\n\t\ttry{\r\n\t\t\tvar Lp = M.duplicate();\r\n\t\t\tLp.moveToElementText(obj);\r\n\t\t}catch(e){\r\n\t\t\tvar Lp=obj.createTextRange();\r\n\t\t}\r\n\t\tLp.setEndPoint(\"EndToStart\",M);\r\n\t\tvar rb=Lp.text.length;\r\n\t\tif(rb>obj.value.length){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn rb;\r\n\t}\r\n}", "title": "" }, { "docid": "fb942098aad2ef76628f825da949b26e", "score": "0.6540749", "text": "function getCaretStart(obj) {\n if (typeof obj.selectionStart != \"undefined\") {\n return obj.selectionStart;\n } else if (document.selection && document.selection.createRange) {\n var M = document.selection.createRange();\n try {\n var Lp = M.duplicate();\n Lp.moveToElementText(obj);\n } catch (e) {\n var Lp = obj.createTextRange();\n }\n Lp.setEndPoint(\"EndToStart\", M);\n var rb = Lp.text.length;\n if (rb > obj.value.length) {\n return -1;\n }\n return rb;\n }\n}", "title": "" }, { "docid": "c2715336fed8ffe98ebf6c0aa41ce67b", "score": "0.6519035", "text": "function devPos(idObjeto){\n\tinput = document.getElementById(idObjeto);\n\tif (typeof document.selection != 'undefined' && document.selection && typeof input.selectionStart == 'undefined') {\n\t\tvar str = document.selection.createRange();\n\t\tstored_range = str.duplicate();\n\t\tstored_range.moveToElementText(input);\n\t\tstored_range.setEndPoint('EndToEnd', str );\n\t\tinput.selectionStart = stored_range.text.length - str.text.length;\n\t\tinput.selectionEnd = input.selectionStart + str.text.length;\n\t\treturn input.selectionStart;\n\t} else if (typeof input.selectionStart != 'undefined') {\n\t\treturn input.selectionStart;\n\t}\n}", "title": "" }, { "docid": "f8b56611b467ec7d62d14361ef245b74", "score": "0.6353079", "text": "function getInputSelectionRange(object) {\n object = getObject(object);\n if (object == null || !object.type) {\n return null;\n }\n try {\n if (object.selectionEnd) {\n return [object.selectionStart, object.selectionEnd];\n } else if (object.createTextRange && object.caret) {\n var end = getCaret(object);\n return [end - object.caret.text.length, end];\n }\n } catch (e) {\n // Ignore\n }\n return null;\n}", "title": "" }, { "docid": "460b2009dcde390db662479ec016c39a", "score": "0.63203645", "text": "function SetCaretPosition (oField, iCaretPos) {\n\n // IE Support\n if (document.selection) { \n\n // Set focus on the element\n oField.focus ();\n\n // Create empty selection range\n var oSel = document.selection.createRange ();\n\n // Move selection start and end to 0 position\n oSel.moveStart ('character', -oField.value.length);\n\n // Move selection start and end to desired position\n oSel.moveStart ('character', iCaretPos);\n oSel.moveEnd ('character', 0);\n oSel.select ();\n }\n\n // Firefox support\n else if (oField.selectionStart || oField.selectionStart == '0') {\n oField.selectionStart = iCaretPos;\n oField.selectionEnd = iCaretPos;\n oField.focus ();\n }\n}", "title": "" }, { "docid": "5710f150edd4614e78295c4d91af82e5", "score": "0.6292876", "text": "function getCaretPosition(ctrl, textToInsert) {\r\n\r\n var txt = ctrl.value;\r\n var caretPos = 0;\r\n // IE Support\r\n if (document.selection) {\r\n ctrl.focus();\r\n var selection = document.selection.createRange();\r\n\r\n selection.moveStart('character', -ctrl.value.length);\r\n\r\n caretPos = selection.text.length;\r\n txt = txt.substring(0, caretPos) + textToInsert + txt.substring(caretPos);\r\n }\r\n // Firefox support\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\r\n caretPos = ctrl.selectionStart;\r\n txt = txt.substring(0, caretPos) + textToInsert + txt.substring(caretPos);\r\n }\r\n ctrl.value = txt;\r\n}", "title": "" }, { "docid": "6f9bfc19086d241a703d61d4aa797062", "score": "0.6279", "text": "function doSetCaretPosition (oField, iCaretPos) {\n\n // IE Support\n if (document.selection) { \n\n // Set focus on the element\n oField.focus ();\n \n // Create empty selection range\n var oSel = document.selection.createRange ();\n \n // Move selection start and end to 0 position\n oSel.moveStart ('character', -oField.value.length);\n \n // Move selection start and end to desired position\n oSel.moveStart ('character', iCaretPos);\n oSel.moveEnd ('character', 0);\n oSel.select ();\n }\n\n // Firefox support\n else if (oField.selectionStart || oField.selectionStart == '0') {\n oField.selectionStart = iCaretPos;\n oField.selectionEnd = iCaretPos;\n oField.focus ();\n }\n}", "title": "" }, { "docid": "d5b56c40212ac6e5955edfad127ba101", "score": "0.6175759", "text": "function getInsertPos(textbox) {\r\n var iPos = 0;\r\n if (textbox.selectionStart || textbox.selectionStart == \"0\") {\r\n iPos = textbox.selectionStart;\r\n }\r\n else if (document.selection) {\r\n textbox.focus();\r\n var range = document.selection.createRange();\r\n var rangeCopy = range.duplicate();\r\n rangeCopy.moveToElementText(textbox);\r\n while (range.compareEndPoints(\"StartToStart\", rangeCopy) > 0) {\r\n range.moveStart(\"character\", -1);\r\n iPos++;\r\n }\r\n }\r\n return iPos;\r\n }", "title": "" }, { "docid": "cb25ac06cb2f3a4b51e50d9031711ae0", "score": "0.6139952", "text": "function getElementSelection(that) {\n var position = {};\n if (that.selectionStart === undefined) {\n that.focus();\n var select = document.selection.createRange();\n position.length = select.text.length;\n select.moveStart('character', -that.value.length);\n position.end = select.text.length;\n position.start = position.end - position.length;\n } else {\n position.start = that.selectionStart;\n position.end = that.selectionEnd;\n position.length = position.end - position.start;\n }\n return position;\n }", "title": "" }, { "docid": "aaa19f61cc08fa8cca270b01cc9f85e8", "score": "0.6099274", "text": "function getSelectionStart(o) {\n\n if (o.createTextRange) {\n var r = document.selection.createRange().duplicate()\n r.moveEnd('character', o.value.length)\n if (r.text == '') {\n return o.value.length;\n }\n return o.value.lastIndexOf(r.text);\n } else {\n return o.selectionStart;\n }\n\n}", "title": "" }, { "docid": "987be61c358b8d0893fc9f2a75e5d024", "score": "0.60544676", "text": "function getElementSelection(that) {\n const position = {};\n if (isUndefined(that.selectionStart)) {\n that.focus();\n const select = document.selection.createRange();\n position.length = select.text.length;\n select.moveStart('character', -that.value.length);\n position.end = select.text.length;\n position.start = position.end - position.length;\n } else {\n position.start = that.selectionStart;\n position.end = that.selectionEnd;\n position.length = position.end - position.start;\n }\n\n return position;\n }", "title": "" }, { "docid": "4176a5079d4eb7c59fd4ab37074d14de", "score": "0.60302866", "text": "function caret(pos) {\n var ctrl = $('#input').get(0);\n if (typeof pos != 'undefined') {\n if(ctrl.setSelectionRange) {\n ctrl.focus();\n ctrl.setSelectionRange(pos, pos);\n } else if (ctrl.createTextRange) {\n var range = ctrl.createTextRange();\n range.collapse(true);\n range.moveEnd('character', pos);\n range.moveStart('character', pos);\n range.select();\n }\n } else {\n var pos = 0;\n if (document.selection) {\n ctrl.focus ();\n var sel = document.selection.createRange();\n Sel.moveStart ('character', -ctrl.value.length);\n pos = Sel.text.length;\n } else if (ctrl.selectionStart\n || ctrl.selectionStart == '0')\n pos = ctrl.selectionStart;\n return pos;\n }\n}", "title": "" }, { "docid": "cee14d6bd286b02bfd61684c56cc615d", "score": "0.59807825", "text": "function getCaretCharacterOffsetWithin(element) {\n var caretOffset = 0;\n var doc = element.ownerDocument || element.document;\n var win = doc.defaultView || doc.parentWindow;\n var sel;\n if (typeof win.getSelection != \"undefined\") {\n var range = win.getSelection().getRangeAt(0);\n var preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if ( (sel = doc.selection) && sel.type != \"Control\") {\n var textRange = sel.createRange();\n var preCaretTextRange = doc.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n return caretOffset;\n}", "title": "" }, { "docid": "079d742fa7521ff6b86307830a521c25", "score": "0.5973917", "text": "function getCaret(editor) {\n const pos = editor.getCursor();\n return editor.indexFromPos(pos);\n }", "title": "" }, { "docid": "deec078299466a6c650e690d9578b140", "score": "0.59520483", "text": "function getCaretEnd(obj){\r\n\tif(typeof obj.selectionEnd != \"undefined\"){\r\n\t\treturn obj.selectionEnd;\r\n\t}else if(document.selection&&document.selection.createRange){\r\n\t\tvar M=document.selection.createRange();\r\n\t\ttry{\r\n\t\t\tvar Lp = M.duplicate();\r\n\t\t\tLp.moveToElementText(obj);\r\n\t\t}catch(e){\r\n\t\t\tvar Lp=obj.createTextRange();\r\n\t\t}\r\n\t\tLp.setEndPoint(\"EndToEnd\",M);\r\n\t\tvar rb=Lp.text.length;\r\n\t\tif(rb>obj.value.length){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn rb;\r\n\t}\r\n}", "title": "" }, { "docid": "deec078299466a6c650e690d9578b140", "score": "0.59520483", "text": "function getCaretEnd(obj){\r\n\tif(typeof obj.selectionEnd != \"undefined\"){\r\n\t\treturn obj.selectionEnd;\r\n\t}else if(document.selection&&document.selection.createRange){\r\n\t\tvar M=document.selection.createRange();\r\n\t\ttry{\r\n\t\t\tvar Lp = M.duplicate();\r\n\t\t\tLp.moveToElementText(obj);\r\n\t\t}catch(e){\r\n\t\t\tvar Lp=obj.createTextRange();\r\n\t\t}\r\n\t\tLp.setEndPoint(\"EndToEnd\",M);\r\n\t\tvar rb=Lp.text.length;\r\n\t\tif(rb>obj.value.length){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn rb;\r\n\t}\r\n}", "title": "" }, { "docid": "94d1fcce45a26f030dcc4f3e03ad65a6", "score": "0.5919961", "text": "function getCaretPosition(view) {\n var scimoz = view.scintilla.scimoz;\n var caretPosition = {\n firstVisibileLine : scimoz.firstVisibleLine,\n startPos : null,\n endPos : null\n };\n\n if (view.selection.length != 0) {\n caretPosition.startPos = scimoz.selectionStart;\n caretPosition.endPos = scimoz.selectionEnd;\n } else {\n caretPosition.startPos = scimoz.currentPos;\n caretPosition.endPos = caretPosition.startPos;\n }\n\n return caretPosition;\n}", "title": "" }, { "docid": "40898ece9a1638037e9b555204376386", "score": "0.5870921", "text": "getStartPosition() {\n return Range.getStartPosition(this);\n }", "title": "" }, { "docid": "f7a019786f955aea81e5ba3cf72cda61", "score": "0.58689016", "text": "function getCaretEnd(obj){\n\tif(typeof obj.selectionEnd != \"undefined\"){\n\t\treturn obj.selectionEnd;\n\t}else if(document.selection&&document.selection.createRange){\n\t\tvar M=document.selection.createRange();\n\t\ttry{\n\t\t\tvar Lp = M.duplicate();\n\t\t\tLp.moveToElementText(obj);\n\t\t}catch(e){\n\t\t\tvar Lp=obj.createTextRange();\n\t\t}\n\t\tLp.setEndPoint(\"EndToEnd\",M);\n\t\tvar rb=Lp.text.length;\n\t\tif(rb>obj.value.length){\n\t\t\treturn -1;\n\t\t}\n\t\treturn rb;\n\t}\n}", "title": "" }, { "docid": "896a15b20947c3334a14d8263db6a923", "score": "0.58461225", "text": "function getSelection( elem ) {\n\n var result = { start: 0, end: 0 };\n var field = elem.jquery ? elem.get(0) : elem;\n\n if ( field.selectionStart ) {\n result['start'] = field.selectionStart;\n result['end'] = field.selectionEnd;\n } else if ( field.selection ) {\n\n field.focus(); \n\n var r = document.selection.createRange(); \n if (r != null) { \n\n var re = field.createTextRange(); \n var rc = re.duplicate(); \n re.moveToBookmark(r.getBookmark()); \n rc.setEndPoint('EndToStart', re); \n\n result['start'] = rc.text.length;\n result['end'] = rc.text.length + r.text.length;\n }\n }\n\n return result;\n\n\n }", "title": "" }, { "docid": "e8cf635163782f26714fb15e9e810545", "score": "0.58456933", "text": "function getCaretEnd(obj) {\n if (typeof obj.selectionEnd != \"undefined\") {\n return obj.selectionEnd;\n } else if (document.selection && document.selection.createRange) {\n var M = document.selection.createRange();\n try {\n var Lp = M.duplicate();\n Lp.moveToElementText(obj);\n } catch (e) {\n var Lp = obj.createTextRange();\n }\n Lp.setEndPoint(\"EndToEnd\", M);\n var rb = Lp.text.length;\n if (rb > obj.value.length) {\n return -1;\n }\n return rb;\n }\n}", "title": "" }, { "docid": "93915b8e6ef7a57ec50dbde0f740429c", "score": "0.58451295", "text": "function getCursorPosition() {\n const selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n}", "title": "" }, { "docid": "93915b8e6ef7a57ec50dbde0f740429c", "score": "0.58451295", "text": "function getCursorPosition() {\n const selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n}", "title": "" }, { "docid": "ffca43502a37a211862958d0686292db", "score": "0.5827181", "text": "function getSelection( part )\n\t{\n\t\tvar pos\t= this.value.length;\n\t\t\n\t\t// Work out the selection part.\n\t\tpart = ( part.toLowerCase() == 'start' ? 'Start' : 'End' );\n\t\t\n\t\tif( document.selection ){\n\t\t\t// The current selection\n\t\t\tvar range = document.selection.createRange(), stored_range, selectionStart, selectionEnd;\n\t\t\t// We'll use this as a 'dummy'\n\t\t\tstored_range = range.duplicate();\n\t\t\t// Select all text\n\t\t\t//stored_range.moveToElementText( this );\n\t\t\tstored_range.expand('textedit');\n\t\t\t// Now move 'dummy' end point to end point of original range\n\t\t\tstored_range.setEndPoint( 'EndToEnd', range );\n\t\t\t// Now we can calculate start and end points\n\t\t\tselectionStart = stored_range.text.length - range.text.length;\n\t\t\tselectionEnd = selectionStart + range.text.length;\n\t\t\treturn part == 'Start' ? selectionStart : selectionEnd;\n\t\t}\n\t\t\n\t\telse if(typeof(this['selection'+part])!=\"undefined\")\n\t\t{\n\t\t \tpos = this['selection'+part];\n\t\t}\n\t\treturn pos;\n\t}", "title": "" }, { "docid": "ffca43502a37a211862958d0686292db", "score": "0.5827181", "text": "function getSelection( part )\n\t{\n\t\tvar pos\t= this.value.length;\n\t\t\n\t\t// Work out the selection part.\n\t\tpart = ( part.toLowerCase() == 'start' ? 'Start' : 'End' );\n\t\t\n\t\tif( document.selection ){\n\t\t\t// The current selection\n\t\t\tvar range = document.selection.createRange(), stored_range, selectionStart, selectionEnd;\n\t\t\t// We'll use this as a 'dummy'\n\t\t\tstored_range = range.duplicate();\n\t\t\t// Select all text\n\t\t\t//stored_range.moveToElementText( this );\n\t\t\tstored_range.expand('textedit');\n\t\t\t// Now move 'dummy' end point to end point of original range\n\t\t\tstored_range.setEndPoint( 'EndToEnd', range );\n\t\t\t// Now we can calculate start and end points\n\t\t\tselectionStart = stored_range.text.length - range.text.length;\n\t\t\tselectionEnd = selectionStart + range.text.length;\n\t\t\treturn part == 'Start' ? selectionStart : selectionEnd;\n\t\t}\n\t\t\n\t\telse if(typeof(this['selection'+part])!=\"undefined\")\n\t\t{\n\t\t \tpos = this['selection'+part];\n\t\t}\n\t\treturn pos;\n\t}", "title": "" }, { "docid": "8e529efbc394e7d7959dea6fdbeea86f", "score": "0.5820346", "text": "function getCursorXY({ text, i }) {\n const lines = text.slice(0, i).split(\"\\n\");\n const x = lines.slice(-1)[0].length;\n const y = lines.length - 1;\n return { x, y };\n}", "title": "" }, { "docid": "bfcb82408879e123105fc4a52f51d170", "score": "0.57965875", "text": "getCaretPosition(elem) {\n var sel = window.getSelection();\n var cumLength = [0, 0];\n\n if (sel.anchorNode == elem) {\n cumLength = [sel.anchorOffset, sel.extentOffset];\n } else {\n var nodesToFind = [sel.anchorNode, sel.extentNode];\n if (!elem.contains(sel.anchorNode) || !elem.contains(sel.extentNode)) {\n return undefined;\n } else {\n var found = [0, 0];\n var i;\n this.nodeWalk(elem, function(node) {\n for (i = 0; i < 2; i++) {\n if (node == nodesToFind[i]) {\n found[i] = true;\n if (found[i == 0 ? 1 : 0]) {\n return false; // all done\n }\n }\n }\n\n if (node.textContent && !node.firstChild) {\n for (i = 0; i < 2; i++) {\n if (!found[i]) {\n cumLength[i] += node.textContent.length;\n }\n }\n }\n });\n cumLength[0] += sel.anchorOffset;\n cumLength[1] += sel.extentOffset;\n }\n }\n if (cumLength[0] <= cumLength[1]) {\n return cumLength;\n }\n return [cumLength[1], cumLength[0]];\n }", "title": "" }, { "docid": "4775588b8e31b1006cabae80c109fa1a", "score": "0.57912606", "text": "function getPosition(){\n var doc = DocumentApp.getActiveDocument();\n var cursor = doc.getCursor();\n var element = cursor.getElement();\n var ele_type = element.getType();\n Logger.log(ele_type);\n var offset = cursor.getOffset();\n}", "title": "" }, { "docid": "9ba7597f998de7e1ba0c66212be8d22b", "score": "0.5706771", "text": "textOffset() {\n\t\t\treturn this.curr[2]\n\t\t}", "title": "" }, { "docid": "a517bca4d69b3dbb3fecdc158e97f34f", "score": "0.56981516", "text": "function getCursorLineNumber() {\n\tconsole.log(\"in loquacious.js\");\n txtArea = document.getElementById('loquacious');\n \n var cursorPos = 0;\n // Internet Explorer\n if (document.selection) {\n txtArea.focus();\n var Sel = document.selection.createRange();\n Sel.moveStart('character', -txtArea.value.length);\n cursorPos = Sel.text.length;\n }\n // Firefox, Safari support\n else if(txtArea.selectionStart || txtArea.selectionStart == '0')\n cursorPos = txtArea.selectionStart; \t \n \n return (txtArea.value.substring(0, cursorPos).split(\"\\n\").length);\n}", "title": "" }, { "docid": "732fde6bc708e21763222d378df2d07c", "score": "0.5698119", "text": "function getRangeLength(el)\r\n\t{ \r\n\tif (el.selectionStart) { return el.selectionEnd - el.selectionStart; }\r\n\telse if (document.selection)\r\n\t\t{\r\n\t\tel.focus();\r\n\t\tvar r = document.selection.createRange(); \r\n\t\tif (r == null) { return 0; } \r\n\t\treturn r.text.length;\r\n\t\t} \r\n\treturn 0; \r\n\t}", "title": "" }, { "docid": "0110879b5e8d5cbed466d04124b68acc", "score": "0.569134", "text": "function setCaretPosition(textField, index) {\n if (index > textField.value.length) {\n index = textField.value.length;\n }\n textField.selectionStart = index;\n textField.selectionEnd = index;\n}", "title": "" }, { "docid": "7b03ebad53e3db0fd9fb93ba36e8848d", "score": "0.56853735", "text": "function getSelectedTextPosition(e) {\n var height = void 0;\n var target = e.target,\n clientX = e.clientX,\n clientY = e.clientY;\n\n var text = (0, _getSelectedText2.default)();\n var width = Math.round((0, _getTextWidth2.default)(text, target) || 0);\n if (!text || target.classList.contains('md-text-field')) {\n height = parseInt(window.getComputedStyle(target).fontSize, 10);\n return {\n width: width,\n height: height,\n left: clientX - width,\n top: clientY\n };\n }\n\n // All browsers I am supporting have window.getSelection, but better safe than sorry\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var rect = null;\n if (range.getClientRects) {\n var rects = range.getClientRects();\n if (rects.length > 0) {\n rect = rects[0];\n }\n }\n\n if (!rect) {\n var span = document.createElement('span');\n span.appendChild(document.createTextNode(ZERO_WIDTH_CHARACTER));\n range.insertNode(span);\n rect = span.getBoundingClientRect();\n\n var spanParent = span.parentNode;\n spanParent.removeChild(span);\n spanParent.normalize();\n }\n\n return rect;\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "7d77ceeaff8e7e5420715ef0a231ea4a", "score": "0.5678211", "text": "getCursorPosition() {\n // Leave cursor in place if deleting\n if (this.isDeleteKey()) { return this.lastPosition; }\n return this.getNewPosition();\n }", "title": "" }, { "docid": "fbafa0c4b94f5a228e80e61f160ddb9c", "score": "0.56360763", "text": "function getCursor(currentElement,e){\n\n var selection = getCaretPosition(currentElement); /*console.log('selection.start-1 - '+selection.start);*/\n selectionStart = selection.start;\n }", "title": "" }, { "docid": "4d4d706cae45f3d94a65e3771e88936e", "score": "0.5596427", "text": "function getSelectedTextPosition(e) {\n var height = void 0;\n var target = e.target,\n clientX = e.clientX,\n clientY = e.clientY;\n\n var text = getSelectedText();\n var width = Math.round(getTextWidth(text, target) || 0);\n if (!text || target.classList.contains('md-text-field')) {\n height = parseInt(window.getComputedStyle(target).fontSize, 10);\n return {\n width: width,\n height: height,\n left: clientX - width,\n top: clientY\n };\n }\n\n // All browsers I am supporting have window.getSelection, but better safe than sorry\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var rect = null;\n if (range.getClientRects) {\n var rects = range.getClientRects();\n if (rects.length > 0) {\n rect = rects[0];\n }\n }\n\n if (!rect) {\n var span = document.createElement('span');\n span.appendChild(document.createTextNode(ZERO_WIDTH_CHARACTER));\n range.insertNode(span);\n rect = span.getBoundingClientRect();\n\n var spanParent = span.parentNode;\n spanParent.removeChild(span);\n spanParent.normalize();\n }\n\n return rect;\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "aec5f2957d4adbd3cac11153bfec5ec3", "score": "0.5591963", "text": "function getSelectedTextPosition(e) {\n var height = void 0;\n var target = e.target,\n clientX = e.clientX,\n clientY = e.clientY;\n\n var text = Object(__WEBPACK_IMPORTED_MODULE_0__getSelectedText__[\"a\" /* default */])();\n var width = Math.round(Object(__WEBPACK_IMPORTED_MODULE_1__getTextWidth__[\"a\" /* default */])(text, target) || 0);\n if (!text || target.classList.contains('md-text-field')) {\n height = parseInt(window.getComputedStyle(target).fontSize, 10);\n return {\n width: width,\n height: height,\n left: clientX - width,\n top: clientY\n };\n }\n\n // All browsers I am supporting have window.getSelection, but better safe than sorry\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var rect = null;\n if (range.getClientRects) {\n var rects = range.getClientRects();\n if (rects.length > 0) {\n rect = rects[0];\n }\n }\n\n if (!rect) {\n var span = document.createElement('span');\n span.appendChild(document.createTextNode(ZERO_WIDTH_CHARACTER));\n range.insertNode(span);\n rect = span.getBoundingClientRect();\n\n var spanParent = span.parentNode;\n spanParent.removeChild(span);\n spanParent.normalize();\n }\n\n return rect;\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "cf08f487ccdf353af5ff7a35fc4f308c", "score": "0.55810773", "text": "getOffset(node) {\n\t\tvar range = document.createRange();\n\t\trange.selectNodeContents(this.code);\n\t\trange.setEnd(node, 0);\n\t\treturn range.toString().length;\n\t}", "title": "" }, { "docid": "c1ec828f6ed83cdbcabeedd6739eb593", "score": "0.55280817", "text": "function getSelection(input) {\n if (\"selectionStart\" in input && document.activeElement == input) {\n return {\n start: input.selectionStart,\n end: input.selectionEnd\n };\n } else if (input.createTextRange) {\n var sel = document.selection.createRange();\n if (sel.parentElement() === input) {\n var rng = input.createTextRange();\n rng.moveToBookmark(sel.getBookmark());\n for (var len = 0;\n rng.compareEndPoints(\"EndToStart\", rng) > 0;\n rng.moveEnd(\"character\", -1)) {\n len++;\n }\n rng.setEndPoint(\"StartToStart\", input.createTextRange());\n for (var pos = { start: 0, end: len };\n rng.compareEndPoints(\"EndToStart\", rng) > 0;\n rng.moveEnd(\"character\", -1)) {\n pos.start++;\n pos.end++;\n }\n return pos;\n }\n }\n return false;\n }", "title": "" }, { "docid": "185ae1830f01a2488f38bbce9cbd8a58", "score": "0.55278474", "text": "get position() { return parseInt(new String(this._base.getPosition())) }", "title": "" }, { "docid": "8ed04ee111842fe2043058ecda75970d", "score": "0.54355544", "text": "function _getTextRangeBoundaryPosition(textRange, isStart) {\n var workingRange = textRange.duplicate();\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n var workingNode = document.createElement(\"span\");\n var comparison, workingComparisonType = isStart ?\n \"StartToStart\" : \"StartToEnd\";\n\n var boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at\n // the end and working backwards, until the working range reaches or goes\n // past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ( (comparison = workingRange.compareEndPoints(\n workingComparisonType, textRange)) > 0 && workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're\n // interested in so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n if (comparison == -1 && boundaryNode) {\n // This must be a data node (text, comment, cdata) since we've overshot.\n // The working range is collapsed at the start of the node containing\n // the text range's boundary, so we move the end of the working range\n // to the boundary point and measure the length of its text to get\n // the boundary's offset within the node\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n boundaryPosition = {\n node: boundaryNode,\n offset: workingRange.text.length\n };\n } else {\n // We've hit the boundary exactly, so this must be an element\n boundaryPosition = {\n node: containerElement,\n offset: getChildIndex(workingNode)\n };\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n}", "title": "" }, { "docid": "f2a5cb1cccd5414f08b44fff96665d99", "score": "0.5412538", "text": "function doSetCaretPosition( textbox, nCaretPos )\n{\n if ( document.selection ) // IE Support\n { \n // Set focus on the element\n textbox.focus( );\n\n // Create empty selection range\n var oSel = document.selection.createRange( );\n\n // Move selection start and end to 0 position\n oSel.moveStart( 'character', -textbox.value.length );\n\n // Move selection start and end to desired position\n oSel.moveStart( 'character', nCaretPos );\n oSel.moveEnd( 'character', nCaretPos );\n // oSel.moveEnd( 'character', 0 );\n oSel.select( );\n }\n else // Firefox support\n {\n if ( textbox.selectionStart || textbox.selectionStart == '0' )\n {\n textbox.selectionStart = nCaretPos;\n textbox.selectionEnd = nCaretPos;\n textbox.focus( );\n }\n }\n}", "title": "" }, { "docid": "b756ebb12dbdbf081b4fa69f1e06f45d", "score": "0.5409627", "text": "function getCaretCoordinates(element, position) {\n // mirrored div\n var div = document.createElement(\"div\");\n div.id = \"input-textarea-caret-position-mirror-div\";\n document.body.appendChild(div);\n\n var style = div.style;\n var computed = window.getComputedStyle ? getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9\n var yScale = style.msFlexWrap !== undefined || window.navigator.userAgent.toLowerCase().indexOf('edge') > -1 ? .75 : 1;\n var xScale = style.msFlexWrap !== undefined || window.navigator.userAgent.toLowerCase().indexOf('edge') > -1 ? 1.25 : 1;\n\n // default textarea styles\n style.whiteSpace = \"pre-wrap\";\n style.wordWrap = \"break-word\"; // only for textarea-s\n\n // position off-screen\n style.position = \"absolute\"; // required to return coordinates properly\n style.visibility = \"hidden\"; // not 'display: none' because we want rendering\n\n var props = [\n \"direction\", // RTL support\n \"boxSizing\",\n \"width\", // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n \"height\",\n \"overflowX\",\n \"overflowY\", // copy the scrollbar for IE\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderStyle\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n \"fontStyle\",\n \"fontVariant\",\n \"fontWeight\",\n \"fontStretch\",\n \"fontSize\",\n \"fontSizeAdjust\",\n \"lineHeight\",\n \"fontFamily\",\n \"textAlign\",\n \"textTransform\",\n \"textIndent\",\n \"textDecoration\", // might not make a difference, but better be safe\n \"letterSpacing\",\n \"wordSpacing\",\n \"tabSize\",\n \"MozTabSize\"\n ];\n\n for (var i = 0; i < props.length; ++i) {\n style[props[i]] = computed[props[i]];\n }\n\n style.overflow = \"hidden\"; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n\n div.textContent = element.value.substring(0, position);\n\n var span = document.createElement(\"span\");\n // Wrapping must be replicated *exactly*, including when a long word gets\n // onto the next line, with whitespace at the end of the line before (#7).\n // The *only* reliable way to do that is to copy the *entire* rest of the\n // textarea's content into the <span> created at the caret position.\n // for inputs, just '.' would be enough, but why bother?\n span.textContent = element.value.substring(position) || \".\"; // || because a completely empty faux span doesn't render at all\n div.appendChild(span);\n\n var coordinates = {\n top: yScale * (span.offsetTop + parseInt(computed[\"borderTopWidth\"])) + element.offsetTop,\n left: xScale * (span.offsetLeft + parseInt(computed[\"borderLeftWidth\"])) + element.offsetLeft\n };\n\n document.body.removeChild(div);\n\n return coordinates;\n }", "title": "" }, { "docid": "12304a9d7a364e683e328d93659cb577", "score": "0.5401099", "text": "function insertAtCursor(myField, myValue) {\n //IE support\n var scrollPos = myField.scrollTop;\n if (document.selection) {\n myField.focus();\n //in effect we are creating a text range with zero\n //length at the cursor location and replacing it\n //with myValue\n sel = document.selection.createRange();\n sel.text = myValue;\n }\n \n //Mozilla/Firefox/Netscape 7+ support\n else if (myField.selectionStart || myField.selectionStart == '0'){\n\n //Here we get the start and end points of the\n //selection. Then we create substrings up to the\n //start of the selection and from the end point\n //of the selection to the end of the field value.\n //Then we concatenate the first substring, myValue,\n //and the second substring to get the new value.\n var startPos = myField.selectionStart;\n var endPos = myField.selectionEnd;\n myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);\n}\nelse\n{\n myField.value += myValue;\n}\n myField.scrollTop = scrollPos;\n}", "title": "" }, { "docid": "87630c865ce2792ab8e618bdb7eb272e", "score": "0.5391283", "text": "get actualizedStartPos(){\n this._computeStartPos();\n return this._startPos;\n }", "title": "" }, { "docid": "296ae4756ba620eab052e92e5db563e3", "score": "0.53663594", "text": "function getCaretCoordinates(element, position, options) {\n\t\t// We'll copy the properties below into the mirror div.\n\t\t// Note that some browsers, such as Firefox, do not concatenate properties\n\t\t// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n\t\t// so we have to list every single property explicitly.\n\t\tvar properties = [\n\t\t\t'direction', // RTL support\n\t\t\t'boxSizing',\n\t\t\t'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n\t\t\t'height',\n\t\t\t'overflowX',\n\t\t\t'overflowY', // copy the scrollbar for IE\n\n\t\t\t'borderTopWidth',\n\t\t\t'borderRightWidth',\n\t\t\t'borderBottomWidth',\n\t\t\t'borderLeftWidth',\n\t\t\t'borderStyle',\n\n\t\t\t'paddingTop',\n\t\t\t'paddingRight',\n\t\t\t'paddingBottom',\n\t\t\t'paddingLeft',\n\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/CSS/font\n\t\t\t'fontStyle',\n\t\t\t'fontVariant',\n\t\t\t'fontWeight',\n\t\t\t'fontStretch',\n\t\t\t'fontSize',\n\t\t\t'fontSizeAdjust',\n\t\t\t'lineHeight',\n\t\t\t'fontFamily',\n\n\t\t\t'textAlign',\n\t\t\t'textTransform',\n\t\t\t'textIndent',\n\t\t\t'textDecoration', // might not make a difference, but better be safe\n\n\t\t\t'letterSpacing',\n\t\t\t'wordSpacing',\n\n\t\t\t'tabSize',\n\t\t\t'MozTabSize'\n\t\t];\n\n\t\tvar isFirefox = window.mozInnerScreenX != null;\n\n\t\t// The mirror div will replicate the textarea's style\n\t\tvar div = document.createElement('div');\n\t\tdiv.id = 'input-textarea-caret-position-mirror-div';\n\t\tdocument.body.appendChild(div);\n\n\t\tvar style = div.style;\n\t\tvar computed = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9\n\n\t\t// Default textarea styles\n\t\tstyle.whiteSpace = 'pre-wrap';\n\t\tstyle.wordWrap = 'break-word'; // only for textarea-s\n\n\t\t// Position off-screen\n\t\tstyle.position = 'absolute'; // required to return coordinates properly\n\t\tstyle.visibility = 'hidden'; // not 'display: none' because we want rendering\n\n\t\t// Transfer the element's properties to the div\n\t\tproperties.forEach(function (prop) {\n\t\t\tstyle[prop] = computed[prop];\n\t\t});\n\n\t\tif (isFirefox) {\n\t\t// Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n\t\tif (element.scrollHeight > parseInt(computed.height))\n\t\t\tstyle.overflowY = 'scroll';\n\t\t} else {\n\t\t\tstyle.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n\t\t}\n\n\t\tdiv.textContent = element.value.substring(0, position);\n\t\t// The second special handling for input type=\"text\" vs textarea:\n\t\t// spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n\n\n\t\tvar span = document.createElement('span');\n\t\t// Wrapping must be replicated *exactly*, including when a long word gets\n\t\t// onto the next line, with whitespace at the end of the line before (#7).\n\t\t// The *only* reliable way to do that is to copy the *entire* rest of the\n\t\t// textarea's content into the <span> created at the caret position.\n\t\t// For inputs, just '.' would be enough, but no need to bother.\n\t\tspan.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n\t\tdiv.appendChild(span);\n\n\t\tvar coordinates = {\n\t\t\ttop: span.offsetTop + parseInt(computed['borderTopWidth']),\n\t\t\tleft: span.offsetLeft + parseInt(computed['borderLeftWidth']),\n\t\t\theight: parseInt(computed['lineHeight'])\n\t\t};\n\n\t\tdocument.body.removeChild(div);\n\n\t\treturn coordinates;\n\t}", "title": "" }, { "docid": "c1b37e8d347b0c898211761f255cd366", "score": "0.53572744", "text": "function S_getRightCaret() {\n objet = S_getLigneCourante();\n if (CARET.start > objet.text().length)\n return objet.text().length;\n else\n return CARET.start;\n}", "title": "" }, { "docid": "8f62a80864d19fc12ae5c50959289386", "score": "0.53413695", "text": "indexOfRange(value, pos_begin, pos_end){\n\t\tvar pos = super.indexOf(value, pos_begin);\n\t\tif (pos == -1 || pos > pos_end)\n\t\t\treturn -1;\n\t\treturn pos;\n\t}", "title": "" }, { "docid": "4fd6a41544132a1d8d2e36686525d6b2", "score": "0.5333361", "text": "static getStartPosition(range) {\n return new position_1.Position(range.startLineNumber, range.startColumn);\n }", "title": "" }, { "docid": "7c2c54652abb9521614aa8f68892b904", "score": "0.53295743", "text": "getCursorPosition() {\n throw new Error('Not implemented: getCursorPosition');\n }", "title": "" }, { "docid": "dc490f654b5b4d5ead0a13a31f93a50e", "score": "0.5327918", "text": "function _setCursorPosition(\n line: HTMLElement,\n offset: number,\n range: Range,\n startOrEnd: 'start' | 'end',\n): void {\n const textNodes = _getAllTextChildren(line);\n\n if (textNodes.length === 0) {\n return startOrEnd === 'start'\n ? range.setStart(line, 0)\n : range.setEnd(line, 0);\n }\n\n let oldLength = 0;\n let length = 0;\n\n // Using for..of instead of .forEach() so we can save time and break out\n // of the loop early.\n // Iterate over the text nodes in this line until we find the one that\n // contains our cursor position\n // eslint-disable-next-line no-restricted-syntax\n for (const node of textNodes) {\n const textLength = node.textContent.length;\n oldLength = length;\n length += textLength;\n if (offset <= length) {\n const charIdxToSet = offset - oldLength;\n return startOrEnd === 'start'\n ? range.setStart(node, charIdxToSet)\n : range.setEnd(node, charIdxToSet);\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "b50178c0fb9eef862a48d95aeedea45e", "score": "0.5314193", "text": "get textOffset() {\n return PAGE_BYTES;\n }", "title": "" }, { "docid": "ea98a5000d94a1bcbca64e2bd62fdfe8", "score": "0.53038996", "text": "selectionRangeOfFocus(focus, rowOffset) {\n const row = this._rows[focus.row];\n if (row === undefined) {\n return undefined;\n }\n const cell = row.getCellAt(focus.column);\n if (cell === undefined) {\n return undefined;\n }\n if (cell.content === '') {\n return undefined;\n }\n const rowPos = focus.row + rowOffset;\n const cellWidths = row.getCells().map((cell) => cell.rawContent.length);\n let columnPos = row.marginLeft.length + 1;\n for (let columnIndex = 0; columnIndex < focus.column; columnIndex++) {\n columnPos += cellWidths[columnIndex] + 1;\n }\n columnPos += cell.paddingLeft;\n return new range.Range(new point.Point(rowPos, columnPos), new point.Point(rowPos, columnPos + cell.content.length));\n }", "title": "" }, { "docid": "4189f8642dec6669d94e7e70a86f0919", "score": "0.52940077", "text": "calculateTextPosition() {\n // Calculate the position of the text to center it verticaly inside the element\n\n this.input_text_pos = {\n x: this.pos_x,\n y: this.pos_y + (this.height / 2) + (this.text_size / 3)\n }\n }", "title": "" }, { "docid": "9338ba3fc22ffc97e27ddd827e4c1eac", "score": "0.5292998", "text": "function showCaretPosition() {\n if (switchModeElement.checked === true) {\n return;\n }\n\n formatBold = document.queryCommandState('bold');\n formatItalic = document.queryCommandState('italic');\n formatUnderline = document.queryCommandState('underline');\n if (formatBold === true) {\n boldBtn.classList.add('active');\n } else {\n boldBtn.classList.remove('active');\n }\n if (formatItalic === true) {\n italicBtn.classList.add('active');\n } else {\n italicBtn.classList.remove('active');\n }\n if (formatUnderline === true) {\n underlineBtn.classList.add('active');\n } else {\n underlineBtn.classList.remove('active');\n }\n\n var ie = (typeof document.selection != \"undefined\" && document.selection.type != \"Control\") && true;\n var w3 = (typeof window.getSelection != \"undefined\") && true;\n var caretOffset = 0;\n var length = 0;\n if (w3) {\n var sel = window.getSelection && window.getSelection();\n if (!sel || sel.rangeCount <= 0) return;\n var range = sel.getRangeAt(0);\n var preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(editorElement);\n length = preCaretRange.toString().trim().length;\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().trim().length;\n } else if (ie) {\n var textRange = document.selection.createRange();\n var preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(editorElement);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n caretPositionElement.innerText = caretOffset + \"/\" + length;\n console.log(caretOffset + \"/\" + length);\n return caretOffset + \"/\" + length;\n }", "title": "" }, { "docid": "51656571704d06e37dc7a16504058434", "score": "0.52827454", "text": "function AIP_getPositionOfMaskString (control, lastposition)\n {\n\t\tvar position=lastposition;\n\t\twhile(position < control.value.length)\n\t\t{\n\t\t\tif ( control.value.charAt(position) == '_' )\n\t\t\t\tbreak;\n\t\t\tposition++;\n\t\t}\n\t\t//alert(position);\n\t\treturn position;\n }", "title": "" }, { "docid": "a650c89eba8ddac04f9eacb7bcc40f28", "score": "0.52729267", "text": "function getCaretRect(rng) {\n var rects, textNode, node, container = rng.startContainer;\n\n rects = rng.getClientRects();\n if (rects.length) {\n return rects[0];\n }\n\n if (!rng.collapsed || container.nodeType != 1) {\n return;\n }\n\n node = container.childNodes[lastRng.startOffset];\n\n // Skip empty whitespace nodes\n while (node && node.nodeType == 3 && !node.data.length) {\n node = node.nextSibling;\n }\n\n if (!node) {\n return;\n }\n\n // Check if the location is |<br>\n // TODO: Might need to expand this to say |<table>\n if (node.tagName == 'BR') {\n textNode = dom.doc.createTextNode('\\uFEFF');\n node.parentNode.insertBefore(textNode, node);\n\n rng = dom.createRng();\n rng.setStartBefore(textNode);\n rng.setEndAfter(textNode);\n\n rects = rng.getClientRects();\n dom.remove(textNode);\n }\n\n if (rects.length) {\n return rects[0];\n }\n }", "title": "" }, { "docid": "34ea78d300e2f7c321bf45c0a2200b1c", "score": "0.5256484", "text": "function getCursorRow() {\n return (this.$acInput.parent().position().top + this.options.lineHeight) / this.options.lineHeight;\n }", "title": "" }, { "docid": "7f5bf617e4faf31f17d2fe02d2e593ec", "score": "0.5251695", "text": "function cursorX() {\n return cx;\n }", "title": "" }, { "docid": "8e989d102683e7adef6f16fe717ae1eb", "score": "0.5233165", "text": "function getTextRangeBoundaryPosition(textRange, isStart) {\n var workingRange = textRange.duplicate();\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n var workingNode = document.createElement(\"span\");\n var comparison, workingComparisonType = isStart ?\n \"StartToStart\" : \"StartToEnd\";\n\n var boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at\n // the end and working backwards, until the working range reaches or goes\n // past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ((comparison = workingRange.compareEndPoints(\n workingComparisonType, textRange)) > 0 && workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're\n // interested in so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n if (comparison == -1 && boundaryNode) {\n // This must be a data node (text, comment, cdata) since we've overshot.\n // The working range is collapsed at the start of the node containing\n // the text range's boundary, so we move the end of the working range\n // to the boundary point and measure the length of its text to get\n // the boundary's offset within the node\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n boundaryPosition = {\n node: boundaryNode,\n offset: workingRange.text.length\n };\n } else {\n // We've hit the boundary exactly, so this must be an element\n boundaryPosition = {\n node: containerElement,\n offset: getChildIndex(workingNode)\n };\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n }", "title": "" }, { "docid": "a1c4954ce83da986f0c368a4888a73b0", "score": "0.52239394", "text": "get position() {}", "title": "" }, { "docid": "a1c4954ce83da986f0c368a4888a73b0", "score": "0.52239394", "text": "get position() {}", "title": "" } ]
5306c7be2c3851d890cee4354726ac3b
Initializes the controlfile handlers, including dealing with the possibility that the server is getting started up in a state where the control files indicate it shouldn't be running.
[ { "docid": "b6226d70357f6a1285edcb78ccb440f3", "score": "0.5851176", "text": "init() {\n // If the `shutdown` or `stopped` files exist, then this server shouldn't\n // start up in the first place.\n if (fs.existsSync(this._stoppedPath)) {\n log.event.alreadyStopped();\n this._shutdownCondition.value = true;\n } else if (fs.existsSync(this._shutdownPath)) {\n // Write the `stopped` file to acknowledge to the world that the server\n // got the request to shut down. (If we don't do this, the controlling\n // environment might mistakenly believe the server still needs to run.)\n this._writeStoppedFile();\n log.event.alreadyShuttingDown();\n this._shutdownCondition.value = true;\n }\n\n if (this._shutdownCondition.value) {\n // We already know we're shutting down, so don't bother with the polling.\n return;\n }\n\n // If we receive SIGHUP, immediately check for the shutdown file.\n process.on('SIGHUP', this._checkForShutdownRequest.bind(this));\n\n // Loop forever, waiting/polling for the shutdown file to exist, and/or for\n // the shutdown condition to be flipped by other means (notably, the signal\n // handler which got setup just above here).\n (async () => {\n const shutdownTrue = this._shutdownCondition.whenTrue();\n\n while (!this._shutdownCondition.value) {\n await Promise.race([\n Delay.resolve(SHUTDOWN_POLL_DELAY_MSEC),\n shutdownTrue]);\n\n this._checkForShutdownRequest();\n }\n\n this._doShutdown();\n })();\n }", "title": "" } ]
[ { "docid": "f0f1b5e2fec7c2fc2be5a9f0d323b3b7", "score": "0.6254941", "text": "function initWebServer() {\n\t// create routing for files and serve files\n\tfunction route(path, request, response) {\n\t\t// file extension header definitions\n\t\tvar extensions = {\n\t\t\t'css' : 'text/css',\n\t\t\t'gif' : 'image/gif',\n\t\t\t'html' : 'text/html',\n\t\t\t'ico' : 'image/x-ico',\n\t\t\t'jpg' : 'image/jpeg',\n\t\t\t'jpeg' : 'image/jpeg',\n\t\t\t'json' : 'application/json',\n\t\t\t'js' : 'application/javascript',\n\t\t\t'png' : 'image/png',\n\t\t\t'txt' : 'text/plain'\n\t\t};\n\n\t\t// extract file extension from path\n\t\tvar extension = path.split('.');\n\t\textension = extension[extension.length-1];\n\n\t\t// read file from path\n\t\tfs.readFile(__dirname + path, function(err, file) {\n\t\t\tif(err) {\n\t\t\t\t// advertise error\n\t\t\t\tconsole.log('There was an error reading the file \\'' + path + '\\' -> ' + err);\n\n\t\t\t\t// send error response to client\n\t\t\t\tresponse.writeHead(404);\n\t\t\t\treturn response.end(\"File Not Found.\");\n\t\t\t}\n\n\t\t\t// advertise web interface loaded\n\t\t\tconsole.log('[WEB] web interface loaded for address -> ' + request.connection.remoteAddress);\n\n\t\t\tresponse.writeHead(200, {'Content-Type' : extensions[extension]});\n\t\t\tresponse.end(file);\n\t\t});\n\t};\n\n\t// create an http web server\n\tserver = http.createServer(function(request, response) {\n\t\t//determine if request is a command\n\t\tif(request.url == '/command') {\n\t\t\t// advertise to console\n\t\t\tconsole.log('command detected');\n\t\t\t// init command buffer\n\t\t\tvar commandBuffer = '';\n\n\t\t\trequest.on('data', function(chunk) {\n\t\t\t\tcommandBuffer += chunk;\n\t\t\t})\n\n\t\t\trequest.on('end', function() {\n\t\t\t\t// define command from its buffer\n\t\t\t\tvar command = commandBuffer.split('/');\n\n\t\t\t\tconsole.log('Received command: ' + command[2]);\n\n\t\t\t\tif(command[1] == 'value') {\n\t\t\t\t\tif(ready) {\n\t\t\t\t\t\t// send data to Imp module\n\t\t\t\t\t\tif(command[2] == '1') {\n\t\t\t\t\t\t\t// turn LED on and wait for response before setting program ready state to true\n\t\t\t\t\t\t\tsetImpLEDToOn();\n\t\t\t\t\t\t} else if(command[2] == '0') {\n\t\t\t\t\t\t\t// turn LED on and wait for response before setting program ready state to true\n\t\t\t\t\t\t\tsetImpLEDToOff();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// advertise program is not ready for next request to be processed\n\t\t\t\t\t\tconsole.log('Unable to process request at this time');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('Command \\'' + command[1] + '\\' not yet implemented.');\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\t// send response back to client\n\t\t\tresponse.end('success');\n\t\t} else {\n\t\t\t// route request to file path\n\t\t\troute((request.url == '/' ? '/index.html' : request.url), request, response);\n\t\t}\n\t});\n\n\t// have server listen on specific port\n\tserver.listen(WEB_PORT);\n}", "title": "" }, { "docid": "8fc578f3aaada821a485bf239852c66e", "score": "0.6038541", "text": "function setUpServerState()\n{\n\tserver_state.on('invalid_request', onInvalid);\n\tserver_state.on('get_file', onGet);\n\tserver_state.on('join', onJoin);\n\tserver_state.on('move', onMove);\n\tserver_state.on('next_player', onNextPlayer);\n\tserver_state.on('game_over', onGameOver);\n\tserver_state.on('winning_player', onWinningPlayer);\n\tserver_state.on('reset', onReset);\n\tserver_state.on('turn_over', onTurnOver);\n\n\t// set the client handler\n\tserver_state.setClientHandler(client_handler);\n\tconsole.log(\"[Message]: Server State Set Up and Ready\");\n\n\t// server is set up, lets initialise the game\n\tinitialiseGame(client_handler.getNumberOfDetectives());\n}", "title": "" }, { "docid": "449fd1d5739483d9fba9ba0a72046902", "score": "0.5753893", "text": "_initHandlers(){\n // get clientdata of this client\n this.socket.on(Packages.PROTOCOL.SERVER.RESPONSE_CLIENT_ACCEPTED, this._onClientAccepted.bind(this));\n\n // receive data about the dame (after initialisation, or gamechange\n this.socket.on(Packages.PROTOCOL.SERVER.INIT_GAME, this._onInitGame.bind(this));\n\n // receive game updates\n this.socket.on(Packages.PROTOCOL.SERVER.UPDATE_STATE, this._onStateUpdate.bind(this));\n\n // another player connected\n this.socket.on(Packages.PROTOCOL.SERVER.CLIENT_CONNECTED, this._onClientConnected.bind(this));\n\n // an client disconnects\n this.socket.on(Packages.PROTOCOL.SERVER.CLIENT_DISCONNECTED, this._onClientDisconnected.bind(this));\n\n // a value of a client/player has changed\n this.socket.on(Packages.PROTOCOL.SERVER.CLIENT_VALUE_UPDATE, this._onClientValueUpdate.bind(this));\n\n // if chat message from server is received\n this.socket.on(Packages.PROTOCOL.MODULES.CHAT.SERVER_CHAT_MSG, this._onChatMessageReceived.bind(this));\n\n // if value reject from serveris received\n this.socket.on(Packages.PROTOCOL.SERVER.CLIENT_VALUE_UPDATE_REJECTED, this._onClientValueUpdateRejected.bind(this));\n\n this.socket.on('disconnect', this._onDisconnect.bind(this));\n\n this.socket.on(Packages.PROTOCOL.SERVER.ERROR,this._onServerError.bind(this));\n }", "title": "" }, { "docid": "c97bbd801ad2ce2773154abca94db535", "score": "0.575218", "text": "function initHandlers(io, server, app, socket) {\n\tvar handlers = {};\n\t\n\tvar infoLen = socketio_config.length;\n\tlogger.debug('Count of event handler in socketio_config : %d', infoLen);\n \n\tfor (var i = 0; i < infoLen; i++) {\n\t\tvar curItem = socketio_config[i];\n\t\t\t\n\t\t// check file exist\n var filename = path.join(__dirname, socketio_folder, curItem.file);\n logger.debug('filename #' + i + ' : ' + filename);\n \n loadModule(io, socket, filename, curItem);\n \n\t}\n \n \n \n\treturn handlers;\n}", "title": "" }, { "docid": "031239e0e7ae5560df4edd4354913c65", "score": "0.5719797", "text": "_setup() {\n // The server will certainly be initialized by now\n const server = require('./server').server;\n server.on('close', () => this.emit('close'));\n }", "title": "" }, { "docid": "231b0e9bda30576987cfe692b9c5d9cd", "score": "0.56732947", "text": "_addServerEventHandlers() {}", "title": "" }, { "docid": "668f3da957d8c1c7eb8189e3ec646b1c", "score": "0.5657657", "text": "async init() {\n\n // Log a separator\n await this.logger.log(\"separator\");\n\n // Load all commands\n const cmdFile = await readdir(\"./commands/\");\n cmdFile.forEach(async (dir) => {\n const commands = await readdir(\"./commands/\" + dir + \"/\");\n commands.filter((cmd) => cmd.split(\".\").pop() === \"js\").forEach((cmd) => {\n this.loadCommand(\"./commands/\" + dir, cmd);\n });\n });\n\n // Load all events\n const evtFile = await readdir(\"./events/\");\n evtFile.forEach((file) => {\n const eventName = file.split(\".\")[0];\n const event = new (require(`../events/${file}`))(this);\n this.logger.log(\"event\", eventName)\n this.on(eventName, (...args) => event.run(...args));\n delete require.cache[require.resolve(`../events/${file}`)];\n }); \n\n // Log a separator\n await this.logger.log(\"separator\");\n\n // Login with discord\n this.login(this.cfg.token);\n }", "title": "" }, { "docid": "9bcace0759abb273eeaa602b22ba534f", "score": "0.565157", "text": "initHTTPServer() {\n\t\tthis.log(0,\"Beginning HTTP server init\",\"Port: \",this.port,\"Logging level: \",this.logging);\n\t\tthis.HTTP = http.createServer((request, response) => {\n\t\t\ttry {\n\t\t\t\tthis.HTTPRequest(request,response);\n\t\t\t}\n\t\t\tcatch(err) {\n\t\t\t\tconsole.log(\"********** CRITICAL ERROR PROCESSING A HTTP REQUEST **********\");\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t});\n\n\t\t//Begin listening for requests\n\t\tthis.HTTP.listen(this.port);\n\t\tthis.log(0,\"Finished HTTP server init\");\n\t}", "title": "" }, { "docid": "48462f73cf4283b2bc4dc51034b9be2b", "score": "0.56082326", "text": "init() {\n this._bindHandlers()\n }", "title": "" }, { "docid": "8adc2a225363d7995069897af63d52cd", "score": "0.5605007", "text": "initHandlers() {\n // SETUP THE TOOLBAR BUTTON HANDLERS\n\n // SETS UP LIST BUTTON HANDLERS\n this.initAddListButton();\n\n // SETS UP CLOSE BUTTON HANDLERS\n this.initCloseButton();\n\n // SETS UP UNDO BUTTON HANDLERS\n this.initUndoButton();\n\n // SETS UP REDO BUTTON HANDLERS\n this.initRedoButton();\n\n // SETS UP ITEM HANDLERS\n for (let i = 1; i <= 5; i++) {\n this.initListItem(i);\n }\n\n // SETS UP DROPBOX HANDLERS\n this.initDropBoxHandlers();\n }", "title": "" }, { "docid": "f25ed02366dc658e29369bd81c6e9ec0", "score": "0.5592695", "text": "function setUpHandlers() {\n // Handlers for the main buttons.\n $('#monitor_page').click(startMonitoring);\n $('.stop_monitoring').click(stopMonitoring);\n $('.open_page').click(openPage);\n}", "title": "" }, { "docid": "c7d826237ca149ae100e433f50bc6566", "score": "0.5590271", "text": "async initialize() {\n this.rpcHandler = await this.dir.registerService(\"gatewayServer\");\n await this.rpcHandler.registerAsGateway();\n this.servers = [];\n }", "title": "" }, { "docid": "3fce177d6af385b026bf0a1107fa4854", "score": "0.55414265", "text": "function onStartServer() {\n\n}", "title": "" }, { "docid": "4d92cc02abb29108b31869fc4dc8259c", "score": "0.5500242", "text": "function setupHandlers() {\n\n // onClick open checkbox - Tell server to Open or Close a pin\n $('.open').click(function () {\n var value1 = $(this).prop('checked');\n sendUpdateToServer(this, \"open\", value1);\n });\n\n // onClick High checkbox - Tell server to set Pin High or Low\n $('.high').click(function () {\n var value1 = $(this).prop('checked');\n sendUpdateToServer(this, \"setvalue\", value1);\n });\n\n // onClick Radio button - Tell server to set pin driveMode\n $('.radio').click(function () {\n var drvMode1 = $(this).attr('value');\n sendUpdateToServer(this, \"setdrivemode\", drvMode1);\n });\n\n $('#reconnect').click(function () {\n poll(1);\n });\n }", "title": "" }, { "docid": "2431c6908b0890c347c0fb600ea1ed25", "score": "0.5467573", "text": "importFileHandler() {\n\t\tthis.setState({\n\t\t\theaderDefault: this.defaultHeaderActions,\n\t\t\timportMode: '',\n\t\t});\n\t}", "title": "" }, { "docid": "e315835ba3963a96b571773b1bdc69b9", "score": "0.5452108", "text": "function loadFileExtensionHandlers(){\r\n \tfileExtensionHandler = new Array();\r\n \tfileExtensionHandler['templateJavascriptDirectory'] = new Array(\".js\") ;\r\n\tfileExtensionHandler['templateCSSDirectory'] = new Array(\".css\");\r\n\tfileExtensionHandler['templateImagesDirectory'] = new Array(\".gif\", \".jpg\", \".png\");\r\n\tfileExtensionHandler['importFile'] = new Array(\".zip\");\r\n }", "title": "" }, { "docid": "83ec408b7125d39ab55d55fa0edfd114", "score": "0.5437934", "text": "function _runReadyHandlers() {\n\t\tif(--_modulesToInit === 0) {\n\t\t\t$.each(_readyHandlers, function() {\n\t\t\t\tthis.call(this);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e1cfd7ae835f1f825d8d5177c736a583", "score": "0.5329822", "text": "registerHandlers() {\n this.expressServer.get(\"/id/:id\", Server.raceHandler);\n //this.expressServer.get(\"/id/:id/remove\", Server.removeCacheHandler);\n this.expressServer.get(\"/\", Server.indexHandler);\n this.expressServer.get(\"/robots.txt\", Server.robotsHandler);\n }", "title": "" }, { "docid": "e3aad12522514ebc825e40a7264d075a", "score": "0.53278714", "text": "function _preHandlers() {\n var session;\n // enable db connection\n if(config.db.enabled) {\n var db = require('./db');\n db.init(config.db);\n logger.info(pkgname + \" mongodb initialized at:\"+config.db.url);\n\n // export crudHelper\n exports.crudHelpers = require('mongoose-plugins').crudHelpers;\n exports.installUserSchema = require('mongoose-plugins').installUserSchema;\n\n // enable db sessions\n var oneWeek = 657450000;\n session = express.session({\n key : config.app.key,\n store : new Session({url: config.db.url }), \n cookie : { maxAge: config.app.cookieAge||oneWeek }, \n secret : config.app.secret\n });\n logger.info(pkgname + \" persistent sessions enabled\");\n } else {\n session = express.session({\n key : config.app.key,\n secret : config.app.secret\n });\n logger.info(pkgname + \" in-memory sessions enabled\");\n }\n app.use(session);\n\n}", "title": "" }, { "docid": "a556343cecca68eaebf0bbaf1ea826e4", "score": "0.5324858", "text": "function initServer() {\n\n app.use( bodyParser.json() ); // to support JSON-encoded bodies\n app.use(bodyParser.urlencoded({ // to support URL-encoded bodies\n extended: true\n }));\n\n // Error Handler\n app.use(function(err, req, res, next) {\n console.error(err.stack);\n res.status(500).send('Something broke!');\n });\n\n // Log with Timestamp and Request Path\n app.use(function(req, res, next) {\n console.log(\"Time: \\t\" + Date.now() + \"\\t| Request-path:\\t\" + req.path);\n next();\n });\n\n server.listen(PORT, function () {\n console.log('--Listening on port 3000--');\n });\n\n}", "title": "" }, { "docid": "fb39219ade0cf767f305aeabca4696e5", "score": "0.5312678", "text": "init() {\n\t\t_.bindAll(this, 'start')\n\t\twindow.App = this\n\t\tthis.browserHistory = useRouterHistory(createHistory)({basename: process.env.BASENAME_ENV});\n\t\tthis.BaseName = process.env.BASENAME_ENV.replace('/','');\n\t\tthis.Bridge = { dispatch: _.noop }\n\t\tthis.Urls = resolver.init(config, this);\n\t\tthis.Config = Object.assign(config, this.getCustomerConfig(this.Settings.Customer));\n\t\tthis.Globals = new globals;\n\t\t//temp fix, needs to set it on the server\n\t\tif (this.BaseName === 'baja-cms') {\n\t\t\tthis.Settings.Customer = 'baja';\n\t\t}\n\t\tthis.commands = commands\n\n\t\tif (isLocal()) {\n\t\t\tconst domain = App.Urls.node\n\t\t\tconst endpoint = App.Endpoints.nodepath\n\t\t\tthis.Urls.nodepath = `${domain}${endpoint}`\n\t\t}\n\n\t\tthis.prestart()\n\t}", "title": "" }, { "docid": "866910268379e360a3bdaaa26365b19e", "score": "0.5311438", "text": "function init() {\n\tdisableHandler();\n\t\t//need url for whitelist handling\n\t\tchrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {\n\t\t//get base url\n\t\tvar pathArray = tabs[0].url.split( '/' );\n\t\turl = pathArray[0] + '//' + pathArray[2];\n\t\twhitelistHandler();\n\t});\n}", "title": "" }, { "docid": "47245c0ab0c75710975325bd1b94394d", "score": "0.530003", "text": "async init(){\n //Variable for reading files from handlers directory.\n const fileNames = readdirSync('./src/handlers/commands');\n //Getting each file and importing the files.\n for(const name of fileNames){\n //Import starts from where the command handler is.\n const { default: Command } = await import(`./commands/${name}`);\n const command = new Command();\n if(!command.name) continue;\n\n //Setting each command to its name.\n this.commands.set(command.name, command);\n }\n\n console.log(`${fileNames.length - 1} commands were loaded.`);\n }", "title": "" }, { "docid": "ca92c0cbc3d3925023a2efdc0537c985", "score": "0.52830976", "text": "function _setEvents() {\n // Setup the eventing for the server\n // NOTE Setting the module methods explicitly so we can unit test eventing\n server.on('request', module.exports.requestHandler);\n server.on('error', module.exports.errorHandler);\n server.on('socketError', module.exports.errorHandler);\n}", "title": "" }, { "docid": "f5ae4630b128384fa0579e55490d78c6", "score": "0.5272976", "text": "preInitialization() {\n\t\tconst states = {\n\t\t\t\"start\" : /^(\\d+) files total$/i,\n\t\t\t\"parse\" : /^parsing (.*)$/i,\n\t\t\t\"ended\" : /^all (\\d+) php files parsed in \\d+ seconds. \\d+ mib allocated.$/i,\n\t\t};\n\n\t\t// Index files are present in log messages, so let's just parse them\n\t\tthis._lc.onLogMessage((message) => {\n\t\t\tconst data = message.message;\n\n\t\t\tObject.keys(states).map((state, index) => {\n\t\t\t\tconst pattern = states[state];\n\t\t\t\tconst matches = data.match(pattern);\n\n\t\t\t\tif (matches) {\n\t\t\t\t\tconst value = matches[1];\n\n\t\t\t\t\tswitch (state) {\n\t\t\t\t\t\tcase \"start\" : this.incrementProgressBar(value) ; break;\n\t\t\t\t\t\tcase \"parse\" : this.incrementProgressBar(value) ; break;\n\t\t\t\t\t\tcase \"ended\" : this.updateStatusBar(matches[0]) ; break;\n \t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t})\n\t}", "title": "" }, { "docid": "b4965b57f016e8e186f3371579d320b0", "score": "0.52675414", "text": "function onStartup() {\n\tcon.info(`Server started at ${server.address().address}:${server.address().port}`);\n\tcon.info(\"Working directory is \" + process.cwd() + \"/\");\n\tcon.info(\"Server is located at \" + __dirname + \"/\");\n}", "title": "" }, { "docid": "0aae257cca22a9f2128662eaeeecddfb", "score": "0.5223353", "text": "function initialiseRoutes() {\n LogEventDispatcher.log('Loading routes...');\n var routes = __dirname + '/routes';\n\n fs.readdirSync(routes).forEach(function (file) {\n LogEventDispatcher.log('\\t' + file);\n require(routes + '/' + file)(server, schemas);\n });\n}", "title": "" }, { "docid": "2f642dcd6e75c405c4969308d4b089dd", "score": "0.5218566", "text": "function onListen() {\n\t\t\tvar addr = server.address();\n\t\t\tdebug( 'HTTP server initialized. Server is listening for requests on %s:%d.', addr.address, addr.port );\n\t\t\tdone( null, server );\n\t\t}", "title": "" }, { "docid": "b25e8c97172e9f4b9aae9a0b8753c6c6", "score": "0.5212704", "text": "function init() {\n\t\troutes.options.viewBase = $('#main');\n\t\t\n\t\tupdateBaseHref();\n\t\troutes.on('route', handleRouteChange);\n\t\troutes.init(location.pathname.replace(/(^|\\/)index\\.html$/gi,'/'));\n\t\t\n\t\tapp.emit('init');\n\t}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.5209758", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.5209758", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "b5a241c8b4aa5776f41e3bddbca9af4c", "score": "0.5204707", "text": "initializeConnectionHandler() {\n this.connectionHandler = new ConnectionHandler();\n this.connectionHandler.subscribe(\"updateChannelsList\", updateChannelObserver.bind(this));\n this.connectionHandler.subscribe(\"onGetChannel\", onGetChannelObserver.bind(this));\n this.connectionHandler.subscribe(\"onMessage\", onMessage.bind(this));\n this.connectionHandler.subscribe(\"onError\", onErrorObserver.bind(this));\n this.connectionHandler.connect(`ws://log2420-nginx.info.polymtl.ca/`, this.model.username);\n }", "title": "" }, { "docid": "d802b814c139fe1575e5e456087c854e", "score": "0.5204696", "text": "_mountHandlers() {\n if (this._handlers) {\n this._handlers.forEach((item) => {\n this._mount(item);\n });\n }\n }", "title": "" }, { "docid": "df1b4a1283368f9ea0ac93253f53fdad", "score": "0.5203005", "text": "function init() {\n /**\n * Init Function to add event handlers\n */\n $('#addMoreGoalButton').click(addMoreGoal);\n $('#lastGoalInput').keypress(function (e) {\n if (e.which == 13) {\n e.preventDefault();\n e.stopPropagation();\n addMoreGoal();\n }\n });\n $('#addMoreRequirementButton').click(addMoreRequirement);\n $('#lastRequirementInput').keypress(function (e) {\n if (e.which == 13) {\n e.preventDefault();\n e.stopPropagation();\n addMoreRequirement();\n }\n });\n\n $(\"#uploadFile\").on('change', function(event) {\n uploadFile(event.target.files[0])\n });\n $('#lcs4Proceed').click(handleLCS4Proceed);\n}", "title": "" }, { "docid": "38b72f51dce8f0744f404dcd72d13099", "score": "0.52003", "text": "start() {\n\t\tthis.server = new Hapi.Server();\n\t\tthis.server.connection({\n\t\t\tport: this.port,\n\t\t\thost: this.host,\n\t\t});\n\n\t\t// Register all required plugins / middleware\n\t\tthis.server.register([\n\t\t\t{\n\t\t\t\tregister: Blipp,\n\t\t\t\toptions: {},\n\t\t\t},\n\t\t\t{\n\t\t\t\tregister: logger,\n\t\t\t},\n\t\t], registerErr => {\n\t\t\tif(registerErr) {\n\t\t\t\tthrow registerErr;\n\t\t\t}\n\n\t\t\t// Register routes\n\t\t\tthis.server.route(routes);\n\n\t\t\t// Start server\n\t\t\tthis.server.start(startErr => {\n\t\t\t\tif(startErr) {\n\t\t\t\t\tthrow startErr;\n\t\t\t\t}\n\n\t\t\t\tconsole.log(`Server running at: ${this.server.info.uri}`);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "c25b6c54e34c7a35dfe02ca407574cd8", "score": "0.51971066", "text": "initializing() {\n this.log(yosay(chalk.green('Starting to handle ESLint actions.')));\n this.conf = this.fs.readJSON(this.destinationPath(confNameFile));\n }", "title": "" }, { "docid": "4141c7ea3a18fb11536e5210851ff343", "score": "0.5194446", "text": "function Init(cb){\n // cb will be called, after all files are loaded\n finished = _.after(Object.keys(files).length, () => {\n if(crashFlag){\n console.error(\"Filesystem failed initializing!\");\n console.log(errorArray);\n //TODO Properly handle errors, with error page, etc\n return;\n }\n cb();\n });\n fs.readFile('./JSON/tools.json',(err, data) => setParseData(\"toolsJSON\", err, data));\n}", "title": "" }, { "docid": "7e8051827fa949a6fecf3291db4bc0f9", "score": "0.5184245", "text": "onReady() {\n this.l.info('ready fired');\n\n this.emit('beforePluginsLoad');\n\n this.loadPlugins();\n\n this.emit('beforeModulesLoad');\n\n this.loadModules();\n\n this.emit('beforeDesktopJsLoad');\n\n // desktopLoaded event in emitted from the inside of loadDesktopJs\n this.loadDesktopJs();\n\n this.localServer = this.modules.localServer;\n\n this.localServer.setCallbacks(\n this.onStartupFailed.bind(this),\n this.onServerReady.bind(this),\n this.onServerRestarted.bind(this)\n );\n\n this.emit('beforeLocalServerInit');\n\n this.localServer.init(\n this.modules.autoupdate.getCurrentAssetBundle(),\n this.desktopPath\n );\n\n this.emit('afterInitialization');\n }", "title": "" }, { "docid": "83be5f58c0ec35d0e0c021d596c2eb98", "score": "0.5184134", "text": "_bindEventHandlers(){\n if ( this._server !== null ){\n // Bind the event handler for errors.\n this._server.on('error', (error) => {\n Logger.logError(error);\n this.emit('error', error);\n });\n // Bind the event handler for client requests.\n this._server.on('request', async (request, response) => {\n await this._handleRequest(request, response);\n this.emit('request', request, response);\n });\n // Bind the event handler used to track client requests.\n this._server.on('connection', (connection) => {\n this._trackConnection(connection);\n this.emit('connection', connection);\n });\n // Emit all events supported by the built-in http module.\n this._forwardEvents();\n }\n }", "title": "" }, { "docid": "03a25a0fc38485138a1cfa90653fba8f", "score": "0.5180354", "text": "function setupEventHandlers( ) {\n\n // set hidden form fields, used to attach the upload correctly\n jq.hdnOwnerCollection.val(ownerCollection);\n jq.hdnOwnerId.val(ownerId);\n\n jq.frmSingleImg.attr('action', Y.doccirrus.infras.getPrivateURL( '/1/media/:upload' ));\n\n Y.log('Setting up handlers: ' + ownerCollection + '::' + ownerId, 'debug', NAME);\n\n jq.frmSingleImg.off('submit').on( 'submit', onLegacyFormSubmission );\n\n jq.btnReset.off('click.image').on( 'click.image', resetCurrentImage );\n\n jq.imgPreview.off('click.image').on( 'click.image' , onImageClick );\n\n jq.btnCamera.off('click.image').on( 'click.image', onCameraClick );\n\n jq.btnSnapshotBack.off('click.image').on( 'click.image', onBackClick );\n\n jq.selAttachedImg.off( 'change.image' ).on( 'change.image', onSelChanged );\n\n jq.fileUploadBox.on('change', function( e ) {\n onUploadChanged( e, function(err) {\n if (err) {\n Y.log('Error uploading from file upload box: ' + err, 'warn', NAME);\n }\n } );\n } );\n\n jq.fileSelect.on('change', function( e ) {\n onUploadChanged( e , function(err) {\n if (err) {\n Y.log('Error uploading from file select: ' + err, 'warn', NAME);\n }\n });\n } );\n\n if (true === useAjax) {\n jq.btnSubmitLegacy.hide();\n }\n\n //Y.log('Setting preview size: ' + thumbWidth + 'x' + thumbHeight, 'debug', NAME);\n jq.imgPreview.width(thumbWidth);\n jq.imgPreview.height(thumbHeight);\n\n Y.doccirrus.media.makeDroppable('imgPreviewDiv', onFilesDropped);\n\n }", "title": "" }, { "docid": "12d691eaad2b519fc2a956a85d7475b1", "score": "0.517037", "text": "function initialize () {\n setupVariables();\n populateCache();\n setupTerminationHandlers();\n\t\t\t\t\n }", "title": "" }, { "docid": "347881012e295516fd3c830965b97e9a", "score": "0.517004", "text": "function initialize() {\n zapp.setupTerminationHandlers();\n\n // Create the express server and routes.\n zapp.initializeModels();\n zapp.initializeServer();\n}", "title": "" }, { "docid": "d6023f79b86faeb49839b8654ce4bb20", "score": "0.5163327", "text": "static start() {\n\t\t//Load plugins\n\t\tApp._loadPlugins();\n\t\tApp._createRoutes();\n\t\tApp._startListeners()\n\t\t\t.then(() => {\n\t\t\t\tApp._setSocketHandlers();\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tthrow err;\n\t\t\t});\n\t}", "title": "" }, { "docid": "a76898207bd8ff2e7263f722f285860d", "score": "0.5154279", "text": "_init() {\n this.components = [];\n try {\n this.services(this.options.services);\n this.uses(this.options.components);\n\n process.on('SIGTERM', () => {\n this.logger.info('SIGTERM received...');\n this.shutdown();\n });\n\n process.on('SIGINT', () => {\n this.logger.info('SIGINT received...');\n this.shutdown();\n });\n } catch (err) {\n this.logger.error(err.message);\n process.exit(1);\n }\n }", "title": "" }, { "docid": "faa71a10cf698bfe384f379826ec6dd0", "score": "0.5151956", "text": "init() {\n\t\tdebug = this.debug;\n\t\tlog = this.log;\n\n\t\tthis.initPresets();\n\t\tthis.init_tcp();\n\t}", "title": "" }, { "docid": "2d393b858b3d830a656890024712b982", "score": "0.51513755", "text": "function content_init() {\n\tdocument.getElementById('newserver').addEventListener('click', (e) => {\n\t\tshowStartForm();\n\t});\n\tdocument.getElementById('connect_connect').addEventListener('click', (e) => {\n\t\tdoJoinServer();\n\t});\n\tlet join_server_form_input_list = ['connect_server', 'connect_port', 'connect_username', 'connect_realname'];\n\tfor (let i = 0; i < join_server_form_input_list.length; i++) {\n\t\tlet element = document.getElementById(join_server_form_input_list[i]);\n\t\telement.addEventListener('keydown', (e) => {\n\t\t\tif (e.keyCode == 13) {\n\t\t\t\tdoJoinServer();\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0b08bf25cac05c9cf2356920a2adc4ba", "score": "0.51379955", "text": "function initIndex(){\n\t/* \n\t This adds the html files for serving in our html folder. \n\t serv is the url we are serving to, and path is the path \n\t of the file that we are serving. \n\t*/\n\tvar htmlPath = __dirname + \"/html\";\n\tfs.readdir(htmlPath, function(err, files){\n\t\tfor(let i in files){\n\t\t\tvar f = fs.statSync(__dirname+\"/html/\"+files[i]);\n\t\t\tif(f.isFile()){\n\t\t\t\tif(files[i].includes(\".html\") && !files[i].includes(\"~\")){\n\t\t\t\t\tindex.html.push({path: __dirname+\"/html/\"+files[i], serv: files[i].replace(\".html\", \"\")});\n\t\t\t\t}\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tinitIndexHtmlHelper(__dirname+\"/html/\"+files[i]);\n\t\t\t}\n\t\t}\n\t});\n\t\n\t/* \n\t This adds the css files for serving in our css folder. \n\t serv is the url we are serving to, and path is the path \n\t of the file that we are serving.\n\t*/\n\tvar cssPath = __dirname + \"/css\";\n\tfs.readdir(cssPath, function(err, files){\n\t\tfor(let i in files){\n\t\t\tvar f = fs.statSync(__dirname+\"/css/\"+files[i]);\n\t\t\tif(f.isFile()){\n\t\t\t\tif(files[i].includes(\".css\") && !files[i].includes(\"~\")){\n\t\t\t\t\tindex.css.push({path: __dirname+\"/css/\"+files[i], serv: files[i]});\n\t\t\t\t}\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tinitIndexCssHelper(__dirname+\"/css/\"+files[i]);\n\t\t\t}\n\t\t}\n\t});\n\t\n\t/* \n\t This adds the js files for serving in our js folder. \n\t serv is the url we are serving to, and path is the path \n\t of the file that we are serving.\n\t*/\n\tvar jsPath = __dirname + \"/js\";\n\tfs.readdir(jsPath, function(err, files){\n\t\tfor(let i in files){\n\t\t\tvar f = fs.statSync(__dirname+\"/js/\"+files[i]);\n\t\t\tif(f.isFile()){\n\t\t\t\tif(files[i].includes(\".js\") && !files[i].includes(\"~\")){\n\t\t\t\t\tindex.js.push({path: __dirname+\"/js/\"+files[i], serv: files[i]});\n\t\t\t\t}\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tinitIndexJsHelper(__dirname+\"/js/\"+files[i]);\n\t\t\t}\n\t\t}\n\t});\n\t\n\t/* \n\t This adds the js files for serving in our js folder. \n\t serv is the url we are serving to, and path is the path \n\t of the file that we are serving.\n\t*/\n\tvar mediaPath = __dirname + \"/media\";\n\tfs.readdir(mediaPath, function(err, files){\n\t\tfor(let i in files){\n\t\t\tvar f = fs.statSync(__dirname+\"/media/\"+files[i]);\n\t\t\tif(f.isFile()){\n\t\t\t\tif(!files[i].includes(\"~\") && !files[i].includes(\"DS_Store\") ){\n\t\t\t\t\tindex.media.push({path: __dirname+\"/media/\"+files[i], serv: files[i]});\n\t\t\t\t}\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tinitIndexMediaHelper(__dirname+\"/media/\"+files[i]);\n\t\t\t}\n\t\t}\n\t});\n\t\n\t/* \n\t This reads a file and creates a bunch of urls to redirect \n\t users similar to Windows host file. \n\t*/\n\tfs.readFile(__dirname + \"/reddir\", \"utf8\", function(err, res){\n\t\tvar data = res.split(\"\\n\");\n\t\tfor(let i in data){\n\t\t\tdata[i] = data[i].replace(/\\s+/g, \" \");\n\t\t\tindex.reddir.push({from: \"\"+data[i].split(\" \")[0].trim(), to: \"\"+data[i].split(\" \")[1].trim() });\n\t\t}\n\t\t//console.table(index.reddir);\n\t});\n\t\n\t/* \n\t This adds the api files that we run when a user accesses \n\t a url in our api folder. serv is the url we are serving \n\t to, and path is the path of the file that we are serving. \n\t All of these files must have a main funtion that accepts \n\t a request and a response from the server, and ends the \n\t connection after doing whatever their job is. \n\t*/\n\tvar htmlPath = __dirname + \"/api\";\n\tfs.readdir(htmlPath, function(err, files){\n\t\tfor(let i in files){\n\t\t\tvar f = fs.statSync(__dirname+\"/api/\"+files[i]);\n\t\t\tif(f.isFile()){\n\t\t\t\tif(files[i].includes(\".js\") && !files[i].includes(\"~\")){\n\t\t\t\t\tindex.api.push({path: __dirname+\"/api/\"+files[i], serv: files[i].replace(\".js\", \"\")});\n\t\t\t\t}\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tinitIndexApiHelper(__dirname+\"/api/\"+files[i]);\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "f22a56b962212bf128a281f91d9899fc", "score": "0.5127963", "text": "function initialize(evt) {//err, callback) {\n insertShellUI();\n return getDir(\"/\", function(node) {\n if(!node) {\n return err(\"could not initialize root directory\");\n }\n _self.pathhandler.current = node;\n _self.root = node;\n // return feedlyconsole.ready(function() {\n\n // });\n });\n }", "title": "" }, { "docid": "9a3774f511fdbdac70df412683ee736f", "score": "0.51209944", "text": "init() {\n // By default we don't trace http server since most web frameworks use it.\n if ((process.env.EPSAGON_TRACE_HTTP_SERVER || '').toUpperCase() === 'TRUE') {\n shimmer.wrap(http, 'createServer', func => httpServerWrapper(func, 'http'));\n shimmer.wrap(https, 'createServer', func => httpServerWrapper(func, 'https'));\n }\n }", "title": "" }, { "docid": "2e0aa0253e995e1a078ee0f5ead77c51", "score": "0.5114449", "text": "async registerHttpServer() {\n\t\tthis.httpServer = new HttpServer(this.app, this.port);\n\t\tthis.httpServer.on('error', err => {\n\t\t\treturn new VError(err, 'Error to initialize the server');\n\t\t});\n\t\tthis.httpServer.on('info', msg => {\n\t\t\tconsole.log(msg);\n\t\t});\n\n\t\tthis.httpServer.init();\n\t}", "title": "" }, { "docid": "fe80caccb1abfb828779428c630828d1", "score": "0.5103851", "text": "function _init() {\n\t\t\t// Trigger a few events so the bar looks good on startup.\n\t\t\t_timeHandler({\n\t\t\t\tid: _api.id,\n\t\t\t\tduration: _api.jwGetDuration(),\n\t\t\t\tposition: 0\n\t\t\t});\n\t\t\t_bufferHandler({\n\t\t\t\tid: _api.id,\n\t\t\t\tbufferProgress: 0\n\t\t\t});\n\t\t\t_muteHandler({\n\t\t\t\tid: _api.id,\n\t\t\t\tmute: _api.jwGetMute()\n\t\t\t});\n\t\t\t_stateHandler({\n\t\t\t\tid: _api.id,\n\t\t\t\tnewstate: jwplayer.api.events.state.IDLE\n\t\t\t});\n\t\t\t_volumeHandler({\n\t\t\t\tid: _api.id,\n\t\t\t\tvolume: _api.jwGetVolume()\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "d4a365b0ef66cd7133d737fd6562d2c3", "score": "0.5099958", "text": "function setupHandlers( node ) {\n\n // keep these for later\n myNode = node;\n ownerCollection = node.dcimages.ownerCollection;\n ownerId = node.dcimages.ownerId;\n\n // pre-cache jquery selectors\n\n jq = {\n hdnOwnerCollection: $('#hdnOwnerCollection'),\n hdnOwnerId: $('#hdnOwnerId'),\n frmLogoImg: $('#frmLogoImg'),\n ifSaveTarget: $('#ifSaveTarget'),\n btnReset: $('#resetbtn'),\n btnSubmit: $('#btnSubmit'),\n fileUploadBox: $('#fileUploadBox'),\n fileUploadLabel: $('#fileUploadLabel'),\n legacyFile: $('#file'),\n imgPreview: $('#logopreview'),\n txtFilename: $('#filename')\n };\n\n // set hidden form fields, used to attach the upload correctly\n jq.hdnOwnerCollection.val(ownerCollection);\n jq.hdnOwnerId.val(ownerId);\n\n // legacy browsers only, under consideration for removal\n jq.frmLogoImg.attr('action', Y.doccirrus.infras.getPrivateURL( '/1/media/:upload' ));\n\n Y.log('Setting up handlers: ' + ownerCollection + '::' + ownerId, 'debug', NAME);\n\n if (false === useAjax) {\n jq.btnSubmit.show();\n }\n\n jq.frmLogoImg.off('submit').on( 'submit', function ( ) {\n Y.log('Form submission', 'info', NAME);\n deleteCurrentLogo();\n\n jq.ifSaveTarget.off('load').on('load', function(){\n Y.log('iframe loaded', 'info', NAME);\n reloadImages();\n });\n\n });\n\n jq.btnReset.off('click').on('click', function() {\n deleteCurrentLogo();\n } );\n\n jq.fileUploadBox.off('change').on('change', function( e ) {\n onUploadChanged( e );\n } );\n\n jq.legacyFile.off('change').on('change', function( e ) {\n onUploadChanged( e );\n } );\n\n if (true === useAjax) {\n jq.btnSubmit.hide();\n }\n\n // dropdiv is actually an image @now\n var dropdiv = document.getElementById( 'logoDiv' ); // jQuery events didn't work for me here;\n\n dropdiv.addEventListener( \"dragenter\", function( evt ) {\n onDragEnter( evt );\n }, false );\n\n dropdiv.addEventListener( \"dragexit\", function( evt ) {\n onDragExit( evt );\n }, false );\n\n dropdiv.addEventListener( \"dragover\", function( evt ) {\n onDragOver( evt );\n }, false );\n\n dropdiv.addEventListener( \"drop\", function( evt ) {\n onDrop( evt );\n return false;\n }, false );\n\n reloadImages();\n }", "title": "" }, { "docid": "3b558fd715cd9df17d9c24fb796ec00f", "score": "0.50973594", "text": "function LoadServer(server, controllers) {\n server.register([\n {\n register: require('bell')\n },\n {\n register: require('vision')\n },\n {\n register: Inert\n },\n {\n register: require('good'),\n options: logOptions\n }\n ], function(err) {\n\n // views\n server.views(viewOptions);\n\n // statics\n server.route(routes.assets);\n\n // health check\n server.route(routes.health);\n\n server.register(controllers, function(err) {\n if (!module.parent) {\n server.start(function () {\n debug('Server started at port ' + server.info.port);\n });\n }\n });\n\n });\n}", "title": "" }, { "docid": "876a105f4560ad9a7d330775aa41ab5b", "score": "0.5094032", "text": "function initializeServer() {\n zapp.app.use(allowCrossDomain);\n zapp.app.use(bodyParser.json({limit: '50mb'}));\n //zapp.app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));\n var ioObject = createSocket();\n\n routes.init(zapp.app, ioObject);\n\n // Setting application local variables\n zapp.app.locals.title = config.app.title;\n zapp.app.locals.jsFiles = config.getJavaScriptAssets();\n zapp.app.locals.cssFiles = config.getCSSAssets();\n\n // Passing the request url to environment locals\n /*zapp.app.use(function(req, res, next) {\n res.locals.url = req.protocol + '://' + req.headers.host + req.url;\n next();\n });*/\n\n // Should be placed before express.static\n zapp.app.use(compress({\n filter: function(req, res) {\n return (/json|text|javascript|css/).test(res.getHeader('Content-Type'));\n },\n level: 9\n }));\n\n // Showing stack errors\n zapp.app.set('showStackError', true);\n\n // Set swig as the template engine\n zapp.app.engine('server.view.html', consolidate[config.templateEngine]);\n\n // Set views path and view engine\n zapp.app.set('view engine', 'server.view.html');\n zapp.app.set('views', 'app/views');\n\n // Setting the app router and static folder\n zapp.app.use(express.static(path.resolve('./public')));\n //zapp.app.use('public/assets', express.static(path.resolve('./public/assets')));\n}", "title": "" }, { "docid": "40079ce03dc9c9bdaa30c2d845886d8b", "score": "0.50876516", "text": "_setupHandlers() {\n this._onAirportChangeHandler = this.onAirportChange.bind(this);\n this._onTutorialToggleHandler = this.tutorial_toggle.bind(this);\n\n return this;\n }", "title": "" }, { "docid": "8e677e4bf06b28d039592abdc397007d", "score": "0.50828755", "text": "function FileHandler(reqContext, config)\r\n {\r\n this._reqContext = reqContext;\r\n this._config = config;\r\n }", "title": "" }, { "docid": "487ecfd25b292b982b795ddbd35c91ac", "score": "0.50823236", "text": "function initialize(serverSvc, fileSystemSvc) {\n\n var dirRouteFileName = 'routes.js';\n console.log('Initializing routes');\n fileSystemUtility.getSubDirectories('./server/routes', function(err, directories) {\n directories.forEach(function(dir) {\n var fileName = dir + '/' + dirRouteFileName;\n fileSystemSvc.getFileExistsAsync(fileName, function(exists) {\n if (exists) {\n require(fileName.replace('./server/routes','./')\n .replace('.js', ''))(serverSvc);\n }\n });\n });\n\n });\n\n\n var urlObj = { protocol: cb.config.protocol, hostname: cb.config.hostname,\n pathname: cb.config.baseUri};\n if (cb.config.usePortInHypermedia) urlObj.port = cb.config.port;\n\n var rs = cb.rootRequire('route-builder')(serverSvc.addRoute,\n require('url').format(urlObj));\n\n rs.addResource({ uri: '', name: 'root', rel: 'root'} )\n .addMethod(rs.resourceMethods.GET, { rules: [a.Guest]}, coreCtrl.core,\n { self: true });\n\n}", "title": "" }, { "docid": "962a7f8c92ce7d43cec3273fc0faa686", "score": "0.5078135", "text": "_setupServer() {\n this.server.use(restify.plugins.queryParser());\n\n // Adds Probo's request logger\n this.server.use(requestLogger({ logger: this.logger }));\n\n // Sets up request logging\n this.server.use((req, res, next) => {\n this.logger.info({ req: req }, 'REQUEST');\n next();\n });\n\n this.server.on(\n 'after',\n restify.plugins.auditLogger({\n log: this.logger,\n event: 'after',\n })\n );\n }", "title": "" }, { "docid": "e5d9c7565882223e46529db832224913", "score": "0.5077989", "text": "function startWebServer( ){\n\n var srvCfg = yaml.load( ft.getRootPath( ) + ft.CONST.PATH_DELIMITER + 'config.yaml' );\n\n getWebServer( ).listen( srvCfg.SERVER.SERVER_PORT );\n\n notifier.notify( {\n\n 'title': 'Server',\n 'message': 'Start at ' + srvCfg.SERVER.SERVER_DOMAIN + ':' + srvCfg.SERVER.SERVER_PORT\n } );\n}", "title": "" }, { "docid": "d64594040bfc449abfae6da505d75dbb", "score": "0.5067981", "text": "function initializeRemoteFilesResolution() {\n const func = 'initializeRemoteFilesResolution'; OUT.debug(func);\n clearRemoteFileSelection();\n setupRemoteFilePrompt();\n }", "title": "" }, { "docid": "269e892a922900c11e8ae4215d631cf7", "score": "0.50675833", "text": "initHTTPErrorCodes() {\n\t\t//HTTP error codes and pages\n\t\tthis.errorCodes = {};\n\t\tfs.readFile(path.join(configDirectory,\"errorCodes.json\"), 'utf8', (err,data) => {\n\t\t\tthis.setHTTPErrorCodes(err,data);\n\t\t});\n\t}", "title": "" }, { "docid": "1b28a44f898f48ca33d42bdc6edc2de1", "score": "0.50673133", "text": "constructor () {\n this.handlers = {\n ls: {\n handlerFunc: (protocol, conn) => lsHandler(this, conn),\n matchFunc: matchExact\n\n }\n }\n this.log = util.log.listener()\n }", "title": "" }, { "docid": "1b28a44f898f48ca33d42bdc6edc2de1", "score": "0.50673133", "text": "constructor () {\n this.handlers = {\n ls: {\n handlerFunc: (protocol, conn) => lsHandler(this, conn),\n matchFunc: matchExact\n\n }\n }\n this.log = util.log.listener()\n }", "title": "" }, { "docid": "df7e5e1ffd2ce39beb85ebe73391accf", "score": "0.50456357", "text": "function initialize() {\n fileUpload.getQueues()\n .success(function (data) {\n //if there are uploads, cycle through them and add them\n if (data.uploads) {\n for (var x = data.uploads.length - 1; x >= 0; x--) {\n $scope.fileUploads[data.uploads[x].fileId] = data.uploads[x];\n watchFileProcess(data.uploads[x].fileId);\n }\n }\n });\n }", "title": "" }, { "docid": "f604959884ab2a919525e5a588155e41", "score": "0.50433177", "text": "init() {\n\t\ttry {\n\t\t\tthis.manager.get(\"hostReq\").request(\n\t\t\t\t{\n\t\t\t\t\tmethod: \"post\",\n\t\t\t\t\turl: this.endpoints.get,\n\t\t\t\t\tdata: {},\n\t\t\t\t},\n\t\t\t\t(response) => {\n\t\t\t\t\tif (typeof response !== \"object\" && !response.website) {\n\t\t\t\t\t\t$(document).Toasts(\"create\", {\n\t\t\t\t\t\t\tclass: \"bg-danger\",\n\t\t\t\t\t\t\ttitle: \"Error loading WWSU server configuration\",\n\t\t\t\t\t\t\tbody:\n\t\t\t\t\t\t\t\t\"There was an error WWSU server configuration. Please report this to the engineer.\",\n\t\t\t\t\t\t\tautoHide: true,\n\t\t\t\t\t\t\tdelay: 10000,\n\t\t\t\t\t\t\ticon: \"fas fa-skull-crossbones fa-lg\",\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.config = response;\n\t\t\t\t\t\tthis.emitEvent(\"configChanged\", [response, this.config]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (e) {\n\t\t\t$(document).Toasts(\"create\", {\n\t\t\t\tclass: \"bg-danger\",\n\t\t\t\ttitle: \"Error loading WWSU server configuration\",\n\t\t\t\tbody:\n\t\t\t\t\t\"There was an error WWSU server configuration. Please report this to the engineer.\",\n\t\t\t\tautoHide: true,\n\t\t\t\tdelay: 10000,\n\t\t\t\ticon: \"fas fa-skull-crossbones fa-lg\",\n\t\t\t});\n\t\t\tconsole.error(e);\n\t\t}\n\t}", "title": "" }, { "docid": "d17f741011f379fd88c0088b1b2c8080", "score": "0.50430983", "text": "assignHandlers() {\n this.funcs.forEach((func) => {\n const handlerPath = `${this.config().handlersDirName.replace('\\\\', '/')}/${func.rpcHandlerFile}`;\n const serviceFunc = this.sls.service.functions[func.key];\n serviceFunc.handler = `${handlerPath}.${func.rpcHandlerObject}`;\n\n // Adding handler to include (in case it was excluded).\n if (_.isObject(serviceFunc.package) && _.isObject(serviceFunc.package.include)) {\n serviceFunc.package.include = [...serviceFunc.package.include, handlerPath];\n }\n });\n\n // Adding the general rpc handlers dir to include (in case it was excluded).\n if (_.isObject(this.sls.service.package.include)) {\n this.sls.service.package.include = [\n ...this.sls.service.package.include,\n `${this.config().handlersDirName.replace('\\\\', '/')}/**`,\n ];\n }\n }", "title": "" }, { "docid": "2631896c44b804bd6f3e4c77e926ba6b", "score": "0.50419754", "text": "constructor( args ) {\n\n // Parse and show banner\n const pack = JSON.parse( fs.readFileSync( __dirname + '/package.json', 'utf8' ) );\n console.log(pack.name,'version',pack.version);\n\n // Parse config\n const config = yaml.safeLoad(\n fs.readFileSync( args.config, 'utf8' ),\n {\n schema: yamlinc.YAML_INCLUDE_SCHEMA\n } );\n\n // Cleanup the tree as we have intermediate '/' keys\n Object.keys(config)\n .filter( k => config[k]['/'] )\n .forEach( k => config[k]=config[k]['/'] );\n\n // Look for any database entries within handlers\n Database.register( Object.keys(config.handlers)\n .map( n => config.handlers[n] )\n .map( h => h.databases )\n .filter( n => n )\n .reduce( (a,b) => Object.assign( a, b ), {} )\n );\n\n // Also flatten the handlers into a single array\n config.handlers = Object.keys(config.handlers)\n // Map to handlers\n .map( n => config.handlers[n] )\n // Filter out any files without a handlers entry\n .filter( n => n )\n // Now the inner element\n .map( h => h.handlers )\n // Filter out any files without a handlers entry\n .filter( n => n )\n // Reduce into a single array\n .reduce( (a,b) => a.concat(b), [] );\n\n // Now configure each server\n this.servers = Object.keys(config.servers)\n .reduce( (servers,name) => {\n servers[name] = ServerRepository.resolve(name, config.servers[name], config);\n return servers;\n }, {});\n\n // Now start the servers\n Object.keys(this.servers)\n .map( n => this.servers[n] )\n .reduce(\n (p,s) => s.start( p ),\n new Promise( (res,rej) => res() )\n .catch(e => {\n console.error('Promise failure', e);\n process.exit(1);\n })\n );\n\n // Stops the process from exiting whilst promises are resolved\n setTimeout( () => {}, 1000);\n }", "title": "" }, { "docid": "3a5b4fe0de6a467f6d01ffd7abc2bda1", "score": "0.50416136", "text": "function InitialLoadModule()\n {\n registerHandlers();\n // GEEK: Load files that are used later, \n setTimeout('loadOtherFiles();',500);\n // Set a debugger option.\n if( isDebugMode() )\n {\n console.info(\"We are in DEBUG MODE\");\n }\n \n }", "title": "" }, { "docid": "9bc0e23ab153d65bb4593a51c4b07f45", "score": "0.503707", "text": "function initialise() {\n mainMenu();\n\n loadSystemInfo(); // Kick off cgi scripts\n initialisePage();\n}", "title": "" }, { "docid": "e178b876a06dc9d29458ab28e6f21a4b", "score": "0.503544", "text": "function init(){\n\n /*\n * Temporary code to remove hashbang on local test environment\n */\n history.replaceState({}, '', location.href.replace('#/', ''));\n console.log('Router is running');\n\n /*\n * onpopstate triggers everytime there is a browser navigation. Forward, Back or Reload.\n * We assign the onpopstate event to run our checkPath function.\n */\n window.onpopstate = checkPath;\n\n /**\n * Alternate code for same behaviour. But with an event listener instead of\n * direct assignment. Will need to test if it's working later on.\n */\n /*\n window.addEventListener('onpopstate', function(){\n checkPath();\n });\n */\n\n /*\n * Run the checkPath function to get the current location and load the page accordingly\n * Also run the session logic if required\n */\n checkPath();\n\n }", "title": "" }, { "docid": "1fdd810bba118f4b2ef87f06b89e4222", "score": "0.5034094", "text": "function initializeServer() {\n\tvar app = express();\n\tapp.use(express.static('./frontend'));\n\tvar port = (process.env.PORT || server_config.httpServerPort);\n\tvar server = http.createServer(app).listen(port, function(){\n\t\tconsole.log('app.js @', port);\n\t});\n\tio = socketio.listen(server);\n\tio.sockets.on(\"connection\", requestHandler);\n\n}", "title": "" }, { "docid": "a3ddf79c33ada91f53cc3c0365f1751f", "score": "0.50320584", "text": "function init() {\n\t\t// Get data from JSON file\n\t\tgetData(function(err, data) {\n\n\t\t\t// There was a connection error of some sort\n\t\t\tif (err) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Generate Navbar's HMTL items from data object\n\t\t\tvar html = generateNavbar('', data.items);\n\n\t\t\t// Set Navbar's HTML content\n\t\t\tdocument.getElementById('nav-menu').innerHTML = html;\n\n\t\t\t// Add behavior: Bind Events\n\t\t\tbindEvents(\"click\", '#nav-menu > li > a', evToggleSecondNav);\n\t\t\tbindEvents(\"click\", 'body', evToggleTranslucentMask);\n\t\t\tbindEvents(\"click\", '#toggle-open', evToggleMobileMenu);\n\t\t\tbindEvents(\"keyup\", 'body', evToggleTranslucentMaskEsc);\n\t\t\t// Check window resize\n\t\t\twindow.onresize = (function () {\n\t\t\t\tif (window.innerWidth >= 768 ) {\n\t\t\t\t\tresetPrimaryNav();\n\t\t\t\t\ttoggleContentWrap();\n\t\t\t\t}\n\t\t\t});\n\n\t\t});\n\t}", "title": "" }, { "docid": "00bcd51c8de1e2398c34454db3ffbbb2", "score": "0.5026774", "text": "initialize() {\n this.transportManager = new BleTransportManager();\n this.transportManager.initialize();\n\n this.transportManager.registerRequestHandler((action, correlationId, payload) => {\n this.dispatchRequest(action, correlationId, payload);\n });\n }", "title": "" }, { "docid": "766175b709ccfda2ac163b8dd9f6fa22", "score": "0.5024162", "text": "function init() {\n\t\tdefineMode();\n\t\tdefineMime();\n\t\tdefineLanguage();\n\t}", "title": "" }, { "docid": "c55cf802a4ed8ff171fb89bfebbe6988", "score": "0.50139594", "text": "initialActions() {\n\t\tif (this.allowInternalStyles) {\n\t\t\tthis.internalCSS();\n\t\t}\n\t\tif (this.checkForErrors()) {\n\t\t\troundabout.on++;\n\t\t\tif (this.allowInternalHTML) {\n\t\t\t\tthis.defaultHTML();\n\t\t\t}\n\t\t\tif (this.autoGenCSS && this.allowInternalStyles) {\n\t\t\t\tthis.defaultCSS();\n\t\t\t}\n\t\t\tif (this.throttleMatchTransition) {\n\t\t\t\tthis.throttleTimeout = this.transition;\n\t\t\t}\n\t\t\tif (this.autoscroll) {\n\t\t\t\tthis.setAutoScroll(this, true);\n\t\t\t}\n\t\t\tthis.generatePages();\n\t\t\tthis.boundFollow = this.execMM.bind(this);\n\t\t\tthis.boundEnd = this.execMU.bind(this);\n\t\t\tthis.boundCancel = this.execTC.bind(this);\n\t\t\tif (this.type == \"normal\") {\n\t\t\t\tthis.swipeThreshold /= this.pagesToShow;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "6740f39450d0a7575fd284cc657cb4f7", "score": "0.5011557", "text": "async generateHandlers() {\n fs.removeSync(join(this.originalServicePath, this.config().handlersDirName));\n await this.generateHandlersCode();\n this.assignHandlers();\n }", "title": "" }, { "docid": "7d31bb068b082c61702500a8fba0a3a0", "score": "0.50075936", "text": "async function serverInitialize() {\n\n // Server ip and port configuration\n const server = Hapi.server({\n host: SERVER_MAIN_HOST,\n port: SERVER_MAIN_PORT\n });\n\n //Server plugins\n server.register({\n plugin: CookieAuth\n })\n\n //Register model methods into server\n server.method('getLevelData', controller.getLevelData, {});\n server.method('saveNewPlayer', controller.registerPlayer, {});\n server.method('logPlayer', controller.logPlayer, {});\n server.method('dlgPlayer', controller.dlgPlayer, {});\n server.method('getSessionData', controller.getSessionData, {});\n server.method('joinQueue', controller.joinQueue, {});\n server.method('leaveQueue', controller.leaveQueue, {});\n server.method('removePlayerFromSession', controller.removePlayerFromSession, {});\n server.method('abortJoinQueue', controller.abortJoinQueue, {});\n server.method('registerRecord', controller.registerRecord, {});\n //server.method('testMockLevels', controller.testMockLevels, {});\n //server.method('testMockPlayers', controller.testMockPlayers, {});\n\n server.events.on({ name: 'request' }, (request, event, tags) => {\n if(tags.abort) {\n handlers.handleAbort(request);\n }\n })\n\n //Server authentication settings\n const options = {\n password: '@|@|@|@this@is@n1nj4@r4c3@server@password@auth@cookie@bro@|@|@|@',\n cookie: 'ninjaRaceCookie',\n isSecure: false,\n redirectTo: false,\n ttl: SERVER_COOKIE_TTL\n };\n\n //Defines authentication policy for handlers\n const authPolicy = {\n auth: {\n mode: 'try',\n strategy: 'session'\n },\n plugins: {'hapi-auth-cookie': {redirectTo: false}}\n };\n\n await server.auth.strategy('session', 'cookie', options);\n\n // Response to level data request\n server.route({\n method: SERVER_MAIN_METHOD_GET,\n path: routes.LEVEL_DATA_REQUEST,\n config: authPolicy,\n handler: handlers.handleLevelDataRequest\n });\n\n // Response to player register request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.PLAYER_REGISTER_REQUEST,\n handler: handlers.handleRegisterPlayerRequest\n });\n\n // Response to login request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.PLAYER_LOGIN_REQUEST,\n handler: handlers.handleLoginRequest\n });\n\n // Response to logout request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.PLAYER_LOGOUT_REQUEST,\n config: authPolicy,\n handler: handlers.handleLogoutRequest\n });\n\n // Response to a joinQueue request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.JOIN_QUEUE_REQUEST,\n config: authPolicy,\n handler: handlers.handleQueueJoinRequest\n });\n\n // Response to a leaveQueue request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.LEAVE_QUEUE_REQUEST,\n config: {\n auth: authPolicy.auth,\n plugins: authPolicy.plugins,\n timeout: { socket: 600000, server: 540000 }\n },\n handler: handlers.handleQueueLeaveRequest\n });\n\n //Response to a registerRecord request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.UPDATE_RECORD,\n config: authPolicy,\n handler: handlers.handleRecordRegisterRequest\n });\n\n // Response to leaveSession request\n server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.LEAVE_SESSION_REQUEST,\n config: authPolicy,\n handler: handlers.handleSessionLeaveRequest\n });\n\n // Enabling this handler is prohibited unless the project is on testing\n /*server.route({\n method: SERVER_MAIN_METHOD_POST,\n path: routes.TEST_ENV_SET_UP_REQUEST,\n handler: handlers.handleEnvironmentSetup\n });*/\n\n //After server is set up, we make server start in order to listen the desired port\n try {\n await server.start();\n console.log(`NinjaRace server is now running at port ${server.info.port}`);\n } catch(err) {\n console.log(err);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "c5744846ac7c78a82240f19f06adf297", "score": "0.5007509", "text": "function initializeFunctionality() {\r\n //Determine when to save\r\n jQuery('input[name=importFileType], .dataFileFilter').change(function() {\r\n saveComponent();\r\n });\r\n\r\n isAdminUser = parent.getAdminUserFlag();\r\n\r\n fileLocationFunctionality();\r\n\r\n jQuery('#importFile').click(ensureUploadIsAllowed);\r\n jQuery('#importFile').change(choseNewFile);\r\n tryToEnableUploadFileButton();\r\n\r\n jQuery('input[id=irbRequirementsMet]').change(function() {\r\n if (irbRequirementIsMet()) {\r\n jQuery('#irbRequirementDiv').hide();\r\n jQuery('#dataTypeDiv, #uploadFileButton').show();\r\n updateHelperText();\r\n }\r\n tryToEnableUploadFileButton();\r\n });\r\n\r\n jQuery('input[name=importFileType]').change(function() {\r\n styleSelectedDataType();\r\n if (getFileTypeSelection() != jQuery('#fileType').val() &&\r\n jQuery('#fileType').val() != undefined &&\r\n jQuery('#fileType').val() != \"\") {\r\n // Different file type selected, ask if they want to reupload the file with a new type\r\n reUploadDialog();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a1bcd282831d299023b97391ea1c4d77", "score": "0.50054926", "text": "bindHandlers () {}", "title": "" }, { "docid": "003f6d5efb14a2c577ad84af097b5904", "score": "0.49995652", "text": "constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }", "title": "" }, { "docid": "dcffa2661a4b5e0d55a474c1ad3becc7", "score": "0.49979687", "text": "function init() {\n serversService.getServers().then(function(data) {\n vm.servers = data;\n }, function(reason) {\n console.log('Error fetching servers: ' + reason);\n });\n }", "title": "" }, { "docid": "72b3f5b247cdd72327cc5050bf513ba9", "score": "0.49933425", "text": "initInstallRoutes(){\n\n let $ = this;\n\n this.controller = this.newDispatcher( Path.join(\"pages\",\"install.html\"));\n\n // init routes serving static contents\n this.initStaticRoutes();\n\n this.app.use('/api/settings', require(\"./routes/InstallRoutes\")); \n }", "title": "" }, { "docid": "82fbb685f0efcbcdf5f2d127e6a3f203", "score": "0.49904943", "text": "function main() {\n\tconsole.log('O876 Modulable Server - dev version 2015-02-04');\n\tvar sServerConfigKey = 'server';\n\tvar c = readConfig();\n\t\n\t// configuration des services\n\tif (sServerConfigKey in c) {\n\t\tinit(c[sServerConfigKey]);\n\t} else {\n\t\tthrow new Error('Server configuration file not found : config/server.js');\n\t}\n\n\tvar aServices = [];\n\tvar oService;\n\tfor (var s in c) {\n\t\tif (s != sServerConfigKey) {\n\t\t\toService = require(s);\n\t\t\tif (!('service' in oService)) {\n\t\t\t\tthrow new Error('Service ' + s + ' has no method \"service()\".');\n\t\t\t}\n\t\t\tif ('init' in oService) {\n\t\t\t\toService.init(c[s]);\n\t\t\t}\n\t\t\tif ('emitter' in oService) {\n\t\t\t\toService.emitter(oEmitter);\n\t\t\t}\n\t\t\taServices.push(oService);\n\t\t}\n\t}\n\trun(aServices);\n}", "title": "" }, { "docid": "7321ae1b340566a6b668838e9fac8477", "score": "0.49883488", "text": "loadFiles() {\n let {\n root,\n sourceDir,\n files,\n buildFiles\n } = loadProcessFiles(this.buildConf, this.logger);\n\n this.files = files;\n this.root = root;\n this.sourceDir = sourceDir;\n this.babelConfig = babelUtil.readBabelConfig(root);\n this.waitingBuildFiles = buildFiles;\n\n this.addNewFileHandler = this.onAddNewFile.bind(this);\n files.on('addFile', this.addNewFileHandler);\n\n let {output, wx2swan, designWidth} = this.buildConf;\n this.compileContext = {\n cache: this.cache,\n resolve: npm.resolve.bind(null, this),\n addFile: this.addNewFile.bind(this),\n getFileByFullPath: this.getFileByFullPath.bind(this),\n designWidth,\n appType: this.appType,\n allAppTypes,\n logger: this.logger,\n envConfigKey: this.envConfigKey,\n sourceDir,\n root,\n output,\n wx2swan,\n componentExtname: this.componentExtname\n };\n\n this.initGlobalComponents(this.buildConf.component);\n\n this.generator = new FileOutput(this, this.buildConf.output);\n }", "title": "" }, { "docid": "f11fadb0d50f32a2c93b05ae6a94ae3e", "score": "0.49827564", "text": "init() {\n // 定数定義\n Object.freeze(Const);\n\n // 設定の読み込み\n this.stateManager = null;\n this.configManager = new ConfigManager();\n this.configManager.load();\n\n // 各エリア制御オブジェクトの生成\n this.menuAreaControl = new MenuAreaControl(this, this.configManager, this.stateManager);\n this.configAreaControl = new ConfigAreaControl(this, this.configManager, this.stateManager);\n this.infoNoticeAreaControl = new InfoNoticeAreaControl(this, this.configManager, this.stateManager);\n this.fileOpenAreaControl = new FileOpenAreaControl(this, this.configManager, this.stateManager);\n this.contentsAreaControl = new ContentsAreaControl(this, this.configManager, this.stateManager);\n\n // 各エリアの表示\n this.menuAreaControl.display();\n this.configAreaControl.display();\n this.infoNoticeAreaControl.display();\n this.fileOpenAreaControl.display();\n this.contentsAreaControl.display();\n\n // 各エリアのイベント登録\n this.menuAreaControl.registEvent();\n this.configAreaControl.registEvent();\n this.infoNoticeAreaControl.registEvent();\n this.fileOpenAreaControl.registEvent();\n this.contentsAreaControl.registEvent();\n }", "title": "" }, { "docid": "7ed126d6f89fefbae85096e26c4cd11d", "score": "0.49810785", "text": "function setupTerminationHandlers (){\n // Process on exit and signals.\n process.on('exit', function() { terminator(); });\n\n // Removed 'SIGPIPE' from the list - bugz 852598.\n ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',\n 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'\n ].forEach(function(element, index, array) {\n process.on(element, function() { terminator(element); });\n });\n }", "title": "" }, { "docid": "ef6cdb08887e404f368e5bb2c26b4120", "score": "0.49794537", "text": "function initialize() {\n if (__DEVONLY__) $log.debug('EntryController initialize');\n \n // If there is an auth cookie, reroute out of login \n userManager.rerouteCheck();\n }", "title": "" }, { "docid": "c66240e1351dc442060876183f09cf21", "score": "0.49761647", "text": "function initControllers()\n\t{\n\trobotExample = injector['robotExample'] = require('./server/RobotExampleCntr.js')(db,injector,emit); //emit - functions to send current round\n\trobotDok = injector['robotDok'] = require('./server/RobotDokCntr.js')(db,injector,emit); //emit - functions to send current round\n\troundCntr = injector['roundCntr'] = require('./server/RoundCntr.js')(db,injector,emit);\n\taccountCntr = injector['accountCntr'] = function(){return require('./server/AccountCntr.js')(db,injector,config,jwt)};\n\n\tROBOTS = injector['ROBOTS'] = [];\n\tROBOTS.push(robotExample); //push pointer to robot, to calculate diferent stat over all robots;\n\tROBOTS.push(robotDok);\n\n\tAPI = function (){return require('./server/ApiCntr.js')(db,roundCntr,ROBOTS)};\n\n\n\tfor (var each in injector)\n\t\t{\n\t\tif (typeof injector[each]['inject']=='function')\n\t\t\tinjector[each].inject();\n\t\t}\n\t}", "title": "" }, { "docid": "5ada066912914a66457a4e32ff4bce02", "score": "0.49750614", "text": "initializeRoutes() {\n this.sockets.set(\"eosbtc\", null);\n this.socketSources.set(\"eosbtc\", 'wss://stream.binance.com:9443/ws/eosbtc@kline_1m');\n\n this.sockets.set(\"ethbtc\", null);\n this.socketSources.set(\"ethbtc\", 'wss://stream.binance.com:9443/ws/ethbtc@kline_1m');\n\n Router.route(\"eosbtc\", this.getRouteSwitchCallback(\"eosbtc\"), { where: \"server\" });\n Router.route(\"ethbtc\", this.getRouteSwitchCallback(\"ethbtc\"), { where: \"server\" });\n }", "title": "" }, { "docid": "270334a20f46f465b72f92b3d5d2ea88", "score": "0.49720192", "text": "function init() {\n initExpressApp(80);\n initSocketIoServer(8080);\n}", "title": "" }, { "docid": "b7b3d2f06e18011ad290b323c7f284b3", "score": "0.49639714", "text": "_setupRoutes() {\n // For requests to webhook handler path, make the webhook handler take care\n // of the requests.\n this.server.post(this.webhookOptions.path, (req, res, next) => {\n this.handler(req, res, (error) => {\n res.send(400, 'Error processing hook');\n this.logger.error({ err: error }, 'Error processing hook');\n\n next();\n });\n });\n\n this.server.post(\n '/builds/:bid/status/:context',\n restify.plugins.jsonBodyParser(),\n this.buildStatusController.bind(this)\n );\n this.server.post(\n '/update',\n restify.plugins.jsonBodyParser(),\n this.buildStatusController.bind(this)\n );\n this.server.post(\n '/builds/hash',\n restify.plugins.jsonBodyParser(),\n this.hashBuildController.bind(this)\n );\n\n this.server.get(\n '/pull-request/:owner/:repo/:pullRequestNumber',\n this.getPullRequest.bind(this)\n );\n }", "title": "" }, { "docid": "4a5d5cc3fa6f3912679aa6ec0652bfae", "score": "0.49596503", "text": "beforeLaunch() {\n return createServer(baseConfig.configureHttpServer());\n }", "title": "" }, { "docid": "80e332ec02d1244db7719c60113ccb01", "score": "0.49549404", "text": "setupHTTPServer() {\n this.app.server = this.app.http.createServer(this.app).listen(8080);\n console.log(\"[MAIN_SERVER] Started up http server on port 8080-\");\n }", "title": "" }, { "docid": "72878402c480e36ee0b862ce12118cb0", "score": "0.49541196", "text": "function Server() {\n this.configOptions = {}\n this.registry = new composers.Registry()\n variants.clearAll()\n\n this.httpServer = null\n\tthis.router = new Router()\n this.templates = new TemplateManager()\n this.moduleLoader = new ModuleLoader(this.registry)\n}", "title": "" }, { "docid": "c09a660cda5fddb70f706cffc3f12bc8", "score": "0.49539468", "text": "async _setupWebserverRoutes() {\n\t\tconst appRouter = this.$services.WebserverService.Interface.Router;\n\n\t\t// Browser Error Data via the Beacon API / XHR Post\n\t\tappRouter.post('/collectClientErrorData', (ctxt) => {\n\t\t\tconst query = ctxt.query;\n\t\t\tconst beaconData = Object.assign({}, query, ctxt.request.body);\n\n\t\t\tctxt.status = 200;\n\t\t\tctxt.body = { 'status': true };\n\n\t\t\tif(beaconData.error === 'TransitionAborted')\n\t\t\t\treturn;\n\n\t\t\t// TODO: Do something more sophisticated - like storing it into Cassandra, and running analysis\n\t\t\tconsole.error(`Client Error Data: ${JSON.stringify(beaconData, null, '\\t')}`);\n\t\t});\n\n\t\t// Add in the components\n\t\tObject.keys(this.$components || {}).forEach((componentName) => {\n\t\t\tconst componentRouter = this.$components[componentName].Router;\n\t\t\tappRouter.use(componentRouter.routes());\n\t\t});\n\n\t\t// Add in the features\n\t\tObject.keys(this.$features || {}).forEach((featureName) => {\n\t\t\tconst featureRouter = this.$features[featureName].Router;\n\t\t\tappRouter.use(featureRouter.routes());\n\t\t});\n\n\t\t// Add in the templates at the end...\n\t\tObject.keys(this.$templates).forEach((tmplName) => {\n\t\t\tconst tmplRouter = this.$templates[tmplName].Router;\n\t\t\tappRouter.get('*', tmplRouter.routes());\n\t\t});\n\n\t\t// console.log(`All Routes: ${JSON.stringify(appRouter.stack.map((route) => { return `${JSON.stringify(route.methods)} ${route.path}`; }), null, '\\t')}`);\n\t\treturn;\n\t}", "title": "" }, { "docid": "5fc3f532e4563b76ecb2235fefc328ea", "score": "0.4953291", "text": "init() {\n var runHandler = function (recorder, hookName, args) {\n if (recorder.get('debug')) {\n console.log(hookName, args);\n }\n if (recorder.get('_' + hookName)) {\n recorder.get('_' + hookName).apply(recorder, args);\n }\n if (recorder.get(hookName)) {\n recorder.get(hookName).apply(recorder, args);\n }\n };\n\n HOOKS.forEach(hookName => {\n var _this = this;\n window[hookName] = function () {\n var args = Array.prototype.slice.call(arguments);\n var recorder;\n var recorderIdPositions = {\n 'onUploadDone': 3,\n 'userHasCamMic': 2,\n 'onCamAccess': 1,\n 'onConnectionStatus': 1,\n 'onSaveOk': 5\n };\n var recorderIdPos = recorderIdPositions[hookName] || 0;\n var recorderId = args[recorderIdPos];\n\n // Make sure this recorder ID is actually in _recorders;\n // otherwise fails by returning all of _recorders in this case.\n if (_this._recorders.hasOwnProperty(recorderId)) {\n recorder = _this.get(`_recorders.${recorderId}`);\n }\n if (!recorder) {\n Object.keys(_this.get('_recorders')).forEach((id) => {\n recorder = _this.get(`_recorders.${id}`);\n runHandler(recorder, hookName, args);\n });\n } else {\n runHandler(recorder, hookName, args);\n }\n };\n });\n }", "title": "" }, { "docid": "45a7f3e8309187d25769515e1cb9559e", "score": "0.49493012", "text": "function handler (request, response) {\n\trequest.addListener('end', function () {\n fileServer.serve(request, response);\n });\nrequest.resume();\n\n}", "title": "" }, { "docid": "cdf13dd2dfc7cbf1fb6828d8011d7e80", "score": "0.4943099", "text": "initialize()\n {\n if (this._initialized)\n throw new Error(\"App controller is already initialized.\");\n\n this._initialized = true;\n\n // FIXME: eventually all code within WI.loaded should be distributed elsewhere.\n WI.loaded();\n }", "title": "" }, { "docid": "119145baea13b0bb5dcedf9a7c82685c", "score": "0.4942146", "text": "setupRoutes() {\n var normalizedPath = this.app.path.join(__dirname, \"endpoints\");\n this.app.all(\"*\", function(req, res, next) {\n if(this.app.config.useHTTP && this.app.sessions.size > 0) {\n req.cookies = { \"sessionID\": this.app.sessions.entries().next().value[0] };\n }\n\n next();\n }.bind(this));\n\n this.app.fs.readdirSync(normalizedPath).forEach(function(file) {\n var Endpoint = require(\"./endpoints/\" + file);\n var ep = new Endpoint(this.app);\n ep.handle();\n }.bind(this));\n }", "title": "" }, { "docid": "4dadb27c35177eed80f60690803a2eda", "score": "0.49391967", "text": "function INIT () {\n\n\t\tvar i;\n\t\tvar l = bills.length;\n\t\tfor (i=0; i<l; i++) {\n\t\t\tsb.addEvent(bills[i], \"click\", makeRequest);\n\t\t}\n\n\t\tsb.listen({\n\t\t\tlistenFor: [\"bill-data-return\"],\n\t\t\tmoduleID: this.moduleID,\n\t\t\tmoduleFunction: \"receiveBillData\",\n\t\t})\n\n\t\tsb.listen({\n\t\t\tlistenFor: [\"stop-load\"],\n\t\t\tmoduleID: this.moduleID,\n\t\t\tmoduleFunction: \"makeReceptive\",\n\t\t})\n\t}", "title": "" } ]
4c2afb96e6f40c62da65dc9272230f03
8 kyu Closest elevator/Solution
[ { "docid": "ad3f711245edbe530c5c0921c7349370", "score": "0.0", "text": "function elevator(left, right, call) {\n\treturn Math.abs(call - left) < Math.abs(call - right) ? 'left' : 'right';\n}", "title": "" } ]
[ { "docid": "581c5bda999e2fd17a4d18c921ad4f66", "score": "0.6564081", "text": "function nearestEpic() {\n dlog('nearestEpic');\n const epics = ['master', 'develop', 'origin/master', 'origin/develop']; // TODO: consider adding others\n return P.reduce(epics, (best, committish) => {\n dlog('best:', best, 'committish:', committish);\n return distanceTo(committish)\n .then(d => {\n dlog(`${committish}: ${d}`);\n return d < best[1] ? [committish, d] : best;\n });\n }, [null, Number.POSITIVE_INFINITY])\n .then(best => best[0]);\n}", "title": "" }, { "docid": "e2deeb0a9ac8404fa7857c5cdf5d8d20", "score": "0.6484614", "text": "findElevator(requestedFloor, requestedDirection) {\n let bestElevator = this.elevatorList[0];\n let bestScore = 5;\n let referenceGap = 10000000;\n let bestElevatorInformations = {\n bestElevator: bestElevator,\n bestScore: bestScore,\n referenceGap: referenceGap,\n };\n\n for (let i = 0; i < this.elevatorList.length; i++) {\n if (\n requestedFloor == this.elevatorList[i].currentFloor &&\n this.elevatorList[i].status == \"stopped\" &&\n requestedDirection == this.elevatorList[i].direction\n ) {\n bestElevatorInformations = this.checkIfElevatorIsBetter(\n 1,\n this.elevatorList[i],\n bestScore,\n referenceGap,\n bestElevator,\n requestedFloor\n );\n } else if (\n requestedFloor > this.elevatorList[i].currentFloor &&\n this.elevatorList[i].direction == \"up\" &&\n requestedDirection == this.elevatorList[i].direction\n ) {\n bestElevatorInformations = this.checkIfElevatorIsBetter(\n 2,\n this.elevatorList[i],\n bestScore,\n referenceGap,\n bestElevator,\n requestedFloor\n );\n } else if (\n requestedFloor < this.elevatorList[i].currentFloor &&\n this.elevatorList[i].direction == \"down\" &&\n requestedDirection == this.elevatorList[i].direction\n ) {\n bestElevatorInformations = this.checkIfElevatorIsBetter(\n 2,\n this.elevatorList[i],\n bestScore,\n referenceGap,\n bestElevator,\n requestedFloor\n );\n } else if (this.elevatorList[i].status == \"idle\") {\n bestElevatorInformations = this.checkIfElevatorIsBetter(\n 3,\n this.elevatorList[i],\n bestScore,\n referenceGap,\n bestElevator,\n requestedFloor\n );\n } else {\n bestElevatorInformations = this.checkIfElevatorIsBetter(\n 4,\n this.elevatorList[i],\n bestScore,\n referenceGap,\n bestElevator,\n requestedFloor\n );\n }\n\n bestElevator = bestElevatorInformations.bestElevator;\n bestScore = bestElevatorInformations.bestScore;\n referenceGap = bestElevatorInformations.referenceGap;\n }\n\n return bestElevatorInformations.bestElevator;\n }", "title": "" }, { "docid": "3690fce5efa6f722d47a31886f49f262", "score": "0.63316226", "text": "function findSolution(target) {\n function find(current, history) {\n if (current == history) {\n return history;\n } else if (current > target) {\n return null;\n } else {\n return find(current + 5, `${history + 5}`) ||\n find(current * 3, `${history * 3}`);\n }\n }\n return find(1, \"1\");\n}", "title": "" }, { "docid": "d577ca1d2ee9474ecd052946b90b80e1", "score": "0.63284624", "text": "function findSolution(target) {\n function find(current, history) {\n if (current == target) {\n return history;\n } else if (current > target) {\n return null;\n } else {\n return find(current + 5, `(${history} + 5 )`) || find(current * 3, `(${history} * 3)`);\n }\n }\n return find(1, \"1\");\n}", "title": "" }, { "docid": "a367df0e69e9d80a1b0e9483e5df02c6", "score": "0.63085496", "text": "step() {\n if (this.openSet.length > 0) {\n // Best next option\n let winner = 0;\n\n this.openSet.forEach((idx, candidate) => {\n if (candidate.f < this.openSet[winner].f) {\n winner = idx;\n }\n //If we have a tie according to the standard heuristic\n if (candidate.f == this.openSet[winner].f) {\n //Prefer to explore options with longer known paths (closer to goal)\n if (candidate.g > this.openSet[winner].g) {\n winner = idx;\n }\n }\n });\n\n const current = this.openSet[winner];\n this.lastCheckedNode = current;\n\n // Did I finish?\n if (current === this.end) {\n this.solved = true;\n this.status = 1;\n console.log('DONE!');\n return 1;\n }\n\n // Best option moves from openSet to closedSet\n\n this.openSet = this.openSet.filter((item) => item !== current);\n this.closedSet.push(current);\n\n // Check all the neighbors\n const neighbors = current.getNeighbors();\n\n for (const neighbor of neighbors) {\n // Valid next spot?\n if (!this.closedSet.includes(neighbor)) {\n // Is this a better path than before?\n const tempG = current.g + this.heuristic(neighbor, current);\n\n // Is this a better path than before?\n if (!this.openSet.includes(neighbor)) {\n this.openSet.push(neighbor);\n } else if (tempG >= neighbor.g) {\n // No, it's not a better path\n continue;\n }\n neighbor.g = tempG;\n neighbor.h = this.heuristic(neighbor, this.end);\n neighbor.f = neighbor.g + neighbor.h;\n neighbor.previous = current;\n }\n }\n\n this.status = 0;\n\n return 0;\n // Uh oh, no solution\n } else {\n console.log('no solution');\n this.solved = true;\n this.status = -1;\n return -1;\n }\n }", "title": "" }, { "docid": "825a6a146b854d77dd5088102a9491ed", "score": "0.62806934", "text": "function sol(days, costs) {\n return helper(0);\n\n function helper(lo) {\n if (!days[lo] || lo >= days.length) return 0;\n let res = costs[0] + helper(lo + 1);\n // find first idx that has day[i] >= day[lo]\n let idx7 = search(days[lo] + 7);\n res = Math.min(res, costs[1] + helper(idx7));\n // find first idx that had day[i] >= day[lo] + 30\n let idx30 = search(days[lo] + 30);\n res = Math.min(res, costs[2] + helper(idx30));\n\n return res;\n }\n\n function search(target) {\n for (let i = 0; i < days.length; i++) {\n if (days[i] >= target) return i;\n }\n // no return here\n // so line36 return 0\n }\n}", "title": "" }, { "docid": "90c9ae5449898efc71a19ef5b801265c", "score": "0.6265228", "text": "findBestElevatorOption(requestedFloor, direction){ \n let idleStatus = false;\n let bestGap = this.numberOfFloorToServe;\n let elevatorBestGap = 0; \n for (let i = 0; i < this.elevatorArray.length; i++) {\n if (this.elevatorArray[i].status == `IDLE`) {\n idleStatus = true;\n } else if ((this.elevatorArray[i].direction == `UP`) && (direction == `UP`) && (requestedFloor > this.elevatorArray[i].currentFloor)) {\n this.elevatorArray[i].sameDirecton = true\n } else if ((this.elevatorArray[i].direction == `DOWN`) && (direction == `DOWN`) && (requestedFloor < this.elevatorArray[i].currentFloor)) {\n this.elevatorArray[i].sameDirecton = true\n } else {\n this.elevatorArray[i].sameDirecton = false\n }\n }\n if (idleStatus == true) {\n for (let i = 0; i < this.elevatorArray.length; i++) {\n if (this.elevatorArray[i].status == `IDLE`) {\n let gap = Math.abs(this.elevatorArray[i].currentFloor - requestedFloor);\n if (gap < bestGap) {\n elevatorBestGap = this.elevatorArray[i].id;\n bestGap = gap;\n }\n }\n }\n return this.findElevatorId(elevatorBestGap)\n }\n if (idleStatus == false) {\n for (let i = 0; i < this.elevatorArray.length; i++) {\n if (this.elevatorArray[i].sameDirecton == true) {\n let gap = Math.abs(this.elevatorArray[i].currentFloor - requestedFloor);\n if (gap < bestGap) {\n elevatorBestGap = this.elevatorArray[i].id;\n bestGap = gap;\n }\n }\n }\n return this.findElevatorId(elevatorBestGap)\n }\n }", "title": "" }, { "docid": "846e1a1f034269dfe5f1e75714766219", "score": "0.6257554", "text": "greedyBestFirstSearch(start, goal) {\n let open = new Array(),\n closed = new Array();\n let h = new Map(), //containing the approx. value of distance to goal.\n parent = new Map();\n for (let key of this.adjList.keys()) {\n //set heuristic measure for all nodes as Infinity.\n h.set(key, Infinity);\n }\n //set the heuristic for start node as 0.\n h.set(start, 0);\n open.push(start); //push the start node in open list\n while (open.length > 0) {\n let [q, ind] = this.getMinOpenNodeGreedy(open, h);\n open.splice(ind, 1); //delete the min node from open list.\n //push the min node in closed list.\n closed.push(q);\n let successors = this.adjList.get(q);\n for (let successor of successors) {\n //for all successors of that node,\n if (successor[\"node\"] == goal) {\n //if that successor is goal, end the function.\n parent.set(successor[\"node\"], q);\n let path = new Stack();\n let child = goal;\n while (child != start && child != undefined) {\n path.push(child);\n child = parent.get(child);\n }\n path.push(start);\n let pathPrint = \"\";\n while (path.size() != 1) {\n pathPrint += path.pop() + \" ==> \";\n }\n pathPrint += path.pop();\n console.log(pathPrint);\n return;\n } else if (!closed.includes(successor[\"node\"])) {\n //if that successor is not included in closed list,\n let hNew = this.manhattanDistance(successor[\"node\"], goal);\n if (\n h.get(successor[\"node\"]) == Infinity ||\n h.get(successor[\"node\"]) > hNew\n ) {\n open.push(successor[\"node\"]);\n h.set(successor[\"node\"], hNew);\n parent.set(successor[\"node\"], q);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "50e86fb383fd43117ab4b291d79eaeb0", "score": "0.6247795", "text": "function findBestPath(){\n maxValue = myGameArea.canvas.width * myGameArea.canvas.height;\n workArray = [maxValue, -1]; //distance, position\n workArray2 = [maxValue, -1];\n count = 0;\n for(x of exhaustedL1){\n testing = x.indexOf(triggerV);\n if(testing != -1){\n if(testing < workArray[0]){\n workArray[0] = testing;\n workArray[1] = count;\n }\n }\n count++;\n }\n count = 0;\n for(x of exhaustedL2){\n testing = x.indexOf(triggerV);\n if(testing != -1){\n if(testing < workArray2[0]){\n workArray2[0] = testing;\n workArray2[1] = count;\n }\n }\n count++;\n }\n console.log(workArray + \" : \" + exhaustedL1.length);\n console.log(workArray2 + \" : \" + exhaustedL2.length);\n \n temp1 = exhaustedL1[workArray[1]].slice(0, workArray[0]);\n temp2 = exhaustedL2[workArray2[1]].slice(0, workArray2[0] + 1);\n temp2.reverse();\n console.log(temp1.concat(temp2).join());\n return temp1.concat(temp2);\n}", "title": "" }, { "docid": "49baa446c654d66ac77f3c880df16e3e", "score": "0.6225747", "text": "function oneStep() {\n if (open.length > 0) {\n // Sort the cells based their cost\n open.sort(function(a, b) {\n if(a.f < b.f) return -1;\n if(a.f > b.f) return 1;\n return 0\n });\n\n // choose the cell with the minimum cost\n let q = open[0]\n open.splice(0,1)\n closed.push(q)\n\n // If we Reach the end Print the best path\n if (q == end) {\n console.log(\"Done\");\n open = []\n return 1;\n }\n\n // Calculate the cost for all the neighbors\n for (var i = 0; i < q.neighbors.length; i++) {\n let neighbor = q.neighbors[i];\n\n // If we didn't reach the end Calculate the cost of the neighbor\n let temp_g = q.g + 1;\n let temp_h = neighbor.heuristic(end);\n let temp_f = temp_g + temp_h;\n\n // IF the neighbor is not already passed\n if (!closed.includes(neighbor) && !neighbor.blocked) {\n // If the neighbor is not checked before\n if (!open.includes(neighbor)) {\n // Check it\n open.push(neighbor);\n neighbor.g = temp_g;\n neighbor.f = temp_f;\n neighbor.cameFrom = q;\n } else if(temp_f >= neighbor.f){\n // No, it's not a better path\n continue;\n }\n }\n }\n\n path = [];\n let temp = q;\n path.push(temp);\n while(temp.cameFrom){\n path.push(temp.cameFrom);\n temp = temp.cameFrom;\n }\n }\n}", "title": "" }, { "docid": "07fc39b9a631d3cff3d9f3edaf1a6c73", "score": "0.61604095", "text": "function findSolution (target){\n function find (start, history){\n // if the current (start) number is the target number then the current history is a way to reach target\n if (start === target)\n return history;\n // if the current number is greater than the target\n else if (start > target)\n // no sense in furthur expolring history. adding and multiplying will only make number bigger\n return null;\n // if still bellow target the function tries both possible paths that start from the current number by calling it self twice\n // if returns something that is not null it is returned\n else return find(start + 5, \"(\" + history + \"+ 5)\") ||\n find(start * 3, \"(\" + history + \"* 3)\");\n }\n // otherwise second call is returned regardless whether string or null\n return find(1, \"1\");\n}", "title": "" }, { "docid": "f691cfc80970bdff34f21898cb9870d3", "score": "0.61425334", "text": "static solvingSpeed() {\r\n\t return 800;\r\n }", "title": "" }, { "docid": "d11b38ec725b23ef68078d8a6268ea82", "score": "0.61232835", "text": "function playWithAI()\n{\n//BACKUP PLAN\nvar counter = 0;\nvar getPX = -1, getPY = -1, sortedC;\n\n\t\t//console.log(\"button: \",player.x);\n\t\tgetPX = player.x;\n\t\tgetPY = player.y;\n\t\tsortedC = getAndSortBoxes(player.x, player.y);\n\t\t//console.log(closestBox);\n\t\t//console.log(\"Jumping about \",sortedC[0].x) - player.x;\n\t\tjumpToBox(sortedC[0].x, sortedC[0].y, player.x, player.y);\n\n\n\n\n\t\t//testing:\n\n\n\n\n\n\t\t//end testing\n\n\n\n\t\t\t//playWithAI();\n\n\n\n\n//better plan:\n//get shortest path!\n\n\n\n\n\n\n\n\n\n\n\n\n\n}//end play withAI", "title": "" }, { "docid": "25b6e535659c1060ecfb5bce7922e3fa", "score": "0.61196053", "text": "function longerQueue(elevator){\r\n console.log(\"up\\t\" + upQueue);\r\n console.log(\"down\\t\" + downQueue);\r\n var direction;\r\n function avgDestQueue(){\r\n var sum = 0;\r\n for(var i = 0; i < elevators.length; i++){\r\n sum += elevators[i].destinationQueue.length;\r\n }//close for\r\n var avg = Math.round(sum / elevators.length);\r\n if(avg > 0){\r\n return avg;\r\n }else{\r\n return 1;\r\n }\r\n }//close avgDestQueue;\r\n function assembleClosestValues(floorNum,queue,difference){\r\n var answerIndices = [];\r\n // console.log(\"difference\\t\" + difference);\r\n // console.log(\"floorNum\\t\" + floorNum);\r\n // console.log(\"queue\\t\" + queue);\r\n var index = findClosestValue(floorNum, queue);\r\n var floorNumTemp = queue[index];//redefine floornum\r\n \r\n if(floorNumTemp > floorNum){\r\n direction = \"up\"\r\n }else{\r\n direction = \"down\"\r\n }\r\n floorNum = queue[index];//redefine floornum\r\n answerIndices.push(queue.splice(index, index+1));//redefine queue\r\n //catch if avg is longer than available\r\n if(difference > queue.length){\r\n difference = queue.length;\r\n }\r\n for(var i = 1; i < difference; i++){\r\n var index = findClosestValue(floorNum, queue, direction);\r\n if(index === -1){\r\n break;\r\n }\r\n floorNum = queue[index];//redefine floornum\r\n answerIndices.push(queue.splice(index, index+1));//redefine queue\r\n }//close for\r\n // console.log(\"answerIndices\\t\" + answerIndices);\r\n return answerIndices;\r\n }//close assembleClosestValues\r\n\r\n function findClosestValue(floorNum,queue,direction){\r\n if(direction === undefined){\r\n direction = \"unknown\";\r\n }\r\n\r\n var dif = Math.abs(floorNum - queue[0]);\r\n var closest = 0;\r\n //evaluate if there are others in that direction, get out if not\r\n if((direction === \"up\" ) || (direction ===\"down\")){\r\n closest = -1;\r\n for(var i = 0; i < queue.length; i++){\r\n if(direction === \"up\"){\r\n if(queue[i] > floorNum){\r\n closest = i;\r\n break;\r\n }\r\n }else{\r\n if(queue[i] < floorNum){\r\n closest = i;\r\n break;\r\n }\r\n }\r\n }//close for\r\n if(closest === -1){\r\n return -1;\r\n }\r\n }//close if\r\n \r\n for(var i = 0; i < queue.length; i++){\r\n var tempDif = Math.abs(queue[i] - floorNum);\r\n \r\n if(direction === \"up\"){\r\n if(queue[i] < floorNum){\r\n continue;\r\n }\r\n }\r\n if(direction === \"down\"){\r\n if(queue[i] > floorNum){\r\n continue;\r\n }\r\n }\r\n\r\n if(tempDif < dif){\r\n closest = i;\r\n }//close if\r\n }//close for\r\n return closest;\r\n }//close findClosestValue\r\n // console.log(\"two\");\r\n\r\n //for idle\r\n var differenceArray = [];\r\n\r\n if((upQueue.length === 0) && (downQueue.length === 0)){\r\n // console.log(\"does enter\");\r\n // distribute(elevator);\r\n elevator.checkDestinationQueue();\r\n direction = elevator.destinationDirection();\r\n /*if(direction === \"down\"){\r\n elevator.goingDownIndicator(true);\r\n elevator.goingUpIndicator(false);\r\n }else{\r\n elevator.goingDownIndicator(false);\r\n elevator.goingUpIndicator(true);\r\n }*/\r\n return;\r\n // console.log(\"does not exit\");\r\n }\r\n\r\n var difference = Math.abs(upQueue.length - downQueue.length);\r\n if(difference === 0){\r\n var index = findClosestValue(elevator.currentFloor(),upQueue);\r\n return upQueue.splice(index, index+1);\r\n }\r\n // console.log(\"two - 2\");\r\n //find closest avg to floor num of elevator for # of items(difference)\r\n difference = avgDestQueue();\r\n\r\n if(upQueue.length > downQueue.length){\r\n // console.log(\"three -1\");\r\n differenceArray = assembleClosestValues(elevator.currentFloor(),upQueue,difference);\r\n }else{\r\n // console.log(\"three - 2\");\r\n // console.log(\"downQueue\\t\" + downQueue);\r\n differenceArray = assembleClosestValues(elevator.currentFloor(),downQueue,difference);\r\n // console.log(\"downQueue\\t\" + downQueue);\r\n }//close else\r\n // console.log(\"differenceArray\\t\" + differenceArray);\r\n elevator.destinationQueue = elevator.destinationQueue.concat(differenceArray);\r\n elevator.checkDestinationQueue();\r\n /* direction = elevator.destinationDirection();\r\n if(direction === \"down\"){\r\n elevator.goingDownIndicator(true);\r\n elevator.goingUpIndicator(false);\r\n }else{\r\n elevator.goingDownIndicator(false);\r\n elevator.goingUpIndicator(true);\r\n }*/\r\n }", "title": "" }, { "docid": "f63bdacfbdc79c545a52fa6b91ee416a", "score": "0.60915554", "text": "function getCloseElevator(){\n let i=0;\n let distance=0;\n let elv=null;\n //Init the first elevator\n for(i=0;i<elevatorsObj.length;i++){\n let tempEl= elevatorsObj[i];\n if(tempEl.isAvailable){\n elv=elevatorsObj[i];\n distance=Math.abs(tempEl.curFloor- floorNumber);\n break;\n }\n }\n //Choose a closer elevator\n for(i=0;i<elevatorsObj.length;i++){\n let tempEl= elevatorsObj[i];\n if(tempEl.isAvailable){\n let tempDis= Math.abs(tempEl.curFloor- floorNumber);\n if(distance>tempDis){\n elv=tempEl;\n distance=tempDis\n }\n }\n }\n return elv;\n}", "title": "" }, { "docid": "fe10787aab8f06228219ad2fd1cf678f", "score": "0.6043955", "text": "function polySolution()\t\t//\testo es una clase que busca y almacena las soluciones (si las hay)\n{\n\tvar board;\t\t\t\t//board state\n\tvar boardX, boardY;\t\t//maximum board X, Y\n\tvar maxSolution;\t\t//how many answer want to find \n\tvar blockGroup;\t\t\t//block group\n\n\tvar totalAnswer;\t\t//total answer find\n\tvar totalBlockUsed;\t\t//total block already used \n\tvar solvedBoard = [];\t//solution board\n\tvar searchEnd;\t\t\t//end of search\n\n\t//---------------------------------\n\t// public function : initial value \n\t//---------------------------------\n\tthis.init = function(initBoard, maxBoardX, maxBoardY, maxAnswer, block, random )\n\t{\n\t\tboard = initBoard; \n\t\tboardX = maxBoardX; \n\t\tboardY = maxBoardY; \n\t\tmaxSolution = maxAnswer; \n\t\tblockGroup = block; \n\t\t\n\t\tsearchEnd = 0;\n\t\ttotalAnswer = 0;\n\t\ttotalBlockUsed = 0;\n\t\tgetTotalBlockUsed();\n\t\tif(random) {\n\t\t\trandomBlockStyle(blockGroup);\n\t\t}\n\t}\n\t\n\t//------------------------------------------\n\t// public function : find answer\n\t// output: {\n\t// totalAnswer: how many answer find \n\t// elapsedTime: elapsed time\n\t// solvedBoard: array for answer board, \n\t// length = totalAnswer\n\t// } \n\t//------------------------------------------\n\tthis.find = function()\n\t{\n\t\tvar startTime, endTime;\n\t\tvar emptyPos = findEmptyPos({x:1, y:1});\n\t\tvar blockStart = Math.floor(Math.random()*(blockGroup.length))-1; //[-1 .. blockGroup.length-2]\n\t\tvar blockIndex = findNextAvailableBlock(blockStart);\n\t\t\n\t\tif(emptyPos.x < 0 || blockIndex < 0) {\n\t\t\t//all blocks are used or board full\n\t\t\treturn { totalAnswer: 0,\n\t\t\t\t\telapsedTime: 0,\n\t\t\t\t\tsolvedBoard: null\n\t\t\t};\n\t\t}\n\t\t\n\t\tstartTime = new Date();\n\t\tfindSolution(blockIndex, emptyPos, 0);\n\t\tendTime = new Date();\n\t\t\n\t\treturn { totalAnswer: totalAnswer,\n\t\t\t elapsedTime: (endTime-startTime)/1000,\n\t\t\t\t solvedBoard: solvedBoard\n\t\t};\n\t}\n\t\n\n\t\n\t//-------------------------------\n\tfunction getTotalBlockUsed()\t\t// get block used before search\n\t{\n\t\tfor(var g =0; g < blockGroup.length; g++) {\n\t\t\tif(blockGroup[g].blockUsed) totalBlockUsed++;\n\t\t\t\n\t\t\t//clear block order\n\t\t\tblockGroup[g].order = -1; //insert order for UI only\n\t\t}\n\t}\n\n\n\n\t//---------------------\n\tfunction findEmptyPos(startPos)\t\t//find empty position\n\t{\n\t\tvar y = startPos.y;\n\t\tvar x = startPos.x;\n\t\t\n\t\tfor(; y <= boardY; y++) {\n\t\t\tfor(; x <= boardX; x++) {\n\t\t\t\tif(board[x][y] == 0) {\n\t\t\t\t\treturn {x:x, y:y};\n\t\t\t\t}\n\t\t\t}\n\t\t\tx = 1;\n\t\t}\n\t\treturn {x:-1, y:-1};\n\t}\t\n\t\n\t//---------------------------\n\n\t//--------------------------- \n\tfunction findNextAvailableBlock(curIndex)\t\t// find next available block\n\t{\n\t\tfor(var i = 0 ; i < blockGroup.length; i++) {\n\t\t\tif(++curIndex >= blockGroup.length) curIndex = 0;\n\t\t\tif(!blockGroup[curIndex].blockUsed) return (curIndex);\n\t\t}\n\t\treturn -1;\n\t}\n\n\n \n\t//-------------\n\tfunction savesolvedBoard()\t\t\t\t// save answer\n\t{\n\t\tsolvedBoard[totalAnswer] = [];\n\t\tfor(var x = 0; x < (boardX+2) ; x++) {\n\t\t\tsolvedBoard[totalAnswer][x] = [];\n\t\t\tfor(var y = 0; y < (boardY+2) ; y++) {\n\t\t\t\tsolvedBoard[totalAnswer][x][y] = board[x][y];\n\t\t\t}\n\t\t}\n\t\ttotalAnswer++;\n\t}\n\t\n\n\n\t//-------------\n\tfunction findSolution(headIndex, curPos, deep)\t\t\t// find answer. encuentra una solucion\n\t{\n\t\tvar nextPos = {};\n\t\tvar numberOfBlockStyle; \n\t\tvar curIndex;\n\n\t\tcurIndex = headIndex;\n\t\tdo {\n\t\t\tnumberOfBlockStyle = blockGroup[curIndex].blockStyle.length; \n\t\t\tfor(var i = 0 ; i < numberOfBlockStyle && !searchEnd; i++) {\n\t\t\t\tif(insertBlockToBoard(board, boardX, boardY, blockGroup[curIndex].blockStyle[i], curPos, curIndex+1)) {\n\t\t\t\t\tblockGroup[curIndex].blockUsed = 1; \n\t\t\t\t\t\n\t\t\t\t\t//for UI only\n\t\t\t\t\tblockGroup[curIndex].usedStyle = i; //keep blockStyle\n\t\t\t\t\tblockGroup[curIndex].pos = curPos; //keep position\n\t\t\t\t\tblockGroup[curIndex].order = deep; //keep order (deep)\n\t\t\t\t\t\n\t\t\t\t\tnextPos = findEmptyPos(curPos); \n\t\t\t\t\tif((++totalBlockUsed >= blockGroup.length) || (nextPos.x == -1 && nextPos.y == -1)) {\n\t\t\t\t\t\t//(1) all blocks have put into board\n\t\t\t\t\t\t//(2) board is filled with blocks\n\t\t\t\t\t\tsavesolvedBoard();\n\t\t\t\t\t\tif(maxSolution >= 0 && totalAnswer >= maxSolution) {\n\t\t\t\t\t\t\tsearchEnd = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfindSolution(findNextAvailableBlock(curIndex), nextPos, deep+1);\n\t\t\t\t\t}\n\t\t\t\t\tif(!searchEnd) { //keep last solution in board for UI demo\n\t\t\t\t\t\tremoveBlockFromBoard(board, blockGroup[curIndex].blockStyle[i], curPos);\n\t\t\t\t\t\tblockGroup[curIndex].blockUsed = 0;\n\t\t\t\t\t\tblockGroup[curIndex].order = -1; \n\t\t\t\t\t\ttotalBlockUsed--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurIndex = findNextAvailableBlock(curIndex);\n\t\t} while (curIndex != headIndex && !searchEnd);\n\t}\n}", "title": "" }, { "docid": "266b41592afe5444021453bfa72f0e3a", "score": "0.6038022", "text": "static IdentifyTop3Risks()\n {\n try\n {\n // top 3 are 3 with closest approach during course of next 10 seconds\n var dist = [];// new double[3];\n dist[0] =Number.MAX_VALUE;\n dist[1] =Number.MAX_VALUE;\n dist[2] =Number.MAX_VALUE;\n var vmg = [];// new double[3];\n vmg[0] =Number.MAX_VALUE;\n vmg[1] =Number.MAX_VALUE;\n vmg[2] =Number.MAX_VALUE;\n var Boat3 = [];// new int[3];\n Boat3[0] = -1;\n Boat3[1] = -1;\n Boat3[2] = -1;\n var time = [];//new int[3];\n time[0] = Number.MAX_VALUE;\n time[1] = Number.MAX_VALUE;\n time[2] = Number.MAX_VALUE;\n\n var distance =Number.MAX_VALUE;\n var closestTime = Number.MAX_VALUE;\n var VMG1 = 0;\n\n console.log(\"In IdentifyTop3Risks\")\n //for (var boat = 0; boat < YachtClub.NumberOfBoatsRacing; boat++)\n for (var boat = 0; boat < YachtClub.NUMBER_OF_MOORINGS; boat++)\n {\n console.log(\"IdentifyTop3Risks loop: \" + boat)\n if (!(YachtClub.Fleet[boat].TicksUntilRadarCheck > 0))\n {\n dist[0] =Number.MAX_VALUE;\n dist[1] =Number.MAX_VALUE;\n dist[2] =Number.MAX_VALUE;\n\n vmg[0] =Number.MAX_VALUE;\n vmg[1] =Number.MAX_VALUE;\n vmg[2] =Number.MAX_VALUE;\n\n Boat3[0] = -1;\n Boat3[1] = -1;\n Boat3[2] = -1;\n\n time[0] = Number.MAX_VALUE;\n time[1] = Number.MAX_VALUE;\n time[2] = Number.MAX_VALUE;\n\n distance =Number.MAX_VALUE;\n closestTime = Number.MAX_VALUE;\n VMG1 =Number.MAX_VALUE; ;\n\n for (var i = 0; i < YachtClub.NUMBER_OF_MOORINGS; i++)\n {\n if (boat != i)\n {\n distance =Number.MAX_VALUE;\n VMG1 =Number.MAX_VALUE;\n\n for (var t = 0; t < 10; t++)\n {\n if (!(Radar.FleetDistanceMatrix[t, boat, i] == 0))\n {\n if (t > 0 && Radar.FleetDistanceMatrix[t, boat, i] != 0)\n {\n console.log(\"WHat: \" + Radar.FleetDistanceMatrix[t, boat, i])\n throw \"WHAT?\";\n }\n\n if (Radar.FleetDistanceMatrix[t, boat, i] < distance)\n {\n distance = Radar.FleetDistanceMatrix[t, boat, i];\n VMG1 = Radar.FleetVMGMatrix[t, boat, i];\n closestTime = t;\n }\n else\n break;\n }\n }\n\n // now, distance is the closest that this boat will get and it will occur at time closestTime\n if (distance < dist[0])\n {\n dist[2] = dist[1];\n dist[1] = dist[0];\n dist[0] = distance;\n\n vmg[2] = vmg[1];\n vmg[1] = vmg[0];\n vmg[0] = VMG1;\n\n time[2] = time[1];\n time[1] = time[0];\n time[0] = closestTime;\n\n Boat3[2] = Boat3[1];\n Boat3[1] = Boat3[0];\n Boat3[0] = i;\n }\n else if (distance < dist[1])\n {\n dist[2] = dist[1];\n dist[1] = distance;\n\n time[2] = time[1];\n time[1] = closestTime;\n\n vmg[2] = vmg[1];\n vmg[1] = VMG1;\n\n Boat3[2] = Boat3[1];\n Boat3[1] = i;\n }\n else if (distance < dist[2])\n {\n dist[2] = distance;\n time[2] = closestTime;\n vmg[2] = VMG1;\n Boat3[2] = i;\n }\n }\n }\n try\n {\n YachtClub.Fleet[boat].top3 = new Top3(boat, dist[0], dist[1], dist[2], vmg[0], vmg[1], vmg[2], Boat3[0], Boat3[1], Boat3[2], time[0], time[1], time[2]);\n }\n catch (ex)\n {\n console.log(\"EXX:\" + ex);\n }\n }\n }\n }\n catch (ex)\n {\n console.log(\"Ex:\" + ex);\n }\n }", "title": "" }, { "docid": "534fbbfea80f81e236e474ed4631ca36", "score": "0.5957548", "text": "function solveTimeToDistFromPoint(curPos, curVel, accel, targetPos, distanceGoal) {\n /* (p1-(p2+vt + (1/2 * a*t^2))) = r\n -(p2+vt + (1/2 * a*t^2)) = r - p1\n -p2-vt - (1/2 * a*t^2) = r - p1\n -vt - (1/2 * a*t^2) = r - p1 + p2\n vt + (1/2 * a*t^2) = (p1 - p2) - r\n Now since ||d|| = ||b||+||c|| when d = b+c, we know that\n \n ||v||t + 1/2 * ||a||t^2 = ||p1-p2|| - r\n ||v||t + 1/2 * ||a||t^2\t- ||p1-p2|| + r = 0\t\t\t\t\t\t\t\t\t\t//NEW,\troots are when this = 0. Yields solution????\n */\n\n //console.log(\" solving time to dist from point, \");\n //console.log(\" curPos \", curPos);\n //console.log(\" curVel \", curVel);\n //console.log(\" accel \", accel);\n //console.log(\" targetPos \", targetPos);\n //console.log(\" distanceGoal \", distanceGoal);\n\n\n var c = -(curPos.subtract(targetPos).length()) + distanceGoal;\n var rootsArray = solveQuadratic(accel.length() / 2, curVel.length(), c); //TODO DEBUG PRINT STATEMENTS AND VERIFY THIS IS CORRECT, PROBABLY WRONG. DOES THIS ACTUALLY WORK? WAS IT REALLY THIS EASYYYY????????\n\n //console.log(\"solveTimeToDistFromPoint. accel.length() \", accel.length(), \", curVel.length() \", curVel.length(), \", curPos \", curPos, \", targetPos \", targetPos, \", distanceGoal \", distanceGoal);\n //console.log(\" possible time distances are \", rootsArray[0], \", \", rootsArray[1]);\n var time = (rootsArray === null ? null : closestPositive(rootsArray[0], rootsArray[1]));\n\n //console.log(\" solved time to dist from point. Time at: \", time);\n return time;\n }", "title": "" }, { "docid": "bfdbeb56768872ae2ef9f8e0f9a00b69", "score": "0.5892856", "text": "function getNextClosestPoint() {\n var shortestDistance = -1;\n var locatedPoint = \"none\";\n // Find the cloest point that hasn't been checked off (confirmed not shortest path)\n for (var name in pointsChecklist) {\n //console.log(\"Searching index \" + index);\n if (pointsChecklist[name].noOtherPaths == false) {\n if ((shortestDistance == -1) ||\n (pointsChecklist[name].shortestDistanceToHere < shortestDistance)) {\n shortestDistance = pointsChecklist[name].shortestDistanceToHere;\n if (shortestDistance != Number.MAX_VALUE) {\n locatedPoint = name;\n }\n }\n }\n }\n return locatedPoint;\n }", "title": "" }, { "docid": "4c62487839588ec284afe0787eb10fa3", "score": "0.5862715", "text": "getBestSolutions(){\r\n let besten = [];\r\n let decrementor = this.optimalMembers.length - 1;\r\n while (decrementor > 0) {\r\n if (this.optimalSolutionValues[decrementor] == this.optimalSolutionScore) {\r\n besten.push(this.optimalMembers[decrementor]);\r\n decrementor--;\r\n } else {\r\n break;\r\n }\r\n }\r\n return besten;\r\n }", "title": "" }, { "docid": "c694d0eb2a29758e2e9837f8c9b148b5", "score": "0.5828561", "text": "function find_D_West() {\n var end_1 = 342;\n var end_7 = 342 * 6 + 334;\n var end_8 = end_7 + 339;\n var end_9 = end_8 + 337;\n if (miner <= end_1) {\n return genericFind();\n }\n if (miner > end_1 && miner <= end_7) { // cols 2 - 7\n if (miner <= end_1 + 16 * 4) {\n column = 2;\n return helper(end_1, 16);\n } else {\n miner += 8;\n return genericFind();\n }\n } else {\n if (miner > end_7 && miner <= end_8) { // col 8\n if (miner <= end_7 + 17) {\n column = 8;\n row = 19;\n miner = 18 - (miner - end_7);\n return print_Result();\n } else if (miner <= end_7 + 17 + 16) {\n column = 8;\n row = 18;\n miner = 17 - (miner - (end_7 + 17));\n return print_Result();\n } else {\n flipped = true;\n miner += 3 + 8;\n return genericFind();\n }\n }\n if (miner > end_8 && miner <= end_9) { // col 9\n if (miner <= end_8 + 14) {\n column = 9;\n row = 19;\n miner = 15 - (miner - end_8);\n return print_Result();\n } else if (miner <= end_8 + 14 + 17) {\n column = 9;\n row = 18;\n miner = 18 - (miner - (end_8 + 14));\n return print_Result();\n } else {\n flipped = true;\n miner += 16;\n return genericFind();\n }\n }\n if (miner > end_9) {\n if (miner <= end_9 + 16) {\n column = 10;\n row = 19;\n miner = 17 - (miner - end_9);\n return print_Result();\n } else if (miner <= end_9 + 16 + 17) {\n column = 10;\n row = 18;\n miner = 18 - (miner - (end_9 + 16));\n return genericFind();\n } else {\n flipped = true;\n miner += 16 + 3;\n return genericFind();\n }\n }\n }\n}", "title": "" }, { "docid": "edc9d48a015bc73658116440c2f1e4a5", "score": "0.5789747", "text": "static bestElevator(elevators, floor, dir) {\n let totalTime = [];\n elevators.forEach((ele, idx) => {\n if (ele.curDir === dir || ele.curDir === null) {\n let time = (ele.curFloor - floor) * ele.travelDelay * (2 * ele.doorDelay);\n time = time < 0 ? -time : time;\n totalTime.push(time);\n } else {\n totalTime.push(999999);\n }\n });\n let elevatorNo = totalTime.reduce((min, x, i, arr) => x < arr[min] ? i : min, 0);\n\n // Hard Coded To Check if Elevator Can go to penthouse or basement.\n if(elevatorNo === 0) {\n if(floor === 10)\n elevatorNo = 1;\n } else {\n if(floor === 0)\n elevatorNo = 0;\n }\n\n return elevators[elevatorNo];\n }", "title": "" }, { "docid": "b1e215d77036cd5af31f1c7f5024dea5", "score": "0.57869506", "text": "function lookForSolution(){\n function search(sum, i) {\n if (sum == target) {\n return true;\n }\n else if (sum > target || i === array.length) {\n return null;\n }\n else {\n return search(sum + array[i], i + 1) ||\n search(sum, i + 1);\n }\n }\n \n // Begin search\n return search(0,0);\n }", "title": "" }, { "docid": "80f8d3fc6bcb7fbd820b6b24cd32a4e5", "score": "0.57828885", "text": "aStarSearch(start, goal) {\n //Formula: f(n)=g(n)+h(n)\n let open = new Array(),\n closed = new Array();\n let f = new Map(),\n g = new Map(), //Distance between start and that node\n h = new Map(), //approx. distance between that node and goal.\n parent = new Map(); //To store information of parent.\n for (let key of this.adjList.keys()) {\n //set f, g, and h as infinity for all\n f.set(key, Infinity);\n g.set(key, Infinity);\n h.set(key, Infinity);\n }\n //set f,g,and h 0 for start node.\n f.set(start, 0);\n g.set(start, 0);\n h.set(start, 0);\n\n //push the start node in open list.\n open.push(start);\n while (open.length > 0) {\n let [q, ind] = this.getMinOpenNode(open, f);\n open.splice(ind, 1); //deleting the node with min f.\n closed.push(q); //pushing that node in closed list.\n let successors = this.adjList.get(q);\n for (let successor of successors) {\n //For all its successors,\n if (successor[\"node\"] == goal) {\n //if that successor is our final goal,\n //end the function.\n parent.set(successor[\"node\"], q);\n let path = new Stack();\n let child = goal;\n while (child != start && child != undefined) {\n path.push(child);\n child = parent.get(child);\n }\n path.push(start);\n let pathPrint = \"\";\n while (path.size() != 1) {\n pathPrint += path.pop() + \" ==> \";\n }\n pathPrint += path.pop();\n console.log(pathPrint);\n return;\n } else if (!closed.includes(successor[\"node\"])) {\n //if the successor is not in closed list,\n let gNew = g.get(q) + this.getWeight(q, successor[\"node\"]);\n let hNew = this.manhattanDistance(successor[\"node\"], goal);\n let fNew = gNew + hNew;\n if (\n f.get(successor[\"node\"]) == Infinity ||\n f.get(successor[\"node\"]) > fNew\n ) {\n open.push(successor[\"node\"]);\n f.set(successor[\"node\"], fNew);\n g.set(successor[\"node\"], gNew);\n h.set(successor[\"node\"], hNew);\n parent.set(successor[\"node\"], q);\n }\n }\n }\n } //Time-complexity: O(E)\n }", "title": "" }, { "docid": "2caa3c2781e2b4f87935d5232873bb7e", "score": "0.57795155", "text": "function bestSpot() {\n\treturn minimax(board, AI).index;\n}", "title": "" }, { "docid": "a537d6d44856d0330aebf996e15a5289", "score": "0.57733643", "text": "function find_E_West() {\n var end_3 = 342 * 3;\n var end_7 = 342 * 6 + 16 * 4 + 15 * 18; // 2386\n if (miner <= end_3) {\n return genericFind();\n } else if (miner <= end_7) { // column 4\n column = 4;\n if (miner <= end_3 + 16 * 5) { // rows 15 - 19\n return helper(end_3, 16);\n }\n miner += 10;\n return genericFind();\n } else if (miner > end_7 && miner <= end_7 + 332) { // col 8\n miner += 2;\n column = 8;\n if (miner <= end_7 + 16 * 4) { // rows 16 - 19\n return helper(end_7, 16);\n }\n miner += 16;\n return genericFind();\n }\n miner += 18;\n return genericFind();\n}", "title": "" }, { "docid": "b066b352458c2ac885553c52d5d7a489", "score": "0.5755188", "text": "function t96search(board,player,depth,maxdepth,passy)\n { var t96target; var t96best = 0; var t96secondbest = 0; var t96points;\n var subboard = new Array();\n t96boardcopy(board,subboard);\n var t96bestpoints = t96boardeval(subboard,player);\n var t96secondbestpoints = t96bestpoints;\n if ((passy < 2)&&(depth < maxdepth))\n { for (t96target in subboard)\n { if (t96simulmove(1*t96target,player,subboard) > 0)\n { if (depth < maxdepth)\n { t96points =\n -t96search(subboard,-player,depth+1,maxdepth,0); }\n else { t96points = t96boardeval(subboard,player); }\n if (t96points > t96bestpoints)\n { if (t96value[t96best] >= t96value[t96secondbest])\n { t96secondbestpoints = t96bestpoints;\n t96secondbest = t96best; }\n t96bestpoints = t96points; t96best = 1*t96target; }\n else if ((t96secondbest == 0)||\n (t96value[t96secondbest]< t96value[t96target])||\n ((t96value[t96secondbest] == t96value[t96target])&&\n (t96points > t96secondbestpoints)))\n { t96secondbestpoints = t96points;\n t96secondbest = 1*t96target; }\n t96boardcopy(board,subboard); } } }\n if (depth == 0)\n { if (t96secondbest == 0) { return(t96best); }\n if ((t96value[t96secondbest] > t96value[t96best])&&\n (t96secondbestpoints+10>t96bestpoints))\n { return(t96secondbest); }\n else { return(t96best); } }\n return(t96bestpoints); }", "title": "" }, { "docid": "fadfbe59d98032263a69bfd81b23709a", "score": "0.5712445", "text": "function makeSolution () {\n var solutions = [\"BULBASAUR\", \"IVYSAUR\", \"VENUSAUR\", \"CHARMANDER\", \"CHARMELEON\", \"CHARIZARD\", \"SQUIRTLE\", \"WARTORTLE\", \"BLASTOISE\", \"CATERPIE\", \"METAPOD\", \"BUTTERFREE\", \"WEEDLE\", \"KAKUNA\", \"BEEDRILL\", \"PIDGEY\", \"PIDGEOTTO\", \"PIDGEOT\", \"RATTATA\", \"RATICATE\", \"SPEAROW\", \"FEAROW\", \"EKANS\", \"ARBOK\", \"PIKACHU\", \"RAICHU\", \"RAICHU\", \"SANDSHREW\", \"SANDSLASH\", \"NIDORAN\", \"NIDORINA\", \"NIDOQUEEN\", \"NIDORINO\", \"NIDOKING\", \"CLEFAIRY\", \"CLEFABLE\", \"VULPIX\", \"NINETALES\", \"JIGGLYPUFF\", \"WIGGLYTUFF\", \"ZUBAT\", \"GOLBAT\", \"ODDISH\", \"GLOOM\", \"VILEPLUME\", \"PARAS\", \"PARASECT\", \"VENONAT\", \"VENOMOTH\", \"DIGLETT\", \"DUGTRIO\", \"MEOWTH\", \"PERSIAN\", \"PSYDUCK\", \"GOLDUCK\", \"MANKEY\", \"PRIMEAPE\", \"GROWLITHE\", \"ARCANINE\", \"POLIWAG\", \"POLIWHIRL\", \"POLIWRATH\", \"ABRA\", \"KADABRA\", \"ALAKAZAM\", \"MACHOP\", \"MACHOKE\", \"MACHAMP\", \"BELLSPROUT\", \"WEEPINBELL\", \"VICTREEBEL\", \"TENTACOOL\", \"TENTACRUEL\", \"GEODUDE\", \"GRAVELER\", \"GOLEM\", \"PONYTA\", \"RAPIDASH\", \"SLOWPOKE\", \"SLOWBRO\", \"MAGNEMITE\", \"MAGNETON\", \"FARFETCHD\", \"DODUO\", \"DODRIO\", \"SEEL\", \"DEWGONG\", \"GRIMER\", \"MUK\", \"SHELLDER\", \"CLOYSTER\", \"GASTLY\", \"HAUNTER\", \"GENGAR\", \"ONIX\", \"DROWZEE\", \"HYPNO\", \"KRABBY\", \"KINGLER\", \"VOLTORB\", \"ELECTRODE\", \"EXEGGCUTE\", \"EXEGGUTOR\", \"CUBONE\", \"MAROWAK\", \"HITMONLEE\", \"HITMONCHAN\", \"LICKITUNG\", \"KOFFING\", \"WEEZING\", \"RHYHORN\", \"RHYDON\", \"CHANSEY\", \"TANGELA\", \"KANGASKHAN\", \"HORSEA\", \"SEADRA\", \"GOLDEEN\", \"SEAKING\", \"STARYU\", \"STARMIE\", \"MR MIME\", \"SCYTHER\", \"JYNX\", \"ELECTABUZZ\", \"MAGMAR\", \"PINSIR\", \"TAUROS\", \"MAGIKARP\", \"GYARADOS\", \"LAPRAS\", \"DITTO\", \"EEVEE\", \"VAPOREON\", \"JOLTEON\", \"FLAREON\", \"PORYGON\", \"OMANYTE\", \"OMASTAR\", \"KABUTO\", \"KABUTOPS\", \"AERODACTYL\", \"SNORLAX\", \"ARTICUNO\", \"ZAPDOS\", \"MOLTRES\", \"DRATINI\", \"DRAGONAIR\", \"DRAGONITE\", \"MEWTWO\", \"MEW\"];\n var solution = solutions[Math.floor(Math.random() * solutions.length)];\n\n return solution;\n}", "title": "" }, { "docid": "ede5fd76b22e8fb9f49080f58cd5afb7", "score": "0.5698217", "text": "async function minimumCost(from, to, passengers=1){\n const result = await solution.callable(from, to, passengers)\n Object.keys(result).forEach(element => {\n console.log(`${element} - ${result[element][0]} - ${result[element][1]}`) \n });\n}", "title": "" }, { "docid": "0aa859214d4112cc168d4f79a853bcfd", "score": "0.5671688", "text": "function solve(part) {\n\tbest = Infinity\n\tvar res = recurse(extend({},state), true, 0, 0, '')\n\tconsole.log(best)\n\tconsole.log(bestSeq)\n\treturn res\n}", "title": "" }, { "docid": "a99e3d5813cdfb8b57a994587e87074a", "score": "0.5668387", "text": "function findBestmove() {\n\t\tvar best = -1000;\n\t\tcoordsX = -1;\n\t\tcoordsY = -1;\n\t\tfor(var i = 0; i < 3; i++) {\n\t\t\tfor(var j = 0; j < 3; j++) {\n\t\t\t\tif(gameBoard[i][j] == null) {\n\t\t\t\t\tgameBoard[i][j] = aiChoice;\n\t\t\t\t\tvar moveVal = minimax(false);\n\t\t\t\t\tgameBoard[i][j] = null;\n\t\t\t\t\tif(moveVal > best) {\n\t\t\t\t\t\tcoordsX = i;\n\t\t\t\t\t\tcoordsY = j;\n\t\t\t\t\t\tbest = moveVal;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c7abacae37edc20cad66ad2883c403b0", "score": "0.5657248", "text": "function bestSpot() {\n\tconsole.log(minimax(board, aiplayer));\n\treturn minimax(board, aiplayer).index;\n}", "title": "" }, { "docid": "55b65444d31a5748f0902126e2219f54", "score": "0.565363", "text": "function waysToGiveACheck(board) {\n // Complete this function\n\n var kPosition = {\n x: -1,\n y: -1\n };\n\n var pPosition = [];\n\n for (var i = 0; i < board.length; i++) {\n for (var j = 0; j < board[i].length; j++) {\n if (board[i][j] === \"k\") {\n kPosition.y = i;\n kPosition.x = j;\n } else if (i === 1 && board[i][j] === \"P\" && board[i - 1][j] === \"#\") {\n pPosition.push({\n x: j,\n y: i\n });\n }\n }\n }\n\n //console.log(pPosition[0]);\n\n var knightMoves = [{\n x: -2,\n y: 1\n }, {\n x: 2,\n y: 1\n }, {\n x: -1,\n y: 2\n }, {\n x: 1,\n y: 2\n }];\n\n for (var i = 0; i < pPosition.length; i++) {\n if (kPosition.y === pPosition[i].y - 1 || kPosition.x === pPosition[i].x) {\n return 2;\n } else if (Math.abs(pPosition[i].x - kPosition.x) === kPosition.y) {\n return 2;\n } else {\n for (var j = 0; j < knightMoves.length; j++) {\n if (pPosition.x + knightMoves[j].x < 0 || pPosition.x + knightMoves[j].x > 7) {\n continue;\n } else if (pPosition[i].x + knightMoves[j].x === kPosition.x && pPosition[i].y - 1 + knightMoves[j].y === kPosition.y) {\n return 1;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "1353f7e34a9ad4ab819e884246160575", "score": "0.5641016", "text": "function optimizeQA(atman, solomon, hs) {\n var output1 = \"\";\n var bestAtman = atman;\n var bestSolomon = solomon;\n var bestQA = getQA(solomon.plus(ancient[3].bonusFromRelics), atman.plus(ancient[13].bonusFromRelics));\n var highestAtman = getHighestAtman(atman, hs);\n if (atman.gte(2880)) {\n bestSolomon = getNewSolomon(solomon, hs);\n bestQA = getQA(bestSolomon.plus(ancient[3].bonusFromRelics), bestAtman.plus(ancient[13].bonusFromRelics));\n } else {\n for (var i = highestAtman; i.gte(atman); i = i.minus(1)) {\n var newAtman = i;\n var costAtman = Decimal.pow(2, newAtman.plus(1)).minus(Decimal.pow(2, atman.plus(1))).times(Decimal(1).plus(outsider[2].multiplier)).ceil();\n var newSolomon = getNewSolomon(solomon, hs.minus(costAtman));\n var newQA = getQA(newSolomon.plus(ancient[3].bonusFromRelics), newAtman.plus(ancient[13].bonusFromRelics));\n output1 += \"Atman: \" + newAtman + \" (+\" + newAtman.minus(atman) + \"), Solomon: \" + integerFormat(newSolomon) + \" (+\" + newSolomon.minus(solomon) + \"), QA: \" + integerFormat(newQA) + \"<br>\";\n if (newQA.gt(bestQA)) {\n bestAtman = newAtman;\n bestSolomon = newSolomon;\n bestQA = newQA;\n } else\n break;\n }\n }\n $(\"#result2\").append(\"Atman: \" + bestAtman + \" (+\" + bestAtman.minus(atman) + \"), Solomon: \" + integerFormat(bestSolomon) + \" (+\" + easyCopyFormat(bestSolomon.minus(solomon)) + \"), QA: \" + integerFormat(bestQA) + \"<br>\");\n $(\"#result3\").append(output1 + \"<br>\");\n var output = [bestAtman, bestSolomon, bestQA];\n return output;\n}", "title": "" }, { "docid": "d82a7bb6a21f97411b16dbfde300d17c", "score": "0.56400526", "text": "function IDA() {\n\tfinished = false;\n\tsol = '';\n\tthreshold = heuristic(board);\n\tnewthreshold = INT_MAX;\n\twhile (!finished) {\n\t\tdfs('');\n\t\tthreshold = newthreshold;\n\t\tnewthreshold = INT_MAX;\n\t}\n\tsolve();\n}", "title": "" }, { "docid": "3fe7735c8038d46d27c5968b4609e7d5", "score": "0.5633294", "text": "closestApproachFF2(l1l) {\n // Get the closest approach points of two infinite lines\n let ca = this.findClosestApproachII(l1l);\n\n if (ca === null) {\n // project l1p0 and l1p1 onto l0\n let pp0 = this.getNearestLambdaToI(l1l.P0);\n let pp1 = this.getNearestLambdaToI(l1l.P1);\n let mag2 = this.vector.magnitude2;\n if (pp0 < 0 && pp1 < 0) {\n // both endpoints are below p0\n if (pp0 > pp1)\n return -mag2 * pp0;\n return -mag2 * pp1;\n }\n if (pp0 > 1 && pp1 > 1) {\n // both endpoints are above p1\n if (pp0 < pp1)\n return mag2 * (pp0 - 1);\n return mag2 * (pp1 - 1);\n }\n let l0 = this.vector;\n let d0 = l1l.P0.minus(this.P0);\n let q = d0.minus(l0.times(l0.dot(d0) / l0.magnitude2));\n return q.magnitude2;\n }\n\n if (ca.alpha < 0) {\n // closest approach is before the start of line 1\n if (ca.beta < 0)\n // closest approach is before the start of line 2\n return (this.P0.minus(l1l.P0)).magnitude2;\n if (ca.beta > 1)\n // closest approach is beyond the end of line 2\n return (this.P0.minus(l1l.P1)).magnitude2;\n // closest approach is somewhere along line 2\n return l1l.distanceF2(this.P0);\n }\n\n if (ca.alpha > 1) {\n if (ca.beta < 0)\n return (this.P1.minus(l1l.P0)).magnitude2;\n if (ca.beta > 1)\n return (this.P1.minus(l1l.P1)).magnitude2;\n return l1l.distanceF2(this.P1);\n }\n\n if (ca.beta < 0)\n return this.distanceF2(l1l.P0);\n if (ca.beta > 1)\n return this.distanceF2(l1l.P1);\n return ca.dist2;\n }", "title": "" }, { "docid": "e714cdf6eb300895e8afd370a741dd6b", "score": "0.56316936", "text": "function bestSpot() {\r\n return minimax(origBoard, computerSymbol).index;\r\n}", "title": "" }, { "docid": "d92b9af36251728f5ee189d5c0e68943", "score": "0.56245625", "text": "function findShortestPath(grid, sx, sy, ex, ey) {\n var limit = 10, //execution limiter\n iteration = 0, //our limiter to make sure we don't go over\n path = [], //the winning path to go back\n cx, cy; //our coordinates when traversing back\n\n //initialize our queue with the endoing point\n queue = [ [ex, ey, 0] ];\n\n //while we haven't scanned the start\n while ( !getQueue(sx, sy) && iteration < limit ) {\n //for every coordidate in the queue\n for ( var i = 0, l = queue.length; i < l; i++ ) {\n var q = queue[i],\n x = q[0],\n y = q[1],\n d = q[2];\n\n //check around us, and add valid spaces to the queue\n if ( isValid(x - 1, y) ) {\n queue.push( [x - 1, y, d + 1] );\n }\n if ( isValid(x + 1, y) ) {\n queue.push( [x + 1, y, d + 1] );\n }\n if ( isValid(x, y - 1) ) {\n queue.push( [x, y - 1, d + 1] );\n }\n if ( isValid(x, y + 1) ) {\n queue.push( [x, y + 1, d + 1] );\n }\n }\n iteration++;\n }\n\n //no path available or too far away\n if ( iteration >= limit ) {\n return false;\n }\n\n iteration = 0;\n //we have scanned the area and at this point have found the start\n cx = sx;\n cy = sy;\n cd = getQueue(cx, cy)[2];\n\n //push the start onto our solution\n path.push( [sx, sy] );\n do {\n //find the next lowest distance neighbor to go to\n var next = findLowestNeighbor(cx, cy, cd);\n cx = next[0];\n cy = next[1];\n cd = next[2];\n\n //add this neighbor to the path back\n path.push( [cx, cy] );\n\n iteration++;\n } while ( (cx != ex || cy != ey) && iteration < limit );\n return path;\n}", "title": "" }, { "docid": "c04b126d230be5c1717d188765b74205", "score": "0.5619528", "text": "function continueVertexSearch() {\n\n // if the simulation is paused, we can do nothing, as this function\n // will be called again when we restart\n if (pause) {\n return;\n }\n\n // keep track of points that were leaders but got beaten to be\n // colored grey if they are no longer a leader in any category\n var defeated = [];\n\n // first we finish the previous point to see if it's a new winner,\n // and if necessary downgrade anyone who was beaten by this one\n\n // special case of first checked\n if (nextToCheck == 0) {\n // this was our first check, so this point wins all to start\n northIndex = 0;\n southIndex = 0;\n eastIndex = 0;\n westIndex = 0;\n shortIndex = 0;\n longIndex = 0;\n foundNewLeader = true;\n }\n // we have to do real work to see if we have new winners\n else {\n // keep track of whether this point is a new leader\n var foundNewLeader = false;\n\n // check north\n if (parseFloat(waypoints[nextToCheck].lat) > parseFloat(waypoints[northIndex].lat)) {\n foundNewLeader = true;\n defeated.push(northIndex);\n northIndex = nextToCheck;\n }\n // check south\n if (parseFloat(waypoints[nextToCheck].lat) < parseFloat(waypoints[southIndex].lat)) {\n foundNewLeader = true;\n defeated.push(southIndex);\n southIndex = nextToCheck;\n }\n // check east\n\n if (parseFloat(waypoints[nextToCheck].lon) > parseFloat(waypoints[eastIndex].lon)) {\n foundNewLeader = true;\n defeated.push(eastIndex);\n eastIndex = nextToCheck;\n }\n // check west\n if (parseFloat(waypoints[nextToCheck].lon) < parseFloat(waypoints[westIndex].lon)) {\n foundNewLeader = true;\n defeated.push(westIndex);\n westIndex = nextToCheck;\n }\n\n // check label lengths\n if (waypoints[nextToCheck].label.length < waypoints[shortIndex].label.length) {\n foundNewLeader = true;\n defeated.push(shortIndex);\n shortIndex = nextToCheck;\n }\n\n if (waypoints[nextToCheck].label.length > waypoints[longIndex].label.length) {\n foundNewLeader = true;\n defeated.push(longIndex);\n longIndex = nextToCheck;\n }\n\n }\n\n // any point that was a leader but is no longer gets discarded,\n while (defeated.length > 0) {\n var toCheck = defeated.pop();\n if (toCheck != northIndex &&\n toCheck != southIndex &&\n toCheck != eastIndex &&\n toCheck != westIndex &&\n toCheck != longIndex &&\n toCheck != shortIndex) {\n\n updateMarkerAndTable(toCheck, visualSettings.discarded,\n 20, true);\n }\n }\n\n // the leader in each category is now highlighted in the tables and\n // on the map\n\n // TODO: handle better the situations where the same vertex\n // becomes the leader in multiple categories, as right now\n // it just gets colored with the last in this list\n if (foundNewLeader) {\n\t\n\t// this work will often be redundant but it's probably easier\n\t// than trying to avoid it\n\t\n\t// north\n\tupdateMarkerAndTable(northIndex, visualSettings.northLeader, \n\t\t\t 40, false);\n\tinfoBox = document.getElementById('info1');\n\tinfoBox.innerHTML = 'North extreme:<br />' +\n\t extremePointLeaderString(northIndex, visualSettings.northLeader);\n\t\n\t// south\n\tupdateMarkerAndTable(southIndex, visualSettings.southLeader,\n\t\t\t 40, false);\n\tinfoBox = document.getElementById('info2');\n\tinfoBox.innerHTML = \"South extreme:<br />\" +\n\t extremePointLeaderString(southIndex, visualSettings.southLeader);\n\t\n\t// east\n\tupdateMarkerAndTable(eastIndex, visualSettings.eastLeader,\n\t\t\t 40, false);\n infoBox = document.getElementById('info3');\n infoBox.innerHTML = \"East extreme:<br />\" +\n extremePointLeaderString(eastIndex, visualSettings.eastLeader);\n\n // west\n updateMarkerAndTable(westIndex, visualSettings.westLeader,\n 40, false);\n infoBox = document.getElementById('info4');\n infoBox.innerHTML = \"West extreme:<br />\" +\n extremePointLeaderString(westIndex, visualSettings.westLeader);\n\n // shortest\n updateMarkerAndTable(shortIndex, visualSettings.shortLabelLeader,\n 40, false);\n infoBox = document.getElementById('info5');\n infoBox.innerHTML = \"Shortest vertex label:<br />\" +\n labelLeaderString(shortIndex, visualSettings.shortLabelLeader);\n\n // longest\n updateMarkerAndTable(longIndex, visualSettings.longLabelLeader,\n 40, false);\n infoBox = document.getElementById('info6');\n infoBox.innerHTML = \"Longest vertex label:<br />\" +\n labelLeaderString(longIndex, visualSettings.longLabelLeader);\n } else {\n // we didn't have a new leader, just discard this one\n updateMarkerAndTable(nextToCheck, visualSettings.discarded,\n 20, true);\n }\n\n document.getElementById('algorithmStatus').innerHTML =\n 'Visiting: <span style=\"color:' + visualSettings.visiting.textColor +\n '; background-color:' + visualSettings.visiting.color + '\"> ' +\n nextToCheck + '</span>, ' + (markers.length - nextToCheck - 1) +\n ' remaining';\n\n // prepare for next iteration\n nextToCheck++;\n if (nextToCheck < markers.length) {\n updateMarkerAndTable(nextToCheck, visualSettings.visiting,\n 30, false);\n \n setTimeout(continueVertexSearch, delay);\n } else {\n\t\tdone = true;\n document.getElementById('algorithmStatus').innerHTML =\n \"Done! Visited \" + markers.length + \" waypoints.\";\n }\n}", "title": "" }, { "docid": "d30c89e05d5a707ea1f417c3e2a75f22", "score": "0.5604085", "text": "function elevator(left, right, call){\r\n // code on! :)\r\n var one = Math.abs(call - left);\r\n var two = Math.abs(call - right);\r\n if (one>=two) {\r\n return \"right\";\r\n } else {\r\n return \"left\";\r\n }\r\n}", "title": "" }, { "docid": "2b58090ef76a13677a731ea94ca895e6", "score": "0.5594464", "text": "function DFS( day,\n TODAY_ORE, // amount of resources at the start of the day\n TODAY_CLAY,\n TODAY_OBSIDIAN,\n TODAY_GEODES,\n TODAY_ORE_ROBOTS,\n TODAY_CLAY_ROBOTS,\n TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODE_ROBOTS) {\n \n if (DISPLAY_EXTRA_INFO\n && Math.floor((Date.now() - TIME_START_BLUEPRINT)/(1000*60)) === NEXT_MIN_TARGET)\n {\n console.log(`... ${\n NEXT_MIN_TARGET\n } mins have passed since beginning this blueprint`);\n console.log(`... ${\n Math.floor((Date.now() - TIME_AT_START)/(1000*60))\n } mins have passed since beginning this run`);\n ++NEXT_MIN_TARGET;\n }\n\n if (day > TIME_LIMIT) return 0; // if DFS gets called past TIME_LIMIT, return 0\n // to indicate a 'dead' branch\n\n if (day === TIME_LIMIT) { // BASE CASE: AT TIME LIMIT\n BEST_GEODES = Math.max(BEST_GEODES, TODAY_GEODES);\n return TODAY_GEODES;\n }\n\n const STATE = [\n TODAY_ORE,\n TODAY_CLAY,\n TODAY_OBSIDIAN,\n TODAY_GEODES,\n TODAY_ORE_ROBOTS,\n TODAY_CLAY_ROBOTS,\n TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODE_ROBOTS\n ];\n const SERIAL = STATE.join(',')\n\n\n // NOTE: IMPORTANT OPTIMIZATION. WE CHECK IF WE COULD MAGICALLY GUARANTEE THAT WE BUY A GEODE ROBOT EVERY DAY FOR THE\n // REST OF THE SIMULATION, STARTING NOW, THAT WOULD STILL NOT GENERATE ENOUGH GEODES COMPARED TO A PREVIOUSLY KNOWN VALUE.\n // IF THIS HAPPENS WE CAN PRUNE THIS BRANCH.\n const CANNOT_GET_ENOUGH_GEODES = TODAY_GEODES\n + ((TIME_LIMIT - day) * TODAY_GEODE_ROBOTS)\n + ((TIME_LIMIT - day - 1) * (TIME_LIMIT - day) / 2)\n <= BEST_GEODES;\n if (CANNOT_GET_ENOUGH_GEODES) MEMO[day][SERIAL] = 0;\n\n\n // TNOTE: these booleans make it very easy to reason through the decision tree\n const NO_MORE_OBSIDIAN_ROBOTS = TODAY_OBSIDIAN_ROBOTS >= MAX_OBSIDIAN_ROBOTS;\n const NO_MORE_CLAY_ROBOTS = NO_MORE_OBSIDIAN_ROBOTS || TODAY_CLAY_ROBOTS >= MAX_CLAY_ROBOTS;\n const NO_MORE_ORE_ROBOTS = NO_MORE_OBSIDIAN_ROBOTS && TODAY_ORE_ROBOTS >= MAX_ORE_ROBOTS;\n\n if (!(SERIAL in MEMO[day])) {\n\n // NOTE: INSTEAD OF SIMULATING EACH INDIVIDUAL DAY, THE OPTIMIZATION HEURISTIC WE USE HERE IS TO RECOGNIZE THAT\n // EVERY TIME WE RUN THE DFS FUNCTION, WE HAVE A CHOICE TO MAKE: WHICH ROBOT, IF ANY, WILL BE THE ONE WE BUY NEXT\n // (WHETHER IMMEDIATELY OR AFTER A FEW DAYS)? NOTE THAT WE SHOULD BUY THIS ROBOT AS SOON AS IT IS POSSIBLE TO DO SO.\n // FURTHERMORE WE CAN, BY DEFINITION, ASSERT THAT THERE ARE NO OTHER CHANGES TO THE ROBOT COUNT UNTIL THE NEXT ROBOT IS\n // PURCHASED.\n\n function GET_DAYS_TO_WAIT(NEXT_ROBOT) {\n switch (NEXT_ROBOT) {\n case GEODE:\n return Math.max(\n TODAY_ORE >= COSTS.GEODE_ROBOT.ore\n ? 0\n : Math.ceil((COSTS.GEODE_ROBOT.ore - TODAY_ORE) / TODAY_ORE_ROBOTS),\n TODAY_OBSIDIAN >= COSTS.GEODE_ROBOT.obsidian\n ? 0\n : Math.ceil((COSTS.GEODE_ROBOT.obsidian - TODAY_OBSIDIAN) / TODAY_OBSIDIAN_ROBOTS)\n );\n\n case OBSIDIAN:\n return Math.max(\n TODAY_ORE >= COSTS.OBSIDIAN_ROBOT.ore\n ? 0\n : Math.ceil((COSTS.OBSIDIAN_ROBOT.ore - TODAY_ORE) / TODAY_ORE_ROBOTS),\n TODAY_CLAY >= COSTS.OBSIDIAN_ROBOT.clay\n ? 0\n : Math.ceil((COSTS.OBSIDIAN_ROBOT.clay - TODAY_CLAY) / TODAY_CLAY_ROBOTS)\n );\n\n case CLAY:\n return TODAY_ORE >= COSTS.CLAY_ROBOT.ore\n ? 0\n : Math.ceil((COSTS.CLAY_ROBOT.ore - TODAY_ORE) / TODAY_ORE_ROBOTS);\n\n case ORE:\n return TODAY_ORE >= COSTS.ORE_ROBOT.ore\n ? 0\n : Math.ceil((COSTS.ORE_ROBOT.ore - TODAY_ORE) / TODAY_ORE_ROBOTS);\n\n default:\n throw 'ERROR: INVALID ROBOT TYPE';\n }\n }\n\n const DAYS_TO_WAIT_FOR_GEODE_ROBOT = GET_DAYS_TO_WAIT(GEODE);\n const DAYS_TO_WAIT_FOR_OBSIDIAN_ROBOT = GET_DAYS_TO_WAIT(OBSIDIAN);\n const DAYS_TO_WAIT_FOR_CLAY_ROBOT = GET_DAYS_TO_WAIT(CLAY);\n const DAYS_TO_WAIT_FOR_ORE_ROBOT = GET_DAYS_TO_WAIT(ORE);\n\n // NOTE: ANOTHER IMPORTANT OPTIMIZATION IS THAT WE *THROW AWAY EXTRA RESOURCES* THAT WE DON'T NEED, IN HOPES OF REDUCING\n // UNNECESSARY VARIATION TO STATES, AND INCREASING THE LIKELIHOOD OF GETTING A CACHE HIT ON THE MEMO.\n \n // NOTE ALSO THAT IT SEEMS (THOUGH I AM NOT ENTIRELY SURE) THAT IT IS BETTER TO RECURSE WITH THE MOST AGGRESSIVE BUYING STRATEGY\n // FIRST BEFORE THE OTHERS, BECAUSE I BELIEVE IT WILL RESULT IN MORE CACHE HITS (WHICH IS TIME SAVED).\n\n const BUY_GEODE_ROBOT = DFS(day + (DAYS_TO_WAIT_FOR_GEODE_ROBOT + 1),\n NO_MORE_ORE_ROBOTS ? MAX_ORE_ROBOTS // max useful # ore robots\n : TODAY_ORE\n + (DAYS_TO_WAIT_FOR_GEODE_ROBOT + 1) * TODAY_ORE_ROBOTS\n - COSTS.GEODE_ROBOT.ore,\n NO_MORE_CLAY_ROBOTS ? 0 // throw away extra clay\n : TODAY_CLAY\n + (DAYS_TO_WAIT_FOR_GEODE_ROBOT + 1) * TODAY_CLAY_ROBOTS,\n NO_MORE_OBSIDIAN_ROBOTS ? MAX_OBSIDIAN_ROBOTS // max useful # obsidian robots\n : TODAY_OBSIDIAN\n + (DAYS_TO_WAIT_FOR_GEODE_ROBOT + 1) * TODAY_OBSIDIAN_ROBOTS\n - COSTS.GEODE_ROBOT.obsidian,\n TODAY_GEODES\n + (DAYS_TO_WAIT_FOR_GEODE_ROBOT + 1) * TODAY_GEODE_ROBOTS,\n TODAY_ORE_ROBOTS,\n TODAY_CLAY_ROBOTS,\n TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODE_ROBOTS + 1);\n\n const BUY_OBSIDIAN_ROBOT = NO_MORE_OBSIDIAN_ROBOTS\n ? 0\n : DFS(day + (DAYS_TO_WAIT_FOR_OBSIDIAN_ROBOT + 1),\n TODAY_ORE\n + (DAYS_TO_WAIT_FOR_OBSIDIAN_ROBOT + 1) * TODAY_ORE_ROBOTS\n - COSTS.OBSIDIAN_ROBOT.ore,\n TODAY_CLAY\n + (DAYS_TO_WAIT_FOR_OBSIDIAN_ROBOT + 1) * TODAY_CLAY_ROBOTS\n - COSTS.OBSIDIAN_ROBOT.clay,\n TODAY_OBSIDIAN\n + (DAYS_TO_WAIT_FOR_OBSIDIAN_ROBOT + 1) * TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODES\n + (DAYS_TO_WAIT_FOR_OBSIDIAN_ROBOT + 1) * TODAY_GEODE_ROBOTS,\n TODAY_ORE_ROBOTS,\n TODAY_CLAY_ROBOTS,\n TODAY_OBSIDIAN_ROBOTS + 1,\n TODAY_GEODE_ROBOTS);\n\n const BUY_CLAY_ROBOT = NO_MORE_CLAY_ROBOTS\n ? 0\n : DFS(day + (DAYS_TO_WAIT_FOR_CLAY_ROBOT + 1),\n TODAY_ORE\n + (DAYS_TO_WAIT_FOR_CLAY_ROBOT + 1) * TODAY_ORE_ROBOTS\n - COSTS.CLAY_ROBOT.ore,\n TODAY_CLAY\n + (DAYS_TO_WAIT_FOR_CLAY_ROBOT + 1) * TODAY_CLAY_ROBOTS,\n TODAY_OBSIDIAN\n + (DAYS_TO_WAIT_FOR_CLAY_ROBOT + 1) * TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODES\n + (DAYS_TO_WAIT_FOR_CLAY_ROBOT + 1) * TODAY_GEODE_ROBOTS,\n TODAY_ORE_ROBOTS,\n TODAY_CLAY_ROBOTS + 1,\n TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODE_ROBOTS);\n\n const BUY_ORE_ROBOT = NO_MORE_ORE_ROBOTS\n ? 0\n : DFS(day + (DAYS_TO_WAIT_FOR_ORE_ROBOT + 1),\n TODAY_ORE\n + (DAYS_TO_WAIT_FOR_ORE_ROBOT + 1) * TODAY_ORE_ROBOTS\n - COSTS.ORE_ROBOT.ore,\n NO_MORE_CLAY_ROBOTS ? 0\n : TODAY_CLAY\n + (DAYS_TO_WAIT_FOR_ORE_ROBOT + 1) * TODAY_CLAY_ROBOTS,\n NO_MORE_OBSIDIAN_ROBOTS ? MAX_OBSIDIAN_ROBOTS\n : TODAY_OBSIDIAN\n + (DAYS_TO_WAIT_FOR_ORE_ROBOT + 1) * TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODES\n + (DAYS_TO_WAIT_FOR_ORE_ROBOT + 1) * TODAY_GEODE_ROBOTS,\n TODAY_ORE_ROBOTS + 1,\n TODAY_CLAY_ROBOTS,\n TODAY_OBSIDIAN_ROBOTS,\n TODAY_GEODE_ROBOTS);\n\n const BUY_NOTHING = TODAY_GEODES + TODAY_GEODE_ROBOTS * (TIME_LIMIT - day); // calculate total geode yield based on geode robots owned today\n\n // THERE ARE ONLY 5 THINGS YOU CAN DO: CHOOSE THE ROBOT TYPE YOU WILL BUY NEXT BEFORE ANY OTHERS, OR COMMIT TO NEVER BUY ANOTHER ROBOT\n\n MEMO[day][SERIAL] = Math.max( BUY_GEODE_ROBOT, BUY_OBSIDIAN_ROBOT, BUY_CLAY_ROBOT, BUY_ORE_ROBOT, BUY_NOTHING );\n }\n\n BEST_GEODES = Math.max(BEST_GEODES, MEMO[day][SERIAL]);\n return MEMO[day][SERIAL];\n }", "title": "" }, { "docid": "3dc53a216eb81b1dc7dc311072188e76", "score": "0.5578817", "text": "function bestSpot() {\n\tif (gamelevel == 'easy') return emptySquares()[0];\t// easy algorithm for ai player by determining next consecutive empty place.\n\treturn minimax(origBoard, aiPlayer).index;\t// unbeatable ai algorithm.\n}", "title": "" }, { "docid": "7b57742d75cc5b28e26fd7518027e156", "score": "0.5574989", "text": "function riddleSolver() {\n\n}", "title": "" }, { "docid": "2cf46242ad0af5bf2c94e9e6e99f064f", "score": "0.55700934", "text": "closest(targets) {\n let minDist = 1000000;\n let myTarget = null;\n targets.forEach(target => {\n let distance = this.distanceTo(target);\n if (distance < minDist) {\n minDist = distance;\n myTarget = target;\n }\n });\n return myTarget;\n }", "title": "" }, { "docid": "c81f8ba5d3d1fdbe01e62c7aa0da65d5", "score": "0.55647683", "text": "function heldKarpDriver(cities)\r\n{\r\n\tvar minDist = Infinity;\r\n\tvar minStart = undefined;\r\n\tfor (var i = 0; i<cities.length; i++)\r\n\t{\r\n\t\tvar dist = heldKarp(cities, i);\r\n\t\tif (dist < minDist)\r\n\t\t{\r\n\t\t\tminDist = dist;\r\n\t\t\tminStart = i;\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"Min Dist is \", minDist,\" starting at city \",minStart);\r\n\treturn minDist\r\n}", "title": "" }, { "docid": "8dab460b5f3dc554758a542f29a62ccf", "score": "0.55584526", "text": "function improve_solution(board, blocks, options) {\n //blocks = place_greedy(board, blocks, remaining, cb) {\n var graph = new PatheryGraph(board);\n blocks = graph.dictify_blocks(blocks);\n\n var solution = find_pathery_path(graph, blocks);\n\n var best_val = solution.value;\n var best_remove_block = null;\n var best_add_block = null;\n var num_tied = 1;\n var val;\n\n var fail_improve = 0;\n\n options.num_failures = options.num_failures || 1;\n if (options.try_shortcut === undefined) {options.try_shortcut = true;}\n\n while (fail_improve < options.num_failures) {\n fail_improve += 1;\n if (options.try_shortcut) {\n }\n\n for (var remove_block in blocks) {\n delete blocks[remove_block];\n\n solution = find_pathery_path(graph, blocks);\n var relevant_blocks = solution.relevant_blocks;\n\n for (var add_block in relevant_blocks) {\n blocks[add_block] = true;\n solution = find_pathery_path(graph, blocks);\n val = solution.value;\n if (val > best_val) {\n num_tied = 1;\n fail_improve = 0;\n best_remove_block = remove_block; best_add_block = add_block; best_val = val;\n } else if (val == best_val) {\n num_tied += 1;\n if (options.randomize) {\n if (Math.random() * num_tied < 1) {\n best_remove_block = remove_block; best_add_block = add_block; best_val = val;\n }\n }\n }\n delete blocks[add_block];\n }\n blocks[remove_block] = true;\n }\n\n if (best_remove_block) {\n delete blocks[best_remove_block]\n blocks[best_add_block] = true;\n }\n }\n return graph.listify_blocks(blocks);\n}", "title": "" }, { "docid": "3091695f0da031c7e55e774ec6a2a25e", "score": "0.5549107", "text": "function getPath(src, dst) {\n var res = dijkstras(src);\n console.log(res);\n // console.log(res[0][0]);\n // Pick the best starting route, specific to A and B\n // Needs to be here b/c it depends on B and dijkstras calculates for all B\n var curr;\n var best;\n var min = 99999;\n for(var c in res) {\n if(res[c] == 0) { // Was Error\n continue;\n }\n console.log(res[c][0][dst]);\n\n curr = res[c][0][dst];\n if(curr < min) {\n best = res[c];\n min = curr;\n }\n }\n // Debugging\n if(best == undefined) {\n console.log(\"Unreachable!\");\n return;\n }\n\n var ests = best[0];\n var prev = best[1];\n var route = best[2];\n // console.log(\"ROUTE: \", route, \" ; BEST: \", best);\n\n // Trace back the path, printing the route\n curr = dst;\n var lastRoute = route[dst];\n var path = []; // List of [{route_id, enter, exit}] (usually will just be 1 triple)\n // Unless they had to make a transfer.\n // path[lastRoute] = {\"exit\": dst};\n\tpath.push({\"route_id\": lastRoute, \"exit\": dst})\n var safety = 0;\n var s = \"\";\n while(curr != src) {\n safety++;\n if(safety > 1000) {\n return 0;\n }\n s = curr + \" - \" + stopTable[curr].name + \"\\n\" + s;\n curr = prev[curr]; // Increment\n if(route[curr] != lastRoute) {\n path[0].enter = curr; // Finish entry for the last one\n\t\t\tpath.unshift({\"route_id\": route[curr], \"exit\": curr}); // Insert next to beginning\n // path[route[curr]] = {\"exit\": curr};\n lastRoute = route[curr]; // Update last route used\n }\n }\n s = curr + \" - \" + stopTable[curr].name + \"\\n\" + s;\n\n console.log(\"path: \", s);\n path[0].enter = src; // Add entering the first segment\n console.log(src, dst, \"SRC : DST\");\n console.log(\"Path = \", path);\n\n return [path, ests[dst]]; // Returns [path, estimate]\n}", "title": "" }, { "docid": "5d32ec53b8bba82f80340d6b6cf75027", "score": "0.5538972", "text": "function waypointSearch ( )\n {\t\n var closest = 0;\n var distance = 0;\n var distance2 = 0;\n var close = 0;\n for ( var i = 0; i < waypoints.Length; i++ ) \n {\n //check the distance of the enemy from all waypoint\n distance = Vector3.Distance ( transform.position, waypoints[i].position );\n if ( i + 1 != waypoints.Length )\n {\n distance2 = Vector3.Distance ( transform.position, waypoints[i + 1].position );\n if ( i == 0 )\n {\n close = distance;\n }\n if ( distance < distance2 )\n {\n if ( close <= distance )\n {\n\t\t\t\t\t\n }\n else \n {\n close = distance;\n closest = i;\n }\n } \n else \n {\n if ( close < distance2 )\n {\n\t\t\t\t\t\t\n }\n else \n {\n close = distance2;\n closest = i + 1;\n }\n }\n } \n }\n // return the closest one\n return closest;\t\n }", "title": "" }, { "docid": "eee80e840deb884de0e30e8f8f4c5c8b", "score": "0.5537529", "text": "function bestSpot () {\r\n\treturn minimax(origBoard, aiPlayer).index; // Function in AI.js file\r\n}", "title": "" }, { "docid": "71ce27a8f1ee3e2b6e1daad84042df2c", "score": "0.55336356", "text": "function MinCostMatching(cost, Lmate, Rmate) {\n var n = cost.length;\n\n // construct dual feasible solution\n // VD u(n);\n // VD v(n);\n var u = [], v = [];\n\n for (var i = 0; i < n; i++) {\n u[i] = cost[i][0];\n for (var j = 1; j < n; j++) u[i] = Math.min(u[i], cost[i][j]);\n }\n for (var j = 0; j < n; j++) {\n v[j] = cost[0][j] - u[0];\n for (var i = 1; i < n; i++) v[j] = Math.min(v[j], cost[i][j] - u[i]);\n }\n\n // construct primal solution satisfying complementary slackness\n // Lmate = VI(n, -1);\n // Rmate = VI(n, -1);\n\n for (var i = 0; i < n; i++) Lmate[i] = Rmate[i] = -1;\n\n var mated = 0;\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n if (Rmate[j] !== -1) continue;\n if (Math.abs(cost[i][j] - u[i] - v[j]) < 1e-10) {\n Lmate[i] = j;\n Rmate[j] = i;\n mated++;\n break;\n }\n }\n }\n\n // VD dist(n);\n // VI dad(n);\n // VI seen(n);\n var dist = [], dad = [], seen = [];\n\n // repeat until primal solution is feasible\n while (mated < n) {\n\n // find an unmatched left node\n var s = 0;\n while (Lmate[s] !== -1) s++;\n\n // initialize Dijkstra\n // fill(dad.begin(), dad.end(), -1);\n // fill(seen.begin(), seen.end(), 0);\n for (var i = 0; i < n; i++) {\n dad[i] = -1;\n seen[i] = false;\n }\n for (var k = 0; k < n; k++)\n dist[k] = cost[s][k] - u[s] - v[k];\n\n var j = 0;\n while (true) {\n\n // find closest\n j = -1;\n for (var k = 0; k < n; k++) {\n if (seen[k]) continue;\n if (j == -1 || dist[k] < dist[j]) j = k;\n }\n seen[j] = true;\n\n // termination condition\n if (Rmate[j] === -1) break;\n\n // relax neighbors\n var i = Rmate[j];\n for (var k = 0; k < n; k++) {\n if (seen[k]) continue;\n var new_dist = dist[j] + cost[i][k] - u[i] - v[k];\n if (dist[k] > new_dist) {\n dist[k] = new_dist;\n dad[k] = j;\n }\n }\n }\n\n // update dual variables\n for (var k = 0; k < n; k++) {\n if (k == j || !seen[k]) continue;\n var i = Rmate[k];\n v[k] += dist[k] - dist[j];\n u[i] -= dist[k] - dist[j];\n }\n u[s] += dist[j];\n\n // augment along path\n while (dad[j] >= 0) {\n var d = dad[j];\n Rmate[j] = Rmate[d];\n Lmate[Rmate[j]] = j;\n j = d;\n }\n Rmate[j] = s;\n Lmate[s] = j;\n\n mated++;\n }\n\n var value = 0;\n for (var i = 0; i < n; i++)\n value += cost[i][Lmate[i]];\n\n return value;\n}", "title": "" }, { "docid": "0bade434367625c9db2f4175547c1e8d", "score": "0.5531269", "text": "findClosestUnit() {\n\t\tlet minDist = MAX_DIST;\n\t\tlet closestUnitIdx = null;\n\t\t\n\t\tlet len = this.suList.length;\n for (let i = 0; i < len; i++) {\n\t\t\tlet su = this.suList[i];\n\t\t\tif (!su.isActive()) continue;\n\t\t\tthis.ouList.forEach(ou => {\n\t\t\t\tif (su.pathData.attackable[ou.gridPos.x][ou.gridPos.y] !== -1) {\n\t\t\t\t\tlet gpsFrom = su.pathData.listAttackable[su.pathData.attackable[ou.gridPos.x][ou.gridPos.y]].gpsFrom;\n\t\t\t\t\tlet lenLA = gpsFrom.length;\n\t\t\t\t\tfor (let j = 0; j < lenLA; j ++) {\n\t\t\t\t\t\tlet target = this.hGame.findUnitByGridPos(gpsFrom[j]);\n\t\t\t\t\t\tif (target === null) {\n\t\t\t\t\t\t\t// this su can attack ou from gpsFrom[j]!!\n\t\t\t\t\t\t\t// normally here you should find best attacker & best target\n\t\t\t\t\t\t\t// but this is OHKO game so that's probably irrelevant (unless you do omakase)\n\t\t\t\t\t\t\tminDist = -1;\n\t\t\t\t\t\t\tclosestUnitIdx = i;\n\t\t\t\t\t\t\treturn;\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\tlet dist = this.suPDIR[i].dist[ou.gridPos.x][ou.gridPos.y];\n\t\t\t\t//alert(su.unitID+\" -> \"+ou.unitID +\" = \"+ dist);\n\t\t\t\tif (dist < minDist) {\n\t\t\t\t\tminDist = dist;\n\t\t\t\t\tclosestUnitIdx = i;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn closestUnitIdx;\n\t}", "title": "" }, { "docid": "3700c800c9b105c65cfbd55f1c942f3e", "score": "0.5503774", "text": "function apartmentHunting(blocks, reqs) {\n let cleanBlocks = JSON.parse(JSON.stringify(blocks));\n\n blocks.forEach((block, idx) => {\n for (const [key, value] of Object.entries(block)) {\n if (block[key]) block[key] = 0;\n else block[key] = findClosest(key, idx, cleanBlocks);\n }\n });\n\n let lowestAmt = Infinity;\n let lowestIdx;\n blocks.forEach((block, idx) => {\n let newBlock = Object.entries(block).filter((el) => reqs.includes(el[0]));\n\n newBlock.sort((a, b) => b[1] - a[1]);\n\n if (newBlock[0][1] < lowestAmt) {\n lowestAmt = newBlock[0][1];\n lowestIdx = idx;\n }\n });\n\n return lowestIdx;\n\n function findClosest(localeToFind, currentLocale, blocksToSearch) {\n let currSmallest = blocksToSearch.length;\n blocksToSearch.forEach((block, idx) => {\n if (block[localeToFind] && idx !== currentLocale) {\n let currDiff =\n Math.max(idx, currentLocale) - Math.min(idx, currentLocale);\n if (currDiff < currSmallest) {\n currSmallest = currDiff;\n }\n }\n });\n return currSmallest;\n }\n}", "title": "" }, { "docid": "a65511890acccd469119f64037007adb", "score": "0.5496943", "text": "function findOptimalSolutionIBFS ({initialState, treeExpander, checkTarget, depthLimit, heuristic}) {\n\tvar root = new InformedDecisionTreeNode({state: initialState, heuristic});\n\tvar queue = new HOBFS(InformedDecisionTreeNode.compareInformedDecisionTreeNodes);\n\tqueue.push(root);\n\treturn findOptimalSolution({treeExpander, checkTarget, queue, depthLimit})\n}", "title": "" }, { "docid": "dfac57cfc690d7be160cb6c7144d287e", "score": "0.5490187", "text": "prims() {\n // the maze is built along the edge with the lowest weight\n // that choice must not connect with a previously visited node\n // (1) observe the frontier to the current cell\n // (2) compare the edge weights & set the minimum cell\n // FIXME: non-fatal rare complaint: 'Cannot set property 'discovered' of null'\n let newEdge = new Edge(null, null, 1); // dummy edge, outside maximum weight\n for (let i = 0; i < this.frontier.length; i += 1) {\n if (this.frontier[i].nodeFrom.discovered && this.frontier[i].nodeTo.discovered) {\n this.frontier.splice(i, 1);\n } else if (this.frontier[i].weight < newEdge.weight && !this.frontier[i].nodeTo.discovered) {\n newEdge = this.frontier[i];\n }\n }\n newEdge.nodeTo.discovered = true;\n\n // re-build the frontier at the new node for each of 4 directions\n Object.values(CNS.DIRECTIONS).forEach((direction) => {\n // there should be a cell at the direction && it should be undiscovered\n if (\n (newEdge.nodeTo.neighbors[direction] !== undefined)\n && (!newEdge.nodeTo.neighbors[direction].nodeTo.discovered)\n ) {\n this.frontier.push(newEdge.nodeTo.neighbors[direction]);\n }\n });\n\n // `nodeFrom` is related to `nodeTo` by an edge\n const currentPos = `${newEdge.nodeFrom.x}, ${newEdge.nodeFrom.y}`;\n const nextPos = `${newEdge.nodeTo.x}, ${newEdge.nodeTo.y}`;\n\n // each grid node stores a neighbor in the format [edge, node] where the edge\n // is the passage to the next node. since this is an undirected graph, the\n // currentPos has a neighbor nextPos, and the nextPos has a neighbor currentPos\n // if this was a directed graph, omit one of the ternaries - observe that\n // dead-ends will be very common when using random extremes, since the\n // search algorithm isn't allowed to look in an 'opposite' direction\n this.tree[currentPos] === undefined\n ? this.tree[currentPos] = [[newEdge, newEdge.nodeTo]]\n : this.tree[currentPos].push([newEdge, newEdge.nodeTo]);\n this.tree[nextPos] === undefined\n ? this.tree[nextPos] = [[newEdge, newEdge.nodeFrom]]\n : this.tree[nextPos].push([newEdge, newEdge.nodeFrom]);\n\n // color in the node since it was (1) visited and (2) added, and\n // color the edge from the previous node to nodeTo, based on # of nodes.\n // a gradient of 20 colors determines the fill color for the extent of progress\n let colorStep = (Object.keys(this.tree).length / CNS.PROGRESS);\n colorStep = ((Math.ceil(colorStep * 20)) / 20).toFixed(2); // round to nearest .05\n this.draw.drawEdge(newEdge, colorStep);\n this.draw.drawNode(newEdge.nodeTo, colorStep);\n }", "title": "" }, { "docid": "01d92fd424d741a43167452c4c09a85b", "score": "0.5490105", "text": "findClosestValue(num) {\n return 9 - num;\n }", "title": "" }, { "docid": "50551c5bc3329c742a58cfbbf0b50155", "score": "0.54897416", "text": "_moveUpOrDownhill(worstPossible, findIsBetter, getNeighbors, varName) {\n var patch, turtle, winner, winners, winningValue;\n turtle = SelfManager.self();\n patch = turtle.getPatchHere();\n winningValue = worstPossible;\n winners = [];\n getNeighbors(patch).forEach(function(neighbor) {\n var value;\n value = neighbor.getPatchVariable(varName);\n if (NLType(value).isNumber()) {\n if (findIsBetter(value, winningValue)) {\n winningValue = value;\n return winners = [neighbor];\n } else if (winningValue === value) {\n return winners.push(neighbor);\n }\n }\n });\n if (winners.length !== 0 && findIsBetter(winningValue, patch.getPatchVariable(varName))) {\n winner = winners[this._rng.nextInt(winners.length)];\n turtle.face(winner);\n turtle.moveTo(winner);\n }\n }", "title": "" }, { "docid": "35331800f11b7ec5617790c75abedde6", "score": "0.54733837", "text": "slower() {\r\n if (!this.solver.isSolving()) {\r\n this.solve();\r\n }\r\n this.solvingSpeedInMs = 4 + Math.floor(this.solvingSpeedInMs / 0.8);\r\n }", "title": "" }, { "docid": "443589a5cf827001c107a8cb614d93ea", "score": "0.5471344", "text": "function tournamentSelect(paths) {\n\tvar tournamentSize = 8;\n\tvar fittest = -1;\n\tvar bestDistance = Number.MAX_VALUE;\n\tfor (var i = 0; i < tournamentSize; i++) {\n\t\tvar randomIndex = Math.floor(paths.length *getRandomIntInclusive(0, 1) );\n\t\tvar fitness = getPathDistance(paths[randomIndex]);\n\t\tif (fitness < bestDistance) {\n\t\t\tbestDistance = fitness;\n\t\t\tfittest = randomIndex;\n\t\t}\n\t}\n\treturn fittest;\n}", "title": "" }, { "docid": "c61c231846137ac635cca19ced7d5863", "score": "0.54706335", "text": "evaluate(doel){\r\n this.solutions = [];\r\n let counter = 0;\r\n\r\n for (let i = 0; i < this.values.length; i++) {\r\n if (this.values[i] <= doel) {\r\n this.solutions.push(this.members[i]);\r\n counter++;\r\n\r\n // A check with the best (the best seen so far).\r\n if (this.values[i] > this.optimalSolutionScore) {\r\n this.optimalSolutionScore = this.values[i];\r\n this.optimalSolutionValues.push(this.values[i]);\r\n this.optimalMembers.push(this.members[i]);\r\n } else if(this.values[i] === this.optimalSolutionScore) {\r\n\r\n // Loop through to check if it is a unique member.\r\n let uniqueMember = true;\r\n for (let k = 0; k < this.optimalMembers.length; k++) {\r\n if (this.optimalMembers[k] === this.members[i]) {\r\n uniqueMember = false;\r\n };\r\n }\r\n // Add if unique in encoding.\r\n if (uniqueMember) {\r\n this.optimalMembers.push(this.members[i]);\r\n this.optimalSolutionValues.push(this.values[i]);\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c5f415de46fc4c3926e20bccd9908048", "score": "0.54678744", "text": "bestDecision() {\n let sortedScores = [...this.possibleScores].sort((a, b) => b - a);\n let bestMove = null;\n for (const score of sortedScores) {\n let possibleMoves = [];\n if (this.isIntialMove) {\n possibleMoves = this.wordsFromTiles.filter(word => word.score === score);\n if (possibleMoves.length) {\n return { word: possibleMoves[0].word, vertical: false, x: 6, y: 7 };\n }\n return null;\n } else {\n for (const node of this.currWords) {\n possibleMoves = node.doublingPossibilities.filter(word => word.score === score);\n bestMove = this.choose2XMove(node, possibleMoves);\n if (bestMove) {\n return bestMove;\n }\n possibleMoves = node.crossAxisPossibilites.filter(word => word.score === score);\n bestMove = this.chooseCrossAxisMove(node, possibleMoves);\n if (bestMove) {\n return bestMove;\n }\n possibleMoves = node.mainAxisPossibilites.filter(word => word.score === score);\n bestMove = this.chooseMainAxisMove(node, possibleMoves);\n if (bestMove) {\n return bestMove;\n }\n }\n }\n }\n return bestMove;\n }", "title": "" }, { "docid": "79e06ca483f875bd84fa1f087a36be51", "score": "0.5461444", "text": "function miniMax(player) {\n let board = boardSettings.getBoard();\n let availableSpaces = emptySpaces(board);\n let score = checkForWin(board);\n let compPlayer = boardSettings.getComputerChoice();\n let huPlayer = boardSettings.getPlayerChoice();\n\n //Score possible outcomes of moves by comp/human player\n if(checkForWin(compPlayer) === 1) {\n return {point: 10};\n }\n else if(checkForWin(huPlayer) === -1) {\n return {point: -10};\n }\n else if(availableSpaces.length === 0) {\n return {point: 0};\n }\n\n let movesArray = [];\n //Increment over all available spaces making moves for hu/comp player\n for(let i=0; i < availableSpaces.length; i++) {\n let move ={};\n let tempIndex = parseInt(availableSpaces[i]);\n move.index = board[tempIndex];\n board[tempIndex] = player;\n\n if(player === compPlayer) {\n let resultA = miniMax(huPlayer);\n move.point = resultA.point;\n }\n else {\n let resultB = miniMax(compPlayer);\n move.point = resultB.point;\n }\n board[tempIndex] = move.index;\n\n //Push index/points of each move to an array.\n movesArray.push(move);\n }\n\n //Find best move for comp/human players when it's there turn.\n var bestMove;\n if(player === compPlayer) {\n var best = -10000;\n movesArray.forEach(function(ele, index) {\n let tempA = ele.point;\n if(tempA > best) {\n best = tempA;\n bestMove = index;\n }\n });\n\n }\n else {\n var bestVal = 10000;\n movesArray.forEach(function(elem, ind) {\n let tempB = elem.point\n if(tempB < bestVal) {\n bestVal = tempB;\n bestMove = ind;\n }\n });\n }\n\n //Return best index/points pair to calling function.\n return movesArray[bestMove];\n }", "title": "" }, { "docid": "1f3ef76da4cb1b14508bbf90b0896404", "score": "0.545107", "text": "closestApproachII2(l1l) {\n let ca = this.findClosestApproachII(l1l);\n if (ca)\n return ca.dist2;\n // parallel\n let l0 = this.vector;\n let d0 = l1l.P0.minus(this.P0);\n let q = d0.minus(l0.times(l0.dot(d0) / l0.magnitude2));\n return q.magnitude2;\n }", "title": "" }, { "docid": "a8726e8ec99469b85667f0e0fb2fddec", "score": "0.5443001", "text": "checkIfElevatorIsBetter(\n scoreToCheck,\n newElevator,\n bestScore,\n referenceGap,\n bestElevator,\n Floor\n ) {\n if (scoreToCheck < bestScore) {\n bestScore = scoreToCheck;\n bestElevator = newElevator;\n referenceGap = Math.abs(newElevator.currentFloor - Floor);\n } else if (bestScore == scoreToCheck) {\n let Gap = Math.abs(newElevator.currentFloor - Floor);\n if (referenceGap > Gap) {\n bestElevator = newElevator;\n referenceGap = Gap;\n }\n }\n let bestElevatorInformations = {\n bestElevator: bestElevator,\n bestScore: bestScore,\n referenceGap: referenceGap,\n };\n return bestElevatorInformations;\n }", "title": "" }, { "docid": "52b86c524f5b76850f3eb3cf2844e06b", "score": "0.54399955", "text": "function closest(curr_bug) {\r\n\t\r\n\tvar curr_food;\r\n\tvar\tx = 0;\r\n\tvar\ty = 0;\r\n\tvar\td = 721;\r\n\tvar target;\r\n\t\r\n\tfor (k = 0; k < foods.length; k++){\r\n\t\tcurr_food = foods[k];\r\n\t\t\r\n\t\tif (curr_food.status == 1){\r\n\t\t\t\r\n\t\t\t// Distance\r\n\t\t\tif (Math.sqrt(Math.pow((curr_food.x - curr_bug.x), 2) + Math.pow((curr_food.y - curr_bug.y), 2)) < d){\r\n\t\t\t\tx = (curr_food.x + 10) - curr_bug.x;\r\n\t\t\t\ty = (curr_food.y + 10) - curr_bug.y;\r\n\t\t\t\td = Math.sqrt(Math.pow((curr_food.x - curr_bug.x), 2) + Math.pow((curr_food.y - curr_bug.y), 2));\r\n\t\t\t\ttarget = curr_food;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tnormalize(curr_bug, x, y)\r\n\tcurr_bug.target = target;\r\n}", "title": "" }, { "docid": "0a6c05765b9d925517a8512db35e1df2", "score": "0.5433081", "text": "function r(e,t,n,i,o){\n// This function terminates when one of the following is true:\n//\n// 1. We find the exact element we are looking for.\n//\n// 2. We did not find the exact element, but we can return the index of\n// the next closest element that is less than that element.\n//\n// 3. We did not find the exact element, and there is no next-closest\n// element which is less than the one we are searching for, so we\n// return -1.\nvar a=Math.floor((t-e)/2)+e,s=o(n,i[a],!0);\n// aHaystack[mid] is greater than our needle.\n// aHaystack[mid] is less than our needle.\nreturn 0===s?a:s>0?t-a>1?r(a,t,n,i,o):a:a-e>1?r(e,a,n,i,o):0>e?-1:e}", "title": "" }, { "docid": "e22b55346aa767c610d33088e6284a15", "score": "0.54309016", "text": "_getMinDistance(msStart, msTarget, msSearch, isGoUp) {\n let result = null;\n let resultDistance = null;\n\n let accumulator = 1;\n let nextApply = 2; // We apply 2, 5 and 10 as multiplier and divider to search for the best suitable tick step size\n\n let prevDistance = null;\n for (let i = 0; i < 10000; i++) { // Watch dog to not suddenly go into an eternal loop\n const current = isGoUp\n ? msStart * accumulator\n : msStart / accumulator;\n const offset = current - msTarget;\n const distance = Math.abs(offset);\n\n // Check maybe we found a good distance\n const isDistanceAllowed = (distance <= msSearch) || (offset > 0);\n if (isDistanceAllowed) {\n if ((resultDistance === null) || (resultDistance > distance)) {\n result = current;\n resultDistance = distance;\n }\n }\n\n // Check maybe it's time to finish search, because we have started to go away from the target\n if ((prevDistance !== null) && (prevDistance < distance)) {\n break;\n }\n prevDistance = distance;\n\n // Increase the accumulator\n switch (nextApply) {\n case 2:\n accumulator *= 2;\n nextApply = 5;\n break;\n case 5:\n accumulator /= 2;\n accumulator *= 5;\n nextApply = 10;\n break;\n case 10:\n accumulator /= 5;\n accumulator *= 10;\n nextApply = 2;\n break;\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "67494a63731af72796f73f5f817028e1", "score": "0.5430296", "text": "function findOptimalSolution(_ref) {\n\tvar initialState = _ref.initialState;\n\tvar treeExpander = _ref.treeExpander;\n\tvar checkTarget = _ref.checkTarget;\n\tvar _ref$depthLimit = _ref.depthLimit;\n\tvar depthLimit = _ref$depthLimit === undefined ? 0 : _ref$depthLimit;\n\tvar _ref$queue = _ref.queue;\n\tvar queue = _ref$queue === undefined ? new BFS() : _ref$queue;\n\n\t// Validate input params\n\tif (!(treeExpander instanceof TreeExpander)) throw new Error(\"treeGen parameter should be instanceof TreeExpander subclass\");\n\tif (!queue.next || !queue.push) throw new Error(\"queue should have push and next functions defined\");\n\n\t//Initialize either from the state or from queue\n\tvar root;\n\tif (queue.length == 0) {\n\t\troot = new DecisionTreeNode({ state: initialState });\n\t\tqueue.push(root);\n\t} else {\n\t\t// If queue is not empty we expectits initialized with root node\n\t\troot = queue[0];\n\t}\n\n\t// Go through all nodes in the order defined by queue.next,\n\t// expanding every node further to the queue using treeGen.expandNode\n\twhile (queue.length > 0) {\n\t\tvar node = queue.next();\n\t\t//\t\ttraceJSON(\"queue\", queue);\n\t\tif (!(node instanceof DecisionTreeNode)) throw new Error(\"Incorrect node was generated by treeExpander: \" + node);\n\t\tif (checkTarget(node.state)) return new SuccessResult({ node: node, root: root });\n\t\tif (depthLimit == 0 || node.depth < depthLimit) {\n\t\t\t(0, _log.traceJSON)(\"Expanding node \", node);\n\t\t\tvar expander = treeExpander.expandNode(node);\n\t\t\tif (queue.length > 10) expander = expander.filter(function (node) {\n\t\t\t\treturn !node.duplicate(queue);\n\t\t\t});\n\t\t\tqueue.push.apply(queue, _toConsumableArray(expander));\n\t\t\t//\t\t\ttraceJSON(\"Expanded node with \", expander)\n\t\t}\n\t}\n\treturn new FailureResult(SEARCH_CUTOFF, { root: root });\n}", "title": "" }, { "docid": "5ca3f5c96519873d2cf7c0cddb610219", "score": "0.5424494", "text": "function breadthFirstSearch8Directions() {\r\n\r\n for (let i = 0; i < intervalTracker.length; i++) {\r\n clearInterval(intervalTracker[i]);\r\n }\r\n\r\n //init 2d array\r\n let matrix = [];\r\n let n = 0;\r\n for (let i = 0; i < rc.getDimensions().rows; i++) {\r\n matrix[i] = [];\r\n for (let j = 0; j < rc.getDimensions().cols; j++) {\r\n matrix[i][j] = n;\r\n n++;\r\n }\r\n }\r\n\r\n //get shortest path\r\n let adjacencyList = convertToAdjacencyList8Directions(matrix);\r\n let shortestPath = breadthFirstSearchHelper(adjacencyList, startPoint, endPoint);\r\n\r\n //clear any current paths\r\n let limits = rc.getDimensions().rows * rc.getDimensions().cols;\r\n for (let i = 0; i < limits; i++) {\r\n if (i != startPoint && i != endPoint && document.getElementById(i.toString()).getAttribute(\"isObstacle\") === \"false\") {\r\n document.getElementById(i.toString()).style.background = \"grey\";\r\n }\r\n if (document.getElementById(i.toString()).style.background === \"red\" && document.getElementById(i.toString()).getAttribute(\"isObstacle\") === \"true\") {\r\n document.getElementById(i.toString()).style.background = \"grey\";\r\n document.getElementById(i.toString()).setAttribute(\"isObstacle\", \"false\");\r\n }\r\n }\r\n\r\n //amount of steps\r\n if (shortestPath !== undefined) {\r\n\r\n //don't count end and start\r\n shortestPath.shift();\r\n shortestPath.pop();\r\n\r\n //highlight path\r\n let run = setInterval(traverse, 50);\r\n intervalTracker.push(run);\r\n let i = 0;\r\n function traverse() {\r\n if (i === shortestPath.length) {\r\n clearInterval(run);\r\n }\r\n else {\r\n document.getElementById(shortestPath[i].toString()).style.background = \"red\";\r\n i++;\r\n }\r\n }\r\n\r\n let instructionsDiv = document.getElementById(\"instructions\");\r\n let instructions = document.createTextNode(\"Shortest path via octal-directional breadth first search is \" + (shortestPath.length + 1) + \" steps.\");\r\n instructionsDiv.innerHTML = \"\";\r\n instructionsDiv.style.color = \"green\";\r\n instructionsDiv.appendChild(instructions);\r\n } else {\r\n let instructionsDiv = document.getElementById(\"instructions\");\r\n let instructions = document.createTextNode(\"Unable to find path via octal-directional breadth first search!\");\r\n instructionsDiv.innerHTML = \"\";\r\n instructionsDiv.style.color = \"red\";\r\n instructionsDiv.appendChild(instructions);\r\n }\r\n}", "title": "" }, { "docid": "2ce76ca2e2464cac502e298a0b57c654", "score": "0.54201657", "text": "function jumpingOnClouds(c) {\n let minPath = 0;\n\n let i = 0;\n while (i < c.length - 1) {\n if (c[i] == 1) continue;\n\n if (c[i + 2] == 0) {\n minPath++;\n i += 2;\n continue;\n }\n\n if (c[i + 1] == 0) {\n i += 1;\n minPath++;\n }\n }\n\n return minPath;\n}", "title": "" }, { "docid": "8fc919ed28eb64f07ea53e4ab965e3f0", "score": "0.54196817", "text": "closestApproachFI2(l1l) {\n let ca = this.findClosestApproachII(l1l);\n if (ca) {\n if (ca.alpha < 0)\n return l1l.distanceI2(this.P0);\n if (ca.beta > 1)\n return l1l.distanceI2(this.P1);\n return ca.dist2;\n }\n let l0 = this.vector;\n let d0 = l1l.P0.minus(this.P0);\n let q = d0.minus(l0.times(l0.dot(d0) / l0.magnitude2));\n return q.magnitude2;\n }", "title": "" }, { "docid": "c2e58b153d6ddfb810c9ad703d493f3e", "score": "0.5416057", "text": "function minimumBribes(q) {\r\n let tmp = 0\r\n let tmp2 = 0\r\n let swpNum = 0\r\n let testIndex = 0\r\n\r\n for (let i = q.length; i > 0; i--) {\r\n let searchFrom = i - 3 < 0 ? 0 : i - 3;\r\n testIndex = q.indexOf(i, searchFrom)\r\n if (testIndex == -1) {\r\n console.log('Too chaotic')\r\n return;\r\n }\r\n\r\n if (q[testIndex] - (testIndex + 1) == 2) {\r\n tmp = q[testIndex + 2]\r\n tmp2 = q[testIndex + 1]\r\n q[testIndex + 2] = q[testIndex]\r\n q[testIndex + 1] = tmp\r\n q[testIndex] = tmp2\r\n swpNum += 2\r\n } else if (q[testIndex] - (testIndex + 1) == 1) {\r\n tmp = q[testIndex + 1]\r\n q[testIndex + 1] = tmp\r\n q[testIndex] = tmp\r\n swpNum += 1\r\n }\r\n }\r\n\r\n console.log(swpNum)\r\n}", "title": "" }, { "docid": "06818217d5d06012a572faaf26e693b4", "score": "0.53969353", "text": "function findBishopPath( currentPos , team, from ) {\n\n if (from !== \"queen\"){\n removeAllCross();\n removeAllPath();\n }\n\n var pathArray = [];\n var crossArray = [];\n\n var check = [];\n\n var content = $ (\"div > div > div > div > div > div > div\").attr(\"id\");\n\n if ((content !== null ) && (content !== undefined)){\n if ((currentPos !== null) && (currentPos !== undefined)){\n\n var x = currentPos.substr(0,1);\n var y = currentPos.substr(1, 1);\n\n var xIndex = getXIndex(x);\n var yIndex = getYIndex(y);\n\n //look path or cross for right upper side\n var count = 1;\n\n for (var i = xIndex + 1; i < col.length; i++){\n if ($(\"#\" + col[i] + row[yIndex + count]).children().length === 0){\n pathArray.push($(\"#\" + col[i] + row[yIndex + count]).attr(\"id\"));\n }\n if ($(\"#\" + col[i] + row[yIndex + count]).children().length > 0){\n if (checkTeam($(\"#\" + col[i] + row[yIndex + count]).children().attr(\"id\")) !== team){\n if(from !== \"check\"){\n crossArray.push($(\"#\" + col[i] + row[yIndex + count]).attr(\"id\"));\n break;\n }else {\n if ($(\"#\" + col[i] + row[yIndex + count]).children().attr(\"id\").includes(\"king\")){\n check.push($(\"#\" + col[i] + row[yIndex + count]).attr(\"id\"));\n break;\n }\n }\n }else {\n break;\n }\n }\n count++;\n }\n\n //look path or cross for left upper side\n count = 1;\n\n for (var i = xIndex - 1; i > -1; i--){\n\n if ($(\"#\" + col[i] + row[yIndex + count]).children().length === 0){\n pathArray.push($(\"#\" + col[i] + row[yIndex + count]).attr(\"id\"));\n }\n\n if ($(\"#\" + col[i] + row[yIndex + count]).children().length > 0){\n if (checkTeam($(\"#\" + col[i] + row[yIndex + count]).children().attr(\"id\")) !== team){\n if(from !== \"check\"){\n crossArray.push($(\"#\" + col[i] + row[yIndex + count]).attr(\"id\"));\n break;\n }else {\n if ($(\"#\" + col[i] + row[yIndex + count]).children().attr(\"id\").includes(\"king\")){\n check.push($(\"#\" + col[i] + row[yIndex + count]).attr(\"id\"));\n break;\n }\n }\n }else {\n break;\n }\n }\n count++;\n }\n\n //look path or cross for right down side\n count =1 ;\n\n for (var i = xIndex + 1; i < row.length; i++){\n\n if ($(\"#\" + col[i] + row[yIndex -count]).children().length > 0){\n\n if (checkTeam($(\"#\" + col[i] + row[yIndex -count]).children().attr(\"id\")) !== team){\n\n crossArray.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n\n if(from !== \"check\"){\n crossArray.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n break;\n\n }else {\n if ($(\"#\" + col[i] + row[yIndex -count]).children().attr(\"id\").includes(\"king\")){\n check.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n break;\n }\n }\n }else {\n break;\n }\n }else {\n pathArray.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n }count++;\n }\n\n //look path or cross for left down side\n count =1;\n\n for (var i = yIndex - 1; i > -1; i--){\n\n if ($(\"#\" + col[i] + row[yIndex -count]).children().length > 0){\n\n if (checkTeam($(\"#\" + col[i] + row[yIndex -count]).children().attr(\"id\")) !== team){\n\n crossArray.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n\n if(from !== \"check\"){\n crossArray.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n break;\n\n }else {\n if ($(\"#\" + col[i] + row[yIndex -count]).children().attr(\"id\").includes(\"king\")){\n\n check.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n break;\n }\n }\n }else {\n break;\n }\n }else {\n pathArray.push($(\"#\" + col[i] + row[yIndex -count]).attr(\"id\"));\n }\n count++;\n }\n }\n }\n if (from !== \"check\"){\n colorCrossPath(crossArray);\n colorPath(pathArray);\n }else {\n return check;\n }\n}", "title": "" }, { "docid": "1b66bd5af0b5a6cb2410032db306ff7e", "score": "0.5389533", "text": "function findTriplet() {\n for (var i = 1; i < limiter; i++) {\n for (var j = 1; j < limiter; j++) {\n for (var k = 1; k < limiter; k++) {\n if (i*i + j*j === k*k && i+j+k === 1000) {\n return ( i*j*k);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5b7530b840ec9e1f57d40467fbf37ffb", "score": "0.5389275", "text": "function getNearestEnemyLeek() {\n\tvar enemies = getEnemies();\n\tvar nearest = getNearestEnemy();\n\tvar myCell = getCell();\n\tfor (var enemy in enemies) {\n\t\tif (!isSummon(enemy) and!isDead(enemy)) {\n\t\t\tif (isSummon(nearest)) {\n\t\t\t\tnearest = enemy;\n\t\t\t} else {\n\t\t\t\tvar nearestCell = getCell(nearest);\n\t\t\t\tvar enemyCell = getCell(enemy);\n\t\t\t\tif (getPathLength(nearestCell, myCell) > getPathLength(enemyCell, myCell)) {\n\t\t\t\t\tnearest = enemy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nearest;\n\n}", "title": "" }, { "docid": "9f31839838f4ea051d986cda4547369e", "score": "0.5388093", "text": "function breadthFirstSearch() {\n //reads the sheet and get the symbols\n var symbols_map = readSheet();\n \n //generate an DescriptionNode map based on the symbols\n var description_map = generateDescription(symbols_map);\n \n var height = symbols_map.length;\n var width = symbols_map[0].length;\n \n var start_cell = getStartCell(symbols_map);\n var end_cell = getEndCell(symbols_map);\n \n //checks if exists a start cell and an end cell\n if(start_cell === null || end_cell === null){\n var err_msg = \"Mapa inválido. Deve haver pelo menos uma casa inicial e final.\";\n console.log(err_msg);\n displayAlert(err_msg);\n return;\n }\n \n //infos\n var size = `${height}x${width}`;\n var method = \"Busca em Largura\";\n \n //starts the clock\n var begin_clock = new Date();\n begin_clock = begin_clock.getTime();\n \n //queue that stores nodes\n var queue = [];\n \n //queue that stores all nodes, to backtrack and find path\n var all_nodes = [];\n var index = 0;\n var parent_index = 0;\n \n //creates a node for the start cell\n var start_node = new SearchNode(index,parent_index,start_cell,[-1,-1],0,0);\n queue.push(start_node);\n all_nodes.push(start_node);\n \n //grabs the last node on the queue\n var last_node = queue[queue.length-1];\n \n //defines the order of preference of the operators\n var order = [\"down\", \"right\", \"up\", \"left\"];\n \n //loop while queue is not empty\n while(last_node !== undefined){\n \n //visit all available neighbors\n var [end_node,new_index] = evaluateNeighborsBFS(last_node,order,description_map,height,width,end_cell,all_nodes,queue,index);\n \n //update the index\n index = new_index;\n \n //if end cell is reached\n if(end_node !== null){\n break;\n }\n \n //search next node\n last_node = queue.shift();\n }\n \n //if queue is empty, then there was no path between start cell and end cell\n if(queue.length === 0){\n var err_msg = \"Todos as casas foram verificadas e não foi encontrado um caminho entre a origem e o destino.\";\n //prints header on sheet\n updateHeader(method,\"\",size,err_msg,\"\");\n console.log(err_msg);\n displayAlert(err_msg);\n return;\n }\n \n //backtrack to get the best path\n var path_node = all_nodes[all_nodes.length-1];\n var path = [];\n \n while(path_node.index !== 0){\n path.push(path_node.address);\n path_node = all_nodes[path_node.parent_index];\n }\n \n path.reverse();\n \n //stringify the path\n var results = path.map(function(point){\n var str = `(${point[0]},${point[1]})`;\n return str;\n });\n \n //inserts the start cell\n results.unshift(`(${start_cell[0]},${start_cell[1]})`);\n var length = results.length;\n results = \"[\" + results.join(\",\") + \"]\"; \n \n path.reverse();\n \n //remove end cell\n path.shift();\n \n //stops clock\n var end_clock = new Date();\n end_clock = end_clock.getTime();\n \n //compute information to print on the sheet header\n var total_duration = end_clock - begin_clock;\n \n //update symbols map to include path symbols\n var new_symbols_map = updateSymbolsMap(symbols_map,path);\n \n //prints map on sheet\n printMap(new_symbols_map,height,width);\n \n //prints header on sheet\n updateHeader(method,total_duration,size,results,length);\n \n console.log(results);\n}", "title": "" }, { "docid": "da61f78bb808142969720fcace668a8b", "score": "0.5385003", "text": "getIntermediateScore({ currentPlayer, currentPlayerIsMaxPlayer, c, r }) {\n let gridScore = 0;\n // Search for current player's connections of one or more chips that are\n // connected to the empty slot\n let connections = this.getConnections({\n // Treat the empty slot as a chip to appease the algorithm\n baseChip: { column: c, row: r, player: currentPlayer },\n connectionSize: 2\n });\n // Sum up connections, giving exponentially more weight to larger connections\n for (let i = 0; i < connections.length; i += 1) {\n gridScore += Math.pow(connections[i].length, 2);\n }\n // Negate the grid score for any advantage the minimizing player has (as this\n // is considered a disadvantage to the maximizing player)\n if (!currentPlayerIsMaxPlayer) {\n gridScore *= -1;\n }\n return gridScore;\n }", "title": "" }, { "docid": "1482027c414749c307a5a301b315a1f0", "score": "0.5384166", "text": "function solution(K, M, A) {\n var bot = -1;\n var top = (M*A.length);\n top = Math.floor(top);\n \n while(bot + 1 < top){\n const mid = Math.floor((bot+top)/2);\n if(IsPossible(mid, K, A)){\n top = mid;\n }\n else{\n bot = mid;\n }\n }\n\n return top;\n}", "title": "" }, { "docid": "881317f92b59d60acf70090be5461b37", "score": "0.53796476", "text": "function minEatingSpeed(piles, h) {\n let left = 1; // minimum 1 banana should be eaten per hour, otherwise no progress\n let right = Math.max(...piles); // at max, max(piles) bananas are required to be eaten per hour\n let mid = Math.floor((left + right) / 2); // mid will be the speed of eating\n let k = Infinity;\n\n // Binary Search\n while (left <= right) {\n let sum = 0; // sum is the total time required to finish all bananas at speed of mid\n\n for (let i = 0; i < piles.length; i++) {\n sum = sum + Math.ceil(piles[i] / mid);\n }\n\n if (sum <= h) {\n k = Math.min(k, mid);\n right = mid - 1;\n mid = Math.floor((left + right) / 2);\n } else {\n left = mid + 1;\n mid = Math.floor((left + right) / 2);\n }\n }\n\n return k;\n}", "title": "" }, { "docid": "44e23993af4db412c3ab40be8a0f36d4", "score": "0.5378813", "text": "function search(){\n var searchtype;\n \n opt=[]\n var opt1=0;\n if(document.getElementById('allowdiagonals').checked)\n {\n if(document.getElementById('nocorner').checked)\n opt1=1;\n else\n opt1=2;\n }\n\n var opt2=0;\n opt.push(opt1);\n if(document.getElementById('euclidean').checked)\n opt2=0;\n else if(document.getElementById('manhattan').checked)\n opt2=1;\n opt.push(opt2);\n\n if(document.getElementById('bfs').checked)\n searchtype=\"bfs\";\n else if(document.getElementById('dijkstra').checked)\n searchtype=\"dijkstra\";\n else if(document.getElementById('bestfirstsearch').checked)\n searchtype=\"bestfirstsearch\";\n else if(document.getElementById('Asearch').checked)\n searchtype=\"Asearch\";\n else if(document.getElementById('IDAsearch').checked)\n searchtype=\"IDAsearch\";\n\n clearpath();\n\n j=Math.floor(fixedcells[0].attr(\"x\")/31);\n i=Math.floor(fixedcells[0].attr(\"y\")/31);\n \n startgridno=i*64+j;\n\n\n j=Math.floor(fixedcells[1].attr(\"x\")/31);\n i=Math.floor(fixedcells[1].attr(\"y\")/31);\n \n endgridno=i*64+j;\n var key;\n endnodes=[]\n endnodes.push(endgridno)\n\n for(key in endlist){\n if(endlist[key]==true)\n {\n k=key.split(',');\n i=parseInt(k[0]);\n j=parseInt(k[1]);\n console.log(i,j);\n b=i*64+j;\n console.log(b);\n endnodes.push(b);\n }\n }\n\n blockednodes=[]\n \n for(key in blocklist){\n if(blocklist[key]==true)\n {\n k=key.split(',');\n i=parseInt(k[0]);\n j=parseInt(k[1]);\n b=i*64+j;\n blockednodes.push(b);\n }\n }\n if((searchtype==\"bestfirstsearch\")||(searchtype==\"Asearch\")||(searchtype==\"IDAsearch\"))\n { endnodes=endnodes[0];}\n \n \n const csrf_token=getCookie('csrftoken');\n searchparam={\n 'start': startgridno,\n 'end':endnodes,\n 'blocked':blockednodes,\n 'options':opt,\n 'searchtype':searchtype,\n \n };\n console.log(searchparam);\n $.get('searchpath',searchparam,function(data,status){\n console.log(data,searchtype);\n drawpath(data,searchtype);\n });\n\n }", "title": "" }, { "docid": "5ecbe645f34fb5712ec5573ef8aa872f", "score": "0.53732294", "text": "function hanoiSolve(hoops, from, to) {\n\tif (hoops === 0) return;\n\n\t//console.log(\"called\");\n\n\thanoiSolve(hoops-1, from, 6-from-to);\n\n\tmoves.push(from + \"->\" + to);\n\n\thanoiSolve(hoops-1, 6-from-to, to);\n}", "title": "" }, { "docid": "680023044cdeafac127f3ce5018e3faa", "score": "0.5369866", "text": "function calcule() {\r\n\tsoluce = new Solution(0,\"\",0);\r\n\tecart = 1000;\r\n\tsolutions2 = new Array;\r\n\tsolutions3 = new Array;\r\n\tsolutions4 = new Array;\r\n\tsolutions5 = new Array;\r\n\tsolutions6 = new Array;\r\n\tvar s = calcul2__1et1();\r\n\tif (s == null) { s = calcul3__2et1(); }\r\n\tif (s == null) { s = calcul4__3et1(); }\r\n\tif (s == null) { s = calcul4__2et2(); }\r\n\tif (s == null) { s = calcul5__4et1(); }\r\n\tif (s == null) { s = calcul5__3et2(); }\r\n\tif (s == null) { s = calcul6__5et1(); }\r\n\tif (s == null) { s = calcul6__4et2(); }\r\n\tif (s == null) { s = calcul6__3et3(); }\r\n\tif (s == null) { s = soluce; }\r\n\tboutonReponse.estActif = true;\r\n\treturn s;\r\n}", "title": "" }, { "docid": "89fe8ec91b008f1c0e575154488eb818", "score": "0.536851", "text": "getSolutionPath() {\n let solutions = [];\n let current = 29377357956;\n while (current !== this.initialState) {\n solutions.push(this.decodeMove[current]);\n current = this.pathTo[current];\n }\n solutions.push(this.decodeMove[current]);\n return solutions;\n }", "title": "" }, { "docid": "b6178ab3ebde636380cb38842fcfed70", "score": "0.53553987", "text": "function find1(soThungThu,thuGom, MAX_WEIGHT){\n\tvar cs = 1;\n\tvar kq = 0;\n\t\n\twhile (cs <= soThungThu.len){\n\t\tvar temp = 0.0;\n\t\twhile (temp < MAX_WEIGHT && cs <= soThungThu.len){\n\t\t\ttemp += thuGom[cs].w;\n\t\t\tcs++;\n\t\t}\n\t\tvar v = Math.ceil(thuGom[cs - 1].w / MAX_WEIGHT);\n\t\tkq += 2 * v * thuGom[cs - 1].id;\n\t\tvar temp_div = v - 1;\n\t\tif (temp - temp_div * MAX_WEIGHT > MAX_WEIGHT)\n\t\t\tkq += 2 * thuGom[cs-2].id;\n\t}\n\treturn kq;\n}", "title": "" }, { "docid": "9347905892eb7e7c549891bd4f252194", "score": "0.53517646", "text": "function bestMove() {\r\n // AI to make its turn\r\n let fbestScore = -Infinity;\r\n let fbsfinder;\r\n let board;\r\n var bsfinder;\r\n var bestScore = -Infinity;\r\n\r\n //check won\r\n for (let j = 0; j < noOfPlane; j++) {\r\n board = getBoard(j);\r\n for (let i = 0; i < 9; i++) {\r\n // Is the spot available\r\n if (board[i] == \"\") {\r\n board[i] = \"O\";\r\n if (gameWon() == true) {\r\n fbsfinder = refBoard[j][i];\r\n bS[fbsfinder] = \"O\";\r\n refreshBoard();\r\n won = gameWon();\r\n playJumpSound();\r\n render();\r\n displayPlane(toDisplayRef[j]); \r\n return;\r\n } else {\r\n board[i] = \"\";\r\n }\r\n }\r\n }\r\n }\r\n //check loss\r\n for (let j = 0; j < noOfPlane; j++) {\r\n board = getBoard(j);\r\n for (let m = 0; m < 9; m++) {\r\n // Is the spot available\r\n if (board[m] == \"\") {\r\n board[m] = \"X\";\r\n if (gameWon() == true) {\r\n fbsfinder = refBoard[j][m];\r\n bS[fbsfinder] = \"O\";\r\n refreshBoard();\r\n playJumpSound();\r\n currentPlayer = \"X\";\r\n render();\r\n displayPlane(toDisplayRef[j]); \r\n return;\r\n } else {\r\n board[m] = \"\";\r\n }\r\n }\r\n }\r\n }\r\n\r\n var idxDisplay;\r\n\r\n for (let j = 0; j < noOfPlane; j++) {\r\n board = getBoard(j);\r\n for (let n = 0; n < 9; n++) {\r\n // Is the spot available\r\n if (board[n] == \"\") {\r\n board[n] = \"O\";\r\n let score = minimax(board, 1, false);\r\n board[n] = \"\";\r\n if (score > bestScore) {\r\n bestScore = score;\r\n bsfinder = refBoard[j][n];\r\n }\r\n }\r\n }\r\n if (bestScore > fbestScore) {\r\n fbestScore = bestScore;\r\n fbsfinder = bsfinder;\r\n idxDisplay = j;\r\n }\r\n }\r\n\r\n //final move\r\n bS[fbsfinder] = \"O\";\r\n refreshBoard();\r\n if (gameWon()) {\r\n won = true;\r\n render();\r\n displayPlane(toDisplayRef[idxDisplay]);\r\n return;\r\n }\r\n playJumpSound();\r\n currentPlayer = \"X\";\r\n render();\r\n displayPlane(toDisplayRef[idxDisplay]);\r\n return;\r\n}", "title": "" }, { "docid": "ea537d0c96e264e58ad247b073f08776", "score": "0.53495467", "text": "function sol(board) {\n if (!board || !board.length) return 0;\n let n = board.length;\n const visited = Array(n * n + 1).fill(false);\n\n const q = [];\n // push first position to the queue\n q.push(1);\n\n let moves = 0;\n // set moves to the max (as if traveresed board one cell at a time, w/o snakes or ladders)\n // if min is still n * n after traversing, then there is no way to reach the end\n let min = n * n;\n while (q.length) {\n let size = q.length;\n for (let i = 0; i < size; i++) {\n let cur = q.shift();\n if (cur === n * n) {\n min = Math.min(min, moves);\n }\n\n for (let j = 1; j <= 6; j++) {\n let num = cur + j;\n if (num > n * n) break;\n if (!visited[num]) {\n visited[num] = true;\n\n const row = n - (num - 1) / n - 1;\n const col =\n (n - row) % 2 === 0 ? n - ((num - 1) % n) - 1 : (num - 1) % n;\n\n console.log(row, col);\n\n if (board[row][col] === -1) {\n q.push(num);\n } else {\n q.push(board[row][col]);\n }\n }\n }\n\n moves++;\n }\n }\n\n return min === n * n ? -1 : min;\n}", "title": "" }, { "docid": "19fea187cc777dd7bf89e5c190bbbdc7", "score": "0.5348588", "text": "function stepsToSolveHanoiT(n, srcP, desP, bufferP) {\r\n if (n >= 1) {\r\n\r\n // Move a tower of n-1 to the buffer peg, using the destination peg.\r\n stepsToSolveHanoiT(n - 1, srcP, bufferP, desP);\r\n\r\n // Move the remaining disk to the destination peg.\r\n console.log(`Move disk ${n} from Tower ${srcP} to Tower ${desP}`);\r\n\r\n // Move the tower of `n-1` from the `buffer peg` to the `destination peg` using the `source peg`. \r\n stepsToSolveHanoiT(n - 1, bufferP, desP, srcP);\r\n }\r\n \r\n return;\r\n}", "title": "" }, { "docid": "75a456fd6c943294584ef4e420620a1a", "score": "0.53452456", "text": "function findSolution(findMove) {\n for (let i = 0; findMove <= 31 && i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n if (copyMatrix[i][j] != 0) {\n let possibles = searchMovement(i, j, copyMatrix);\n if (possibles.length > 0) {\n for (let k = 0; k < possibles.length; k++) {\n let coordinates = getCoordinatesById(possibles[k]);\n if (copyMatrix[i][j] != 2) {\n let i2 = coordinates[0];\n let j2 = coordinates[1];\n if (checkMiddleFullEmpty(i, j, i2, j2, copyMatrix)) {\n changeEmptyByFull(i, j, i2, j2, copyMatrix);\n deleteMiddleFullEmpty(i, j, i2, j2, copyMatrix);\n if (!(findMove >= 31)) {\n let idOrigen = getIdByCoordinates(i, j);\n let idTarget = getIdByCoordinates(i2, j2);\n solutions.push({ \"origin\": idOrigen, \"target\": idTarget });\n if (findSolution(findMove + 1)) {\n return true;\n } else {\n console.log(\"Backtraking back\");\n }\n } else {\n return true;\n }\n }\n }\n }\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "f298e55164845c82467b0529efb9560b", "score": "0.5343807", "text": "function epsilonGreedyHillClimbing(assignment) {\n var reps = 0;\n var rnd;\n var maxUtil = utility(assignment);\n var bestAssignment = assignment;\n\n while (reps < MAX_REPS) {\n var neighbor = findNeighbor(assignment);\n if (neighbor === undefined) {\n return assignment;\n }\n\n // Promote random exploration with prb of epsilon\n rnd = Math.random();\n if (rnd <= OPTIMIZATION_EPSILON) {\n assignment = JSON.parse(JSON.stringify(neighbor));\n } else {\n if (utility(neighbor.halfHours) > utility(assignment.halfHours)) {\n assignment = JSON.parse(JSON.stringify(neighbor));\n }\n }\n\n // If we improved, set reps to 0; otherwise, add 1\n var assignmentUtility = utility(assignment.halfHours);\n if (assignmentUtility > maxUtil) {\n maxUtil = assignmentUtility;\n bestAssignment = assignment;\n reps = 0;\n } else {\n reps += 1;\n }\n }\n // Return the best-quality assignment we could find\n return bestAssignment;\n}", "title": "" }, { "docid": "3600c7e1354c02561c6d9fe6b9bd2524", "score": "0.5343044", "text": "function next_level(skill_name){\n var very_large = 9000000000; //numbers seem to get messed up over 9.999 bil (maybe fixed?)\n var best_next = very_large;\n for(var i = 0; i < visible_list.length; i++){\n var cur_button = visible_list[i];\n if(cur_button.requirements && cur_button.requirements[skill_name]){\n var others_met = true;\n for(var key in cur_button.requirements){\n if(key != skill_name && cur_button.requirements[key] > player[key]){\n others_met = false;\n }\n }\n if(others_met && cur_button.requirements[skill_name] > player[skill_name]){\n best_next = Math.min(best_next, cur_button.requirements[skill_name]);\n }\n }\n if(skill_name == 'math_level' && cur_button.grade_disable){ //grade up math level requirements are handled differently\n for(var key in cur_button.grade_disable){\n if(cur_button.grade_disable[key] > player[skill_name]){ //skill name== math_level\n best_next = Math.min(best_next, cur_button.grade_disable[key]);\n }\n }\n }\n\t\tif(skill_name == 'math_level' && start_math_super_project_button.requirements['math_level'] > player[skill_name]){\n\t\t\tbest_next = Math.min(best_next, start_math_super_project_button.requirements['math_level']);\n\t\t}\n }\n if(best_next >= very_large){\n return false;\n }\n return best_next;\n}", "title": "" }, { "docid": "9f207d75b2ce63196e35b4c53df81754", "score": "0.5341642", "text": "function findNearestSwitch(x, y, x0, y0, x1, y1) {\n var bx0 = Math.floor(x0 / tw);\n var by0 = Math.floor(y0 / th);\n var bx1 = Math.ceil(x1 / tw);\n var by1 = Math.ceil(y1 / th);\n\n var bestdist = Infinity;\n var best = null;\n for(var by = by0; by < by1; by++) {\n for(var bx = bx0; bx < bx1; bx++) {\n if(bx < 0 || by < 0 || bx >= w || by >= h) continue;\n var cell = world[by][bx];\n var c = cell.circuitsymbol;\n if(c == 's' || c == 'S' || c == 'p' || c == 'P' || c == 'r' || c == 'R') {\n var cx = bx * tw + (tw >> 1);\n var cy = by * th + (th >> 1);\n var dx = cx - x;\n var dy = cy - y;\n var d = dx * dx + dy * dy;\n if(d < bestdist) {\n bestdist = d;\n best = cell;\n }\n }\n }\n }\n return best;\n}", "title": "" }, { "docid": "289dc7fea7f8d6c9c7ec179bed74306a", "score": "0.53383505", "text": "findNextAvailableNode(){\n var workingNode = null;\n var closedNodes = 0;\n this.nodes.map( ( node, i, arr )=>{\n if(this.cancel){return;} // For safety\n if(!node.open){\n closedNodes++;\n if(arr.length-1 == closedNodes){ this.reject(this.error.handle( \"closedArea\", \"Could not find path: Closed area.\", this )); this.cancel = true;}\n return;\n }\n if(!workingNode){\n workingNode = node;\n return;\n }\n if( node.totalCost < workingNode.totalCost ){\n workingNode = node;\n }\n this.analytics.nextIteration_nodeSearches++;\n });\n return workingNode;\n }", "title": "" }, { "docid": "38e77ca63d68d26f3878f138c5c9ee20", "score": "0.5336889", "text": "function calculate() {\n\t\t\t\t/*\n\t\t\t\tfunction: \tcalculate\n\t\t\t\tvariables:\tnone\n\t\t\t\treturns:\tbrake assist status\n\t\t\t\ttask:\t\tif variables are changed, the breaking timeline is \n\t\t\t\t\t\t\tcalculated and all possible cases are considered.\n\t\t\t\t\t\t\tThose are:\n\t\t\t\t\t\t\t1. No braking is needed\n\t\t\t\t\t\t\t2. braking according to the pattern\n\t\t\t\t\t\t\t3. braking but not as long as the specified pattern (vehicle is too slow for the second brake)\n\t\t\t\t\t\t\t4. safety puffer cannot be maintained\n\t\t\t\t\t\t\t5. a braking attempt resulting in a crash\n\t\t\t\t*/\n\t\t\t\t\n var v_own = parseFloat(document.getElementById('v_own').value);\n var v_ahead = parseFloat(document.getElementById('v_ahead').value);\n\t\t\t\tvar a_ahead = parseFloat(document.getElementById('a_ahead').value);\n var s_range_m = parseFloat(document.getElementById('range').value);\n\t\t\t\tvar selector = parseFloat(document.getElementById('selector').value);\n\t\t\t\tvar s_braking = 0;\n\t\t\t\tvar s_brakingaux = 0;\n\t\t\t\tvar t_braking_s = 0;\n\t\t\t\tvar t_brakingaux = 0;\n\t\t\t\tvar t_haptic_s = 0;\n\t\t\t\tvar t_nothing_s = 0;\n\t\t\t\tvar t_crash_s = [0, 0];\n\t\t\t\tvar tmp_resultArray = [0, 0];\n\t\t\t\t\n\t\t\t\t//check whether input figures are valid\n\t\t\t\t\n\t\t\t\tif(v_own < 0 || v_ahead < 0 || s_range_m < 0 || isNaN(v_own) || isNaN(v_ahead) || isNaN(a_ahead) || isNaN(s_range_m)){\n\t\t\t\t\tdocument.getElementById('answer').innerHTML = 'Please insert valid numbers only';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t//dynamic unit selection\n\t\t\t\t\tselection(selector);\n\t\t\t\t\t\n\t\t\t\t\t//adapting to the m/s or km/h selector\n\t\t\t\t\tv_own = v_own / selector;\n\t\t\t\t\tv_ahead = v_ahead / selector;\n\t\t\t\t\t\n\t\t\t\t\t//check if there would be a crash\n\t\t\t\t\tt_crash_s = calcBrakeNecc(v_own, v_ahead, a_ahead, s_range_m);\n\t\t\t\t\t\n\t\t\t\t\tif(t_crash_s[0] == -1){\n\t\t\t\t\t\thideGraphics();\n\t\t\t\t\t\tdocument.getElementById('answer').innerHTML = 'Break assistance not required';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse{\n\t\t\t\t\t\t//check if vehicle ahead is braking and handle the case\n\t\t\t\t\t\tif(a_ahead<0){\n\t\t\t\t\t\t\tt_brakingaux = \tv_ahead/-a_ahead;\n\t\t\t\t\t\t\ts_brakingaux = s_range_m + v_ahead*t_brakingaux + 0.5*a_ahead*t_brakingaux*t_brakingaux;\n\t\t\t\t\t\t\tif(t_brakingaux<t_crash_s[0]){\n\t\t\t\t\t\t\t\t//recalculate t_crash_s with a car ahead that has stopped\n\t\t\t\t\t\t\t\tt_crash_s = calcBrakeNecc(v_own, 0, 0, s_brakingaux);\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\t//calculating the braking time\n\t\t\t\t\t\ttmp_resultArray = calculate_t_braking(v_own);\n\t\t\t\t\t\tt_braking_s = tmp_resultArray[0];\n\t\t\t\t\t\tt_haptic_s = tmp_resultArray[1];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//calculate the remaining waiting time\n\t\t\t\t\t\ts_braking=calc_s_braking(t_braking_s, t_haptic_s, v_own);\n\t\t\t\t\t\tt_nothing_s = calc_t_nothing(t_crash_s, s_braking, v_own);\n\n\t\t\t\t\t\t//do the graphics and check for a crash\n\t\t\t\t\t\tif (doGraphicsNormal(t_nothing_s, t_haptic_s, t_braking_s, s_range_m, v_own, v_ahead, a_ahead, t_brakingaux, s_brakingaux)) {\n\t\t\t\t\t\t\tdocument.getElementById('answer').innerHTML = 'Brake Assistance active';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdocument.getElementById('answer').innerHTML = 'Brake assistance can\\'t avoid crash';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n }", "title": "" }, { "docid": "3c06a78359bad93a6e3862e431808eab", "score": "0.53334486", "text": "function Greedy__Algorithm(grid,Visited_Nodes,Unvisited_Nodes,end,Select_Heuristic)\n {\n \n if (Unvisited_Nodes.length > 0){\n var lowestvalueIndex = 0; \n for (var i = 0 ; i< Unvisited_Nodes.length;i++){\n if(Unvisited_Nodes[i].h < Unvisited_Nodes[lowestvalueIndex].h)\n lowestvalueIndex = i ; \n }\n\nvar current_Node = Unvisited_Nodes[lowestvalueIndex];\n\nif (current_Node === end){ // === is for equal testing \n console.log(\"Searching Done!\")\n\n // now we need to find the path \n path = []; \n temp = current_Node; \n path.push(temp);\n while(temp.previous){\npath.push(temp.previous);\ntemp = temp.previous; // backtracks until it reaches to start \n\n }\n noLoop();\n // return;\n}\nremoveFromArray(Unvisited_Nodes,current_Node)\nVisited_Nodes.push(current_Node);\n\nvar neighbors = current_Node.neighbors // the neighbors of the current_Node\nfor (var i = 0 ; i<neighbors.length;i++){\n var neighbor = neighbors[i]; // checking every neighbor \n\n if (!Visited_Nodes.includes(neighbor) && !neighbor.wall){ // if Visited_Nodes does not include neighbor AND our neighbor is not wall then ...\n\nvar tempG = current_Node.g + Euclidean_Distance_heuristic(neighbor, current_Node);\n\n\n neighbor.g = tempG;\n Unvisited_Nodes.push(neighbor);\n\n\nif(Select_Heuristic == 1)\n{\n neighbor.h = Euclidean_Distance_heuristic(neighbor, end);;\n}\n\nif(Select_Heuristic == 2){\n neighbor.h = Manhattan_Distance_heuristic(neighbor, end);;\n}\n\n neighbor.previous = current_Node;\n // only for debugging \n// console.log(\" current neighbor's i : \" + neighbor.i + \" current neighbor's j : \" + neighbor.j);\n// console.log(\"h is : \" + neighbor.h);\n// console.log(\"g is : \" + neighbor.g);\n// console.log(\"f is : \" + neighbor.f);\n\n}\n\n}\n// only for debugging \n// console.log(\"________________________________\");\n} else{\n// no solution \nconsole.log(\"no_Solution\");\n}\n\n }", "title": "" }, { "docid": "0518ba022519428e8e9bd032b4b31a9f", "score": "0.5332664", "text": "function koikoi()\r\n{\r\n var gYaku = guaranteedYaku();\r\n if (forceKoi && !enemyHasKoiKoi && gYaku)\r\n {\r\n koiReasons.push(new Reason(\"Since the enemy is forced to koikoi, and you have a guaranteed play, it is perfectly safe to keep playing\"));\r\n return true;\r\n }\r\n \r\n var toKoi = 0; //increases based on how close you are to getting more points\r\n var toBank = 0; //increases based on how close enemy is to winning\r\n var threshold = 0;\r\n //add likelyhood of yakus for matching pairs in play, and 1/2 the amt for non matching\r\n for (var i=0;i<hand.length;i++)\r\n {\r\n if (givesYaku(yourCards, hand[i].num))\r\n {\r\n if (guaranteed(hand[i]) > 0) { toKoi += 5; koiReasons.push(new Reason(\"Guaranteed a yaku\",5)); }\r\n else if (hasMonth(playField, hand[i].month)) { toKoi+=1; koiReasons.push(new Reason(\"likely to get a yaku (2 cards visible that will give a yaku if taken)\",1)); }\r\n else { toKoi += .4; koiReasons.push(new Reason(\"possible yaku available if a month match is drawn\",.4)); }\r\n }\r\n else\r\n {\r\n //get all possible deck cards that can match\r\n var cardsAvail = getMonthCards(hand[i].month) \r\n if (cardsAvail)\r\n {\r\n //get values for unseen cards\r\n for (var k = 0;k<cardsAvail.length;k++)\r\n cardsAvail[k].value = getValue(cardsAvail[k]);\r\n var bestCard = getHighestValue(cardsAvail);\r\n\r\n //at this point, this should always be true\r\n if (hand[i] && bestCard)\r\n { \r\n var yakus = getYakus(yourCards, enemyCards, hand[i], bestCard);\r\n for (var k=0;k<10;k++)\r\n if (yakus[k] > 0)\r\n {\r\n var dist = yakus[k];\r\n toKoi += 1/(dist*dist) / 10;\r\n \r\n var text = \"card \" + getCardType(hand[i]) + \" + \"+ getCardType(bestCard) + \" yields dist \" + dist + \" away from a \";\r\n if (k == 0)\r\n text+=\"plain yaku\";\r\n else if (k == 1)\r\n text+=\"ribbon yaku\";\r\n else if (k == 2)\r\n text+=\"animal yaku\";\r\n else if (k == 3)\r\n text+=\"RoShamBo yaku\";\r\n else if (k == 4)\r\n text+=\"red ribbon yaku\";\r\n else if (k == 5)\r\n text+=\"blue ribbon yaku\";\r\n else if (k == 6)\r\n text+=\"bright yaku\";\r\n else if (k == 7)\r\n text+=\"loop yaku\";\r\n else if (k == 8)\r\n text+=\"sacrifice yaku\";\r\n else\r\n text=\"card \" + getCardType(hand[i]) + \" on \"+ getCardType(bestCard) +\" gives a wet yaku\";\r\n if (1/(dist*dist)/10 >= .03)\r\n koiReasons.push(new Reason(text,Math.round(100/(dist*dist))/1000));\r\n }\r\n }\r\n }\r\n }\r\n}\r\n //perform the same check on field cards (with even lower likelihoods)\r\n for (var i=0;i<playField.length;i++)\r\n {\r\n if (givesYaku(yourCards, playField[i].num))\r\n {\r\n if (guaranteed(playField[i]) > 0) { toKoi += 5; koiReasons.push(new Reason(\"Guaranteed a yaku\",5)); }\r\n else if (hasMonth(hand, playField[i].month)) { toKoi+=1; koiReasons.push(new Reason(\"likely to get a yaku (2 cards visible that will give a yaku if taken)\",1)); }\r\n else { toKoi += .4; koiReasons.push(new Reason(\"possible yaku available if a month match is drawn\",.4)); }\r\n }\r\n \r\n //get all possible cards in the deck cards that can match\r\n var cardsAvail = getMonthCards(playField[i].month) \r\n if (cardsAvail)\r\n {\r\n //get values for unseen cards\r\n for (var k = 0;k<cardsAvail.length;k++)\r\n cardsAvail[k].value = getValue(cardsAvail[k]);\r\n var bestCard = getHighestValue(cardsAvail)\r\n \r\n //at this point, this should always be true\r\n if (playField[i] && bestCard)\r\n { \r\n var yakus = getYakus(yourCards, enemyCards, playField[i], bestCard);\r\n for (var k=0;k<10;k++)\r\n if (yakus[k] > 0)\r\n {\r\n var dist = yakus[k];\r\n toKoi += 1/(dist*dist) / 10;\r\n \r\n var text = \"card \" + playField[i].num + \" + \"+ bestCard.num + \" yields dist \" + dist + \" away from a \";\r\n if (k == 0)\r\n text+=\"plain yaku\";\r\n else if (k == 1)\r\n text+=\"ribbon yaku\";\r\n else if (k == 2)\r\n text+=\"animal yaku\";\r\n else if (k == 3)\r\n text+=\"RoShamBo yaku\";\r\n else if (k == 4)\r\n text+=\"red ribbon yaku\";\r\n else if (k == 5)\r\n text+=\"blue ribbon yaku\";\r\n else if (k == 6)\r\n text+=\"bright yaku\";\r\n else if (k == 7)\r\n text+=\"loop yaku\";\r\n else if (k == 8)\r\n text+=\"sacrifice yaku\";\r\n else\r\n text=\"card \" + playField[i].num + \" on \"+ bestCard.num +\" gives a wet yaku\";\r\n if (1/(dist*dist)/10 >= .03)\r\n koiReasons.push(new Reason(text,Math.round(100/(dist*dist))/1000));\r\n }\r\n }\r\n }\r\n }\r\n\r\n var checkList = []\r\n for (var gg = 0;gg<hand.length;gg++)\r\n checkList.push(hand[gg]);\r\n for (var gg = 0;gg<playField.length;gg++)\r\n checkList.push(playField[gg]);\r\n //check enemy yakus\r\n toBank += listHasYakus(enemyCards);\r\n if (toBank > 0)\r\n bankReasons.push(new Reason(\"Enemy Already Has Yakus\", toBank));\r\n\r\n for (var i=0;i<checkList.length;i++)\r\n {\r\n if (guaranteed(checkList[i].num) > 0)\r\n continue;\r\n var yakus = [], total = 0;\r\n var possibleCards = getAvailable(checkList[i].month);\r\n var storedBankReasons = [];\r\n if (possibleCards)\r\n {\r\n for (var j = 0;j<possibleCards.length;j++)\r\n {\r\n if (possibleCards[j].num != checkList[i].num)\r\n {\r\n var tmpList = [];\r\n var enemyYakus = 0;\r\n tmpList.push(possibleCards[j]);\r\n tmpList.push(checkList[i]);\r\n enemyYakus = listGivesYaku(enemyCards, tmpList);\r\n if (enemyYakus > 0)\r\n {\r\n bankReasons.push(new Reason(\"If the enemy plays \" + getCardType(checkList[i])+ \" with \" + getCardType(possibleCards[j]) + \" he can get a yaku\", enemyYakus));\r\n toBank += enemyYakus;\r\n break;\r\n }\r\n else\r\n {\r\n var count = 0;\r\n yakus = getYakus(enemyCards, yourCards, possibleCards[j], checkList[i]);\r\n var tmpBankReasons = [];\r\n for (var k=0;k<10;k++)\r\n if (yakus[k] > 0)\r\n {\r\n var dist = yakus[k];\r\n count += 3/(dist*dist) / 10;\r\n \r\n var text = \"card \" + getCardType(checkList[i]) + \" + \"+ getCardType(possibleCards[j]) + \" yields dist \" + dist + \" away from a \";\r\n if (k == 0)\r\n text+=\"plain yaku\";\r\n else if (k == 1)\r\n text+=\"ribbon yaku\";\r\n else if (k == 2)\r\n text+=\"animal yaku\";\r\n else if (k == 3)\r\n text+=\"RoShamBo yaku\";\r\n else if (k == 4)\r\n text+=\"red ribbon yaku\";\r\n else if (k == 5)\r\n text+=\"blue ribbon yaku\";\r\n else if (k == 6)\r\n text+=\"bright yaku\";\r\n else if (k == 7)\r\n text+=\"loop yaku\";\r\n else if (k == 8)\r\n text+=\"sacrifice yaku\";\r\n else\r\n text=\"card \" + getCardType(checkList[i]) + \" with \"+ getCardType(possibleCards[j]) +\"gives a wet yaku\";\r\n if (3/(dist*dist)/10 >= .03)\r\n tmpBankReasons.push(new Reason(text,Math.round(300/(dist*dist))/1000));\r\n }\r\n if (count > total)\r\n {\r\n total = count;\r\n storedBankReasons = tmpBankReasons;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (total > 0)\r\n {\r\n for (var bb = 0;bb < storedBankReasons.length;bb++)\r\n bankReasons.push(storedBankReasons[bb]);\r\n threshold += total;\r\n total = 0;\r\n }\r\n }\r\n if (getYourScoreToWin() - getScore() <= 0)\r\n {\r\n if (toBank > 0 || !gYaku)\r\n {\r\n bankReasons.push(new Reason(\"If you bank now, you win and this game is not guaranteed\",\"\"));\r\n return false;\r\n }\r\n }\r\n if (toBank >= 2)\r\n {\r\n bankReasons.push(new Reason(\"Since the enemy is close to obtaining 2 yakus, I've decided to bank\",\"\"));\r\n return false;\r\n }\r\n \r\n if (getScore() < 7)\r\n {\r\n toKoi += .5;\r\n koiReasons.push(new Reason(\"Your point score is low, and not as much to lose by koikoi\",.3));\r\n }\r\n if (getScore() >= 7)\r\n {\r\n toBank += (getScore()-7)/2;\r\n bankReasons.push(new Reason(\"You've exceeded the 2x multiplier, its best to bail before you lose big\",Math.round(100*(getScore()-7)/3)/100));\r\n }\r\n \r\n var reason1 = new Reason(\"The total sum of weighted distances to enemy yakus is \" + Math.round((threshold + toBank)*100)/100,\"\");\r\n var reason2 = new Reason(\"The total sum of weighted distances to your yakus is \" + Math.round(toKoi*100)/100,\"\");\r\n koiReasons.push(reason2);\r\n bankReasons.push(reason1);\r\n\r\n if (toKoi < (threshold + toBank))\r\n {\r\n bankReasons.push(new Reason(\"Since the enemy has been calculated to have a high chance of reaching a yaku, I think its best if you bank now\",\"\"));\r\n return false;\r\n }\r\n koiReasons.push(new Reason(\"Since the enemy seems much further from reaching a yaku then you, I would suggest koikoi\",\"\"));\r\n return true;\r\n}", "title": "" }, { "docid": "da0e17fdfc2906b9b2f33b7b9f5bfba2", "score": "0.53304356", "text": "badness(proofs){\n\n //M ← {µ : |C↑µ | ≥ m} \\ {0}\n let M = this.calculateM(proofs);\n if (M[0] !== undefined)\n delete M[0];\n\n let max;\n for (max = M.length - 1; M[max] !== undefined && max >= 0; --max);\n\n if (max === 0)\n throw 'max === 0';\n\n\n // ρ ← 1/ max(M)\n let p = 1 / max;\n\n for (let miu = 0; miu < M.length; miu++){\n if (M[miu] === undefined)\n continue;\n\n // B ∈ C↑µ\n let C = proofs.blocksGreaterLevel(miu);\n for (let i = 0; i < C.length; i++){\n\n let C1 = undefined;\n for (let j = i + 1; j < C.length; j++) {\n\n // {B :}\n C1.push(C[j]);\n\n // [: m]\n if (C1.length === consts.POPOW_PARAMS.m) // Sliding m-sized window\n break;\n\n }\n\n //if |C1| = m then\n if (C1.length === consts.POPOW_PARAMS.m){\n\n // C∗ ← C↓↑µ−1\n // TODO DEFINE Cstar\n\n let Cstar = [];\n\n if ( new BigNumber( 2 * C1.length ).isLessThan( new BigNumber(1-consts.POPOW_PARAMS.d).pow(p) * Cstar.length ) )\n return Cstar; //Chain is bad\n\n\n }\n\n }\n\n }\n\n return null; // Chain is good\n }", "title": "" }, { "docid": "617206b2f801634245063610331973b3", "score": "0.5323328", "text": "function minJumpsDP(jumps, dest) {\n if (jumps.length <= 1) return 0\n const table = Array(jumps.length).fill(Number.POSITIVE_INFINITY)\n table[0] = 0\n for (let i = 1; i < table.length; i++) {\n for (let j = i - 1; j >= 0; j--) {\n if (jumps[j] + j >= i) {\n table[i] = Math.min(table[i], table[j] + 1)\n }\n }\n }\n console.log(table)\n return table[table.length-1]\n}", "title": "" }, { "docid": "4aee2b8e42d0a1fe1c6d18b793a11ce6", "score": "0.5322972", "text": "question5FindHighestFloorSolution2(floors, remainingEggs, startingFloor = 0) {\n // If there isn't even one floor from which the egg can be dropped, then we just return -1\n if (floors.indexOf(true) === -1) return -1;\n \n // We starting testing from the highest floor given the number of eggs we have\n // If we have 2 eggs, then we start testing from floor 2 (index 1 in the array)\n let floorToTest = (startingFloor + remainingEggs) - 1;\n if (floors[floorToTest]) {\n return this.question5FindHighestFloorSolution2(floors, remainingEggs, startingFloor + remainingEggs);\n } else {\n for (let i = floorToTest - 1; i >= startingFloor - 1; i--) {\n // If there there is no floor from which the egg can be dropped, i will drop beneath 0\n // But this condition will never be met here since we are already making a test for this at the beginning of the function. So it's just a bonus test\n if (i < 0) return -1;\n\n if (floors[i]) {\n // (i + 1) because the first element in the list is referred to as floor 1, not floor 0\n return i + 1;\n }\n }\n\n return -1;\n }\n }", "title": "" }, { "docid": "9536cf25f0cb6bc51fbe5d929588a51f", "score": "0.53200275", "text": "function tspK3(mode) {\n // tspGreedy(mode);\n currPath = new Array(bestPath.length);\n for (var i = 0; i < bestPath.length; ++i) currPath[i] = bestPath[i];\n\n updateCosts();\n improved = true;\n while (improved) {\n improved = false;\n for (var i = 0; i < currPath.length - 3; ++i) {\n\tfor (var j = i+1; j < currPath.length - 2; ++j) {\n\t for (var k = j+1; k < currPath.length - 1; ++k) {\n\t if (costPerm(i, i+1, j, k, j+1, k+1) < bestTrip)\n\t updatePerm(i, i+1, j, k, j+1, k+1);\n\t if (costPerm(i, j, i+1, j+1, k, k+1) < bestTrip)\n\t updatePerm(i, j, i+1, j+1, k, k+1);\n\t if (costPerm(i, j, i+1, k, j+1, k+1) < bestTrip)\n\t updatePerm(i, j, i+1, k, j+1, k+1);\n\t if (costPerm(i, j+1, k, i+1, j, k+1) < bestTrip)\n\t updatePerm(i, j+1, k, i+1, j, k+1);\n\t if (costPerm(i, j+1, k, j, i+1, k+1) < bestTrip)\n\t updatePerm(i, j+1, k, j, i+1, k+1);\n\t if (costPerm(i, k, j+1, i+1, j, k+1) < bestTrip)\n\t updatePerm(i, k, j+1, i+1, j, k+1);\n\t if (costPerm(i, k, j+1, j, i+1, k+1) < bestTrip)\n\t updatePerm(i, k, j+1, j, i+1, k+1);\n\t }\n\t}\n }\n }\n for (var i = 0; i < bestPath.length; ++i) bestPath[i] = currPath[i];\n }", "title": "" }, { "docid": "8cc9a89ffd121ddb8eb7c139c1249900", "score": "0.5317211", "text": "nextLarger(lowerBound) {\n /**we want to go through every single node to check the val searching from top to bottom*/\n //check if there is anything in the root\n if (!this.root) return null;\n\n //check from top to bottom using a queue\n let queue = [this.root];\n let nextClosest = null;\n\n //loop while there is something in thre queue\n while (queue.length) {\n //check most recently added val;\n let current = queue.shift();\n let currentVal = current.val;\n\n let higherBoundary = currentVal > lowerBound;\n let reassignClosest = currentVal < nextClosest || nextClosest === null;\n\n //if current val is greater than lowerBound and currentVal is less than the nextCloses (or nextClosest is null), reassign the current val to be nextClosest\n if (higherBoundary && reassignClosest) {\n nextClosest = currentVal;\n }\n //if there is a child node, push the child node into the queue\n if (current.left) queue.push(current.left)\n if (current.right) queue.push(current.right)\n\n }\n\n return nextClosest;\n\n }", "title": "" }, { "docid": "abac3099f0f57a3964e75b5794429a8d", "score": "0.53118116", "text": "bestPowerRelativeTo(h /*: groupElement */, g /*: groupElement */) /*: number */ {\n var orbit_g = this.orbitOf( g );\n var bestPower = 0;\n var bestIndex = orbit_g.length;\n var hToThePower = 0;\n for ( var t = 1 ; t < this.group.elementOrders[h] ; t++ ) {\n hToThePower = this.group.mult( hToThePower, h );\n if ( CycleGraph.gcd( t, this.group.elementOrders[h] ) == 1 ) {\n var index = this.howSoonDoesOrbitIntersect(\n hToThePower, orbit_g );\n if ( index < bestIndex ) {\n bestIndex = index;\n bestPower = t;\n }\n }\n }\n // return it\n return bestPower;\n }", "title": "" }, { "docid": "41d5722d6a877f262a2d5e2704b15209", "score": "0.53101146", "text": "findAndMakeBestMove() {\n let self = this;\n self.send('go', () => {\n self.send(`makemove ${self.best_move}`, () => {\n self.api.makeMove(self.gameId, self.best_move);\n });\n });\n }", "title": "" } ]
c4ad225bbc4e224dfa8fb5b7f0c07042
Raytracer class gets registered to the window by the Animation object that owns it
[ { "docid": "f49d77893e5b6eeb63cc02e2f6d917da", "score": "0.6976717", "text": "function Raytracer( parent ) \n{\n //var defaults = { width: 32, height: 32, near: 1, left: -1, right: 1, bottom: -1, top: 1, scanline: 0, visible: true, anim: parent, ambient: vec3( .1, .1, .1 ) };\n var defaults = { width: 4, height: 4, near: 1, left: -1, right: 1, bottom: -1, top: 1, scanline: 0, visible: true, anim: parent, ambient: vec3( .1, .1, .1 ) };\n for( i in defaults ) this[ i ] = defaults[ i ];\n \n this.m_square = new N_Polygon( 4 ); // For texturing with and showing the ray traced result\n this.m_sphere = new Subdivision_Sphere( 4, true ); // For drawing with ray tracing turned off\n this.count = 0;\n \n this.balls = []; // Array for all the balls\n \n initTexture( \"procedural\", true, true ); // Our texture for drawing the ray trace \n textures[\"procedural\"].image.src = \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" // Blank gif file\n \n this.scratchpad = document.createElement('canvas'); // A hidden canvas for assembling the texture\n this.scratchpad.width = this.width;\n this.scratchpad.height = this.height;\n \n this.scratchpad_context = this.scratchpad.getContext('2d');\n this.imageData = new ImageData( this.width, this.height ); // Will hold ray traced pixels waiting to be stored in the texture\n \n this.make_menu();\n\n this.white = vec3(1, 1, 1);\n}", "title": "" } ]
[ { "docid": "992c89ea26b637d6156f0061f0844225", "score": "0.6538977", "text": "function RayHelper(ray){this.ray=ray;}", "title": "" }, { "docid": "def0f7e4d0059cfc5d9fe3956aa05e26", "score": "0.63762635", "text": "function lookToClick() {\n // create the raycaster\n this.projector = new THREE.Projector();\n this.raycaster = new THREE.Raycaster();\n }", "title": "" }, { "docid": "70849f5aa55229c7eb4ec0e08554f6be", "score": "0.61544865", "text": "function RayScene(){\n\t\n\t//the material makeup of an object determines if light bounces, is absorbed, or is emitted.\n\t//some materials are light sources and will just emit lights, while some will reflect completely, and others will refract at an angle while warping the color.\n\tthis.objects;\n\t\n\t//how many bounces do we attempt?\n\tthis.cycleCount;\n\t\n\tthis.view = {//TODO what do we need to define the viewport, both where its positioned and how many pixels need rendered\n\t\t//depth;//how far the screen is from the back plane. If you want the camera to sit at z = 0 with a depht of \n\t\t//width;//we assume that the viewport is centered on 0 0\n\t\t//height;\n\t\t//z;\n\t\t//xRes;\n\t\t//yRes;\n\t}\n}", "title": "" }, { "docid": "839fe90bd3fa915ebb1ad3c57b43af9a", "score": "0.6124268", "text": "function init() {\n raycastArr = []\n raycaster = new THREE.Raycaster()\n }", "title": "" }, { "docid": "e5d5db6e22cd979cc2412a128c55728f", "score": "0.60991836", "text": "init () {\n /**\n * Whether the current device uses mainly touch input or not\n * @type {boolean}\n */\n this.isTouch = window.matchMedia('(pointer: coarse)').matches\n\n /**\n * Whether gaze-only interaction is enabled\n * @type {boolean}\n */\n this.gazeClick = this.isTouch\n\n /**\n * Object holding all active animations\n * @type {Object}\n */\n this.animations = {}\n\n /**\n * Parsed start color\n * @type {Color}\n */\n this.startColor = new THREE.Color()\n\n /**\n * Parsed interaction color\n * @type {Color}\n */\n this.interactionColor = new THREE.Color()\n\n this.bindFunctions()\n this.addEventListeners()\n }", "title": "" }, { "docid": "136991ea9ce07488da87825d8bff3f39", "score": "0.6011869", "text": "openTracer(){\n\t\tthis.color = [Math.floor(rand(rand(220, 255), 255)), 200, 200]; // varying shades of red\n\t\tthis.currentTracer = new tracer();\n\t\tthis.currentTracer.color = this.color;\n\t\tthis.currentTracer.life = 100;\n\t\tthis.currentTracer.add();\n\t}", "title": "" }, { "docid": "8849b8504f50f33e220083b933f80b3b", "score": "0.60114115", "text": "static Raycast() {}", "title": "" }, { "docid": "1c61e20e17dcf8c6e3d39a906ae926f2", "score": "0.5876111", "text": "static invoke() {\n AnimationJinn.time = 0;\n AnimationJinn.registeredFunctions = [];\n window.requestAnimationFrame(AnimationJinn.animationFrameHandler);\n }", "title": "" }, { "docid": "c8288f78f087ae760fff37aa146dd1ad", "score": "0.5873626", "text": "start(){\n this.raf = window.requestAnimationFrame(this.moveAndDraw);\n }", "title": "" }, { "docid": "8674a3b46566cca403aa92405d10305f", "score": "0.58631164", "text": "function Raytracer() {\n var v = gl.getParameter(gl.VIEWPORT);\n var m = gl.modelviewMatrix.m;\n\n var axisX = new Vector(m[0], m[4], m[8]);\n var axisY = new Vector(m[1], m[5], m[9]);\n var axisZ = new Vector(m[2], m[6], m[10]);\n var offset = new Vector(m[3], m[7], m[11]);\n this.eye = new Vector(-offset.dot(axisX), -offset.dot(axisY), -offset.dot(axisZ));\n\n var minX = v[0], maxX = minX + v[2];\n var minY = v[1], maxY = minY + v[3];\n this.ray00 = gl.unProject(minX, minY, 1).subtract(this.eye);\n this.ray10 = gl.unProject(maxX, minY, 1).subtract(this.eye);\n this.ray01 = gl.unProject(minX, maxY, 1).subtract(this.eye);\n this.ray11 = gl.unProject(maxX, maxY, 1).subtract(this.eye);\n this.viewport = v;\n}", "title": "" }, { "docid": "374f9c5a3c7d6017b0e29117ff74356c", "score": "0.5821932", "text": "playerTracer(){\n\t\tthis.color = [200, 250, 200]; // light green\n\t\tthis.currentTracer = new tracer();\n\t\tthis.currentTracer.color = this.color;\n\t\tthis.currentTracer.life = 100;\n\t\tthis.currentTracer.add();\n\t}", "title": "" }, { "docid": "2945e22f4a812c22246bf944821603da", "score": "0.57668954", "text": "animate(){\n\n if( this._disposed ){ return; }\n\n requestAnimationFrame( this.animate.bind(this) );\n\n // If this.el is hidden, do not render\n if( !this.ready || this.el.clientHeight <= 0 ){\n return;\n }\n\n this.update();\n\n const results = this.inc_time();\n const _width = this.domElement.width;\n const _height = this.domElement.height;\n\n if(this.render_flag >= 0){\n\n if(this.has_stats){\n this.stats.update();\n }\n\n \t\tthis.render( results );\n\n /*\n \t\t// show mesh value info\n if( results.selected_object && this.object_chosen.userData.ani_exists ){\n\n const track_type = this.state_data.get(\"color_map\");\n\n const track_data = this.object_chosen.userData.get_track_data( track_type );\n\n if( track_data ){\n const time_stamp = to_array( track_data.time );\n const values = to_array( track_data.value );\n let _tmp = - Infinity;\n for( let ii in time_stamp ){\n if(time_stamp[ ii ] <= results.current_time && time_stamp[ ii ] > _tmp){\n results.current_value = values[ ii ];\n _tmp = time_stamp[ ii ];\n }\n }\n }\n } */\n\n \t\t// draw main and side rendered images to this.domElement (2d context)\n \t\tthis.mapToCanvas();\n\n\n \t\t// Add additional information\n const _pixelRatio = this.pixel_ratio[0];\n const _fontType = 'Courier New, monospace';\n\n this.domContext.fillStyle = this.foreground_color;\n\n // Draw title on the top left corner\n this._draw_title( results, 0, 0, _width, _height );\n\n // Draw timestamp on the bottom right corner\n this._draw_ani( results, 0, 0, _width, _height );\n\n // Draw legend on the right side\n this._draw_legend( results, 0, 0, _width, _height );\n\n // Draw focused target information on the top right corner\n this._draw_focused_info( results, 0, 0, _width, _height );\n\n // check if capturer is working\n if( this.capturer_recording && this.capturer ){\n this.capturer.add();\n }\n }\n\n this._draw_video( results, _width, _height );\n\n if(this.render_flag === 0){\n this.render_flag = -1;\n }\n\n\n\t}", "title": "" }, { "docid": "c1bbcb351fc3274b476df7f0d529f5de", "score": "0.56999964", "text": "init(){\n\n this.mouse = { x: 0, y: 0}\n this.width = this.canvas.offsetWidth;\n this.height = this.canvas.offsetHeight;\n this.scene = new THREE.Scene()\n\n const far = 2000;\n const dist = 500; // this is the distance between camera and vector3(0,0,0);\n const fov = 2 * Math.atan((this.height/2)/dist) * (180/Math.PI);\n this.camera = new THREE.PerspectiveCamera(fov, this.width/this.height, 0.1, far);\n this.camera.position.z = dist;\n this.renderer = new THREE.WebGLRenderer(\n { antialias:true }\n );\n this.renderer.setSize(this.width, this.height);\n this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2));\n // this.renderer.shadowMap.enabled = true;\n // this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; \n\n this.canvas.appendChild(this.renderer.domElement);\n\n this.tLoader = new THREE.TextureLoader();\n this.clock = new THREE.Clock();\n this.raycaster = new THREE.Raycaster();\n }", "title": "" }, { "docid": "0f241fedbc33907e489a456ed80e402f", "score": "0.56687146", "text": "static RaycastAll() {}", "title": "" }, { "docid": "0f3557ff427adaeb4a6d1c68220dbbf5", "score": "0.56552494", "text": "function makeMantaRayButton() {\n\n // Create the clickable object\n mantaRayButton = new Clickable();\n \n mantaRayButton.text = \"\";\n\n mantaRayButton.image = images[16]; \n\n // gives the Manta ray a transparent background \n mantaRayButton.color = \"#00000000\";\n mantaRayButton.strokeWeight = 0; \n\n // set width + height to image size\n mantaRayButton.width = 242; \n mantaRayButton.height = 156;\n\n // places the button on the page \n mantaRayButton.locate( width * (1/32) - mantaRayButton.width * (1/32), height * (1/3) - mantaRayButton.height * (1/3));\n\n // // Clickable callback functions, defined below\n mantaRayButton.onPress = mantaRayButtonPressed;\n mantaRayButton.onHover = beginButtonHover;\n mantaRayButton.onOutside = animalButtonOnOutside;\n}", "title": "" }, { "docid": "47446b1c91164a55fed701f9e60c386f", "score": "0.5654348", "text": "function createObjectAnimations() {\n\n}", "title": "" }, { "docid": "701b91e4f592315d5b033d3396045514", "score": "0.5631701", "text": "function init (data) {\n \n //tree always remembers whole tree, subtree only gets portion of it to create scene\n tree = createTree(data);\n subtree = createTree(data);\n\n renderer = new THREE.WebGLRenderer();\n renderer.setSize( window.innerWidth, window.innerHeight);\n document.body.appendChild( renderer.domElement );\n\n scene = new THREE.Scene();\n mouse = new THREE.Vector2();\n\n //set initial display depth to 2\n levelsToDisplay = 2;\n document.getElementById(\"displayedLevels\").innerHTML = levelsToDisplay ;\n\n raycaster = new THREE.Raycaster();\n\n camera = new THREE.PerspectiveCamera( 100, window.innerWidth/window.innerHeight, 10, 10000 );\n\n //camera field of view\n fov = camera.fov;\n zoom = 1.0;\n inc = -0.01;\n\n //move camera to default view angle\n camera.position.y = 300;\n camera.position.z = 200;\n \n camera.lookAt( scene.position );\n scene.add(camera);\n\n controls = new THREE.OrbitControls( camera, renderer.domElement );\n //controls.addEventListener( 'change', render ); // add this only if there is no animation loop (requestAnimationFrame)\n controls.enableDamping = true;\n controls.dampingFactor = 0.25;\n controls.enableZoom = true;\n\n //fill sunburst with cylinder partitions\n drawCylinderTree(scene, subtree);\n\n light = new THREE.AmbientLight( 0x222222 );\n light.position.set( 100, 200, 100 );\n scene.add( light );\n\n\n renderer.setClearColor( 0xdddddd, 1);\n renderer.render( scene, camera );\n\n //variables for tracking mouse movement\n projector = new THREE.Projector();\n mouseVector = new THREE.Vector3();\n\n //event listeners\n window.addEventListener( 'mousemove', onMouseMove, false );\n window.addEventListener( 'mousedown', onMouseDown, false );\n window.addEventListener( 'resize', onResize, false );\n window.addEventListener( 'mousewheel', mouseWheel, false );\n window.addEventListener( 'keypress', keyDownResolver, false);\n\n lastAccessedObject = subtree.root.sceneObject;\n\n //for firefox, screw firefox, use Chrome\n\t//window.addEventListener( 'DOMMouseScroll', mousewheel, false );\n\n window.animate();\n\n}", "title": "" }, { "docid": "bc9be84fadd52227cde1967576b0247c", "score": "0.56297106", "text": "function main() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"viewport\"); \n var context = canvas.getContext(\"2d\");\n \n //drawPixelsInputSpheresUsingRayCasting(context);\n drawPixelsInputSpheresUsingRayCastingAndLight(context);\n \n}", "title": "" }, { "docid": "dca81c65beab71f55ffb48cf5020e95d", "score": "0.56255233", "text": "function animate() {\n\n //stats.begin();\n if(!isMouseDown){\n camera.position.x = radius * Math.cos( angle ); \n camera.position.z = radius * Math.sin( angle );\n angle += 0.01;\n }\n \n requestAnimationFrame( animate );\n\tcontrols.update();\n //annotation.hidden(false);\n //stats.end();\n\n}", "title": "" }, { "docid": "e32db503805fc9ee99f9c2a09d7158f6", "score": "0.5618474", "text": "show() {\n fill(255);\n ellipse(this.pos.x, this.pos.y, this.radius);\n for (let ray of this.rays) {\n ray.show();\n }\n }", "title": "" }, { "docid": "d0eaff74e8f2228709eca89aa06e51ed", "score": "0.5612112", "text": "init() {\r\n 'use strict';\r\n this.createScene();\r\n this.createRenderer();\r\n this.render();\r\n this.animate();\r\n\r\n window.addEventListener(\"keydown\", KeyDown);\r\n window.addEventListener(\"keyup\", KeyUp);\r\n window.addEventListener(\"resize\", Resize);\r\n }", "title": "" }, { "docid": "e875810043840fff6d4a4b811a1efec6", "score": "0.5594949", "text": "constructor() {\n\n THREE.EventDispatcher.prototype.apply(this);\n this.canvas = document.getElementById(\"main_canvas\");\n\n\n this.context = this.canvas.getContext(\"webgl\");\n\n this.renderer = new THREE.WebGLRenderer({\n canvas: this.canvas,\n context: this.context,\n antialias: true\n });\n this.renderer.setSize(window.innerWidth, window.innerHeight);\n\n this.scene = new THREE.Scene();\n\n\n this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);\n this.camera.position.x = 50;\n this.camera.position.y = 25;\n this.camera.position.z = 50;\n this.camera.rotation.x = 0.3;\n\n\n var directionalLight = new THREE.DirectionalLight(0xffffff, 1);\n directionalLight.position.set(0, 6, 12);\n this.scene.add(directionalLight);\n\n this.actors = [];\n\n }", "title": "" }, { "docid": "520987944093fba4aa132f419225da68", "score": "0.5592788", "text": "constructor({children=[]}={}) {\n this.children = children;\n signal.registerSignals(this);\n let hitTestService = new HitTestService({signal});\n\n //begin animation after instantiating scene, camera, and renderer.\n this.initThreeJs();\n\n console.log('signals: ' + JSON.stringify(signal.getSignalIds()));\n }", "title": "" }, { "docid": "0b597b48a94fd9faaf46917458134526", "score": "0.55861413", "text": "function Animation()\n{\n\t( function init( self )\n\t{\n\t\tself.context = new GL_Context( \"gl-canvas\", Color( 0.129411765, 0.588235294, 0.952941176, 1 ) ); // Set background color to blue\n\t\tself.context.register_display_object( self );\n\n \tshaders = { \"Default\": new Shader( \"vertex-shader-id\", \"fragment-shader-id\" ),\n \"Demo_Shader\": new Shader( \"vertex-shader-id\", \"demo-shader-id\" ) };\n\n\t\tfor( var i = 0; i < texture_filenames_to_load.length; i++ )\n\t\t\tinitTexture( texture_filenames_to_load[i], true );\n\t self.mouse = { \"from_center\": vec2() };\n\n\t self.m_strip = new Old_Square(); // At the beginning of our program, instantiate all shapes we plan to use,\n\t\t\tself.m_tip = new Tip( 3, 10 ); // each with only one instance in the graphics card's memory.\n\t self.m_cylinder = new Cylindrical_Tube( 10, 10 ); // For example we'll only create one \"cube\" blueprint in the GPU, but we'll re-use\n\t self.m_torus = new Torus( 25, 25 ); // it many times per call to display to get multiple cubes in the scene.\n\t self.m_sphere = new Sphere( 10, 10 );\n\t self.poly = new N_Polygon( 7 );\n\t self.m_cone = new Cone( 10, 10 );\n\t self.m_capped = new Capped_Cylinder( 4, 12 );\n\t self.m_prism = new Prism( 8, 8 );\n\t self.m_cube = new Cube();\n\t self.m_obj = new Shape_From_File( \"teapot.obj\", scale( .1, .1, .1 ) );\n\t self.m_sub = new Subdivision_Sphere( 4, false );\t\t// Set parameter flat_shading to false for smooth sphere surface\n\t self.m_axis = new Axis();\n\n\t\t// 1st parameter is our starting camera matrix. 2nd parameter is the projection: The matrix that determines how depth is treated. It projects 3D points onto a plane.\n\t \t//self.graphicsState = new GraphicsState( translation(0, 0,-25), perspective(45, canvas.width/canvas.height, .1, 1000), 0 );\n\t \tself.graphicsState = new GraphicsState( mult(translation(0, -2.5, -40), rotation(15, 1, 0, 0)), perspective(45, canvas.width/canvas.height, .1, 1000), 0 );\t\t// Adjust camera matrix for my animation\n\n\t\tself.stack = [];\t\t\t\t// Initialize a stack to maintain a current model_transform matrix\n\n\t\tself.context.render();\n\t} ) ( this );\n\n\t/**\n\t * Mouse controls.\n\t * @inner\n\t * @arg {event} e - mouse event triggered\n\t * @returns {vec2} new coordinates of mouse\n\t*/\n\tvar mouse_position = function( e ) { return vec2( e.clientX - canvas.width/2, e.clientY - canvas.height/2 ); };\n\n\t// Measure mouse steering, for rotating the flyaround camera.\n\tcanvas.addEventListener(\"mouseup\", ( function(self) { return function(e)\t{ e = e || window.event;\t\tself.mouse.anchor = undefined; } } ) (this), false );\n\tcanvas.addEventListener(\"mousedown\", ( function(self) { return function(e)\t{\te = e || window.event; self.mouse.anchor = mouse_position(e); } } ) (this), false );\n\tcanvas.addEventListener(\"mousemove\", ( function(self) { return function(e)\t{ e = e || window.event; self.mouse.from_center = mouse_position(e); } } ) (this), false );\n\tcanvas.addEventListener(\"mouseout\", ( function(self) { return function(e)\t{ self.mouse.from_center = vec2(); }; } ) (this), false );\t// Stop steering if the mouse leaves the canvas.\n}", "title": "" }, { "docid": "c70aadbe0c17d53b4464cd43fcfc8f6a", "score": "0.55710816", "text": "function RayCollisionDetector (){\r\n\r\n CollisionDetector.call(this);\r\n\r\n}", "title": "" }, { "docid": "8a5150d39e93ecbbfba55f5a1188a5f7", "score": "0.5548418", "text": "function ObjectOrientedRenderer3() {}", "title": "" }, { "docid": "d367d85ff2dd4753548f5ebdeb28e265", "score": "0.5547936", "text": "environment() {\n push();\n noStroke();\n rotateY(frameCount * 0.002);\n sphere(1200);\n pop();\n }", "title": "" }, { "docid": "92c1c8ba4faeafd2514357459204cd50", "score": "0.5530029", "text": "function AnimationMgr()\n{\n}", "title": "" }, { "docid": "b1fb4781ea64173f7dc5aa0faf053071", "score": "0.5525592", "text": "init() {\n this.scene = new THREE.Scene();\n this.camera = new THREE.PerspectiveCamera(\n 75,\n this.width() / this.height(),\n 1,\n 3000\n );\n this.camera.position.set(0, 0, 128);\n\n this.renderer.setPixelRatio(window.devicePixelRatio);\n this.renderer.setSize(this.width(), this.height());\n\n this.container.appendChild(this.renderer.domElement);\n\n this.raycaster = new THREE.Raycaster();\n this.simplex = new SimplexNoise();\n }", "title": "" }, { "docid": "bbd293c8d07fd769791f7ad88cc123b5", "score": "0.551307", "text": "start () {\n\n console.log( 'World::start(): starting animation' );\n\n // Attach reporters from WebVR and GamePad API only if we can render.\n\n this.vr.setWorld( this );\n\n this.gamepad.setWorld( this );\n\n this.ui.setWorld( this );\n\n // Fire the WebVR .requestAnimationFrame (rather than window.requestAnimationFrame).\n\n return ( this.rafId = this.vr.getDisplay().requestAnimationFrame( this.render ) );\n\n }", "title": "" }, { "docid": "f57cced4d5a9d6718af17ca328c32c70", "score": "0.5503871", "text": "function init(_event) {\r\n let canvas = document.getElementsByTagName(\"canvas\")[0];\r\n L11_Inheritance.crc2 = canvas.getContext(\"2d\");\r\n console.log(L11_Inheritance.crc2);\r\n canvas.addEventListener(\"click\", insertNewObject);\r\n for (let i = 0; i < n; i++) {\r\n let star = new L11_Inheritance.DavidStar(\"#00ffff\"); //cyan\r\n stars.push(star);\r\n let rect = new L11_Inheritance.Rect(\"#ff0000\"); //rot\r\n stars.push(rect);\r\n }\r\n animate();\r\n }", "title": "" }, { "docid": "4c68edfd6123a9c9d01499b173145cdc", "score": "0.5497221", "text": "function animate() {\n\n raycaster.setFromCamera(mouse, camera);\n\n // render\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "title": "" }, { "docid": "5d98b6513435504c2406ca55d645cb26", "score": "0.5496974", "text": "constructor(guiSys, rnctx) {\n super();\n var self = this;\n\n var geometry = new THREE.SphereGeometry( 1000, 50, 50 );\n var material = new THREE.MeshBasicMaterial({\n wireframe: false, color: 'white', side: THREE.DoubleSide });\n\n let globe = new THREE.Mesh(geometry, material);\n\n let onUpdate = function(scene, camera) {\n let projScreenMatrix = new THREE.Matrix4();\n let modelViewMatrix = new THREE.Matrix4();\n modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, globe.matrixWorld);\n projScreenMatrix.multiplyMatrices(camera.projectionMatrix, modelViewMatrix);\n globe.geometry.update(self.maxDepth, projScreenMatrix);\n globe.material = globe.geometry.material;\n }\n globe.raycast = panoRayCast.bind(globe);\n globe.rotation.y = -3.14159/2;\n\n this.view = new OVRUI.UIView(guiSys);\n this.view.add(globe);\n this._source = new RCTBindedResource(rnctx.RCTResourceManager);\n Object.defineProperty(this.props, \"source\", {\n set: function (value) {\n if (value.tile) {\n // use tile renderer\n globe.geometry.dispose();\n self.maxDepth = value.maxDepth || 2;\n globe.geometry = new HPanoBufferGeometry(\n 1000,\n self.maxDepth,\n value.tile);\n globe.onUpdate = onUpdate;\n } else {\n // use sphere renderer\n globe.geometry.dispose();\n globe.geometry = geometry;\n globe.onUpdate = null;\n // call onLoadStart in React\n self.UIManager._rnctx.callFunction(\n 'RCTEventEmitter',\n 'receiveEvent',\n [self.getTag(), 'topLoadStart', []]);\n const defaultRequest = function(url, callback) {\n if (url == null) {\n // When a url is null or undefined, send undefined to callback\n callback(undefined)\n } else if (Array.isArray(url)) {\n let loader = new THREE.CubeTextureLoader();\n // When a load error occurs, send undefined to callback\n loader.load(url, callback, /* onProgress */undefined, /* onError */()=>callback(undefined));\n } else {\n // When a load error occurs, send undefined to callback\n let loader = new THREE.TextureLoader();\n loader.load(url, callback, /* onProgress */undefined, /* onError */()=>callback(undefined));\n }\n }\n const callback = function (texture) {\n globe.scale.x = -1;\n if ( texture === undefined ) {\n material.map = undefined;\n material.envMap = undefined;\n } else if (texture.type === 'MonoTextureInfo') {\n material.map = texture.texture;\n material.envMap = undefined;\n } else {\n let cubeTexture = texture.isCubeTexture ? texture : null;\n let flatTexture = texture.isCubeTexture ? null : texture;\n if (texture.isCubeTexture) {\n globe.scale.x = 1;\n texture.generateMipmaps = true;\n } else {\n texture.wrapS = THREE.ClampToEdgeWrapping;\n texture.wrapT = THREE.ClampToEdgeWrapping;\n texture.minFilter = THREE.LinearFilter;\n }\n material.map = flatTexture;\n material.envMap = cubeTexture;\n }\n material.needsUpdate = true;\n\n // call onLoad in React\n if (material.map) {\n self.UIManager._rnctx.callFunction(\n 'RCTEventEmitter',\n 'receiveEvent',\n [self.getTag(), 'topLoad', []]);\n }\n // call onLoadEvent in React\n self.UIManager._rnctx.callFunction(\n 'RCTEventEmitter',\n 'receiveEvent',\n [self.getTag(), 'topLoadEnd', []]);\n };\n\n self._source.request(value.uri, defaultRequest, callback);\n }\n }});\n // register a setter for the backgroundColor so the globe can be tinted\n Object.defineProperty(this.style, \"backgroundColor\", {\n set: function (value) {\n let opacity = parseInt(value.toString(16).slice(0,2), 16)/255.;\n material.color.set(value);\n material.opacity = opacity;\n material.transparent = (opacity < 1);\n }\n });\n }", "title": "" }, { "docid": "c98db7032f06c5cf817516f7b75a4edd", "score": "0.5488019", "text": "_startAnimationLoop() {\n\t\t\tconst xTermMaterials = Array.from(this._xTermLayerMap.values());\n\t\t\tconst timeUniforms = this._shaderPasses.filter(pass => {\n\t\t\t\treturn pass.getFullscreenMaterial().uniforms.time !== undefined;\n\t\t\t}).map(pass => {\n\t\t\t\treturn pass.getFullscreenMaterial().uniforms.time;\n\t\t\t});\n\n\t\t\tconst xTermMaterialsLength = xTermMaterials.length;\n\t\t\tconst timeUniformsLength = timeUniforms.length;\n\n\t\t\tconst that = this;\n\n\t\t\t(function render() {\n\t\t\t\tthat._animationId = window.requestAnimationFrame(render);\n\n\t\t\t\tfor (let i = 0; i < timeUniformsLength; i++) {\n\t\t\t\t\ttimeUniforms.value = that._clock.getElapsedTime();\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0; i < xTermMaterialsLength; i++) {\n\t\t\t\t\txTermMaterials[i].map.needsUpdate = true;\n\t\t\t\t}\n\n\t\t\t\tthat._composer.render(that._clock.getDelta());\n\t\t\t})();\n\t\t}", "title": "" }, { "docid": "895715e00de1723d61f516f7cca460c4", "score": "0.54661965", "text": "init() {\n // Expand the canvas to the whole area of its parent.\n this.canvas = document.getElementById(\"canvasID\");\n this.container = document.getElementById(\"canvasContainerID\");\n var width = this.container.clientWidth;\n var height = this.container.clientHeight;\n this.canvas.width = width;\n this.canvas.height = height;\n\n // Create renderer with canvas pre-set in index.html.\n this.renderer = new THREE.WebGLRenderer({ canvas: this.canvas, antialias: true });\n this.renderer.setSize(width, height);\n //this.renderer.setClearColor(0xffffff);\n\n // Create a camera\n this.camera = new THREE.PerspectiveCamera(70, width / height, 0.01, 100);\n this.camera.position.set(0, 3, 6);\n\n // Add OrbitControls to support interactive view\n this.controls = new THREE.OrbitControls(this.camera, this.renderer.domElement);\n\n // Create scene.\n this.scene = new THREE.Scene();\n\n // Create a raycaster to \n this.raycaster = new THREE.Raycaster();\n\n // Add event handler for window resizing\n window.addEventListener('resize', this.sizeChanged.bind(this));\n this.canvas.addEventListener('click', this.mouseClicked.bind(this));\n\n // Set dimension of seismic cube\n this.cubeWidth = 2;\n this.cubeHeight = 2;\n this.cubeLength = 2;\n\n this.ZZZ = 0;\n this.delta = 0.01;\n }", "title": "" }, { "docid": "84862a9ee936ea9617df05fa8bc7156d", "score": "0.5461886", "text": "function onDocumentMouseDown(event)\n{\n event.preventDefault();\n event.preventDefault();\n mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n\n //Find intersections\n raycaster.setFromCamera( mouse, camera );\n\n //Not sure why I needed to specify \"true\"\n var intersects = raycaster.intersectObjects( scene.children, true );\n if ( intersects.length > 0 )\n {\n clicked = intersects[ 0 ].object;\n\n var clickedRobot = robots.filter(obj => {\n return obj.name === clicked.parent.name\n });\n var clickedRobotIndex = robots.findIndex(x => x.name === clicked.parent.name);\n\n //Adjust score\n if(clickedRobotIndex != -1) {\n score++;\n $('#score').text(score);\n }\n\n //robotMixers[clickedRobotIndex].clipAction(robotAnimations[2]).play();\n robotMixers[clickedRobotIndex].clipAction(robotAnimations[1]).stop();\n\n //Stop robot movement\n clickedRobot[0].moveDistanceX = 0;\n clickedRobot[0].moveDistanceZ = 0;\n clickedRobot[0].dead = 1;\n\n crateAnimator = new KF.KeyFrameAnimator;\n crateAnimator.init({\n interps:\n [\n\n {\n keys:[0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1],\n values:[\n { z : Math.PI / 10 },\n { z : Math.PI / 8 },\n { z : Math.PI / 6 },\n { z : Math.PI / 4 },\n { z : Math.PI / 2 },\n { z : Math.PI / 2 },\n { z : Math.PI / 2 },\n { z : Math.PI / 2 },\n { z : Math.PI / 2 },\n { z : Math.PI / 2 },\n { z : Math.PI / 2 },\n ],\n target:clickedRobot[0].rotation\n },\n ],\n loop: 0,\n duration: animationDuration,\n });\n crateAnimator.start();\n if(!crateAnimator.running) {\n crateAnimator.interps[0].target = clickedRobot[0].rotation;\n\n }\n //playAnimations();\n\n //Wait until the animation finishes\n setTimeout(function(){\n crateAnimator.interps[0].target = null;\n robotMixers[clickedRobotIndex].clipAction(robotAnimations[1]).play();\n //Reset some crap\n //Make X or Y randomly negative for robot distribution\n randomNegX = Math.floor(Math.random() * 2);\n randomNegZ = Math.floor(Math.random() * 2);\n if(randomNegX == 0) {randomNegX = -1;}\n if(randomNegZ == 0) {randomNegZ = -1;}\n //Distribute robots\n var topOrSide = Math.floor(Math.random() * 2);\n //If the robot generates above or below the FOV\n if(topOrSide == 0) {\n var randomX = (Math.floor(Math.random() * 400) - 200) * randomNegX; //Random length-wise\n var randomZ = 100 * randomNegX; //The multiplication makes it either appear above or below\n } else {\n //If the robot generates to the left or right of the FOV\n var randomX = 200 * randomNegX;\n var randomZ = (Math.floor(Math.random() * 200) - 100) * randomNegZ; //Random height-wise\n }\n clickedRobot[0].position.x = randomX;\n clickedRobot[0].position.z = randomZ;\n clickedRobot[0].dead = 0;\n clickedRobot[0].moveDistanceX = randomX / moveDistance;\n clickedRobot[0].moveDistanceZ = randomZ / moveDistance;\n clickedRobot[0].rotation.y = Math.atan(clickedRobot[0].position.x / clickedRobot[0].position.z) + (Math.PI);\n clickedRobot[0].rotation.z = 0;\n }, animationDuration + 100);\n\n }\n}", "title": "" }, { "docid": "5279dfe29f6f97ae4f8d47c7549766f8", "score": "0.54508847", "text": "init() {\n super.init();\n this.log( \"init()\");\n this.scene.add( this._light);\n }", "title": "" }, { "docid": "7087f46d8952ceace88f2aa3f44a7474", "score": "0.54492784", "text": "function startAnimation(scope) {\n object_a_line.graphics.clear();\n object_b_line.graphics.clear();\n direction_arrow_a.graphics.clear();\n direction_arrow_b.graphics.clear();\n scope.control_disable = true;\n scope.pause_disable = false;\n start_flag = true;\n getChild(\"ball_a\").mouseEnabled = false;\n getChild(\"ball_b\").mouseEnabled = false; \n circle_a.alpha = circle_b.alpha = obj_a_circle.alpha = obj_b_circle = 0;\n /**radius of the ball, the total distance of two collided balls is the sum of their radius*/\n radius_AB = (ball_a_radius + ball_b_radius);\n hit_timer = setInterval(function() {\n circleOnEnterFrame(scope)\n }, 10);\n}", "title": "" }, { "docid": "bfa76caca7c459534e8ed3698f4cc680", "score": "0.54492", "text": "static invoke() {\n InteractionJinn.register('text', OverlayJinn.text);\n AnimationJinn.register(OverlayJinn.step);\n }", "title": "" }, { "docid": "f2a411d12d8fd546aef9997fcd54c157", "score": "0.54478663", "text": "function init(){\n\t\t\n\t\tobjects = [];\n\t\t//Set up scene\n\t\tscene = { \"width\": 845, \"height\": 480, \"scene\": new THREE.Scene()};\t\n\t\tcamera = new THREE.PerspectiveCamera(45, 1.77, scene.width /scene.height, 10000); //view_angle, aspect = width/height, near, far\n\t\tmoveCamera(new THREE.Vector3(0,0,100));\n\t\tscene.scene.add(camera);\n\n\t\t//create and append renderer to sceneElement\n\t\trenderer = new THREE.WebGLRenderer();\n\t\trenderer.setSize(scene.width, scene.height);\n\t\tsceneElement.append(renderer.domElement);\n\t\tdebug(\"Added renderer to dom\");\n\n\t\t//Set up the controls: This is boring stuff\n\t\tvar controls = new THREE.TrackballControls(camera, renderer.domElement);\n\t\tcontrols.target.set( 0, 0, 0 ); controls.rotateSpeed = .5;\tcontrols.zoomSpeed = .5; controls.panSpeed = 0.8;\n\t\tcontrols.noZoom = false; controls.noPan = false; controls.staticMoving = false; controls.dynamicDampingFactor = 0.15;\n\t\tcontrols.keys = [65,83,68];\n\t\tcontroller = {\"controls\": controls, \"projector\": new THREE.Projector()};\n\n\t\t//Event listeners: Handling things!\n\t\trenderer.domElement.addEventListener('mousedown', function(){ moveFlag = 0;}, false);\n\t\trenderer.domElement.addEventListener('mouseup', viewMouseUp, false);\n\t\trenderer.domElement.addEventListener('mousemove', viewMouseOver, false);\n\n\t\t//Add lighting!\n\t\tvar pointLight1 = new THREE.PointLight(0xFFFFFF);\n\t\tpointLight1.position = new THREE.Vector3(40,50,130);\n\t\tscene.scene.add(pointLight1);\n\t\tvar pointLight2 = new THREE.PointLight(0xFFFFFF);\n\t\tpointLight2.position = new THREE.Vector3(-40,-50,-130);\n\t\tscene.scene.add(pointLight2);\n\t\tdebug(\"Added lighting to scene\");\n\n\t\t//Add plane! \n\t\tplane = new Plane();\n\n\t\t//Have a variable around for annotation functions\n\t\tannot = new Annotations();\n\t\t\n\t\tanimate();\n\t\t\n\t}", "title": "" }, { "docid": "c0d6377bff118a3963c65a9c8606dd48", "score": "0.54421353", "text": "function drawAnimation(addr) {\n\n}", "title": "" }, { "docid": "cf765788c36a59d7f9e6a0268b4b93c0", "score": "0.5439075", "text": "function animate() {\r\n\trequestAnimationFrame( animate );\r\n\trenderer.render(scene, camera);\r\n}", "title": "" }, { "docid": "573764ce2facbc93ebd2ba1dbdc2759f", "score": "0.542982", "text": "function main() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"viewport\"); \n var context = canvas.getContext(\"2d\");\n \n // Create the image\n raycastEllipsoids( context );\n}", "title": "" }, { "docid": "9cdfa1eebd9f6b63abe18fe60b885f74", "score": "0.5429512", "text": "animate(scope) {\n\n requestAnimationFrame(() => {\n return scope.animate(scope);\n });\n this.renderer.render(this.scene, this.camera);\n }", "title": "" }, { "docid": "40db02e13f2980c99576f3399b76c0ba", "score": "0.54254675", "text": "function init(){\n window.requestAnimationFrame(draw);\n}", "title": "" }, { "docid": "e0a78711f2f341a3b5de686554a49307", "score": "0.54217595", "text": "init() {\r\n 'use strict';\r\n this.createScene();\r\n this.createRenderer();\r\n\r\n this.clock = new THREE.Clock;\r\n this.clock.start();\r\n\r\n this.render();\r\n this.animate();\r\n\r\n window.addEventListener(\"keydown\", KeyDown);\r\n window.addEventListener(\"resize\", Resize);\r\n }", "title": "" }, { "docid": "60d7d1421999c268836394ebcb020f42", "score": "0.54101807", "text": "function init() \r\n {\r\n // Initialize the scene.\r\n scene = new THREE.Scene();\r\n scene.fog = new THREE.FogExp2(0x000000, 0.0003);\r\n\r\n // Add lights to the scene.\r\n scene.add(new THREE.AmbientLight(0xaaaaaa));\r\n var directLight = new THREE.DirectionalLight(0xffffff, 0.5);\r\n directLight.position.set(0, 100, 100);\r\n directLight.target.position.set(0, 0, 0);\r\n directLight.shadowCameraVisible = false;\r\n directLight.castShadow = true;\r\n directLight.shadowDarkness = 0.5; \r\n scene.add(directLight);\r\n\r\n var pointLight = new THREE.PointLight(0xffffff, 0.8);\r\n pointLight.position.set(223, 0, 500);\r\n scene.add(pointLight); \r\n\r\n // Add raytracer to the scene.\r\n raycaster = new THREE.Raycaster();\r\n\r\n // Set the parameters of renderer.\r\n renderer.setClearColor(0x2E2E2E);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.setSize(width, height);\r\n renderer.autoClear = true;\r\n renderer.shadowMapEnabled = true;\r\n renderer.shadowMapSoft = true;\r\n renderer.shadowCameraNear = 3;\r\n renderer.shadowCameraFar = camera.far;\r\n renderer.shadowCameraLeft = -0.5;\r\n renderer.shadowCameraRight = 0.5;\r\n renderer.shadowCameraTop = 0.5;\r\n renderer.shadowCameraBottom = -0.5;\r\n renderer.shadowCameraFov = 50;\r\n renderer.shadowMapBias = 0.0039;\r\n renderer.shadowMapDarkness = 0.5;\r\n renderer.shadowMapWidth = 1024;\r\n renderer.shadowMapHeight = 1024;\r\n container.appendChild(renderer.domElement);\r\n\r\n // Initialize controls. \r\n controls = new THREE.OrbitControls(camera, container);\r\n controls.target = new THREE.Vector3(0, 0, 0);\r\n controls.minDistance = 10;\r\n controls.maxDistance = 1000;\r\n controls.zoomSpeed = 0.8;\r\n controls.maxPolarAngle = Math.PI/2; \r\n controls.noPan = true;\r\n controls.update();\r\n\r\n // Initialize stars.\r\n starGenerator();\r\n \r\n // Initialize the football field.\r\n fieldGenerator();\r\n \r\n // Add event listeners to the container.\r\n window.addEventListener('resize', onWindowResize, false);\r\n container.addEventListener( 'mousedown', onContainerMouseDown, false );\r\n container.addEventListener( 'mousemove', onContainerMouseMove, false );\r\n document.getElementById('smallPanel').addEventListener( 'mousedown', onPanelMouseDown, false );\r\n }", "title": "" }, { "docid": "0088a22acded5c54beaa3a92134b46f5", "score": "0.5401795", "text": "function indisController()\n{\n\t//\n\tthis.animateObjects = [];\n\t//\n\tthis.registorObject2MouseEvent = registorObject2MouseEvent;\n\tthis.onMouseEvent = onMouseEvent;\n\t//\n\tfunction registorObject2MouseEvent(animateobject, MouseEventFunction)\n\t{\n\t\tanimateobject.onMouseEvent = MouseEventFunction;\n\t\tthis.animateObjects.push(animateobject);\n\t}\n\tfunction onMouseEvent(event)\n\t{\n\t\tfor(var i = 0; i < this.animateObjects.length; i++)\n\t\t{\n\t\t\tthis.animateObjects[i].onMouseEvent(event);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3c07f51364356338fca24d722cc95224", "score": "0.5397334", "text": "init() {\r\n 'use strict';\r\n this.clock = new THREE.Clock;\r\n this.clock.start();\r\n\r\n this.createScene();\r\n this.createRenderer();\r\n this.render();\r\n this.animate();\r\n\r\n window.addEventListener(\"keydown\", KeyDown);\r\n window.addEventListener(\"resize\", Resize);\r\n }", "title": "" }, { "docid": "e0a795b75b2211a6eac52800dea4a7f1", "score": "0.5395128", "text": "function animationFrame() {\n // // Clock\n // let elapsedTime = Clock.getElapsedTime();\n // // Update Object\n // Mesh.rotation.y = elapsedTime;\n // Mesh.position.y = Math.sin(elapsedTime);\n // Mesh.position.x = Math.cos(elapsedTime);\n\n // Render\n Renderer.render(Scene, PerspectiveCamera);\n window.requestAnimationFrame(animationFrame);\n}", "title": "" }, { "docid": "e0a160e9768f44d11a62990ee4c8dac0", "score": "0.5393005", "text": "function animate() {\n\n // image probe widget\n if (squareprobe) {\n //raycaster.setFromCamera(mouse, camera);\n // re compute new ROI\n // re draw it\n // probesquare.updateROI();\n }\n\n // render\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "title": "" }, { "docid": "11591d8e45506db771ae8f5bd05d8828", "score": "0.5383507", "text": "function start() {\n globalID = requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "8ea8115340cda40cc9d6ae6ed7fc58c6", "score": "0.5378223", "text": "initWorld() //prints out “Initialising game world”\n {\n //this.touchTest = new TouchTest();\n gameNs.sceneManager = new SceneManager();\n this.scene = new Scene('Scene');\n gameNs.menuScene = new MenuScene('Too Many Walls');\n gameNs.playScene = new PlayScene('Play');\n gameNs.optionsScene = new OptionsScene('Options');\n gameNs.tutorialScene = new TutorialScene('Tutorial');\n\n gameNs.sceneManager.addScene(gameNs.menuScene);\n gameNs.sceneManager.addScene(gameNs.playScene);\n gameNs.sceneManager.addScene(gameNs.optionsScene);\n gameNs.sceneManager.addScene(gameNs.tutorialScene);\n gameNs.sceneManager.goToScene(gameNs.menuScene.title);\n\n // document.addEventListener(\"click\", this.clickHandler.bind(null, gameNs.sceneManager));\n //draw(sceneManager);\n }", "title": "" }, { "docid": "3320d226d9883a0d299b8a3f596985ad", "score": "0.5376889", "text": "init() {\n const _contentCanvas = document.querySelector(\"#content-canvas\");\n\n this.renderer.domElement.id = \"chelet-han\";\n\n this.renderer.setPixelRatio(devicePixelRatio);\n this.renderer.shadowMap.enabled = true;\n this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;\n\n this.scene.add(this.camera);\n this.scene.add(this.group);\n\n this.camera.position.set(0, 0, 1);\n this.camera.lookAt(this.scene.position);\n\n _contentCanvas.appendChild(this.renderer.domElement);\n\n this.initFn();\n }", "title": "" }, { "docid": "e87d8005b97d52fcadc929935a631538", "score": "0.53730243", "text": "function ObjectOrientedRenderer3() { }", "title": "" }, { "docid": "e87d8005b97d52fcadc929935a631538", "score": "0.53730243", "text": "function ObjectOrientedRenderer3() { }", "title": "" }, { "docid": "e87d8005b97d52fcadc929935a631538", "score": "0.53730243", "text": "function ObjectOrientedRenderer3() { }", "title": "" }, { "docid": "e87d8005b97d52fcadc929935a631538", "score": "0.53730243", "text": "function ObjectOrientedRenderer3() { }", "title": "" }, { "docid": "9709e37d0fec9e3fd6b3eab94036dab1", "score": "0.5355839", "text": "function animate() {\n\t// render the 3D scene\n\trender();\n\t// relaunch the 'timer' \n\trequestAnimationFrame( animate );\n\t// update the stats\n\tstats.update();\n}", "title": "" }, { "docid": "c0390df92560301d3f259b64dfb2af48", "score": "0.5353151", "text": "animate() {\n this.frameId = requestAnimationFrame(this.animate.bind(this));\n this.render();\n }", "title": "" }, { "docid": "147ab600e31d1ff0aed2564116db61ee", "score": "0.53477603", "text": "function animate(){\r\n //alert(\"animate start\"); \r\n renderer.render(stage);\r\n window.requestAnimationFrame(animate.bind(window.gameProcess));\r\n //return this;\r\n }", "title": "" }, { "docid": "05948eb1e5554919905c46302eab0f49", "score": "0.5347614", "text": "constructor() {\n const canvas = document.getElementById('canvas');\n const scene = new Scene(canvas);\n const fps = 1000 / 120;\n this.balls = [];\n\n canvas.addEventListener('click', (evt) => {\n const angle = Math.random() * 360;\n const velocity = Math.random() * 30;\n const ball = new Ball(scene, evt.clientX, evt.clientY, angle, velocity);\n this.balls.push(ball);\n });\n\n setInterval(() => {\n scene.sceneSetup();\n\n this.balls.forEach((ball) => {\n ball.render();\n });\n }, fps);\n }", "title": "" }, { "docid": "98d452ed8bdb8e7680a7e530d2e6268c", "score": "0.5343598", "text": "constructor(top, left, timeBetweenSteps) {\n this.$node = $('<span class=\"dancer\"></span>');\n this.timeBetweenSteps = timeBetweenSteps;\n this.originalTop = top;\n this.originalLeft = left;\n this.hovered = false;\n this.$node.on('mouseover', (event) => {\n this.hovered = true;\n this.$node.addClass('highlight');\n });\n this.$node.on('mouseleave', (event) => {\n this.hovered = false;\n this.$node.removeClass('highlight');\n });\n\n // now that we have defined the dancer object, we can start setting up important parts of it by calling the methods we wrote\n // this one sets the position to some random default point within the body\n this.step();\n this.setPosition(top, left);\n }", "title": "" }, { "docid": "7c85817a40697842d72b0ef46362a0c2", "score": "0.5340355", "text": "function my_init_raytrace(option) {\r\n\r\n\tvar i=0, material;\r\n\tmyScene.depthMax = 1;\r\n\tmyScene.itemCount = 0; // start with nothing.\r\n\r\n\t// Now add a grid-plane\r\n\tmyScene.items.push(new CGeom());\r\n\tmyScene.items[i].shapeType = GEOM_GNDPLANE;\r\n\tmyScene.items[i].matlNum = 0; // use the first material;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// (which uses matlNum 2 as its\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// secondary material)\r\n\tmyScene.itemCount++;\r\n\ti++;\r\n\r\n\tif(option==0) {\r\n\t\t// now add a sphere. (center)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_SPHERE;\r\n\t\tmyScene.items[i].matlNum = 7; // use the 2nd material.\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\t\t// and another sphere. (left side)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_SPHERE;\r\n\t\tmyScene.items[i].rayTranslate3d(2, 0, 0);\r\n\t\tmyScene.items[i].rayScale3d(0.5,0.5,0.5);\r\n\t\tmyScene.items[i].matlNum = 8;\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\t\t// and another sphere. (right side)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_SPHERE;\r\n\t\tmyScene.items[i].rayTranslate3d(-1, 1.8, 0);\r\n\t\tmyScene.items[i].rayScale3d(0.5, 0.5, 0.1);\r\n\t\tmyScene.items[i].matlNum = 4; // use the 3rd material.\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\t} else {\r\n\t\t// now add a sphere.\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_SPHERE;\r\n\t\tmyScene.items[i].rayTranslate3d(0, -1, 0);\r\n\t\tmyScene.items[i].matlNum = 2; // use the 2nd material.\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\t\t// and a cylinder. (left side)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_CYLINDER;\r\n\t\tmyScene.items[i].rayTranslate3d(2, 1, 0);\r\n\t\tmyScene.items[i].rayScale3d(0.3,0.3,0.7);\r\n\t\tmyScene.items[i].matlNum = 3;\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\t\t// and a box. (right side)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_BOX;\r\n\t\tmyScene.items[i].rayTranslate3d(-1.2, 2.0, 0);\r\n\t\tmyScene.items[i].rayScale3d(0.5, 0.5, 0.5);\r\n\t\tmyScene.items[i].matlNum = 4;\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\r\n\t\t// and a cone. (upper side)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_CONE;\r\n\t\tmyScene.items[i].rayTranslate3d(1.0, 1.5, 0);\r\n\t\tmyScene.items[i].rayScale3d(0.3, 0.3, 0.7);\r\n\t\tmyScene.items[i].matlNum = 5;\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\r\n\t\t// and a half sphere. (upper side)\r\n\t\tmyScene.items.push(new CGeom());\r\n\t\tmyScene.items[i].shapeType = GEOM_HALFSPH;\r\n\t\tmyScene.items[i].rayTranslate3d(0.5, 0.5, 0);\r\n\t\tmyScene.items[i].rayScale3d(0.4, 0.4, 0.4);\r\n\t\tmyScene.items[i].matlNum = 6;\r\n\t\tmyScene.itemCount++;\r\n\t\ti++;\r\n\t}\r\n\r\n\t// Now make all our materials\r\n\tmyScene.matterCount = 0;\r\n\ti = 0;\r\n\t// Make a 2-color material for gridplane object:\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_SOLIDTEX;\r\n\t// myScene.matter[i].solidID = SOLID_2DGRID; // grid-plane\r\n\tmyScene.matter[i].solidID = SOLID_CHECKERBOARD; // grid-plane\r\n\tmyScene.matter[i].matlB_ID = 1; // secondary material; matter[1]\r\n\tmyScene.matter[i].xgap = 1.0;\r\n\tmyScene.matter[i].ygap = 1.0;\r\n\tmyScene.matter[i].zgap = 1.0;\r\n\tmyScene.matter[i].penwidth = 0.4;\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(0.0, 0.0, 0.0, 0.0);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(0.0, 0.0, 0.0, 0.0);\t// no ambient\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(0.1, 0.1, 0.1, 1.0);\t// dark green lines\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(0.5,0.5,0.5,1.0);\t\t\t// dull white specular\r\n\tmyScene.matter[i].K_shiny = 10.0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\t// matter[1]: secondary material for matter[0];\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(0.0, 0.0, 0.0, 0.0);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(0.0, 0.0, 0.0, 0.0);\t// no ambient.\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(0.9,0.9,0.9,1.0); // bright gray gap-fill\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(0.5,0.5,0.5,1.0); // dull white specular\r\n\tmyScene.matter[i].K_shiny = 30.0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\t// matter[2]: a red shiny material for sphere A\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_RUBY);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\t// matter[3]: a green shiny material for sphere B\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_EMERALD);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\t// matter[4]: a blue shiny material for sphere C\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_COPPER_SHINY);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\t// matter[5]: a blue shiny material for cone\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_OBSIDIAN);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\r\n\t// matter[6]: a blue shiny material for half sphere\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_BRASS);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\r\n\t// matter[7]: a blue shiny material for sphere A\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_SILVER_SHINY);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\r\n\t// matter[8]: a blue shiny material for sphere B\r\n\tmyScene.matter.push(new CMatl());\r\n\tmyScene.matter[i].matlFlags = BIT_PHONG;\r\n\tmaterial = new Material(MATL_GOLD_SHINY);\r\n\tmyScene.matter[i].K_emi = vec4.fromValues(material.emissive[0], material.emissive[1], material.emissive[2], material.emissive[3]);\r\n\tmyScene.matter[i].K_amb = vec4.fromValues(material.ambient[0], material.ambient[1], material.ambient[2], material.ambient[3]);\r\n\tmyScene.matter[i].K_dif = vec4.fromValues(material.diffuse[0], material.diffuse[1], material.diffuse[2], material.diffuse[3]);\r\n\tmyScene.matter[i].K_spec= vec4.fromValues(material.specular[0], material.specular[1], material.specular[2], material.specular[3]);\r\n\tmyScene.matter[i].K_shiny = material.shiny;// specular exponent\r\n\tmyScene.matterCount++;\r\n\ti++;\r\n\r\n\t// Now make all our lights\r\n\tmyScene.lampCount = 0;\r\n\ti = 0;\r\n\t// Make light 0 - point light attahced to camera:\r\n\tmyScene.lamp.push(new CLight());\r\n\tmyScene.lamp[i].lightType = LAMP_POINT;\r\n\tmyScene.lamp[i].pos = vec4.fromValues(LAMP0.pos.x,LAMP0.pos.y,LAMP0.pos.z,LAMP0.pos.w);\r\n\tmyScene.lamp[i].I_a = vec4.fromValues(LAMP0.amb.r,LAMP0.amb.g,LAMP0.amb.b, 0.0);\r\n\tmyScene.lamp[i].I_d = vec4.fromValues(LAMP0.dif.r,LAMP0.dif.g,LAMP0.dif.b, 0.0);\r\n\tmyScene.lamp[i].I_s = vec4.fromValues(LAMP0.spc.r,LAMP0.spc.g,LAMP0.spc.b, 0.0);\r\n\tmyScene.lampCount++;\r\n\ti++;\r\n\t// Make light 1 - point light:\r\n\tmyScene.lamp.push(new CLight());\r\n\tmyScene.lamp[i].lightType = LAMP_POINT;\r\n\tmyScene.lamp[i].pos = vec4.fromValues(LAMP1.pos.x,LAMP1.pos.y,LAMP1.pos.z,LAMP1.pos.w);\r\n\tmyScene.lamp[i].I_a = vec4.fromValues(LAMP1.amb.r,LAMP1.amb.g,LAMP1.amb.b, 1.0);\r\n\tmyScene.lamp[i].I_d = vec4.fromValues(LAMP1.dif.r,LAMP1.dif.g,LAMP1.dif.b, 1.0);\r\n\tmyScene.lamp[i].I_s = vec4.fromValues(LAMP1.spc.r,LAMP1.spc.g,LAMP1.spc.b, 1.0);\r\n\tmyScene.lampCount++;\r\n\ti++;\r\n}", "title": "" }, { "docid": "a0f5ba001102df553396ccb0524ad743", "score": "0.53395987", "text": "function animate()\n{\n\trenderer.render( scene, camera );\n\t//stats.update();\n}", "title": "" }, { "docid": "39704422e4f1776db458e327bc09a964", "score": "0.5330777", "text": "function onXRFrame(t, frame) {\r\nlet session = frame.session;\r\nlet pose = frame.getViewerPose(xrRefSpace);\r\n\r\nreticle.visible = false;\r\n\r\n// If we have a hit test source, get its results for the frame\r\n// and use the pose to display a reticle in the scene.\r\nif (xrHitTestSource && pose) {\r\n let hitTestResults = frame.getHitTestResults(xrHitTestSource);\r\n if (hitTestResults.length > 0) {\r\n let pose = hitTestResults[0].getPose(xrRefSpace);\r\n reticle.visible = true;\r\n reticle.matrix = pose.transform.matrix;\r\n }\r\n}\r\n\r\nscene.startFrame();\r\n\r\nsession.requestAnimationFrame(onXRFrame);\r\n\r\nscene.drawXRFrame(frame, pose);\r\n\r\nscene.endFrame();\r\n}", "title": "" }, { "docid": "072b31ea93d45e688fc7e88be706e116", "score": "0.53165126", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n onWindowResize();\n\n uniform.u_time.value = clock.getElapsedTime();\n}", "title": "" }, { "docid": "072b31ea93d45e688fc7e88be706e116", "score": "0.53165126", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n onWindowResize();\n\n uniform.u_time.value = clock.getElapsedTime();\n}", "title": "" }, { "docid": "3b5d2b0687043449c4b582c4737849e6", "score": "0.5315814", "text": "function animate() {\n renderer.render(scene,camera);\n requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "cede985a6893908c42f7970988c5c37e", "score": "0.5314109", "text": "function main(){\n\trender(); \t\t\t\t\t\t\t\t\t\t\t// Render the objects in the frame on the canvas\n\tglobal.window.requestAnimationFrame(main);\t\t\t// Call for the next frame.\n}", "title": "" }, { "docid": "ac7fda20682b73eca3e5a4c672b948e3", "score": "0.53139", "text": "init () {\n this.addBackground();\n this.animateBackground();\n }", "title": "" }, { "docid": "1a0c9ccf506779e6e0d9977e5be63324", "score": "0.5310934", "text": "function animate()\n{\n requestAnimFrame(animate);\n\n renderer.render(stage); // render the stage\n}", "title": "" }, { "docid": "f89c3ddd572bf6e0943762a739a24d48", "score": "0.5307878", "text": "function MouseKeyboardVRDisplay(){this.displayName='Mouse and Keyboard VRDisplay (webvr-polyfill)';this.capabilities.hasOrientation=true;// Attach to mouse and keyboard events.\nwindow.addEventListener('keydown',this.onKeyDown_.bind(this));window.addEventListener('mousemove',this.onMouseMove_.bind(this));window.addEventListener('mousedown',this.onMouseDown_.bind(this));window.addEventListener('mouseup',this.onMouseUp_.bind(this));// \"Private\" members.\nthis.phi_=0;this.theta_=0;// Variables for keyboard-based rotation animation.\nthis.targetAngle_=null;this.angleAnimation_=null;// State variables for calculations.\nthis.orientation_=new MathUtil.Quaternion();// Variables for mouse-based rotation.\nthis.rotateStart_=new MathUtil.Vector2();this.rotateEnd_=new MathUtil.Vector2();this.rotateDelta_=new MathUtil.Vector2();this.isDragging_=false;this.orientationOut_=new Float32Array(4);}", "title": "" }, { "docid": "c1f120a568cac0dc28bd04ce5c98829d", "score": "0.5300162", "text": "function processRay(object) {\n\tif (object == null) {\n\t\tdocument.getElementById('ray_info').style.display\t= \"none\";\n\t\treturn;\n\t}\n\tif (object.name.substring(0, 6) != \"POINT_\") {\n\t\tdocument.getElementById('ray_info').style.display\t= \"none\";\n\t\treturn;\n\t}\n\tvar\tcontent\t= \"<table>\";\n\tcontent\t\t+= \"<tr>\";\n\tcontent\t\t+= \"<td>Position: </td>\";\n\tcontent\t\t+= \"<td class='framed'>X: \" + object.orgPos.x + \"</td>\";\n\tcontent\t\t+= \"<td class='framed'>Y: \" + object.orgPos.y + \"</td>\";\n\tcontent\t\t+= \"<td class='framed'>Z: \" + object.orgPos.z + \"</td>\";\n\tcontent\t\t+= \"</tr>\";\n\n\tcontent\t\t+= \"<tr>\";\n\tcontent\t\t+= \"<td>Color: </td>\";\n\tcontent\t\t+= \"<td class='framed'>R: \" + Math.floor(object.material.color.r * 255) + \"</td>\";\n\tcontent\t\t+= \"<td class='framed'>G: \" + Math.floor(object.material.color.g * 255) + \"</td>\";\n\tcontent\t\t+= \"<td class='framed'>B: \" + Math.floor(object.material.color.b * 255) + \"</td>\";\n\tcontent\t\t+= \"</tr>\";\n\n\tcontent\t\t+= \"</table>\";\n\n\tdocument.getElementById('ray_info').style.position\t= \"fixed\";\n\tdocument.getElementById('ray_info').style.display\t= \"block\";\n\tdocument.getElementById('ray_info').style.left\t\t= (20 + mouse.x) + \"px\";\n\tdocument.getElementById('ray_info').style.top\t\t= (20 + mouse.y) + \"px\";\n\tdocument.getElementById('ray_info').innerHTML\t\t= content;\n}", "title": "" }, { "docid": "a477f79d3d84a30c3f3d54ae76a65b49", "score": "0.5295734", "text": "function init() {\n\n drawGlobe();\n}", "title": "" }, { "docid": "cddc97414010762a322878490d995222", "score": "0.52949244", "text": "constructor(guisys: GuiSys) {\n this._borderRadius = null;\n this._borderTopLeftRadius = null;\n this._borderTopRightRadius = null;\n this._borderBottomLeftRadius = null;\n this._borderBottomRightRadius = null;\n this._borderRadiusDirty = false;\n this._transformDirty = true;\n this.YGNode = Flexbox.Node.create();\n /* $FlowFixMe */\n this.UIManager = null;\n this.tag = 0;\n this.rootTag = 0;\n this.surfaceName = null;\n this.children = [];\n this.parent = null;\n this.props = {};\n this.style = {\n layoutOrigin: [0, 0],\n };\n this.interactableCount = 0;\n this.inSurfaceContext = false;\n this.mouseInteractableCount = 0;\n this.isDirty = true;\n this.receivesMoveEvent = false;\n // renderGroup style property mapping to three.js view\n // as style is declared in the base class with properties,\n // defining of setters must be accomplished with Object.defineProperty\n Object.defineProperty(\n (this.style: any),\n 'backgroundColor',\n ({\n set: value => {\n if (value == null) {\n value = 0;\n }\n this.view.setBackgroundColor(value);\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'opacity',\n ({\n configurable: true,\n set: value => {\n if (value == null) {\n value = 1.0;\n }\n this.view.setOpacity(value);\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'borderColor',\n ({\n set: value => {\n if (value == null) {\n value = 0xff000000;\n }\n this.view.setBorderColor(value);\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'borderRadius',\n ({\n set: value => {\n if (value == null) {\n value = 0.0;\n }\n this._borderRadius = value;\n this._borderRadiusDirty = true;\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'borderTopLeftRadius',\n ({\n set: value => {\n if (value == null) {\n value = 0.0;\n }\n this._borderTopLeftRadius = value;\n this._borderRadiusDirty = true;\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'borderTopRightRadius',\n ({\n set: value => {\n if (value == null) {\n value = 0.0;\n }\n this._borderTopRightRadius = value;\n this._borderRadiusDirty = true;\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'borderBottomLeftRadius',\n ({\n set: value => {\n if (value == null) {\n value = 0.0;\n }\n this._borderBottomLeftRadius = value;\n this._borderRadiusDirty = true;\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'borderBottomRightRadius',\n ({\n set: value => {\n if (value == null) {\n value = 0.0;\n }\n this._borderBottomRightRadius = value;\n this._borderRadiusDirty = true;\n },\n }: Object)\n );\n Object.defineProperty(\n (this.style: any),\n 'renderGroup',\n ({\n set: value => {\n if (value == null) {\n value = false;\n }\n this.view && (this.view.renderGroup = value);\n },\n }: Object)\n );\n INTERACTION_CALLBACKS.forEach(element => {\n Object.defineProperty(\n this.props,\n element.toString(),\n ({\n set: value => {\n if (this.props['_' + element] !== value) {\n this.interactableCount += value ? 1 : -1;\n if (IS_MOUSE_INTERACTION_CALLBACKS[element]) {\n this.mouseInteractableCount += value ? 1 : -1;\n this.view && this.view.setIsMouseInteractable(this.mouseInteractableCount > 0);\n }\n if (element === 'onMove') {\n this.receivesMoveEvent = !!value;\n }\n this.view && this.view.setIsInteractable(this.interactableCount > 0);\n this.view && this.view.forceRaycastTest(this.interactableCount > 0);\n this.props['_' + element] = value;\n }\n },\n }: Object)\n );\n });\n this.view = null;\n }", "title": "" }, { "docid": "d73af38926015feca20ebd6b0365e319", "score": "0.5292469", "text": "function init() // Initialization\n{\n\n\tWINDOW_NameSpace.container = document.createElement('div');\n\tdocument.body.appendChild(container);\n\n\tinitCamera();\n\tinitScene();\n\tinitControl();\n\tinitLighting();\n\tinitMaterials();\n\tinitRenderer();\n\n\tclock = new THREE.Clock();\n\n\tgenerateFloor();\n\tgenerateStuff();\n\n\tagentList = [];\n\tgenerateAgents();\n\n\tinitStats();\n\n\twindow.addEventListener('resize', onWindowResize, false);\n\n}", "title": "" }, { "docid": "3b9f5531f9123cbd99f9f57c5ea496f9", "score": "0.5291141", "text": "function animate() {\n\n requestAnimationFrame( animate )\n renderer.render( scene, camera )\n\n}", "title": "" }, { "docid": "3b9f5531f9123cbd99f9f57c5ea496f9", "score": "0.5291141", "text": "function animate() {\n\n requestAnimationFrame( animate )\n renderer.render( scene, camera )\n\n}", "title": "" }, { "docid": "c842ab30ab2adc20c61d6257a79225a9", "score": "0.5290121", "text": "function HerbView(herb, x, y, regX, regY) {\n this.sprite = new createjs.Sprite(herb.spriteSheet, \"idle\");\n this.cleared = false;\n this.sprite.x = x;\n this.sprite.y = y;\n this.sprite.regX = regX;\n this.sprite.regY = regY;\n this.sprite.scaleX = this.sprite.scaleY = 2;\n const me = this;\n\n this.idleAnim = function(stage, callback) {\n this.sprite.gotoAndPlay(\"idle\");\n\n // Reset the sprite's position since we took it off the screen during a harvest\n this.sprite.x = x;\n this.sprite.y = y;\n\n if (!this.cleared) {\n stage.addChild(this.sprite);\n }\n safeCall(callback);\n };\n\n this.degradeAnim = function(stage, callback) {\n createjs.Tween.get(this.sprite).to({x: -regX, y: -regY}, 2000, createjs.Ease.getElasticInOut(2, 5)).call(function() {\n stage.removeChild(me.sprite);\n safeCall(callback);\n });\n };\n\n this.depleteAnim = function(stage, callback) {\n this.sprite.gotoAndPlay(\"die\");\n callback();\n };\n\n this.interactAnim = function(stage, event, callback) {\n\n if (notNull(callback)) {\n this.sprite.on('animationend', function() {\n safeCall(callback)\n }, null, true);\n }\n\n if (event.type == eventType.IMMEDIATE) {\n this.sprite.gotoAndPlay(\"water\");\n } else if (event.type == eventType.DELAYED) {\n this.sprite.gotoAndPlay(\"grow\");\n }\n };\n\n this.getOnScreenAssets = function() {\n return [this.sprite];\n }\n}", "title": "" }, { "docid": "81e41833bd30077fad98c5dba591e284", "score": "0.5287994", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "50b1221d8382cde5e652fa2170800449", "score": "0.5286054", "text": "init() {\n\t\t'use strict';\n\t\tthis.createRenderer();\n\t\tthis.createScene();\n\n\t\tthis.clock = new THREE.Clock;\n this.clock.start();\n\n\n\t\twindow.addEventListener(\"keydown\", KeyDown);\n window.addEventListener(\"keyup\", KeyUp);\n\t}", "title": "" }, { "docid": "46d3bffe101382f3efee1514c5b7d5d3", "score": "0.5277854", "text": "function init() {\n look();\n }", "title": "" }, { "docid": "59cbf67cba3129493d3c3c13ece56749", "score": "0.5276775", "text": "function startAnimation () {\n if (!rafActive) {\n rafActive = true\n rafId = requestAnimationFrame(updateAnimation)\n }\n}", "title": "" }, { "docid": "a6931cc6b2ecfff388c1e14e30403b50", "score": "0.52755934", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "d3f947e7d31c73956e5f08fd081ddb76", "score": "0.5275517", "text": "function animate() {\n\n // Calls the Animation Method again\n requestAnimationFrame(animate);\n \n // Updates the Trackball Controls\n controls.update();\n\n // Updates the Stats (Statistics for the Rendering Process)\n stats.update();\n\n}", "title": "" }, { "docid": "cd8b15adf032eee8f830ebe6756d2a0f", "score": "0.52656764", "text": "start() {\n if (this.scenes[0]) {\n this.scenes[0].setup();\n }\n window.requestAnimationFrame(this.onFrame.bind(this));\n }", "title": "" }, { "docid": "3a23cfb71f660af0c825a7937916dc4b", "score": "0.52642447", "text": "initCallback() {\n this._renderLayer.renderer = this._integrator.renderer;\n this._contextInitCallback();\n this._renderLayer.dataframes.forEach(d => d.bind(this._integrator.renderer));\n this.requestMetadata();\n }", "title": "" }, { "docid": "86954a220b5c3fbf5924c4ba78b13859", "score": "0.5260883", "text": "function init() {\n\n var container = document.getElementById( 'container' );\n scene = new THREE.Scene();\n // scene.background = new THREE.Color( 0xffffff );\n clock = new THREE.Clock();\n\n // set up PerspectiveCamera\n camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );\n camera.position.set(0, 100, 0);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n //\n grid = new THREE.GridHelper( 200, 20, 0xffffff, 0xffffff );\n // scene.add( grid );\n\n // set up renderer\n renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true});\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize( window.innerWidth, window.innerHeight );\n container.appendChild( renderer.domElement );\n\n //\n raycaster = new THREE.Raycaster();\n raycaster.params.Points.threshold = threshold;\n\n //\n stats = new Stats();\n container.appendChild( stats.dom );\n\n //\n controls = new THREE.OrbitControls( camera, renderer.domElement );\n\n window.addEventListener( 'resize', onWindowResize, false );\n document.getElementById('container').addEventListener( 'mousemove', onDocumentMouseMove, false );\n document.getElementById('container').addEventListener( 'mousedown', onDocumentMouseDown, false );\n document.getElementById('container').addEventListener( 'mouseup', onDocumentMouseUp, false );\n document.addEventListener( 'mousemove', updateMouse, false );\n document.getElementById( 'save' ).addEventListener( 'click', write_frame_out, false );\n document.getElementById( 'move' ).addEventListener( 'click', moveMode, false );\n document.getElementById( 'move2D' ).addEventListener( 'click', move2DMode, false );\n document.addEventListener(\"keydown\", onKeyDown2); //or however you are calling your method\n document.addEventListener(\"keyup\", onKeyUp2);\n // document.getElementById( 'record' ).addEventListener( 'click', toggleRecord, false );\n\n window.onbeforeunload = function(evt) {\n return true;\n }\n app = new App();\n app.init();\n}", "title": "" }, { "docid": "d8c15a3cb02b2461194424e7e0d381a6", "score": "0.5254317", "text": "function LaserBeamActor() {\r\n}", "title": "" }, { "docid": "0b81d23599e6a0adb9e39d935c3fdf45", "score": "0.5249883", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n // plane.rotation.y += 0.01;\n onWindowResize();\n uniforms.u_time.value = clock.getElapsedTime();\n}", "title": "" }, { "docid": "4f70fbe593a9979e73b30466fb5e2427", "score": "0.5249118", "text": "function init() {\n \n \n \n /* set up the screen. The screen object is defined in the cosmoutils\n * script. */\n display = new Screen();\n display.reSize();\n display.doAngles();\n \n /* set listener to resize the display when window changes */\n window.onresize = function(event) {display.reSize();};\n \n /* initial settings */\n running = true; // animation is running\n elapse = 0; // elapse time is zero at start\n lastTime = 0; // no previous timestamp\n rate = pi2/100000; // initial run rate 20 seconds per year\n drawOrbits = true; // draw orbits and lines\n showNames = true; // show object names\n mouseDown = 0; // no mouse presses\n \n /* create planets. The setUpPlanets() function must be provided by the \n * script file containing details of the diagram to be generated. It \n * should perform all the on-time set-up actions prior to starting\n * the animation. */\n setUpPlanets();\n \n /* start animation */\n requestAnimationFrame(show);\n}", "title": "" }, { "docid": "b0b1f70b5d35b547019024ce897c2af4", "score": "0.5248067", "text": "run () {\n window.requestAnimationFrame(this.run.bind(this), this.getCanvasElement())\n\n if (this.redrawScene !== false) {\n // console.log('run')\n this.update()\n this.draw()\n }\n\n this.redrawScene = false\n }", "title": "" }, { "docid": "63d63c334b266e15af88fe7f9ae4083d", "score": "0.52431613", "text": "static AddToScene(obj) {\r\n scene.add(obj);\r\n this.Render();\r\n }", "title": "" }, { "docid": "4ba5f2a5cba5df6aadd91bc860ab5c68", "score": "0.52284175", "text": "enterSession() {\n this.updateProperties()\n this.controllerEls = document.querySelectorAll('*[webxr-motion-controller]');\n\n let glCanvas = document.createElement(\"canvas\");\n let gl = glCanvas.getContext(\"webgl\", { xrCompatible: true });\n this.onAnimationFrame = this.onAnimationFrame.bind(this)\n\n navigator.xr.requestSession(\"immersive-vr\", this.el.systems['webxr'].sessionConfiguration)\n .then((xrSession) => {\n console.log(\"Sess\", xrSession);\n this.xrSession = xrSession\n gl.makeXRCompatible().then(() => {\n // The content that will be shown on the device is defined by the session's\n // baseLayer.\n xrSession.updateRenderState({ baseLayer: new XRWebGLLayer(xrSession, gl) });\n });\n xrSession.requestReferenceSpace(\"local\").then((xrReferenceSpace) => {\n console.log(\"space\", XRReferenceSpace);\n xrSession.requestAnimationFrame((time, xrFrame) => {\n this.firstFrame(xrFrame)\n });\n });\n });\n }", "title": "" }, { "docid": "b34f24627463178f22017136cb943950", "score": "0.52221775", "text": "function animate(timestamp) {\n\trequestAnimationFrame(animate);\n\trenderer.render(stage);\n}", "title": "" }, { "docid": "9d8c51df85e48f15b443cd3bb1243e0b", "score": "0.5220908", "text": "start()\n {\n this.renderer.bindShader(this.shader);\n }", "title": "" }, { "docid": "64a15f20ea7154439f3f159290d95078", "score": "0.5216893", "text": "animation(){\n }", "title": "" }, { "docid": "e0c1c56fe6e18776dd87158414b222e4", "score": "0.52058727", "text": "function animate() {\n // render\n controls.update();\n renderer.render(scene, camera);\n statsyay.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "title": "" }, { "docid": "aa66a3e48bac4621efe4dac65c9bde2e", "score": "0.5205285", "text": "function animate() {\n renderer.setAnimationLoop(render);\n}", "title": "" } ]
56670c99603a804042f2389fdd0fd1f0
Get an array of properties that you want to store
[ { "docid": "d8952578e618c7b2a9bc2dd64260b0eb", "score": "0.6503266", "text": "getPreferencesProperties() {\n return this.preferenceProperties.slice();\n }", "title": "" } ]
[ { "docid": "71e47b0cd38603dc7ab8034b95051356", "score": "0.74572885", "text": "static get properties () {\n\t\treturn [\n\t\t\t...this.access,\n\t\t\t...this.activate,\n\t\t\t...this.ammunition,\n\t\t\t...this.area,\n\t\t\t...this.bulk,\n\t\t\t...this.cast,\n\t\t\t...this.cost,\n\t\t\t...this.duration,\n\t\t\t...this.effect,\n\t\t\t...this.frequency,\n\t\t\t...this.onset,\n\t\t\t...this.prerequisites,\n\t\t\t...this.price,\n\t\t\t...this.range,\n\t\t\t...this.requirements,\n\t\t\t...this.savingThrow,\n\t\t\t...this.shieldData,\n\t\t\t...this.targets,\n\t\t\t...this.traditions,\n\t\t\t...this.traditionsSubclasses,\n\t\t\t...this.trigger,\n\t\t\t...this.category,\n\t\t\t...this.usage,\n\t\t]\n\t}", "title": "" }, { "docid": "486117e336be17df822c42778255dc24", "score": "0.7035782", "text": "get propValues() {\n let result = []\n if (this.props)\n for (let id in this.props) result.push([+id, this.props[id]])\n return result\n }", "title": "" }, { "docid": "98a3b2f6e4d1976edbe33ab3ee861ff3", "score": "0.69875747", "text": "persistentValues() {\n var self = this._self || this;\n var names = self.persistentProperties();\n var values = [];\n names.forEach(function(name) { \n values.push(self[name]);\n });\n return (values);\n }", "title": "" }, { "docid": "e91409dbd63cb8572d8e2d33d749c665", "score": "0.68122435", "text": "get properties() {\n return getPropertiesObject();\n }", "title": "" }, { "docid": "a34a9002a1350604f2ad468101b428b0", "score": "0.6560864", "text": "get properties() { return this._properties; }", "title": "" }, { "docid": "45a84d624c22eeef92e90bb66a4d1912", "score": "0.6531951", "text": "function getPropList(list) {\n window.miew = new window.Miew({});\n const { miew } = window;\n return miew && JSON.stringify(miew.constructor[list].all.map((entry) => ({\n id: Array.isArray(entry.id) ? entry.id[0] : entry.id,\n name: entry.prototype ? entry.prototype.name : entry.name,\n })));\n }", "title": "" }, { "docid": "d5346f6797d828f2e2385aede4fe22dc", "score": "0.6513222", "text": "function getProperties () { return $.extend(true, {}, properties); }", "title": "" }, { "docid": "1b8225792294985771928393d19ec69f", "score": "0.6448669", "text": "get properties() {\n return this._properties;\n }", "title": "" }, { "docid": "f10aa28d792b7b3adc139657df0f718c", "score": "0.64375573", "text": "async getImmutableProperties() {\n return [];\n }", "title": "" }, { "docid": "b95019876e0e9edc1d3493da7630026c", "score": "0.6436715", "text": "static get properties() {\r\n return {\r\n };\r\n }", "title": "" }, { "docid": "2cec2752cc34f2f668be2a5a02393bb9", "score": "0.6423469", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "b4164110fc499fe8971e445de32f5171", "score": "0.6415812", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "e75bd34894572596c4e362c585a1f012", "score": "0.638891", "text": "function arrFromObj(props){\n let arr = [];\n// eslint-disable-next-line\n Object.keys(props).map(function (s) { arr.push(props[s]) });\n return arr;\n}", "title": "" }, { "docid": "40c91e88dd0f4e22b565bb679119ba84", "score": "0.63823164", "text": "data () {\n let data = {}\n for (let property in this.original) {\n data[property] = this[property]\n }\n\n return data\n }", "title": "" }, { "docid": "045455521b1232fffb2a4bd51b30956e", "score": "0.6378467", "text": "get properties() {\n return SPInstance(this, \"properties\");\n }", "title": "" }, { "docid": "31475b6afb41b1819696e6ca1e3b823d", "score": "0.6347529", "text": "get rawValues() {\n var ret = {};\n Object.keys(propertyInformation).forEach(function (key) {\n ret[key] = _get(key);\n });\n return ret;\n }", "title": "" }, { "docid": "cdf32d51e9647dcf68808f13f7ce5df9", "score": "0.6314808", "text": "getProps(){\n let properties = new ValueMap();\n let propWalker = this;\n\n while(propWalker.__type<0x10){\n for(let [k,v] of propWalker.__props){\n properties.set(k,v);\n }\n propWalker = propWalker.getProp(\"__proto__\");\n };\n return properties;\n }", "title": "" }, { "docid": "eee8b696ce8db814513e1660da72da1a", "score": "0.6297979", "text": "get allProperties() {\n return SPInstance(this, \"allproperties\");\n }", "title": "" }, { "docid": "5ae25376f702a3ec7bb7aca992032543", "score": "0.6289269", "text": "static get properties() {\n return {\n \n };\n }", "title": "" }, { "docid": "346e8f150a13a7e1d3cc69601c66a622", "score": "0.6288416", "text": "data() {\n const data = {}\n for (const property of this.fields) {\n data[property.name] = property.value\n }\n return data\n }", "title": "" }, { "docid": "804a77d68c676aaee6488e01b6fa9301", "score": "0.6267116", "text": "properties(){}", "title": "" }, { "docid": "0781c10e06ef9b1b9a3840e833c164ba", "score": "0.62651294", "text": "static getProperties(properties) {\n let list = [];\n for (const property in properties) {\n if (properties[property] !== void 0) {\n list.push(`${property.toLowerCase()}=\"${this.escape(properties[property])}\"`);\n }\n }\n return list.join(' ');\n }", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "187bf1dca275e68f3566b6feab4f1d5e", "score": "0.625064", "text": "function h$allProps(o) {\n var a = [], i = 0;\n for(var p in o) a[i++] = p;\n return a;\n}", "title": "" }, { "docid": "f592b2eba5d5b5c04bf14606106aa38b", "score": "0.6242943", "text": "function getProperties(props) {\n\t\tvar re = [];\n\n\t\t$.each(props, function(key) {\n\t\t\tkey = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n\t\t\tkey = $.transit.propertyMap[key] || $.cssProps[key] || key;\n\t\t\tkey = uncamel(key); // Convert back to dasherized\n\n\t\t\t// Get vendor specify propertie\n\t\t\tif (support[key])\n\t\t\t\tkey = uncamel(support[key]);\n\n\t\t\tif ($.inArray(key, re) === -1) { re.push(key); }\n\t\t});\n\n\t\treturn re;\n\t}", "title": "" }, { "docid": "2758427cc6716c3ed457f55f8254852c", "score": "0.6222982", "text": "function extractProperty(array, property) {\n var properties = [];\n for (var i = 0, len = array.length; i < len; i++) properties.push(array[i][property]);\n return properties;\n }", "title": "" }, { "docid": "567b7fe54da4dab371298d48407f3470", "score": "0.62219226", "text": "function getData(d, property) {\n x = [];\n for (var i = 0; i < d.length; i++) {\n x.push(d[i].properties[property]);\n }\n\n return x;\n}", "title": "" }, { "docid": "01ae8b2d19a1be132e6867e9e9abcc35", "score": "0.62082016", "text": "array(){\n let arr = [];\n for (let key in this.set){\n arr.push(key);\n }\n return arr;\n }", "title": "" }, { "docid": "682dec3d3f6935df948fc9dceab53f9a", "score": "0.62050384", "text": "static get properties() {\n return {\n id: {\n attribute: 'tableid',\n type: String\n },\n subscriptions: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n prependTemplates: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n appendTemplates: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n headers: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n dataKeys: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n remoteUrl: {\n attribute: 'remoteurl',\n type: String\n },\n storeDataKey: {\n attribute: 'storedatakey',\n type: String\n },\n derivation: {\n attribute: 'derivation',\n type: String\n },\n primaryKeyColumn: {\n attribute: 'primarykeycolumn',\n type: String\n }\n }\n }", "title": "" }, { "docid": "f2373cc9f1c786d913b1d751cd3795cd", "score": "0.6200814", "text": "async function getPropertyValues(prop){\n let propValues=[];\n let bodies = await getAllBodiesFromPages();\n for (let i=0;i<bodies.length;i++){\n propValues.push(bodies[i][prop])\n }\n return await propValues;\n}", "title": "" }, { "docid": "29022045badfc2511ea53b67edb13055", "score": "0.61957085", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function (key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "29022045badfc2511ea53b67edb13055", "score": "0.61957085", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function (key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "31e90a58ab3e580a346cad854052a0e8", "score": "0.6173805", "text": "static get properties() {\n\t\treturn {\n\t\t\taddress : {\n\t\t\t\ttype : Object,\n\t\t\t\tvalue : { address : \"\", name : \"\"},\n\t\t\t},\n\t\t\tpeoplelist : {\n\t\t\t\ttype : Array,\n\t\t\t\tobserver : '_onPeopleListChanged'\n\t\t\t},\n\t\t\treadonly : {\n\t\t\t\ttype : Boolean,\n\t\t\t\tvalue : true\n\t\t\t},\n\t\t\tshowcopy : {\n\t\t\t\ttype : Boolean,\n\t\t\t\tvalue : true\n\t\t\t},\n\t\t}\n\t}", "title": "" }, { "docid": "02db43d860d1d1c289be4a2705929913", "score": "0.61557704", "text": "get() {\n const values = {};\n this.each((spring, key) => values[key] = spring.get());\n return values;\n }", "title": "" }, { "docid": "ab2f996d14f9dec5a1f2575e64d4b1e0", "score": "0.61494", "text": "static get properties() {\n return {\n subscriptions: {\n type: Array,\n converter: value => value ? value.split(',') : []\n }\n }\n }", "title": "" }, { "docid": "6a65c95743853353b0ddd8c32404f5b5", "score": "0.6135278", "text": "serialize() {\n return _.mapValues(this, prop => prop.get());\n }", "title": "" }, { "docid": "13328759f79e7368e4502935337045fb", "score": "0.6127132", "text": "get properties() {\n\t\treturn [\"allowDrag\",\"animation\",\"applyMode\",\"customOperations\",\"disabled\",\"dropDownWidth\",\"fields\",\"fieldsMode\",\"formatStringDate\",\"formatStringDateTime\",\"getDynamicField\",\"icons\",\"locale\",\"localizeFormatFunction\",\"messages\",\"operatorPlaceholder\",\"propertyPlaceholder\",\"rightToLeft\",\"showIcons\",\"theme\",\"unfocusable\",\"value\",\"valueFormatFunction\",\"valuePlaceholder\"];\n\t}", "title": "" }, { "docid": "141e31a590b647fc0425fcde9ea7f88f", "score": "0.61095315", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "91e73784ba819b1c9daa659e098e4b65", "score": "0.6102274", "text": "data() {\n let data = {};\n\n for (let property in this.originalData) {\n data[property] = this[property];\n }\n\n return data;\n }", "title": "" }, { "docid": "91e73784ba819b1c9daa659e098e4b65", "score": "0.6102274", "text": "data() {\n let data = {};\n\n for (let property in this.originalData) {\n data[property] = this[property];\n }\n\n return data;\n }", "title": "" }, { "docid": "91e73784ba819b1c9daa659e098e4b65", "score": "0.6102274", "text": "data() {\n let data = {};\n\n for (let property in this.originalData) {\n data[property] = this[property];\n }\n\n return data;\n }", "title": "" }, { "docid": "2c1b46b1e583cdd4a222770f1a61f185", "score": "0.6093334", "text": "properties() {\n return this._properties;\n }", "title": "" }, { "docid": "6b69ce03c02f74c3524271ea943016fe", "score": "0.6092818", "text": "static get properties() {\n return {\n cols: {\n type: Array,\n value: []\n },\n pl: Object,\n item: Object\n };\n }", "title": "" }, { "docid": "5cea2553ccc43942146439fe4c58cf9f", "score": "0.6090971", "text": "function getArray (data, property) {\n\tvar delimiter = '|',\n\t\tarray = [],\n\t\tvalues = [],\n\t\titem = {},\n\t\tsubKey = '';\n\n\tproperty += '/';\n\n\tfor (var key in data) {\n\t\tif (key.startsWith(property)) { \n\t\t\tsubKey = key.replace(property, '');\n\t\t\tvalues = data[key].toString().split(delimiter);\n\n\t\t\tfor (let i = 0; i < values.length; i++) {\n\t\t\t\tif (values[i] !== '') {\n\t\t\t\t\titem = {};\n\t\t\t\t\titem[subKey] = values[i];\n\t\t\t\t\tarray.push(item);\n\t\t\t\t} \n\t\t\t} \n\t\t}\n\t}\n\n\treturn array;\n}", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.60698617", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.60698617", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.60698617", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0f1dad69c95fa79daaad2db0957c87b5", "score": "0.60698617", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "0981c1d8263b20f34cd7354b80fb7fe8", "score": "0.6065859", "text": "function createProperties(count) {\n const arr = new Array(); \n for (let i = 0; i < count; i += 1) {\n arr[i] = i;\n }\n\n return arr.map((x) => ({ id: x, title: 'Test Property' }));\n}", "title": "" }, { "docid": "397586cf78c98238d42caa373c88d154", "score": "0.6050884", "text": "function pluck(list, propertyName) {\n var new_array = list.map(function( v, i ){\n return v[propertyName];\n })\n return new_array;\n}", "title": "" }, { "docid": "9e0dc7921f1e39a63c39b764b02f9521", "score": "0.60500246", "text": "data() {\n let data = {};\n\n for (let property in this.originalData) {\n data[property] = this[property];\n }\n\n return data;\n }", "title": "" }, { "docid": "18c7a9ae6ef802960405568eaddf4186", "score": "0.6046514", "text": "getObjectRepresentation() {\n\n \t\tretVal = {};\n\n \t\tfor(let [property, value] of this._propertyRepository.entries())\n \t\t\tretVal[property] = value;\n\n\n \t\treturn retVal;\n \t}", "title": "" }, { "docid": "d384a189121961d009958e77287b248d", "score": "0.6042528", "text": "function getPizzaArray(nameOfThePropertyIWant){\n var answer = [];\n\n for(var i = 0; i < allPizzas.length; i++){\n answer[i] = allPizzas[i][nameOfThePropertyIWant];\n }\n console.log('name of the property i want ',answer);\n return answer;\n}", "title": "" }, { "docid": "7b1c3df2433f999f0a3612b6cea35827", "score": "0.6028542", "text": "buscaProprietarios() {\n let proprietarios = [];\n for (let i = 0; i < this.proprietarios.length; i++) {\n proprietarios.push({...this.proprietarios[i]});\n }\n\n return proprietarios;\n }", "title": "" }, { "docid": "9ea7036180bdb4ef3215e1d9528c9d89", "score": "0.60200536", "text": "function getAllPropValues(array, prop) {\n \"use strict\";\n // Write code under this line\n const propValues = [];\n for (let i = 0; i < array.length; i += 1) {\n if (prop in array[i]) {\n propValues.push(array[i][prop]);\n }\n }\n return propValues;\n}", "title": "" }, { "docid": "a083f42a2427c064c5f654be25b76b97", "score": "0.6013346", "text": "function getProperties(props) {\r\n var re = [];\r\n\r\n jQuery.each(props, function(key) {\r\n key = jQuery.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = jQuery.transit.propertyMap[key] || jQuery.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherized\r\n\r\n if (jQuery.inArray(key, re) === -1) { re.push(key); }\r\n });\r\n\r\n return re;\r\n }", "title": "" }, { "docid": "d42f48af7fbce2fde56dcaf4eb543476", "score": "0.60111594", "text": "function getProperties(props) {\r\n var re = [];\r\n\r\n $.each(props, function(key) {\r\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherized\r\n\r\n if ($.inArray(key, re) === -1) { re.push(key); }\r\n });\r\n\r\n return re;\r\n }", "title": "" }, { "docid": "d42f48af7fbce2fde56dcaf4eb543476", "score": "0.60111594", "text": "function getProperties(props) {\r\n var re = [];\r\n\r\n $.each(props, function(key) {\r\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherized\r\n\r\n if ($.inArray(key, re) === -1) { re.push(key); }\r\n });\r\n\r\n return re;\r\n }", "title": "" }, { "docid": "1cc4d37d1336bd80e89d5e04d97d419a", "score": "0.60073954", "text": "static get properties() {\n return {\n peli: { type: Object}\n };\n }", "title": "" }, { "docid": "8a3cb7cfe348e2cd514a2c644254eb49", "score": "0.5996797", "text": "get properties() {\n\t\treturn [\"animation\",\"autoFocusOnMouseenter\",\"checkable\",\"checkboxes\",\"checkMode\",\"dataSource\",\"disabled\",\"displayLoadingIndicator\",\"displayMember\",\"dropDownAppendTo\",\"dropDownOverlay\",\"dropDownPosition\",\"enableMouseWheelAction\",\"filterable\",\"filterInputPlaceholder\",\"filterMode\",\"grouped\",\"itemsMember\",\"loadingIndicatorPlaceholder\",\"loadingIndicatorPosition\",\"locale\",\"localizeFormatFunction\",\"messages\",\"minimizeIconTemplate\",\"minimizeWidth\",\"overflow\",\"readonly\",\"rightToLeft\",\"scrollMode\",\"theme\",\"unfocusable\",\"valueMember\"];\n\t}", "title": "" }, { "docid": "e0ec4e35ca58dddee58d96f072b52ff4", "score": "0.59909356", "text": "get myProperties() {\n return Profiles(this, \"getmyproperties\");\n }", "title": "" }, { "docid": "cce28699a48456bb72f0723a30b104df", "score": "0.5980554", "text": "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "title": "" }, { "docid": "83a614a5ae0df13dcc624dcbf21fa1df", "score": "0.59770924", "text": "function field( objects, property_name ) {\n var result = [];\n for ( var i=0; i<objects.length; i++ ) {\n result.push( objects[i][property_name] );\n }\n return result;\n}", "title": "" }, { "docid": "bc45094355ff181df0e5d646378d76b0", "score": "0.5967529", "text": "function getInfo(arr, property){\n var i = 0;\n var charArr = [];\n while(i < arr.length){\n charArr.push(arr[i][property])\n i++\n } \n return charArr;\n}", "title": "" }, { "docid": "c4b594d799d50c715cdc4f0636b1c85a", "score": "0.59512204", "text": "getPropertyNames() {\n const names = [];\n let currentObject = this;\n while ('__properties' in currentObject) {\n if (core_helpers_1.hasOwnProperty(currentObject, '__properties')) {\n const currentNames = Object.getOwnPropertyNames(currentObject.__properties);\n names.unshift(...currentNames);\n }\n currentObject = Object.getPrototypeOf(currentObject);\n }\n return Array.from(new Set(names));\n }", "title": "" }, { "docid": "63b4889faf7754287193f864016594a3", "score": "0.5951084", "text": "properties() {\n return this._db.request({ path: `/_api/view/${this.name}/properties` }, (res) => res.body);\n }", "title": "" }, { "docid": "4b5ecfe8d00daca7b4c7b738aec5948c", "score": "0.59482306", "text": "function generatePropertyList(properties){\n return properties.join('\\n');\n }", "title": "" }, { "docid": "72e4ee4be9f790e4ddc0cbacfd2fffc4", "score": "0.5947643", "text": "function _getPropertyMap(properties)\n {\n var propertyMap = [];\n var serverProperties = [];\n if (!Array.isArray(properties))\n {\n serverProperties.push(properties);\n }\n else \n {\n serverProperties = properties;\n }\n $.each(serverProperties, function(name, value)\n {\n var propertyName = '';\n var popertyValue = '';\n $.each(this, function(propName, value)\n {\n if (propName === 'key')\n {\n propertyName = value;\n }\n if (propName === 'value')\n {\n propertyValue = value;\n }\n });\n propertyMap[propertyName] = propertyValue;\n });\n return propertyMap;\n }", "title": "" }, { "docid": "162d1864af20a03b564d1011a52f0c6a", "score": "0.59476286", "text": "static get properties() {\n return {\n foo: String,\n whales: Number,\n auth0Options: Object\n }\n }", "title": "" }, { "docid": "807323040dac05d0af71f3426aac7819", "score": "0.59474885", "text": "static get properties() {\n return {\n data: {\n type: Object\n }\n };\n }", "title": "" }, { "docid": "5dc1e379f42d1f1e3fa81ddcec5a4f00", "score": "0.5943439", "text": "static get properties() {\r\n return {\r\n action: {\r\n type: String,\r\n value: 'List'\r\n },\r\n userData: {\r\n type: Array,\r\n value: []\r\n }\r\n };\r\n }", "title": "" }, { "docid": "8b1e990253c6fce7664ac151ac0784f4", "score": "0.5934583", "text": "static get properties() {\n return {\n jokes_list: {type: ArrayBuffer},\n url: {type :String},\n method: {type: String},\n safe: {type: Boolean},\n initial_page: {type: Boolean}\n };\n }", "title": "" }, { "docid": "64b7862583b8664bb6051f1a767385f7", "score": "0.5915145", "text": "get properties() {\n\t\treturn [\"animation\",\"dataSource\",\"disabled\",\"expandedIndexes\",\"expandMode\",\"locale\",\"localizeFormatFunction\",\"messages\",\"readonly\",\"reorder\",\"rightToLeft\",\"theme\",\"unfocusable\"];\n\t}", "title": "" }, { "docid": "0284fd347a67cac54f3149a595cdf606", "score": "0.5913139", "text": "getItemProperties() {\n const apiUrl = `/item_properties/${this.state.id}`;\n\n service\n .get(apiUrl)\n .then(response => {\n let property_list = response.data.map(property => {\n return {\n property_id: property.property_id,\n value: property.value,\n unit: property.unit,\n name: property.name,\n isNumber: property.number,\n edited: false\n };\n });\n\n this.setState({\n properties: property_list\n });\n this.loadedNewInfo();\n })\n .catch(e => {\n throw e;\n });\n }", "title": "" }, { "docid": "801c6792cc50cc8a8d119557769113b6", "score": "0.5890765", "text": "get propertyNames() {\n return Object.keys(this._properties);\n }", "title": "" }, { "docid": "f3428513685e5e3f158283e393820ccb", "score": "0.5889746", "text": "function populateData(prop) {\n\n //create a variable that will be an empty array that will store and return my prop values\n\n let propertyArray = [];\n\n //loop through \n\n for(let i= 0;i < babyImageArray.length; i++) {\n\n propertyArray.push(babyImageArray[i][prop]);\n\n }\n\n return propertyArray;\n\n}", "title": "" }, { "docid": "53beeaf2ee9685cdd0d42944dcf128dc", "score": "0.58832335", "text": "static get properties() {\n return {\n todoList: { type: Array }\n }\n }", "title": "" }, { "docid": "fba26ba3a3044882affb82ff32117f2e", "score": "0.585837", "text": "_buildPropertyProps(properties = {}) {\n const props = {};\n for (const propertyName in properties) {\n const property = properties[propertyName];\n const propData = NOTION_PAGE_PROPERTIES[property.type];\n\n if (!propData) continue;\n\n props[propertyName] = {\n type: propData.type,\n label: propertyName,\n description: this._buildPropDescription(property.type, propData.example),\n options: propData.options(property),\n optional: true,\n };\n }\n return props;\n }", "title": "" }, { "docid": "45390d41a3e7740c9ed2fdd25e7a745b", "score": "0.5852803", "text": "getPropertyKeys() {\n let properties = this.getProperties();\n let propertyKeys = [];\n if (properties) {\n for (var key in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, key)) {\n propertyKeys.push(key);\n }\n }\n }\n propertyKeys = propertyKeys.sort();\n return propertyKeys;\n }", "title": "" }, { "docid": "e791d59b43d01c6c8c261fd747476cd0", "score": "0.5842971", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = []; // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n\n attributes.push(attr);\n }\n });\n\n return attributes;\n }", "title": "" }, { "docid": "e791d59b43d01c6c8c261fd747476cd0", "score": "0.5842971", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = []; // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n\n attributes.push(attr);\n }\n });\n\n return attributes;\n }", "title": "" }, { "docid": "e791d59b43d01c6c8c261fd747476cd0", "score": "0.5842971", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = []; // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n\n attributes.push(attr);\n }\n });\n\n return attributes;\n }", "title": "" }, { "docid": "b06da056dd91d12fdb5f014460da74d2", "score": "0.5830314", "text": "export() {\n let properties = {\n type: this.constructor.name,\n id: this.id\n };\n let self = this;\n\n this.exportedProperties.forEach(function(property) {\n properties[property] = self[property];\n });\n\n return properties;\n }", "title": "" }, { "docid": "db58d0073b607dd1519224d79f6e8e9b", "score": "0.5824528", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = []; // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n\n attributes.push(attr);\n }\n });\n\n return attributes;\n }", "title": "" }, { "docid": "6a227192c0245e9248ba5bc9fb1ac7b9", "score": "0.5824212", "text": "static get properties() {\n return {\n /**\n * Stores an array of all the players on the page.\n */\n els: {\n type: Array,\n value: []\n }\n };\n }", "title": "" }, { "docid": "1d06597516bd5c45b6b422e8c555fe48", "score": "0.58142424", "text": "static get properties() {\n\t\treturn {\n\t\t\t /**\n\t\t\t * Microsoft OAuth access token. typical returned from azure-oauth2\n\t\t\t */\n\t\t\tauthtoken : {\n\t\t\t\ttype : String,\n\t\t\t\tobserver : '_authCodeChanged'\n\t\t\t},\n\t\t\t /**\n\t\t\t * List of Microsoft Outlook events - meeting, appointments, reminders \n\t\t\t * for the current user populated by getList(). \n\t\t\t * This list is paged\n\t\t\t */\n\t\t\teventlist : {\n\t\t\t\ttype : Array,\n\t\t\t\treflectToAttribute : true,\n\t\t\t\tnotify : true\n\t\t },\n\t\t\t /**\n\t\t\t * Maximum number of user entries to return in a query\n\t\t\t */\n\t\t fetchsize : {\n\t\t\t\ttype : Number,\n\t\t\t\tvalue : 10,\n\t\t },\n\t\t\t /**\n\t\t\t * True if the User List has been successfully fetched and there are additional records to fetch\n\t\t\t */\n\t\t\thasnextpage : {\n\t\t\t\ttype : Boolean,\n\t\t\t\tvalue : false,\n\t\t\t\tnotify : true\n\t\t },\n\t\t /**\n\t\t * List of Microsoft Outlook time zone support on the Exchange server and available to the current user\n\t\t */\n\t\t outlookTimeZones : {\n\t\t\t type : Array,\n\t\t\t reflectToAttribute : true,\n\t\t\t notify : true\n\t\t },\n\t\t\t/**\n\t\t\t * Use this to specify the time zone for start and end times in the response. \n\t\t\t * If not specified, those time values are returned in UTC. Optional.\n\t\t\t * {\n\t\t\t * \t\tname : \"microsoft timezone name\",\n\t\t\t * abbr : \"Standard abbriviation\",\n\t\t\t * offset : \"offset from UTC\"\n\t\t\t * }\n\t\t\t */\n\t\t\ttimezone : {\n\t\t\t\ttype : Object,\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0875afc929c57fc6dbdb5fda8af6bc45", "score": "0.58136135", "text": "getPreferencesData() {\n var properties = this.getPreferencesProperties();\n var numberOfProperties = properties.length;\n var data = new UserGlobalPreferences();\n var property;\n\n for (var i=0;i<numberOfProperties;i++) {\n property = properties[i];\n data[property] = this[property];\n }\n\n return data;\n }", "title": "" }, { "docid": "6f6c36ae246469c8406a2012fa71f438", "score": "0.5812975", "text": "values (type, prop) {\n let data = this[type]\n\n let global = data['*'] && data['*'].values\n let values = data[prop] && data[prop].values\n\n if (global && values) {\n return utils.uniq(global.concat(values))\n } else {\n return global || values || []\n }\n }", "title": "" }, { "docid": "97cf8a32c367c8f04e7f2d9cef71b830", "score": "0.57997733", "text": "getProperties() {\n return this.wrapped.properties != null ? Object.assign({}, this.wrapped.properties) : {};\n }", "title": "" }, { "docid": "e63e7de48ba94f4398e431d4c954b4d1", "score": "0.578441", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }", "title": "" }, { "docid": "e63e7de48ba94f4398e431d4c954b4d1", "score": "0.578441", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }", "title": "" }, { "docid": "e63e7de48ba94f4398e431d4c954b4d1", "score": "0.578441", "text": "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }", "title": "" }, { "docid": "cc7bf9d2ff65cbcf4684e593134ce729", "score": "0.57843345", "text": "async containedProperties() {\n let type = await self.type();\n return type ? type.contents.containedProperties() : [];\n }", "title": "" }, { "docid": "831181730cb2ea2e4b50b0708dbc5759", "score": "0.5781719", "text": "function getProperties(doc) {\n var props = [];\n var _module = doc.children[0];\n var _class = _module.children[0];\n _class.children.forEach(c => {\n if (c.kindString === \"Property\") {\n props.push(c.name);\n }\n })\n return props;\n}", "title": "" } ]
80d968c86e151f9adb16ca61593efa1a
make changes to current timer when needed
[ { "docid": "e226a5d75933e215fa90ef7aaf2d8cee", "score": "0.0", "text": "function update(section) {\n $(section).empty();\n \n if(section == \"#bl\"){\n $(section).append(breakLength);\n } else {\n $(section).append(sessionLength);\n }\n \n //update if the tomato is showing a old number\n if(isSession) {\n $(\"#time\").empty();\n $(\"#time\").append(sessionLength);\n i = sessionLength * 60;\n } else {\n $(\"#time\").empty();\n $(\"#time\").append(breakLength);\n i = breakLength * 60;\n }\n }", "title": "" } ]
[ { "docid": "8a2e4b16461d44340e6ecb3d1bd2e0a4", "score": "0.70488346", "text": "timerStart(){\n clock = setInterval(this.updateTimer , 1000)\n this.timer = 15\n $(\"#timer\").html(this.timer)\n }", "title": "" }, { "docid": "071ea938ad40bbcad308b06cab5d49e2", "score": "0.7035823", "text": "function startTimer() {\n time--;\n timer.html(time);\n }", "title": "" }, { "docid": "96b55de7490757d0da0c7c567413fcac", "score": "0.7031716", "text": "function _timer() {\n shouldContinue? setTimeout(_clock, 1000) : timer.innerHTML = \"00:00\";\n}", "title": "" }, { "docid": "ad019f6f2de7cd2122dbf982d17e7ff3", "score": "0.6956683", "text": "function controlTimer() {\n if (!game.runTimer) {\n intervalId = setInterval(decrimentTimer, 1000);\n game.runTimer = true;\n decrimentTimer();\n }\n }", "title": "" }, { "docid": "c104fcc2c8e663011971fef3c237fbeb", "score": "0.69540733", "text": "setTimer(state, time){\n state.timeWork = time.work,\n state.timeShortPause = time.shortPause,\n state.timeLongPause = time.longPause,\n state.timeLeft = time.timeLeft,\n state.stateOfSession = time.stateOfSession,\n state.numberOfCurrentSession = time.numberOfCurrentSession\n state.numberOfFirstSession = time.numberOfCurrentSession\n }", "title": "" }, { "docid": "4333bed8c1f3e0c3b58215ef614bb706", "score": "0.69149995", "text": "function setTimer() {\n\tif($('#countdown').hasClass('work')) {\n\t\t$('#current-timer').html('Session');\n\t\ttoSeconds(sessionTimer);\n\t\tdisplayTimer();\n\t} else {\n\t\t$('#current-timer').html('Break');\t\n\t\ttoSeconds(breakTimer);\n\t\tdisplayTimer();\n\t}\n\n}", "title": "" }, { "docid": "2b4e05b6e8c3603d1edc748822d51bf4", "score": "0.69100094", "text": "function updateTimer(newVal, oldVal) {\n\t\t// Change class on the timer to change the colour if needed.\n\t\t// See the common.css file for more information.\n\t\tif (oldVal) $(`.timerContainer .timer`).toggleClass('timer_'+oldVal.state, false);\n\t\t$(`.timerContainer .timer`).toggleClass('timer_'+newVal.state, true);\n\n\t\t$(`.timerContainer .timer`).html(newVal.time);\n\n\t\tconst finishTimes = newVal.teamFinishTimes;\n\t\tif (Object.keys(finishTimes).length) {\n\t\t\tfor (let id in finishTimes) {\n\t\t\t\tid = Number(id);\n\n\t\t\t\tconst time = finishTimes[id].time;\n\t\t\t\t$(`.timerContainer[timer-id=${id + 1}] .timer`).html(time).toggleClass('timer_stopped timer_running timer_paused', false).toggleClass('timer_finished', true);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "50a339a022c6df3ce3d208912979ccc7", "score": "0.690461", "text": "function updateTimer(){\r\n\ttimer(function(result){\r\n\t\ta_timer = result;\r\n\t});\r\n}", "title": "" }, { "docid": "2c2cc62a9e6438e05c846f25ee9276f2", "score": "0.6874847", "text": "updateTimer(){\n game.timer--\n $(\"#timer\").html(game.timer)\n console.log(\"Updated Timer to \" + game.timer)\n //time up logic\n if(game.timer == 0) { \n game.timerStop()\n game.displayTimesUpBanner()\n game.numberWrong++\n game.currentQuestion++\n if(game.currentQuestion < game.questions.length){\n game.timeUnitNextQuestion()\n }\n else{game.timeUntilDisplayStats()}\n\n }\n }", "title": "" }, { "docid": "e5f765d5049a62b15eccba65a740a2fd", "score": "0.68745655", "text": "function _setTimer() {\n if (this._timer || this._paused || this._mousePaused) {\n return;\n }\n\n const interval = $$1.getDataset(this._items[this._index], 'uiInterval');\n\n this._timer = setTimeout(\n (_) => this.cycle(),\n interval || this._options.interval,\n );\n }", "title": "" }, { "docid": "73027e8ac7010f101b44d4701e0289bb", "score": "0.6843904", "text": "function setTimer(){\n\n var timerString = leadingZero(timer[0])+\":\"+leadingZero(timer[1])+\":\"+leadingZero(timer[2]);\n theTimer.innerHTML = timerString;\n timer[3]++;\n timer[0] = Math.floor((timer[3]/100)/60);\n timer[1] = Math.floor((timer[3]/100)-(timer[0]*60));\n timer[2] = Math.floor(timer[3]-(timer[1]*100) - timer[0]*6000);\n}", "title": "" }, { "docid": "a63677ec2c432b533a1a40e1ed2eaf55", "score": "0.68176544", "text": "function setTimer() {\n\n\tstartTime = new Date();\n\n\t// Call the actual (main) set time function every 1 second\n\ttimer = setInterval(setTime, 1000);\n}", "title": "" }, { "docid": "34fe843e9c603ac5f8ff70da130eb791", "score": "0.67983013", "text": "startTimer() {\n this.startTime = Date.now();\n this.timer = setInterval(this.update, 10);\n }", "title": "" }, { "docid": "76285e3e821a3bfd09bef19bf2af1f48", "score": "0.6774848", "text": "function startTimer(){\n\t\t//stopTimer();\n\t\tuniversal.timer = 25;\n\t\t$('.timer').html('<h2>Time Remaining: ' + universal.timer + ' seconds</h2>');\n\t\tcounter = setInterval(runTimer, 1000);\n }", "title": "" }, { "docid": "ba1b7cf07b1c1b81f567f81dcbd045dd", "score": "0.6774343", "text": "update() {\n this.timer.startTimer(`overall`);\n this.timer.startTimer(`update`);\n super.update();\n this.timer.stopTimer(`update`);\n }", "title": "" }, { "docid": "0a3855f57a6facecd9518d2586b38e17", "score": "0.6762444", "text": "function setTimer(_time = 20) {\n running = false;\n clearInterval(timeRef) \n timeCount = 20;\n \n}", "title": "" }, { "docid": "928617d13b411081192a7b9a4cdb7343", "score": "0.67428154", "text": "function changeTimer() {\n\tif($('#countdown').hasClass('work') ){\n\t\t$('#countdown').removeClass('work').addClass('rest');\n\t\tsetTimer();\n\t} else {\n\t\t$('#countdown').removeClass('rest').addClass('work');\n\t\tsetTimer();\n\t}\n}", "title": "" }, { "docid": "4df93aea676f26531a2e6571c56dbba1", "score": "0.673912", "text": "function updateTimer() {\n if (timeLeft > 0 && timerEnabled) {\n toggleButton.innerText = formatTime(timeLeft);\n timerInput.placeholder = \"+Time (min)\";\n timeLeft -= 1000;\n } else if (timerEnabled){\n turnOff();\n }\n setTimeout(updateTimer, 1000);\n }", "title": "" }, { "docid": "11dcdc92bb44def7caa2c17c62cf82b5", "score": "0.67371494", "text": "function timeUpdate() {\n if (!model.timerActive) {\n clearInterval(timer);\n } else if (model.mins === 0 && model.seconds === 0) {\n clearInterval(timer);\n model.mins = null;\n model.seconds = null;\n } else if (model.seconds === 0) {\n model.mins--;\n model.seconds = 59; \n } else {\n model.seconds--;\n }\n \n if (model.countdownStep === \"session\") {\n if (model.timerActive && model.mins !== null && model.seconds !== null) {\n elements.timer.innerHTML = model.mins + \":\" + model.seconds; \n } else if (model.timerActive && model.mins === null && model.seconds === null) {\n clearInterval(timer);\n timerController.stepChange();\n timerController.timerActiveSwitch();\n timerController.countdownTimerActivator();\n }\n } else if (model.countdownStep === \"break\") {\n if (model.timerActive && model.mins !== null && model.seconds !== null) {\n elements.timer.innerHTML = model.mins + \":\" + model.seconds; \n } else if (model.timerActive && model.mins === null && model.seconds === null) {\n clearInterval(timer);\n timerController.reset();\n return;\n }\n }\n }", "title": "" }, { "docid": "0e90f859a3fdfb7e473dc65cdfb6127e", "score": "0.67238593", "text": "function Timer(){\n this.time = 0;\n this.start_time = Date.now();\n this.update_time();\n}", "title": "" }, { "docid": "80d48687bb28b4ac6475b2e1000ef61a", "score": "0.67062", "text": "setupTimer() {\n this.start = new Date();\n this.timeEl = document.querySelector('.speaker-controls-time');\n this.clockEl = this.timeEl.querySelector('.clock-value');\n this.hoursEl = this.timeEl.querySelector('.hours-value');\n this.minutesEl = this.timeEl.querySelector('.minutes-value');\n this.secondsEl = this.timeEl.querySelector('.seconds-value');\n // Update once directly\n this._updateTimer();\n // Then update every second\n setInterval(this._updateTimer.bind(this), 1000);\n this.timeEl.addEventListener('click', () => {\n this.start = new Date();\n this._updateTimer();\n return false;\n });\n }", "title": "" }, { "docid": "67269fb3f0e324ec84ddcc475cf60776", "score": "0.6704851", "text": "function startTimer() {\n\n\tclickr.timer = setInterval( changeTimer , 1000);\t\n\n}", "title": "" }, { "docid": "9843977defb82f5fd04e000e8fd4c8e1", "score": "0.67025584", "text": "controlTimer() {\n\t if (this.timerOn == true) {\n\t this.timerOn = false;\n\t document.getElementsByClassName('toggle-button')[0].innerText = 'OFF'\n\t this.cancelTimer();\n\t } else {\n\t\t\t\tthis.timerOn = true;\n\t\t\t\tdocument.getElementsByClassName('toggle-button')[0].innerText = 'ON'\n\t\t\t\tthis.getCampaignStatusSecondary();\n\t\t\t\tthis.getCampaignPercentage();\n\t\t\t\tthis.startTimer();\n\t\t\t\tthis.globalTimout()\n\t }\n\t}", "title": "" }, { "docid": "f25f2243d40ce17e14069a92da8cd2dc", "score": "0.66483927", "text": "function timerSetter() {\n\tif (frameCount % 60 == 0 && timer > 0) {\n\t\ttimer--;\n\t}\n\tif (timer != 0) {\n\t\tfill(251, 214, 42)\n\t\ttextFont(gameFont)\n\t\ttextAlign(RIGHT);\n\t\ttextSize(18);\n\t\ttext(timer + \"s\", width - 30, 40)\n\n\n\n\t}\n\tif (timer <= 0) {\n\t\ttextSize(20);\n\t\ttextAlign(CENTER, CENTER);\n\n\t\twinner = \"shemar\"\n\t\tendGame(winner);\n\t\tif (input.id() == winner) {\n\t\t\ttextFont(gameFont);\n\t\t\ttext(`${input.value().toUpperCase()} WINS`, width / 2, 20)\n\t\t}\n\n\t\tconsole.log(winningPlayerName)\n\t\tnoLoop();\n\t\tlocation.reload(true);\n\t}\n\tif ((timerAdjustInvisible === true && invisibilityCount === 1) || (timerAdjustInvisible === true && invisibilityCount === 2) || (timerAdjustInvisible === true && invisibilityCount === 3)) {\n\t\ttimer++\n\t\ttimerAdjustInvisible = false\n\t}\n\n}", "title": "" }, { "docid": "61de38c3e8ae70a23e280d79630d4916", "score": "0.66351944", "text": "function updateTime() {\n\t\tjambi_timer_minutes = (\"0\" + Number(jambi_timer_minutes)).slice(-2);\n\t\t$($elementMins).text(jambi_timer_minutes);\n\t\tjambi_timer_hours = (\"0\" + Number(jambi_timer_hours)).slice(-2);\n\t\t$($elementHours).text(jambi_timer_hours);\n\t}", "title": "" }, { "docid": "8683245be238497ce65e0101e9ab9956", "score": "0.66251826", "text": "function updateTimer() {\n hemocytometer_stage.update(); /** Stage updation */\n}", "title": "" }, { "docid": "b8dd0d9a2146a0cba5146020f70e8b7c", "score": "0.66210747", "text": "function setGameActiveUpdateTimer() {\n\tvar updateDate = moment();\n\tupdateDate.minutes(moment().minutes() + 5);\n\n\tlogger.info(\"Active game, updating again soon\");\n\tsetUpdateTimer(updateDate);\n}", "title": "" }, { "docid": "eb5a448b4740ed627960d975b029018f", "score": "0.6604503", "text": "function timerGo(){\n\tif (!triviaRunning) {\n\ttimeInterval = setInterval(decreaseTime, 1000); \n\ttriviaRunning = true;\n\t}\n}", "title": "" }, { "docid": "46b9610638c7801e7eb1686a975de261", "score": "0.6601763", "text": "function activeTimer() {\n if ( counter === 0 ) {\n getVMs(); getFeats(); getPrefs(); getDevices();\n setTimeout (function() { counter = 0; }, 10000);\n }; counter++;\n\n clearInterval(ls_timer ); ls_timer = setInterval( getVMs, timing_active['getvms' ] * 1000);\n clearInterval(feats_timer); feats_timer = setInterval(getFeats, timing_active['getfeats'] * 1000);\n clearInterval(prefs_timer); prefs_timer = setInterval(getPrefs, timing_active['getprefs'] * 1000);\n clearInterval(devs_timer ); devs_timer = setInterval(getDevices, timing_active['getdevs'] * 1000);\n}", "title": "" }, { "docid": "b90b7d3b161944f788ab4b08e08ebc94", "score": "0.66002035", "text": "prepareTimerForStart() {\n this.isRunning = true;\n this.minutes -= 1;\n this.seconds = 59;\n this.updateTimeUI();\n }", "title": "" }, { "docid": "5002d25b779c0a5a66781ad19ce52d5e", "score": "0.6598161", "text": "tickTimer() {\n if (this.state.seconds > 0 && !this.state.isCountingUp) {\n this.setState({ seconds: this.state.seconds - 1 })\n } else if (\n this.state.seconds < this.state.selectedTime &&\n this.state.isCountingUp\n ) {\n this.setState({ seconds: this.state.seconds + 1 })\n } else {\n this.finished()\n }\n }", "title": "" }, { "docid": "37c74c6e5b49140dcbab1b069f544485", "score": "0.6577671", "text": "function jambiTimer1(){\n \t// increment minutes\n\t\tif(jambi_timer_seconds >= 59) {\n\t\t\tjambi_timer_seconds = 0;\n\t\t\tjambi_timer_minutes++;\n // update mins\n\t\t\tupdateMinutes();\n\n // increment the hours\n\t\t\tif(jambi_timer_minutes > 59) {\n\t\t\t\tjambi_timer_hours++;\n\t\t\t\tjambi_timer_minutes = 0;\n // update hours\n\t\t\t\tupdateTime();\n\t\t\t}\n\t\t}\n\t\telse {\n \t\t// add 1 to the seconds\n\t\t\tjambi_timer_seconds++;\n\t\t}\n // update seconds\n\t\tupdateSeconds();\n\t}", "title": "" }, { "docid": "f90cd997f6ced1544ebf9e4142245502", "score": "0.6566312", "text": "function beginTimer() {\n if (timer === false){\n controlTimer();\n timer = true;\n }\n }", "title": "" }, { "docid": "8fb0503c218c2958465a6586ee8873b5", "score": "0.65525675", "text": "function timer() {\n\n // no existing finish button? => stop timer\n if ( !finish_elem ) return;\n\n // (re)render timer value\n self.ccm.helper.setContent( timer_elem, self.ccm.helper.html( my.html.timer, timer_value ) );\n\n // countdown\n if ( timer_value-- )\n self.ccm.helper.wait( 1000, timer ); // recursive call\n else\n onFinish(); // finish quiz at timeout\n\n }", "title": "" }, { "docid": "848409293451e5565e78db0e885a388d", "score": "0.6547946", "text": "static thick() {\n Time.frameCounter++;\n let newTime = Date.now();\n let newDeltaTime = newTime - Time.startTime;\n Time.totalTimer += newDeltaTime;\n Time.fixedTime += newDeltaTime;\n Time.startTime = newTime;\n Time.deltaTimer = newDeltaTime;\n }", "title": "" }, { "docid": "4a37c39a817b23b04dc453ec59c4b232", "score": "0.65456975", "text": "function resetTime(){t=0;}", "title": "" }, { "docid": "c5cdc79e692b4d4ced778f227b5bd488", "score": "0.65401584", "text": "function myTimer(){\n\t\t\t\t\tcurrVideo++;\n\t\t\t\t\tswitchVideo();\n\t\t\t\t}", "title": "" }, { "docid": "0d43c7c2397454f3c5b0b0b5df217f89", "score": "0.65354985", "text": "function onTimeUpdate(){\n let set = settings.get_int(\"timer\");\n h = settings.get_int(\"hours-value\");\n m = settings.get_int(\"minutes-value\");\n s = settings.get_int(\"seconds-value\");\n\n if (set === SHUTDOWNONTIME) {\n calculateTime();\n }\n time = (h*3600 + m*60 + s);\n renderTime();\n}", "title": "" }, { "docid": "3960a8b7fa6cf4afa48c6cf168ddb94a", "score": "0.65245134", "text": "function startTimer() {\r\n if (timer !== true) {\r\n intervalTime = setInterval(updateTime, 100);\r\n }\r\n}", "title": "" }, { "docid": "4d60879d82a1e03016370689914e6f8f", "score": "0.6514924", "text": "function updateTimer(timer, time) {\n cetiSec = time % 100;\n if (cetiSec < 10) cetiSec = \"0\" + cetiSec;\n $(timer).children(\"b\").text(Math.floor(time / 100));\n $(timer).children(\"sup\").text(cetiSec);\n return timer;\n}", "title": "" }, { "docid": "6c0cb70d95203eb02cb93c781c0ea8da", "score": "0.6505296", "text": "function startTimer() {\n if (seconds === 120) {\n interval = setInterval(function () {\n seconds--;\n\n renderTime();\n }, 1000);\n }\n }", "title": "" }, { "docid": "7e365db36bff214b8f7f06d8ab27c344", "score": "0.65041524", "text": "function updateTimer() {\n\tif(timerPaused) {\n\t console.log('timer paused');\n\t return;\n\t}\n\n\t// get the elapsed time\n\tvar millisElapsed = Date.now() - startTime;\n\n\tif(currentDuration - millisElapsed <= 0) {\n\t // avoid the timer displaying negative values\n\t $('.timer').text('0.00');\n\t lose();\n\t} else {\n\t var roundedElapsedTime = Math.round((currentDuration-millisElapsed)/10)/100;\n\t $('.timer').text(roundedElapsedTime);\n\t}\n }", "title": "" }, { "docid": "f168c9bc288a1b9f19a31d4c8240056c", "score": "0.6498845", "text": "function setTimer() {\n if (isCounting == false) {\n count = setInterval(startTimer, 1000);\n }\n isCounting = true;\n}", "title": "" }, { "docid": "518c96a87b79696648fc7ef2ab356041", "score": "0.64966726", "text": "function timer() {\n if (data.won) return;\n data.timer++;\n localStorage.setItem('currentTime', data.timer);\n let seconds = data.timer % 60;\n if (seconds < 10) seconds = '0' + seconds;\n let minutes = Math.floor(data.timer / 60);\n document.getElementById('timer').innerHTML = 'Time: ' + minutes + ':' + seconds;\n setTimeout(timer, 1000);\n}", "title": "" }, { "docid": "8f97197f90073c7fc0dd55fc710e5457", "score": "0.6491272", "text": "function resetTimer() {\n\t\ttime = 10;\n\t}", "title": "" }, { "docid": "fea05331b67dd3e32834869eea6b9ebd", "score": "0.6489747", "text": "function setupdatetime(){\n\tif(timeupdate == 60000){\n\t\t$('#settime').text('30s');\n\t\ttimeupdate = 30000;\n\t}else if(timeupdate == 30000){\n\t\t$('#settime').text('20s');\n\t\ttimeupdate = 20000;\n\t}else if(timeupdate == 20000){\n\t\t$('#settime').text('10s');\n\t\ttimeupdate = 10000;\n\t}else if(timeupdate == 10000){\n\t\t$('#settime').text('5s');\n\t\ttimeupdate = 5000;\n\t}else{\n\t\t$('#settime').text('60s');\n\t\ttimeupdate = 60000;\n\t}\n\tclearTimeout(timerchat);\n\ttimerchat = setInterval(\"updatechat()\", timeupdate);\n}", "title": "" }, { "docid": "a52eb65be90a01cab700d620a048040c", "score": "0.64848864", "text": "function setTimer() {\n\n //if 59 seconds have reached 59, the next second will reset seconds to 0 and iterate minutes by 1\n if (seconds === 59) {\n minutes += 1;\n seconds = 0;\n if (minutes === 59) {\n hours += 1;\n minutes = 0;\n }\n }\n\n //else only iterate seconds\n else {\n seconds += 1;\n \n }\n\n //print out updated seconds, minutes and hours to game board\n secondTimer.textContent = timerPadding(seconds, 2);\n minuteTimer.textContent = timerPadding(minutes, 2);\n hourTimer.textContent = timerPadding(hours, 2);\n}", "title": "" }, { "docid": "2a91b97083b2cd89c58a127d774c408e", "score": "0.647742", "text": "function onCurrentTimeChanged() {\r\n updateTime();\r\n updateHand();\r\n }", "title": "" }, { "docid": "af8957572b526055762f9efa79ddd35c", "score": "0.64772546", "text": "function restartTimer() {\n stopTimer();\n startTimer();\n }", "title": "" }, { "docid": "6724b2a99e92ee878b652730cf30a856", "score": "0.6461894", "text": "function updateTime () {\n let mins = Math.floor((timerLen / 1000) / 60)\n let seconds = (timerLen / 1000) % 60\n\n /* these if statements tell us if we need to pad our mins/seconds\n numbers with an extra 0 */\n if (mins < 10) {\n mins = '0' + mins\n }\n\n if (seconds < 10) {\n seconds = '0' + seconds\n }\n\n /* update the time on the doc */\n document.getElementById('time-display').innerHTML = mins + ':' + seconds\n /* if timer hits 0 we make some changes */\n if (timerLen <= 0) {\n // debugger\n clearInterval(timerRef)\n stateChange()\n return\n }\n timerLen -= 1000\n }", "title": "" }, { "docid": "f873e06763ef422a4290e49993cf871d", "score": "0.6461483", "text": "function setupTimer() {\n\n\tstartTime = Date.now();\n\ttimerID = setInterval(\"updateTimer()\", 1000);\n\ttimeLeft = 30000;\n}", "title": "" }, { "docid": "dfdb88716eb0c926754ff8633c43ac34", "score": "0.64602727", "text": "initTimer() {\n this.timer = setInterval(() => {\n this.currTime--;\n if (this.currTime % 10 == 0) {\n this.grid.velocity *= 1.5;\n }\n\n if (this.currTime < 0) {\n this.endGame();\n }\n }, 1000);\n }", "title": "" }, { "docid": "d8e51dcf3ccf410bead62c8f9c8936ed", "score": "0.6449005", "text": "function startTimer() {\n if (stoptime == true) {\n stoptime = false\n timerCycle()\n }\n}", "title": "" }, { "docid": "00c5f5031d914f64f075ff66b0e270be", "score": "0.64480007", "text": "startTimer() {\n var self = this;\n if (!this.interval) {\n this.lastUpdateTime = new Date().getTime();\n this.interval = setInterval(function() {\n var now = new Date().getTime();\n var dt = now - self.lastUpdateTime;\n self.currentTimer += dt;\n var time = new Date(self.currentTimer);\n self.timer.innerHTML = (self.formatTime(time.getMinutes())) + ':' + (self.formatTime(time.getSeconds()))\n self.lastUpdateTime = now;\n }, 1);\n }\n }", "title": "" }, { "docid": "9d045f1fbba93b1099b594283c55a016", "score": "0.644514", "text": "function timerStart() {\n if (!timerRunning) {\n intervalId = setInterval(decrement, 1000); \n timerRunning = true;\n }\n }", "title": "" }, { "docid": "2a4377da69e98944e40bc9343c2bbeb6", "score": "0.6445104", "text": "updateTimer(){\n this.elapsed++;\n this.textTime.text = \"Tiempo: \" + this.elapsed;\n }", "title": "" }, { "docid": "0713b46b19e4d5954ab3d3d05703caa5", "score": "0.6436412", "text": "function startTimer() {\n\ttimerInterval = setInterval(() => {\n\t\ttimePassed = timePassed += 1;\n\t\ttimeLeft = time * 60 - timePassed;\n\t\tdocument.getElementById(\"base-timer-label\").innerHTML = formatTime(timeLeft);\n\n\t\tif (timeLeft === 0) {\n\t\t\tonTimesUp();\n\t\t}\n\t}, 1000);\n}", "title": "" }, { "docid": "8d61d19befe5519f4c969e0d8c95078b", "score": "0.64313716", "text": "function startNewTimer(_id) {\n st.timers[_id] = 0;\n }", "title": "" }, { "docid": "37e9a82b0ab2951c0c9154450318e3a9", "score": "0.64286005", "text": "function startTimer() {\n if (actions > 0){\n ++totalSeconds;\n secondsLabel.innerHTML = pad(totalSeconds % 60);\n minutesLabel.innerHTML = pad(parseInt(totalSeconds / 60));\n }\n else {\n return;\n }\n }", "title": "" }, { "docid": "f8623ee49cc539683b51d108f1f48ea5", "score": "0.64194816", "text": "function updateTimer(time) {\n\n\n if (selectedTraj == null) {\n // We make sure that if no trajectory data are selected, we tell this to the user\n document.getElementById(\"timer\").innerHTML = \"No trajectory data!\";\n } else {\n // Update the timer using the function secondsToHms defined in js/main/misc.js\n document.getElementById(\"timer\").innerHTML = secondsToHms(time);\n }\n\n // Change the handle of the slider to display the current time\n slider.noUiSlider.setHandle(1, time, true);\n\n}", "title": "" }, { "docid": "c3fe460ba73eb31bf74ea95196ca1b65", "score": "0.6418631", "text": "function updatetime(){\r\n timer.innerHTML = new Date();\r\n}", "title": "" }, { "docid": "b497fc46a992e819e138a8febb535d22", "score": "0.64127684", "text": "function runTimer() {\n\tlet currentTime = leadingZero(timer[0]) + \":\" + leadingZero(timer[1]) + \":\" + leadingZero(timer[2]);\n\ttheTimer.innerHTML = currentTime;\n\ttimer[3]++;\n\t\n\ttimer[0] = Math.floor((timer[3]/100)/60);\n\ttimer[1] = Math.floor((timer[3]/100) - (timer[0] * 60));\n\ttimer[2] = Math.floor(timer[3] - (timer[1] * 100) - (timer[0] * 6000));\n\t\n}", "title": "" }, { "docid": "0430acc964ef9906d7b2f95e17bdaa04", "score": "0.64041084", "text": "function setTimer() {\n\ttime = 15;\n\ttimeout = time;\n\t$(\".timer\").html(\"Seconds Remaining: \" + time);\n\tcountdown = setInterval(function() {\n\t\ttime--;\n\t\t$(\".timer\").html(\"Seconds Remaining: \" + time);\n\t\tif (time === -1) {\n\t\t\twrongGuesses++;\n\t\t\tclearInterval(countdown);\n\t\t\ttransition();\n\t\t}\n\t}, 1000);\n}", "title": "" }, { "docid": "e70fb45be85e93489d30389e0077bf60", "score": "0.64017093", "text": "function setBonusTimer(){\n\tvar emptyCell = findRandomEmptyCell(board);\n\tboard[emptyCell[0]][emptyCell[1]] = dict.addTimer;\n}", "title": "" }, { "docid": "a90737abb24b12bc0082f649198abff5", "score": "0.64006305", "text": "handleStartTimer() {\n\t\tthis.incrementer = BackgroundTimer.setInterval(() => this.setState({ secondsElapsed: this.state.secondsElapsed + 1 }), 1000);\n\t}", "title": "" }, { "docid": "00bf034937b52263c66f4dc9d6013e9a", "score": "0.63934934", "text": "setTimer() {\n this.timerId = setInterval(() => this.tick(), this.calculateTempo(this.state.bpm));\n}", "title": "" }, { "docid": "095c92a5fc1c9494a1bfa4ad532be4b8", "score": "0.6391495", "text": "function setNextGameUpdateTimer() {\n\tlogger.info(\"No active game, updating for next game\");\n\n\tvar now = moment();\n\n\tvar tomorrow = moment();\n\ttomorrow.date(now.date() + 1);\n\n\tvar halfDay = moment();\n\thalfDay.hours(now.hours() + 12);\n\n\tvar gameStart = nextGameDate;\n\tgameStart.minutes(gameStart.minutes() + 1);\n\n\tif (nextGameDate > tomorrow) {\n\t\tsetUpdateTimer(halfDay);\n\t} else {\n\t\tsetUpdateTimer(gameStart);\n\t}\n}", "title": "" }, { "docid": "981048f8932f647673c87231fe8f39a2", "score": "0.63811815", "text": "function resetTimer() {\n qTimer = 30;\n shortTimer = 8;\n }", "title": "" }, { "docid": "d52197c13cff806adf72be0ba18f8d80", "score": "0.6378111", "text": "updateTimerTime() {\n this.DOM_ELEMENTS.time.innerHTML = this.getTimerTimeString();\n }", "title": "" }, { "docid": "7ee75113c9092df3fff9b10576a41be0", "score": "0.6372369", "text": "function setTime() {\n timer = setInterval(renderCalendar, 15000);\n }", "title": "" }, { "docid": "0666e2717cdf8e5d459a4183879369e1", "score": "0.63711244", "text": "function updateTimer() {\n time--;\n gameTimerDisplay.setText(time);\n }", "title": "" }, { "docid": "69da0537bdcd7e163b2e758d7744f49b", "score": "0.63666564", "text": "function addToTimer(time) {\n counter = counter + time;\n}", "title": "" }, { "docid": "ade2e5c6873e7cc4cf49787c9a6a2894", "score": "0.6366418", "text": "_startTimer () {\n // Clear previous intervalID and set time-limit for current interval\n clearInterval(this._intervalID)\n this._countdownTime = this._timeLimit\n\n let text = this.shadowRoot.querySelector('#time')\n this._intervalID = setInterval(() => {\n text.textContent = this._countdownTime\n this._countdownTime -= this._timerDecrement\n if (this._countdownTime <= 0) {\n this._lostGame()\n }\n this._countdownTime = this._cropTime(this._countdownTime, this._timeDecimalNr)\n }, this._timerRefreshRate)\n }", "title": "" }, { "docid": "d7167a957d2be3e71804f93fe9c92461", "score": "0.6366265", "text": "function setCurrTime(){\n\tkR.currTime = Date.now() - kR.startTime;\n\treadOutNotes();\n}", "title": "" }, { "docid": "dea2ed2e657a4ca3164b26f46a617904", "score": "0.63626945", "text": "function startTime() {\n if (!isTimerRunning) {\n intervalid = setInterval(decrement, 1000)\n isTimerRunning = true;\n }\n }", "title": "" }, { "docid": "29b112ae1574e61b06e34219686ee6dd", "score": "0.63616836", "text": "handleStartTimer() {\n // Show progress bar and clock\n this.showClock();\n // get endTime and start counting down\n setTimeout(() => {\n const endTime = new Date().getTime() + this.state.time;\n this.setState({ endTime }, () => {\n this.timer = setInterval(\n () => this.getTimeUntilZero(this.state.time, this.state.endTime),\n 100\n );\n });\n }, 500);\n }", "title": "" }, { "docid": "53a59fe690891190fa367f5f45e902fa", "score": "0.63615525", "text": "function initTimer()\n{\n\tif (!timerIsRunning())\n\t{\n\t\tupdateTimer(localStorage['timer-mins']);\n\n\t\t// Fucking moronic hack for displaying minutes on the first\n\t\t// start of the plugin. Read more here (canvas and custom font\n\t\t// load issue):\n\t\t// http://lists.w3.org/Archives/Public/www-style/2010Sep/0775.html\n\t\tvar t = setTimeout(function() {\n\t\t\tupdateTimer(localStorage['timer-mins']);\n\t\t\tclearTimeout(t);\n\t\t}, 150);\n\t}\n\telse\n\t{\n\t\tupdateTimer(timeNow());\n\t}\n}", "title": "" }, { "docid": "8c0971b4367c23adc5e5d21295c3edf7", "score": "0.6355716", "text": "function buildTimer(){\n //timer will always count every second\n intervalFunction = window.setInterval(start, 1000);\n\n /*\n * starts & runs timer. \n */\n function start() {\n if(seconds > 0){ //if time is not yet 0\n changeTime(-1);\n //decrement\n } else { //else\n //time has hit 0, this should never run due to handling in changeTime(), it is merely here just in case.\n quizEnd();\n return;\n }\n }\n }", "title": "" }, { "docid": "a1a3c64d5bb1db5c657d25042d5f5859", "score": "0.6350117", "text": "_startTimer() {\n var self = this;\n this.timerInterval = setInterval(function() {\n self.seconds++;\n document.querySelector(\"div.time\").textContent = Utils.formatTime(\n self.seconds\n );\n }, 1000);\n }", "title": "" }, { "docid": "258959f7dc909761f3eb16a10954a551", "score": "0.63481706", "text": "function timer() {\n\t\tseconds--;\n\t\tif (seconds<0) {\n\t\t\tclearInterval();\n\t\t\treturn\n\t\t} else if (seconds === 0 && qn < Object.keys(questions).length) {\n\t\t\tseconds = 30;\n\t\t\tqn++;\n\t\t\tcurrentQuestion(qn);\n\t\t\treturn\n\t\t}\n\t\t// print out time left on the clock\n\t\t$(\"#time\").html(seconds)\n\t}", "title": "" }, { "docid": "fb4384c4320662d11dded500618c4af3", "score": "0.63478357", "text": "updateSeconds() {\n this.setState(state => ({\n timer: state.timer + 1\n }));\n\n if (this.state.timer === 30) {\n this.gameOverTimeOut();\n clearInterval(this.interval);\n }\n }", "title": "" }, { "docid": "446b6cfed8c5cb590279c27561ed2420", "score": "0.6343654", "text": "function updateTimer(adjust) {\n currentTime = currentTime + adjust > 0 ? currentTime + adjust : 0;\n timeCounter.textContent = currentTime;\n\n if (currentTime === 0) {\n finishQuiz();\n }\n}", "title": "" }, { "docid": "8e19782c6621f2b0595d2fcd4d75e2e1", "score": "0.6341684", "text": "updateTime() {\n this.secondsElapsed++;\n var timeRemaining = 0;\n if (totalTimeAllocated > this.secondsElapsed) {\n timeRemaining = totalTimeAllocated - this.secondsElapsed;\n }\n var formattedTime = this.getFormattedTime(timeRemaining);\n var updateTimeEvent = new CustomEvent(timeUpdatedEventType, { detail: { time: timeRemaining, displayTime: formattedTime } });\n window.dispatchEvent(updateTimeEvent);\n // If the timer has completed, stop execution\n if (timeRemaining == 0)\n this.stop();\n }", "title": "" }, { "docid": "5ecc286a9db70505ac1853e6bbaa1719", "score": "0.6336122", "text": "function updateTimer()\n{\n sec = document.getElementById('timer').innerText\n if(timer)\n {\n if(timeMode == true)\n {\n if(sec == 0){sec = 0}\n else{sec = sec - 1}\n }\n else\n {\n document.getElementById('timer').innerText = 0\n sec++\n }\n document.getElementById('timer').innerText = sec\n if(sec == 0)\n {\n result()\n }\n }\n}", "title": "" }, { "docid": "539b82653af1001b622f569b694f266e", "score": "0.633273", "text": "startTimer () {\n this.getElement('#clock').textContent = '0:0'\n this.startTime = Date.now()\n this.setIntervalId = setInterval(() => {\n this.seconds++\n if (this.seconds === 60) {\n this.seconds = 0\n this.minutes++\n }\n\n this.getElement('#clock').textContent = `${this.minutes}:${this.seconds}`\n }, 1000)\n }", "title": "" }, { "docid": "eedce7e2b2638c427f0b26a55e96df29", "score": "0.6332166", "text": "function setTimer() {\n\n // Set time interval\n var timeInterval = setInterval(function () {\n totalSeconds--;\n setTime();\n // Clear interval once we reach 0\n if (totalSeconds === 0) {\n timerEl.textContent = \"\" + totalSeconds;\n clearInterval(timeInterval);\n // Reset back to 60 seconds\n totalSeconds = 60;\n }\n\n }, 1000);\n}", "title": "" }, { "docid": "2f13997ecc893efeb3eb8cfb936fee52", "score": "0.63317156", "text": "function timerOne(){\n timeCounter = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "8432d4c4cbb91dff46bcce882754dec3", "score": "0.6329731", "text": "_scheduleUpdate() {\n this.stopUpdates(); // stop any existing updates\n this._updateEnabled = true;\n this._timer = setTimeout(this.update.bind(this), this.config.frequency * 1000);\n }", "title": "" }, { "docid": "c256bb41310d0e6865ef5f56bda30282", "score": "0.6329115", "text": "function timer(){\n if (!clockRunning){\n intervalId = setInterval(count, 1000);\n clockRunning = true\n }\n }", "title": "" }, { "docid": "09dec77e31550843d36ca0cd1e670c56", "score": "0.6326968", "text": "function resetTimers() {\n $('.timeRemaining').text(\"30\");\n $('.nextQuestion').text(\"5\");\n }", "title": "" }, { "docid": "c316ecff334ecf4a7d8e5ca1f949a246", "score": "0.6322252", "text": "function runTimer(){\n let currentTime = leadingZero(timer[0]) + \":\" + leadingZero(timer[1]) + \":\" + leadingZero(timer[2]);\n theTimer.innerHTML = currentTime;\n timer[3]++;\n\n timer[0] = Math.floor((timer[3]/100)/60);\n timer[1] = Math.floor((timer[3]/100) - (timer[0] * 60));\n timer[2] = Math.floor(timer[3] - (timer[1] * 100) - (timer[0] * 6000));\n}", "title": "" }, { "docid": "d678843408cdc4f6d0a340c4adbc6fa6", "score": "0.6320987", "text": "timerAnimate() {\n ++this.totalSeconds;\n this.visSeconds.innerHTML = this.pad(this.totalSeconds % 60);\n this.visMinutes.innerHTML = this.pad(parseInt(this.totalSeconds / 60));\n this.visHours.innerHTML = this.pad(parseInt(this.totalSeconds / 3600));\n\n //checkGeneralAlerts();\n }", "title": "" }, { "docid": "7a7bcf2da748502eb95e83dfd128a65b", "score": "0.63203096", "text": "function setTimer(){\n seconds.textContent = \"00\";\n minutes.textContent = \"00\";\n }", "title": "" }, { "docid": "758902165b7c1bae11bf64d666a2cf02", "score": "0.6315461", "text": "startTimer(startingTime){\n\t\tthis.startingTime = Date.now();\n\t}", "title": "" }, { "docid": "6a00457f3ec9028c2fbc0937e64a9ff8", "score": "0.63147885", "text": "function runTimer() {\n let currentTime = leadingZero(timer[0]) + \":\" + leadingZero(timer[1]) + \":\" + leadingZero(timer[2]);\n theTimer.innerHTML = currentTime;\n timer[3]++;\n\n timer[0] = Math.floor((timer[3]/100)/60);\n timer[1] = Math.floor((timer[3]/100) - (timer[0] * 60));\n timer[2] = Math.floor(timer[3] - (timer[1] * 100) - (timer[0] * 6000));\n}", "title": "" }, { "docid": "6a00457f3ec9028c2fbc0937e64a9ff8", "score": "0.63147885", "text": "function runTimer() {\n let currentTime = leadingZero(timer[0]) + \":\" + leadingZero(timer[1]) + \":\" + leadingZero(timer[2]);\n theTimer.innerHTML = currentTime;\n timer[3]++;\n\n timer[0] = Math.floor((timer[3]/100)/60);\n timer[1] = Math.floor((timer[3]/100) - (timer[0] * 60));\n timer[2] = Math.floor(timer[3] - (timer[1] * 100) - (timer[0] * 6000));\n}", "title": "" }, { "docid": "f4fe3d4ece37fe5d5aee1f8855c58e9d", "score": "0.63082093", "text": "function runTimer()\n{\n \n if (active)\n {\n\n const millis = Date.now() - start ; //Total milliseconds since start of timer\n\n updateTimer(millis);\n \n \n var drift = Date.now() - expected;\n\n expected += interval;\n\n setTimeout(runTimer, Math.max(0, interval - drift)); //Account for drift when setting interval\n \n }\n\n}", "title": "" }, { "docid": "7ace05018175b7f09170dd37302d9e52", "score": "0.6305188", "text": "function updatetime() {\n if (runningtime && $('.timer').is(':visible')) {\n $('.timer').text(formatelapsed((new Date).getTime() - starttime));\n setTimeout(updatetime,\n 1001 - (((new Date).getTime() - starttime) % 1000));\n } else {\n runningtime = false;\n }\n}", "title": "" }, { "docid": "3e88926a0ec649fb83acc2e92f59455f", "score": "0.6303965", "text": "function resetTimer() {\n if( cancelTimer ) {\n cancelTimer();\n cancelTimer = null;\n }\n if( start && Date.now() - start > maxWait ) {\n utils.compile(runNow);\n }\n else {\n if( !start ) { start = Date.now(); }\n cancelTimer = utils.wait(runNow, wait);\n }\n }", "title": "" }, { "docid": "3e88926a0ec649fb83acc2e92f59455f", "score": "0.6303965", "text": "function resetTimer() {\n if( cancelTimer ) {\n cancelTimer();\n cancelTimer = null;\n }\n if( start && Date.now() - start > maxWait ) {\n utils.compile(runNow);\n }\n else {\n if( !start ) { start = Date.now(); }\n cancelTimer = utils.wait(runNow, wait);\n }\n }", "title": "" }, { "docid": "cf834cd7c729cfc308f05722eaadc653", "score": "0.63025796", "text": "function startTimer(){\n timerStart = new Date().getTime();\n }", "title": "" } ]
3dcddf3352f1a39b9d194debebdf11d4
Finds and removes the bordertop of the top most element on this page
[ { "docid": "37ab1bbbcb7d6317cc6562edd6cff1a0", "score": "0.7993172", "text": "function removeTopBorder() {\n $('.features-content div').first().css({\n 'border-top': '0px'\n });\n }", "title": "" } ]
[ { "docid": "319f93335c57421485032a335cce5a03", "score": "0.6306857", "text": "top() {\n return (\n this.br.twoPage.coverExternalPadding +\n this.br.twoPage.coverInternalPadding\n ); // $$$ + border?\n }", "title": "" }, { "docid": "b4c00e30fa94154ae6ed8ca8473f64ff", "score": "0.6186856", "text": "get_offset_top(element) {\n return (this.get_offset(element)).top;\n }", "title": "" }, { "docid": "58043c097d15d331a6129e2a329d45e4", "score": "0.6075753", "text": "function moveToTopOff (){\n removeClonedNodes();\n}", "title": "" }, { "docid": "37cdf256cdb6ce1e76f22cca133b5e8d", "score": "0.6030314", "text": "function getOffsetTop(elem){\n var rez = elem.offsetTop;\n while (elem.offsetParent && elem.offsetParent != document.body) {\n elem = elem.offsetParent;\n rez += elem.offsetTop;\n } return rez;\n \n }", "title": "" }, { "docid": "67b7d7d4110018822b03957702bc81ef", "score": "0.60236853", "text": "static getTop(element) {\n return validateArgs(element).top;\n }", "title": "" }, { "docid": "de7ca30aab7a4b691b899bdb56deebfb", "score": "0.6008163", "text": "function setTop(elem) {\n $('.annotations .top.label').each(function () {\n $(this).removeClass('top');\n });\n elem.addClass('top');\n}", "title": "" }, { "docid": "4c654ab3fa51caca751c194aa32fd0ac", "score": "0.58446854", "text": "function topPos(el) {\n\treturn doPosLoop(el, \"Top\");\n}", "title": "" }, { "docid": "fb293816f2ac879f2df47b3b2744b33c", "score": "0.58240694", "text": "function removeLastBorder(){\n\n}", "title": "" }, { "docid": "6292b414d0fad4daf40246d75910930a", "score": "0.58195996", "text": "function euIdObjTop(euObj){\r\n\t\t var ret = euObj.offsetTop;\r\n\t\t while ((euObj = euObj.offsetParent)!=null)\r\n\t\t ret += euObj.offsetTop;\r\n\t\t return ret;\r\n\t\t}", "title": "" }, { "docid": "3ee6b2b28c1cf6d2edc52b8ea9231ae3", "score": "0.5783197", "text": "function findPos(obj) {\r\n var curtop = 0;\r\n var bodyBorder=-document.body.offsetTop||document.body.clientTop;\r\n if (navigator.userAgent.indexOf(\"MSIE\")!=-1) { curtop-=8 } \r\n if (obj.offsetParent) {\r\n do {\r\n curtop += obj.offsetTop;\r\n } while (obj = obj.offsetParent);\r\n }\r\n return curtop+bodyBorder;\r\n}", "title": "" }, { "docid": "cfc2f7a1541db857a0bb97e3a75c9331", "score": "0.5768458", "text": "function getAbsoluteTop(elem) {\n return elem.getBoundingClientRect().top;\n }", "title": "" }, { "docid": "e3a6e9a7eb5ec9798e24fef47aebe967", "score": "0.57488704", "text": "static top(node) {\n var top = 0;\n do {\n top += node.offsetTop;\n node = node.offsetParent;\n } while (node && node.tagName.toLowerCase() != 'body');\n return top;\n }", "title": "" }, { "docid": "273d613d2d2386a09c3e13a342da7524", "score": "0.57377267", "text": "function getAbsoluteTop(elem) {\n\t return elem.getBoundingClientRect().top;\n\t}", "title": "" }, { "docid": "273d613d2d2386a09c3e13a342da7524", "score": "0.57377267", "text": "function getAbsoluteTop(elem) {\n\t return elem.getBoundingClientRect().top;\n\t}", "title": "" }, { "docid": "fd18d583a09a10245b10a45e174abed1", "score": "0.5735153", "text": "function getTop(element) {\r\n\tvar sum = element.offsetTop;\r\n\twhile(element = element.offsetParent)\r\n\t\tsum += element.offsetTop;\r\n\treturn sum;\r\n}", "title": "" }, { "docid": "fd18d583a09a10245b10a45e174abed1", "score": "0.5735153", "text": "function getTop(element) {\r\n\tvar sum = element.offsetTop;\r\n\twhile(element = element.offsetParent)\r\n\t\tsum += element.offsetTop;\r\n\treturn sum;\r\n}", "title": "" }, { "docid": "6540e39f10654c12eea9030d2bac572f", "score": "0.57347196", "text": "function setColorToTopBorder(color) {\n\t//check if action is available based on current step\n\tif (checkStep(6)) {\n\t\toptions.topBorderColorName = getColorName(color);\n\t\tmaterials['defaultTopBorder'].color.setHex(color);\n\t\tmaterials['defaultTopBorder'].color.convertSRGBToLinear();\n\t\toptions['topBorderColor'] = color;\n\t\t//update current step number\n\t\tgoToNextStep(7);\n\t\tupdateEditor();\n\t}\n}", "title": "" }, { "docid": "c7c853c86e510e82da59511ac964722b", "score": "0.5720626", "text": "function toTop() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "305942524eac1ffd1f1128e14d99d833", "score": "0.5704432", "text": "function toTop() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n\n }", "title": "" }, { "docid": "6f144fe8b39a8abf45dcabe530002f79", "score": "0.57038426", "text": "function removeSpaceOnTop() {\n $(\".pageheaderdiv1 > h1\").remove();\n}", "title": "" }, { "docid": "b5eda417e48c80141710b91ddf4091e8", "score": "0.569697", "text": "function top50() {\n var a = $('.top-50'),\n b = a.innerHeight(),\n c = b / 2;\n a.css({\n 'margin-top': -c,\n 'position': 'relative',\n 'z-index': 99\n });\n }", "title": "" }, { "docid": "27e0202eea0ce8b7cdb223434f2343c6", "score": "0.5681293", "text": "function toTop(newTop) {\n\n// Set the two dom addresses, one for the old top \n// element and one for the new top element \n\n domTop = document.getElementById(top).style;\n domNew = document.getElementById(newTop).style;\n\n// Set the zIndex properties of the two elements, and\n// reset top to the new top\n\n switch(top){\n case \"regtext1\": domTop.zIndex = \"1\"; break;\n case \"regtext2\": domTop.zIndex = \"2\"; break;\n case \"regtext3\": domTop.zIndex = \"3\"; break;\n case \"regtext4\": domTop.zIndex = \"4\"; break;\n case \"regtext5\": domTop.zIndex = \"5\"; break;\n case \"regtext6\": domTop.zIndex = \"6\"; break;\n case \"regtext7\": domTop.zIndex = \"7\"; break;\n case \"regtext8\": domTop.zIndex = \"8\"; break;\n }\n\t \n domNew.zIndex = \"10\";\n top = newTop;\n}", "title": "" }, { "docid": "53df793e3ff3760faa2e08f91fdb9eba", "score": "0.5668576", "text": "function cssStyleGetBorderTopWidth()\n{\n return xbToInt(this.getEffectiveValue('borderTopWidth'));\n}", "title": "" }, { "docid": "afc5b79cf5ead8a314d71cc2e040cbdd", "score": "0.564284", "text": "function getAbsoluteTop(elem) {\n return elem.getBoundingClientRect().top;\n}", "title": "" }, { "docid": "a661276229e9b5ed742fe84d7c70bd15", "score": "0.56424725", "text": "function getPositionTop(element) {\n var offset = 0;\n while (element) {\n offset += element.offsetTop;\n element = element.offsetParent;\n }\n return offset;\n }", "title": "" }, { "docid": "df624cdb245bb0d3eb01f92299151392", "score": "0.5638303", "text": "function toTop() {\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTop = 0;\r\n}", "title": "" }, { "docid": "efe58bf5e2ce44af70af8b46cb7153ba", "score": "0.5634248", "text": "function toTop() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "290e8bf5d10586a1b0c1949648ead02f", "score": "0.56280476", "text": "function curTop(obj){\r\n\ttoreturn = 0;\r\n\twhile(obj){\r\n\t\ttoreturn += obj.offsetTop;\r\n\t\tobj = obj.offsetParent;\r\n\t}\r\n\treturn toreturn;\r\n}", "title": "" }, { "docid": "76cd0d534cd979976def46b10b2dd892", "score": "0.5612067", "text": "function overTopItem(el) {\n\twith (el.style) {\n\t\t//background = \"buttonface\";\n\t\t//background = \"#006666\";\n\t\tborderLeft = \"0px solid buttonhighlight\";\n\t\tborderRight = \"0px solid buttonshadow\";\n\t\tborderTop = \"0px solid buttonhighlight\";\n\t\tborderBottom = \"0px solid buttonshadow\";\t\t\n\t\tpaddingBottom = \"2px\";\n\t\t//color = \"#FFFF00\"\n\t}\n}", "title": "" }, { "docid": "4a1f231cac69f34283078afc7814196c", "score": "0.5601609", "text": "function topHeight(){\n const height = original_height - (e.pageY - original_mouse_y);\n if (height > minimum_size) {\n element.style.height = height + 'px'\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px'\n }\n }", "title": "" }, { "docid": "d5d3886024e1012727c2cd2168992610", "score": "0.55937296", "text": "function clearTopMess() {\n topMessage('',false,'');\n }", "title": "" }, { "docid": "c94b01b4a8ade80de2a15d6b4139cce8", "score": "0.5589931", "text": "function curTop(obj){\n\ttoreturn = 0;\n\twhile(obj){\n\t\ttoreturn += obj.offsetTop;\n\t\tobj = obj.offsetParent;\n\t}\n\treturn toreturn;\n}", "title": "" }, { "docid": "e252e1e765553936dfe35b388298f3ff", "score": "0.5580019", "text": "function clean_up_top_lefts(){\n let ws_kids = Array.from(workspace_id.children) // copy the kids list\n let top_left_spacer_since_last_block = false\n for(let elt_in_ws of ws_kids) {\n if(elt_in_ws.classList.contains(\"top-left-spacer\")) {\n if (top_left_spacer_since_last_block) { remove_dom_elt(elt_in_ws) } //2 spacers in a row\n top_left_spacer_since_last_block = true\n }\n else if(elt_in_ws.classList.contains(\"bottom-left-spacer\")){ //might be out of order, alawys remove hten always add at end\n remove_dom_elt(elt_in_ws)\n }\n else if(elt_in_ws.classList.contains(\"block-top-left\")){\n if (!top_left_spacer_since_last_block){\n workspace_id.insertBefore(make_top_left_spacer(), elt_in_ws)\n }\n top_left_spacer_since_last_block = false\n }\n }\n workspace_id.appendChild(make_bottom_left_spacer())\n}", "title": "" }, { "docid": "f4f19f926020d260f10e03a1e2699637", "score": "0.5569019", "text": "function topPosition(target) {var top = 0;if(target.offsetParent) {while(1) {top += target.offsetTop;if(!target.offsetParent) {break;}target = target.offsetParent;}} else if(target.y) {top += target.y;}return top;}", "title": "" }, { "docid": "69ab4d87a1431a2cad391332a263276c", "score": "0.5555748", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "69ab4d87a1431a2cad391332a263276c", "score": "0.5555748", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "0d72aa2435acc03a26c90f01097c69dc", "score": "0.5554464", "text": "function _getTopOffset(el, header) {\n var el = el || false;\n var header = header || true;\n var offset = 0;\n if (el && $(el).length > 0) {\n offset = Math.ceil($(el).offset().top);\n var diff = Math.ceil(parseFloat($(el).css('margin-top')) + parseFloat($(el).css('border-top-width')));\n if (diff > 0) offset -= diff;\n if (header && $('#_header').length > 0) offset -= _headerOffset;\n }\n return offset;\n}", "title": "" }, { "docid": "f04e2e0098282f55dc749c246c4d2aa6", "score": "0.5536801", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "d1ca375282039e6ec638053db44ce14c", "score": "0.55365705", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "e4872e37576ebf8b87c2726118b92c16", "score": "0.55343056", "text": "set top(value) {\n this._top = value;\n this.element.css('top', value);\n }", "title": "" }, { "docid": "bbc91ba8084f7e5d3d2f576be343d56c", "score": "0.55297077", "text": "function toTop(){\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "f5808b8cb1087e0aae0a7795acb9be45", "score": "0.5523497", "text": "function getOffsetTop(obj) {\n\tvar top = 0;\n\tif (obj.offsetParent) {\n\t\tdo {top += obj.offsetTop}\n\t\twhile (obj = obj.offsetParent);\n\t}\n\treturn top;\n}", "title": "" }, { "docid": "6b9e7ec9ad61233f92354c7857b48510", "score": "0.55174935", "text": "function get_top_position(row) {\r\n\t\treturn (row*row_height)+'px';\r\n\t}", "title": "" }, { "docid": "4565d7f654694144099bacaa71a14ff3", "score": "0.5516822", "text": "function boxTop(idBox) {\n\t var boxOffset = $(idBox).offset().top;\n\t return boxOffset;\n\t}", "title": "" }, { "docid": "0f436cfa34a7d580c92489669726d5ca", "score": "0.55143934", "text": "function addBorderTop(){\n console.time('addBorderTop');\n for(var col=2; col<trDataJson[1].h.length-1; col++) {\n var clFlag = 0;\n for(var row=2; row<trDataJson.length; row++) {\n var cl = trDataJson[row].h[col].c;\n if(cl.indexOf('creation-bg') > -1) {\n clFlag++;\n if(clFlag == 1) {\n if(trDataJson[row].h[col].h.indexOf('border-light-top') < 0) {\n var position = trDataJson[row].h[col].h.indexOf('=\"') + 2;\n trDataJson[row].h[col].h = trDataJson[row].h[col].h.substr(0, position)\n + ' border-light-top ' + trDataJson[row].h[col].h.substr(position);\n //$(\".center-div table.fixed-left-column tr:eq(\" + row + \") td:eq(\" + col + \") :first-child\").addClass('border-light-top');\n //console.log(row+' - '+col+' - '+$(\".center-div table.fixed-left-column tr:eq(\"+row+\") td:eq(\"+col+\") :first-child\").attr('class'));\n }\n } else {\n trDataJson[row].h[col].h = trDataJson[row].h[col].h.replace('border-light-top', '');\n trDataJson[row].h[col].c = trDataJson[row].h[col].c.replace('border-light-top', '');\n //$(\".center-div table.fixed-left-column tr:eq(\"+row+\") td:eq(\"+col+\") :first-child\").removeClass('border-light-top');\n //console.log(row + ' - ' + col + ' '+clFlag+' === ' + trDataJson[row].h[col].h.indexOf('border-light-top'));\n }\n } else {\n clFlag = 0;\n }\n }\n }\n console.timeEnd('addBorderTop');\n}", "title": "" }, { "docid": "629596d9635702f424ff8f5f0d597ec3", "score": "0.55130714", "text": "function getBoundingBoxTop (elem) {\n // use the native SVG interface to get the bounding box\n var bbox = elem.getBBox();\n // return the center of the bounding box\n return bbox.y + bbox.height;\n}", "title": "" }, { "docid": "4ecc3f2889f2b8b278072430c2590321", "score": "0.5511513", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "4ecc3f2889f2b8b278072430c2590321", "score": "0.5511513", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "4ecc3f2889f2b8b278072430c2590321", "score": "0.5511513", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "0bf1445df79dda4f481fac6121bc4b0d", "score": "0.54971457", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "85f5b6d64f364dc33a8465347c074824", "score": "0.5492026", "text": "function retrieve_top_node() {\r\r\n\t \r\r\n return top_level_nodes = nodes_in_canvas.filter(\r\r\n function(n){\r\r\n if( !n.animationParent ) return n;\r\r\n });\r\r\n}", "title": "" }, { "docid": "c41b9755e381b37dd4851bb823480bee", "score": "0.5491496", "text": "function drawTop() {\n stack.push(modelViewMatrix);\n\n rotateAboutSelfY(topElement);\n\n flattenMVMatrix();\n\n drawElement(topElement);\n\n maintainHierarchy();\n\n rotateOppositeSelfY(topElement);\n\n flattenMVMatrix();\n\n drawConnectors(topElement, middleElements[0], middleElements[1]);\n\n // These lines make it so the shadow rotates in the proper direction\n rotateAboutSelfY(topElement);\n rotateAboutSelfY(topElement);\n\n drawShadows(topElement, mobileLevels.top);\n}", "title": "" }, { "docid": "7d69b8e03b6bff69e98b9665ea44d51a", "score": "0.5489633", "text": "function getTargetTop(elem){\r\n\t\t\t\r\n\t\t\t//gets the id of the section header\r\n\t\t\t//from the navigation's href e.g. (\"#html\")\r\n\t\t\tvar id = elem.attr(\"href\");\r\n\r\n\t\t\t//Height of the navigation\r\n\t\t\tvar offset = 75;\r\n\r\n\t\t\t//Gets the distance from the top and \r\n\t\t\t//subtracts the height of the nav.\r\n\t\t\treturn $(id).offset().top - offset;\r\n\t\t}", "title": "" }, { "docid": "3466c72b1569a00115a042fb7cd3ee37", "score": "0.5486746", "text": "function upB() {bird.css('top', parseInt(bird.css('top')) - 10);}", "title": "" }, { "docid": "952729f75cf4ef31ee5fff850dd897c1", "score": "0.5485045", "text": "function getOffsetTop(elm){\n\tvar mOffsetTop = elm.offsetTop;\n\tvar mOffsetParent = elm.offsetParent;\n\twhile(mOffsetParent){\n\t\tmOffsetTop += mOffsetParent.offsetTop;\n\t\tmOffsetParent = mOffsetParent.offsetParent;\n\t}\n\treturn mOffsetTop;\n}", "title": "" }, { "docid": "a0aee4841ea7f6531071723ebba84b8f", "score": "0.5472932", "text": "function getOffsetTop(elm) {\n\tvar mOffsetTop = elm.offsetTop;\n\tvar mOffsetParent = elm.offsetParent;\n\twhile(mOffsetParent){\n\t\tmOffsetTop += mOffsetParent.offsetTop;\n\t\tmOffsetParent = mOffsetParent.offsetParent;\n\t}\n\treturn mOffsetTop;\n}", "title": "" }, { "docid": "f6949e8ef1bf61edae0761d0e7d3f48a", "score": "0.5468652", "text": "function headfix() {\n\tif ($('#aa_plugins_tabmsgBox').is(':visible') == true) {\n\t\tif($('#navbar').offset().top < 0) {\n\t\t\t$('#navbar').css('top','50px');\n\t\t\t$('#container.mainnav-lg #mainnav-container').css('top','50px');\n\t\t\t$('#aa_plugins_tab0').css('top', '50px');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f55dd816d5576c1133c4e4d73fc73ff7", "score": "0.5468372", "text": "function getOffsetTop(t) {\n\tvar target = t;\n\tvar top = target.offsetTop;\n\twhile(target.offsetParent) {\n\t\ttarget = target.offsetParent;\n\t\ttop += target.offsetTop;\n\t}\n\treturn top;\n}", "title": "" }, { "docid": "00ebedcc68c5b4728a1d593d4da3ef80", "score": "0.5467694", "text": "function topFunction() {\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTop = 0;\r\n }", "title": "" }, { "docid": "00ebedcc68c5b4728a1d593d4da3ef80", "score": "0.5467694", "text": "function topFunction() {\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTop = 0;\r\n }", "title": "" }, { "docid": "ff68b1f1afffb3609684ab75cfbcc95e", "score": "0.54605055", "text": "function absoluteTop(elem)\n\t{\n\t\tvar offset = elem.offsetTop;\n\t\tvar parent = elem.offsetParent;\n\t\t\n\t\tif (parent.tagName == \"BODY\")\n\t\t{\n\t\t\treturn offset;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn offset + absoluteTop(parent);\n\t\t}\n\t}", "title": "" }, { "docid": "7f701d77ad19aaf46124d3ae2641d690", "score": "0.5453843", "text": "function ToTop() {\n\t$('.WikiaBarWrapper .tools')\n\t\t.append('<li style=\"border:none;float:right;\"><a href=\"#top\">Torna a inizio pagina</a></li>')\n}", "title": "" }, { "docid": "5a49401e64076ea768563a9ca31ca5d7", "score": "0.5453644", "text": "function html_removeRedBorder(html_object)\n{\n $('#' + html_object.id).removeClass('redborder');\n}", "title": "" }, { "docid": "8f188cb51ca74564549f58f2fa725bfa", "score": "0.5451598", "text": "function toTop() {\n document.body.scrollTop = 0; // For Safari\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}", "title": "" }, { "docid": "87e838c32d2a65ae5928a44a3f2678a5", "score": "0.54489607", "text": "function topFunction(){document.body.scrollTop=0,document.documentElement.scrollTop=0}", "title": "" }, { "docid": "c6b22e0abe9b223e54f44d43adb254c9", "score": "0.5447156", "text": "topBlockAt(point) {\n const top = this.topNodeAt(point);\n return top ? this.layout.elementFromNode(top) : null;\n }", "title": "" }, { "docid": "2b9f62a78616daf802b55689b4deaa68", "score": "0.54364276", "text": "function goto_top()\r\n{\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTop = 0;\r\n}", "title": "" }, { "docid": "638a1018eb6780b288045a0e49e32e41", "score": "0.5436248", "text": "function removeFlake() {\n\n let div2 = document.getElementsByTagName('div')\n for(let i = 0; i<div2.length; i++) {\n if(div2[i].getBoundingClientRect().top > innerHeight) {\n document.body.removeChild(div2[i])\n } \n } \n}", "title": "" }, { "docid": "0a75dc8cb4cfcf614a73e90ab8e17723", "score": "0.5435764", "text": "function topFunction() {\n container.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "bc380be677abca952f4b0ed151139a0c", "score": "0.5429165", "text": "function topFunction() {\n window.scrollTo({top: 0, behavior: 'smooth'});\n }", "title": "" }, { "docid": "df5e5e112f78b8106a59f4f91ae5445d", "score": "0.542867", "text": "function top() {\n if (top_page === 1) {\n setTop(0)\n }\n else {\n setTop(1)\n }\n }", "title": "" }, { "docid": "ab45cc2dc808d6de1cdf34c4f0d9b0ca", "score": "0.5426792", "text": "function toTop() {\n document.body.scrollTop = 0; // For Safari\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}", "title": "" }, { "docid": "cbc047f328a16f6b4cd7cfecddbf7518", "score": "0.54232925", "text": "function upTop() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "43264813e1ac97fad5087a37b675f1ec", "score": "0.54146886", "text": "function hideTopDisplay () {\n while (TOP_DISPLAY.firstChild) {\n TOP_DISPLAY.removeChild(TOP_DISPLAY.firstChild);\n }\n}", "title": "" }, { "docid": "108435790ed1c11fb40bc10d93c20f59", "score": "0.5411212", "text": "function topFunction() {\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "407d09c22cfc833fb7a758cc2ce9cd59", "score": "0.54072773", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" }, { "docid": "7b486d77b563da806e79e70bd71b960e", "score": "0.54018927", "text": "function topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}", "title": "" } ]
c533da0f0da57186cf3e1464f6cbc287
unlisten processes with pids
[ { "docid": "68e91ae750c412a58abc56a9e3f77c53", "score": "0.83634716", "text": "unlisten(pids) {\n pids = (pids instanceof Array) ? pids : [pids];\n this.pidList = this.pidList.filter(pid => !pids.includes(pid));\n }", "title": "" } ]
[ { "docid": "1479b41e26eeeb4422a4a88dd85dfdea", "score": "0.6475331", "text": "_detachFromProcess(instance) {\n process.removeListener('exit', instance._endSelf);\n process.removeListener('SIGINT', instance._endSelf);\n process.removeListener('SIGTERM', instance._endSelf);\n process.removeListener('SIGQUIT', instance._endSelf);\n process.removeListener('SIGHUP', instance._endSelf);\n process.removeListener('SIGBREAK', instance._endSelf);\n }", "title": "" }, { "docid": "07a8565b4ccfdfb8269e838c3d062adc", "score": "0.6237559", "text": "unsubscribeFromProcessSignals() {\n if (!this.shutdownCleanupRef) {\n return;\n }\n this.activeShutdownSignals.forEach(signal => {\n process.removeListener(signal, this.shutdownCleanupRef);\n });\n }", "title": "" }, { "docid": "9937f0105b56abc7ad5df1bc2624c23d", "score": "0.606984", "text": "unlistenAll() {\r\n this.bindings.forEach(binding => this.unlisten(binding));\r\n }", "title": "" }, { "docid": "ea166f1a133468aeb7b15ed66cc6da0f", "score": "0.596863", "text": "unlistenAll() {\n super.unlistenAll();\n }", "title": "" }, { "docid": "5e2ab06f2e86924b8f0712301ec1e56f", "score": "0.5922794", "text": "stop() {\n if (this.childProcess) {\n this.childProcess.removeAllListeners();\n this.childProcess.kill('SIGKILL');\n }\n }", "title": "" }, { "docid": "b33778bf03a4cfe8703a79d3ea73acc9", "score": "0.5850549", "text": "function unsubscribe(id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "2091d871cee337fd3b9e2cc7b3c82c12", "score": "0.58423126", "text": "function unsubscribe (id) {\n\t listeners[id] = undefined;\n\t }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "f2eb297c67605189336897ac2996c8ca", "score": "0.58081156", "text": "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "title": "" }, { "docid": "be51c17d260617aeed1ffa4bbb0d7ec0", "score": "0.57912886", "text": "function unsubscribe (id) {\r\n listeners[id] = undefined;\r\n }", "title": "" }, { "docid": "e1f97010e78e91a44061c76ea272a9cb", "score": "0.57695615", "text": "onDestroy() {\n this.unlisten()\n }", "title": "" }, { "docid": "d54d7e097175804ba675ab5db904e1be", "score": "0.5734712", "text": "function kickOffLastFMListener() {\n db.searchProcessByAll(function (error, reply) {\n if(error) {\n return console.log(error);\n }\n var updated = false;\n console.log('Kicking off Last.FM Listeners'.green);\n for(var i = 0; i < reply.rows.length; i++) {\n (function () {\n var processEntry = reply.rows[i].value;\n running(processEntry.pid, function (error, live) {\n console.log('Checking to see if pid ' + processEntry.pid + ' is still running.');\n if(error) {\n return console.log(error);\n }\n if(!live) {\n var listener = spawn('node', [__dirname + '/api/linkAccounts/lastfmListener.js', '-l', processEntry.lastfmUser, '-u', processEntry.username]);\n processArray.push(listener);\n app.set('processArray', processArray);\n console.log(('Running new Last.FM Listener Instance with PID ' + listener.pid).green);\n listener.stdout.on('data', function (data) {\n console.log('stdout: ' + data);\n });\n listener.stderr.on('data', function (data) {\n console.log('Make sure you are not restarting the web server a lot, it makes tons of calls to Last.FM for each process startup.');\n console.log('stderr: ' + data);\n });\n // TODO Need to finish getting the signal catcher for the listeners working.\n listener.on('exit', function (code, signal) {\n console.log(('Closing Process with PID ' + listener.pid).red);\n db.deleteProcessByPid(listener.pid, function (error, reply) {\n if(error) {\n return console.log(error);\n }\n deleteProcessFromList(processArray, listener.pid, function (error) {\n if(error) {\n return console.log(error);\n }\n app.use(function (req, res, next) {\n req.processArray = processArray;\n next();\n });\n });\n });\n });\n var user = {\n _rev: processEntry._rev,\n lastfmUser: processEntry.lastfmUser,\n username: processEntry.username,\n pid: listener.pid\n };\n if(processEntry.username === user.username) {\n updated = true;\n db.insert(childProcesses, processEntry._id, user, function (error) {\n if(error) {\n return console.log(error);\n }\n });\n }\n if(!updated) {\n db.insert(childProcesses, uuid.v4(), user, function (error) {\n if(error) {\n return console.log(error);\n }\n });\n }\n } else {\n console.log(('Process with pid ' + processEntry.pid + ' is still running!').green);\n }\n });\n })();\n }\n });\n}", "title": "" }, { "docid": "45b28576d877b597c8b0c2b61422f1a7", "score": "0.57272077", "text": "function remove() {\n primus.removeListener('error', remove)\n .removeListener('open', remove)\n .removeListener('end', remove)\n .clearTimeout('connect');\n }", "title": "" }, { "docid": "1e65d55997e8997b01da82ca7a15fd5c", "score": "0.5698547", "text": "function clearPid() {\n fs.unlinkSync(pidPath);\n}", "title": "" }, { "docid": "24a9cc8dc80e96f7d16e72d70f4e0f28", "score": "0.5674159", "text": "killProcess (id) {\n let pinfo = this.processTable[id]\n if (!pinfo) return\n this.log.warn(() => `killed ${id}`)\n pinfo.s = C.PROC_KILLED\n pinfo.e = Game.time\n this.interruptHandler.clear(id)\n if (pinfo.p === '') return\n let ids = Object.keys(this.processTable)\n for (let i = 0; i < ids.length; i++) {\n let id = ids[i]\n let pi = this.processTable[id]\n if (pi.pid === pinfo.i) {\n if (pi.status === C.PROC_RUNNING) {\n this.killProcess(id)\n }\n }\n }\n }", "title": "" }, { "docid": "62d7911fe8ddc4135f07e32ec749278c", "score": "0.5631767", "text": "function detach() {\n reverse_proxy.removeListener('close', listeners._r_close);\n reverse_proxy.removeListener('data', listeners._r_data);\n socket.removeListener('data', listeners._data);\n socket.removeListener('close', listeners._close);\n }", "title": "" }, { "docid": "86e72c3230df16479f17068cf0c3151c", "score": "0.56276", "text": "stop (err) {\n if (err) this.log.error('\\n', err.stack)\n this.emit('trails:stop')\n\n this.removeAllListeners()\n process.removeAllListeners('exit')\n process.removeAllListeners('uncaughtException')\n\n const unloadPromises = Object.keys(this.packs).map(packName => {\n const pack = this.packs[packName]\n return pack.unload()\n })\n\n return Promise.all(unloadPromises)\n }", "title": "" }, { "docid": "fa7bb0f9757a0d3dbd8208cbab4a99c3", "score": "0.55552185", "text": "unlistenImage_() {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n }", "title": "" }, { "docid": "fa7bb0f9757a0d3dbd8208cbab4a99c3", "score": "0.55552185", "text": "unlistenImage_() {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n }", "title": "" }, { "docid": "fa7bb0f9757a0d3dbd8208cbab4a99c3", "score": "0.55552185", "text": "unlistenImage_() {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n }", "title": "" }, { "docid": "dfd0e93c6cf5850c285360ba3f7059b2", "score": "0.54627323", "text": "function killSessions(id) {\n\t algorithm_1.each(algorithm_1.toArray(Private.runningSessions), function (session) {\n\t if (session.id === id) {\n\t session.terminated.emit(void 0);\n\t session.dispose();\n\t }\n\t });\n\t }", "title": "" }, { "docid": "3fee6bb6b0adf4fb84af986853df1aaa", "score": "0.545227", "text": "function unsubscribeAll() {\n exports.subscriptions.map((s) => unsubscribe(s));\n}", "title": "" }, { "docid": "9c842c746cd8bfc98f05647c2914cfb0", "score": "0.5441616", "text": "checkProcessesNeedRemoval(processes, mount){\n\t\tconst processIds = processes.map(p => { return p.pid });\n\t\tif(processIds.indexOf(mount.unisonPid) == -1){\n\t\t\tthis.removeItem(mount);\n\t\t\tif(this.checkedIds.indexOf(mount.unisonPid) == -1){\n\t\t\t\tthis.checkedIds.push(mount.unisonPid);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a512945a08ffb6b5881c48b44b827cc4", "score": "0.5440303", "text": "unload() {\n\t\tcluster.removeListener('exit', this.exitHandler);\n\t\tcluster.removeListener('online', this.readyListener);\n\t\tcluster.removeListener('message', this.messageListener);\n\t}", "title": "" }, { "docid": "b33931bf1a00f5e2c148c941e31adbcb", "score": "0.5415918", "text": "_unlisten() {\n const disposalListener = this._disposalListener;\n if (disposalListener) {\n this._disposalListener = undefined;\n disposalListener.dispose();\n }\n }", "title": "" }, { "docid": "d60d55165a3ff3ff29781450a9bf3efe", "score": "0.5405544", "text": "function killKernels(id) {\n\t algorithm_1.each(algorithm_1.toArray(Private.runningKernels), function (kernel) {\n\t if (kernel.id === id) {\n\t kernel.terminated.emit(void 0);\n\t kernel.dispose();\n\t }\n\t });\n\t }", "title": "" }, { "docid": "5a2a9ec9c7f94cafdaff2b7732823483", "score": "0.53953874", "text": "function tryUnfriend(pid) {\n socket.emit('remove friend', {'pid': pid})\n }", "title": "" }, { "docid": "ac16125a6424e23f4c920545378f6e6b", "score": "0.5392422", "text": "stop() {\n //TODO: unsubscribe all\n }", "title": "" }, { "docid": "cd341dbaeda375656c064cbd4d179a7c", "score": "0.5389769", "text": "unlistenImage_() {\n this.imageListenerKeys_.forEach(unlistenByKey);\n this.imageListenerKeys_ = null;\n }", "title": "" }, { "docid": "b9ae3bccd03d05175f77a0c5a847fa05", "score": "0.538317", "text": "stop () { this.worker.send('stopProcess') }", "title": "" }, { "docid": "28ab31ab91cd0377582184cdb3e7e7d0", "score": "0.5377962", "text": "stop() {\n if (this._isStopped) return;\n this._isStopped = true;\n\n // Stop listening for events from the connection.\n this._connection.removeListener('ready', this._boundOnReady);\n this._connection.removeListener('nosub', this._boundOnNoSub);\n\n // Stop listening for events potentially set up by `whenReady`.\n this.removeListener('ready', this._boundWhenReadyResolver);\n this.removeListener('nosub', this._boundWhenReadyRejecter);\n\n // Reset ready functions, we unsubscribe from `ready` and `nosub` events\n this._whenReadyResolveFn = null;\n this._whenReadyRejectFn = null;\n\n this._connection._send({\n msg: 'unsub',\n id: this._id,\n });\n this._connection._removeSubscription(JSON.stringify([this._name].concat(this._params)));\n }", "title": "" }, { "docid": "51b25a172a60d0732b6461240d946127", "score": "0.53647727", "text": "unlistenPeerOnlinePresence(peerID) {\n if (this.ws != null) {\n var cmd = {\n \"unlisten\": {\n \"id\": `unlisten peer ${peerID}`,\n \"peer_id\": peerID\n }\n }\n this.ws.send(JSON.stringify(cmd))\n }\n }", "title": "" }, { "docid": "8a12776312eab42d83fbe10a98b3e153", "score": "0.53431666", "text": "deactivate() {\n if (this.listener) {\n this.listener.unlisten();\n }\n }", "title": "" }, { "docid": "37aa798304ba5bcfd23883e7cbed6b2c", "score": "0.53413075", "text": "killStream () {\n\n // Skip if no stream exists.\n if (!this.stream) { return; }\n\n // Unlink from the internal stream.\n this.internalStream.unpipe(this.stream);\n\n // Close the stream.\n this.stream.end();\n\n }", "title": "" }, { "docid": "6919e687306dfe1d8ce9bdd7c42c8150", "score": "0.5323445", "text": "static stopListeningToAll() {\n Messenger.stopListeningByRegexp(new RegExp(`^${this.name}.`));\n }", "title": "" }, { "docid": "44b87db0c94921ed1e520504fc0228e1", "score": "0.5322499", "text": "stop () {\n this._stop = true;\n this.powershell.kill()\n this.subscribers.end.forEach(subscriber => {\n subscriber.call(this);\n });\n }", "title": "" }, { "docid": "de056ba1678dfed8cd95dca14ab49689", "score": "0.53219366", "text": "destroy() {\n // the line below won't be needed with Node6, it provides\n // a method 'eventNames()'\n const eventNames = Object.keys(this._events);\n eventNames.forEach((event) => {\n this.removeAllListeners(event);\n });\n }", "title": "" }, { "docid": "094e823b84b2876ff66b8991b8d1379d", "score": "0.5313034", "text": "function unplugEach (streams, functions) {\n doOnEach('offValue', streams, functions)\n return\n}", "title": "" }, { "docid": "98a52d876478cd6e92d8b06d8744456d", "score": "0.5306315", "text": "detach() {\n for (let eventKey in AllowedEvents) {\n var eventInfo = this.parseEventKey(eventKey);\n var eventName = eventInfo.eventName;\n\n window.removeEventListener(eventName, this.eventListeners[eventName], true);\n }\n\n this.eventListeners = [];\n }", "title": "" }, { "docid": "24a6ce711cad4766c5bb2ee59dadb403", "score": "0.52986765", "text": "function killKernels(id) {\n algorithm_1.each(algorithm_1.toArray(Private.runningKernels), function (kernel) {\n if (kernel.id === id) {\n kernel.dispose();\n }\n });\n }", "title": "" }, { "docid": "3fdb73ecb9197cf4a1dab539b5c7b5db", "score": "0.52972037", "text": "stopListeningForPosition() {\n socket.off(\"position\");\n socket.off(\"cancel\");\n }", "title": "" }, { "docid": "7552dabdc8e3ff0ac3c0978bce546b18", "score": "0.5282801", "text": "function unhandle (handlers) {\n handlers.forEach((handle) =>\n handle.unsubscribe()\n );\n}", "title": "" }, { "docid": "4616115e8a3b103eb98eaad4a5766890", "score": "0.52820086", "text": "function deactivate() {\n if (process) {\n treeKill(process.pid, 'SIGTERM', function(err) {\n if (err) {\n treeKill(process.pid, 'SIGKILL');\n }\n process = null;\n });\n }\n}", "title": "" }, { "docid": "dcaee05f0d0f24044e0c68933be0905c", "score": "0.5279984", "text": "function stopMapServer() {\n if (mapServerPid) {\n killSpawn(mapServerPid);\n mapServerPid = null;\n }\n}", "title": "" }, { "docid": "cded3ca76d72b232c75314c99243bee4", "score": "0.52765965", "text": "destroy() {\n this.removeDOMListeners()\n this.unsubscribers.forEach(unsub => unsub())\n }", "title": "" }, { "docid": "db695edb10b5fe68707b7f944f9ec2d3", "score": "0.5271544", "text": "stopListeningToAll() {\n const messages = Object.keys(this._callbacks);\n\n for (let i = messages.length - 1; i > -1; i--) {\n this.stopListening(messages[i]);\n }\n }", "title": "" }, { "docid": "f43101ce0c25cd7d5f52f02644fb1bb8", "score": "0.5265801", "text": "function killKernels(id) {\n // Iterate on an array copy so disposals will not affect the iteration.\n Private.runningKernels.slice().forEach(kernel => {\n if (kernel.id === id) {\n kernel.dispose();\n }\n });\n }", "title": "" }, { "docid": "949840e67f39e58469f8c4743bdd2ba4", "score": "0.52646804", "text": "stopChrome() {\n // Debugging line.\n Helper.printDebugLine(this.stopChrome, __filename, __line);\n\n // pids -> process identifiers.\n let pids = [];\n\n try {\n // Grep all processes from chrome.\n let tmp = execSync('pgrep chrome');\n tmp = tmp.toString();\n pids = tmp.split(\"\\n\");\n pids.pop();\n } catch (e) {\n // No catching.\n }\n\n // Execute the command \"pkill chrome\" to kill all chrome processes.\n if (pids.length > 0) execSync('pkill chrome');\n }", "title": "" }, { "docid": "fe2cf19d61d6adc0bcc46e970a9ff9ad", "score": "0.52527267", "text": "stopListeningToAll() {\n this._host.stopListeningToAll();\n }", "title": "" }, { "docid": "6b85b45ff16fc94f6054aad037953ace", "score": "0.52429307", "text": "disconnectedCallback() {\n flexygo.events.off(this, 'process', 'executed');\n }", "title": "" }, { "docid": "d2599ce3aabbd7936956c5f763882c14", "score": "0.5233017", "text": "function unbind(eventHandlers) {\n\t Object.keys(eventHandlers).forEach(function (event) {\n\t eventHandlers[event].forEach(function (handler) {\n\t bbcdotcom.pubsub.off(event, handler);\n\t });\n\t });\n\t}", "title": "" }, { "docid": "2c7394644a87da228bfd585466b287d9", "score": "0.5231561", "text": "stop() {\n // Do not process stop if we already have\n if (!this.get('hasBeenStopped')) {\n this.set('hasBeenStopped', true);\n this.unsubscribe(true);\n this.notify('onStopped');\n }\n }", "title": "" }, { "docid": "6b1fecf46abdd85f75340c3c96a44b57", "score": "0.52212834", "text": "stop() {\n this._running = false;\n this.flush(); // emit a flush to let processors cleanly exit.\n }", "title": "" }, { "docid": "4e12da7bb2a8ddad2879b29835a2bee3", "score": "0.52161723", "text": "removeAll ()\n {\n Object.keys(__threads).forEach((id) => {\n if (__threads[id].isRunning()) {\n __threads[id].stop();\n }\n delete __threads[id];\n });\n }", "title": "" }, { "docid": "87dec154943fa3f19e53930f6d6deec8", "score": "0.5213292", "text": "shutdown() {\n const eventEmitter = this.systems.events;\n\n eventEmitter.off('update', this.gamepads.update, this.gamepads);\n eventEmitter.off('shutdown', this.shutdown, this);\n }", "title": "" }, { "docid": "dc220b7ef3d605c2b8f89a5fe2458f1b", "score": "0.5211778", "text": "stop()\n\t{\n\t\t//Stop listening for events, as they might have been queued\n\t\tthis.onactivespeakerchanged = ()=>{};\n\n\t\t//Remove outgoing track listener\n\t\tfor (const [multiplexId,multiplex] of this.multiplex)\n\t\t\t//Remove event\n\t\t\tmultiplex.outgoingTrack.off(\"stopped\",this.onOutgoingTrackStopped);\n\n\t\t//Remove speaker track listener\n\t\tfor (const [speakerId,track] of this.speakers)\n\t\t{\n\t\t\t//Signal dettached\n\t\t\ttrack.detached();\n\t\t\t//Remove event\n\t\t\ttrack.off(\"stopped\",this.onTrackStopped);\n\t\t}\n\n\t\t//Stop multiplexed\n\t\tthis.multiplexer.Stop();\n\n\t\t/**\n\t\t* ActiveSpeakerMultiplexer stopped event\n\t\t*\n\t\t* @name stopped\n\t\t* @memberof ActiveSpeakerMultiplexer\n\t\t* @kind event\n\t\t* @argument {ActiveSpeakerMultiplexer} ActiveSpeakerMultiplexer\n\t\t*/\n\t\tthis.emitter.emit(\"stopped\");\n\t\t\n\t\t//Remove native reference, so destructor is called on GC\n\t\tthis.multiplexer = null;\n\t\tthis.multiplex = null;\n\t\tthis.speakers = null;\n\t\tthis.emitter = null;\n\t}", "title": "" }, { "docid": "498438ac36a1529667bcf401e79c202e", "score": "0.519551", "text": "async function unsubscribePooling({state}) {\n let api = state.origin.split('/')[0],\n origin = state.origin.replace(`${api}/`, '').replace(/\\*/g, '+')\n await Vue.connector.unsubscribeLogs(api, origin, '#')\n }", "title": "" }, { "docid": "675df7203aa49a57e1cc26464a5decf5", "score": "0.5194851", "text": "function kill() {\n (0, _crossSpawnAsync2.default)(\"taskkill\", [\"/F\", \"/T\", \"/PID\", this.pid]);\n}", "title": "" }, { "docid": "132f501be3b9bb6279c2e74052fa2c6b", "score": "0.5190337", "text": "unsubFromAll() {\n if (twitchWebhook) {\n twitchWebhook.unsubscribe('*');\n }\n logger.log('info', 'Unsubbed from all twitch hooks');\n }", "title": "" }, { "docid": "9499c02150cf8ac37f64727c746138df", "score": "0.5189537", "text": "unsubscribeAll() {\n for(var subscriptionId in this.sockets) {\n this.unsubscribe(subscriptionId);\n }\n }", "title": "" }, { "docid": "8d68475c2d995990b9815c4e943d1b43", "score": "0.518793", "text": "function sigterm() {\n log.info('SIGTERM received...shutting down');\n killAllWorkers('SIGTERM');\n\n if (root) {\n fs.unlink(pidLocation, function(err) {\n if (err) {\n log.error(err);\n }\n });\n }\n}", "title": "" }, { "docid": "83eaff1f6ac02fa4b5a2fe528906b1fb", "score": "0.51867676", "text": "unbindEvents() {}", "title": "" }, { "docid": "8540b7ea6358b260ff08269b9b3d3a40", "score": "0.51851314", "text": "destroy() {\n this.removeDOMEventListeners()\n this.unsubs.forEach((u) => u())\n // this.storeSub.unsubscribe()\n }", "title": "" }, { "docid": "aa58ee5e7f605b6efab56d9b8a54a3b9", "score": "0.51791334", "text": "removeListener() {}", "title": "" }, { "docid": "49bde29e3ebb31f12860f815b6cc04a8", "score": "0.51766974", "text": "destruct(){\n\t\tthis.child.stdout.unpipe();\n\t\tthis.child.stderr.unpipe();\n\t\tif(this.child.connected){\n\t\t\tthis.child.disconnect();\n\t\t}\n\t\tthis.child.kill();\n\t}", "title": "" }, { "docid": "6af193d85a24bbac5706f109b6b49190", "score": "0.5172232", "text": "unsubscribeAll(socket) {\n // can't seem to just chuck it all in 1 array...\n socket.removeAllListeners(['player_ready']);\n socket.removeAllListeners(['blue_team_change']);\n socket.removeAllListeners(['red_team_change']);\n socket.removeAllListeners(['disconnect']);\n socket.removeAllListeners(['lobby_player_back']);\n socket.removeAllListeners(['on_player_spectate']);\n }", "title": "" }, { "docid": "873f3ddf8dae48795098e601f97090a2", "score": "0.51695925", "text": "function killSessions(id, baseUrl) {\n var running = runningSessions.get(baseUrl) || [];\n algorithm_1.each(running.slice(), function (session) {\n if (session.id === id) {\n session.dispose();\n }\n });\n }", "title": "" }, { "docid": "e602e60ad1a7cd711fe9e0817819459a", "score": "0.51643854", "text": "removeListener(handle) {\n this.assigned = this.assigned.filter(x => x !== handle);\n }", "title": "" }, { "docid": "e37034a0f56768d3c7794dced654ec58", "score": "0.5161377", "text": "async stop() {\n if (this.addNodeListener) {\n this.nodes.removeListener('add', this.addNodeListener);\n }\n if (this.removeNodeListener) {\n this.nodes.removeListener('remove', this.removeNodeListener);\n }\n for (let i in this.retrySync) {\n clearTimeout(this.retrySync[i]);\n }\n this.retrySync = {};\n this.replicas = {};\n this.nexus = {};\n }", "title": "" }, { "docid": "9c364637a1caf7de0cd7b8ba80445241", "score": "0.5152757", "text": "function killSessions(id, baseUrl) {\n let running = runningSessions.get(baseUrl) || [];\n algorithm_1.each(running.slice(), session => {\n if (session.id === id) {\n session.dispose();\n }\n });\n }", "title": "" }, { "docid": "d7b7a8e5cb60699816c784ac4273a83f", "score": "0.5149732", "text": "kill () {\n this.client.unsubscribe('thing-update/#')\n this.client.end(true)\n this.init()\n }", "title": "" }, { "docid": "83378f9b617abdf99d88fc3e4a850a3a", "score": "0.5143372", "text": "stopListening() {\n this.listening = false;\n }", "title": "" }, { "docid": "301c622018616e539c4cd144ae27d226", "score": "0.5130642", "text": "function sipUnRegister() {\n if (sip_oSipStack) {\n sip_oSipStack.stop(); // shutdown all sessions\n }\n }", "title": "" }, { "docid": "4e0dc63de4ff5fc564835d18e66521b0", "score": "0.5127853", "text": "unsubscribe(args) {\n this._pubnubInstance.unsubscribe(args);\n this._autoload.disableLoad(args);\n }", "title": "" }, { "docid": "0e66fb1ea7e490741cc8673b8190a352", "score": "0.5126399", "text": "deleteEvents() {\n let parent = this;\n this._bnode.removeListener('login', parent.loginListener);\n this._bnode.removeListener('message', parent.messageListener);\n this._bnode.removeListener('disconnected', parent.disconnectedListener);\n }", "title": "" }, { "docid": "0e2d8a04ee00d4ab249f586e499c78c2", "score": "0.5123396", "text": "removeSpectator(pid){\n\t\tlet ind = this.spectators.indexOf(pid);\n\t\tif(ind > -1) this.spectators.splice(ind,1);\n\t\telse return;\n\t\tthis.num_spectators--;\n\t}", "title": "" }, { "docid": "b4bf2221a17f4152b0c90e1276e12270", "score": "0.5119202", "text": "close () {\n this.watcher.close()\n Object.keys(this.listeners).forEach((eventName) => {\n this.postfixAccounts.removeListener(eventName, this.listeners[eventName])\n })\n }", "title": "" }, { "docid": "115b02238758022bbaad71699005af1c", "score": "0.51189923", "text": "function unsubscribeFromStream(session, stream) {\n\tvar subscribers = session.getSubscribersForStream(stream);\n\n\tfor (var i=0; i<subscribers.length; i++) {\n\t\tsession.unsubscribe(subscribers[i]);\n\t\tparticipants--;\n\t}\n}", "title": "" }, { "docid": "79390f60c88441b334e224509b7620fd", "score": "0.51111215", "text": "function killAllProcesses() {\n utils.each( child_processes, function (child_process, child_process_id) {\n killProcess( child_process_id );\n });\n }", "title": "" }, { "docid": "1dae2ad15da7b6b08dc6f8a68f7d691c", "score": "0.51095825", "text": "function killAll() {\n aWorker.send({event:new Event(EventEnum.KILL, null)});\n bWorker.send({event:new Event(EventEnum.KILL, null)});\n}", "title": "" }, { "docid": "14e9e327dd86cf8335e311f02e8abc29", "score": "0.5103993", "text": "function shutdown () {\n clients.forEach(function (client) {\n client.unsubscribe();\n client.quit();\n });\n }", "title": "" }, { "docid": "b949f21f4f394a001dcac8f4c5e3d595", "score": "0.51039314", "text": "function stop_record() {\n procRecord.kill();\n}", "title": "" }, { "docid": "81953b7fc05cc42990edbe4f1f5050c0", "score": "0.50927776", "text": "function killPowerUp(){\n powerGpoup.forEach(function(powerUP){\n powerUP.kill()\n });\n}", "title": "" }, { "docid": "653e512668cb51dd9d791bcd950537e9", "score": "0.50842035", "text": "stopListeningToMembershipsUpdates() {\n logger.debug(...LOG_ARGS, 'stopListeningToMembershipsUpdates()', 'called');\n this.listenerCount -= 1;\n\n if (this.listenerCount <= 0) {\n // Once all listeners are done, stop listening\n this.datasource.memberships.stopListening();\n }\n }", "title": "" }, { "docid": "462c7ad9cf91810e8581dca7aee5e965", "score": "0.50776094", "text": "disconnect() {\n this.queue.forEach(f => (f.status = 'paused'));\n this.queue = [];\n }", "title": "" }, { "docid": "2035e92bac9219d89a115aba38530f86", "score": "0.5077515", "text": "function releaseSocketId(idIn) {\n //Array to store the remaing ids\n var newIds = [];\n\n //Loop through all ids\n ids.forEach(function(id,idx) {\n //If they are not the one we are trying to remove add them to the new array\n if(id != idIn) {\n newIds.push(id);\n }\n\n //If we are on the last iteration of the for loop\n if(idx == ids.length - 1) {\n //Replace the ids array with the array containing the remaining ids\n ids = newIds;\n }\n });\n}", "title": "" }, { "docid": "8e41fd32884b877575f32914bdd4dced", "score": "0.50669795", "text": "function unlisten(evt) {\n if (arguments.length == 1) {\n listeners[evt] = [];\n } else {\n // remove a specific handler\n var handler = Array.prototype.slice.call(arguments)[1];\n listeners[evt] = listeners[evt].filter(function (func) {\n return func != handler;\n });\n }\n }", "title": "" }, { "docid": "13a3d5055c3fb4521e1f609f79081874", "score": "0.50627047", "text": "listen(pids, mark=\"renderer\", url=\"\") {\n pids = (pids instanceof Array) ? pids : [pids];\n pids.forEach((pid) => {\n if (!this.pidList.includes(pid)) {\n this.pidList.push(pid);\n }\n this.typeMap[pid] = this.typeMap[pid] || {};\n this.typeMap[pid].type = mark;\n this.typeMap[pid].url = url;\n });\n }", "title": "" }, { "docid": "047eecfc64ecdbe43e3fd58cae711dd1", "score": "0.5062586", "text": "detachAll() {\n for (var eventName in this.listeners) {\n if (this.listeners[eventName]) {\n this.detach(eventName)\n }\n }\n }", "title": "" } ]
aab3174b68db398c44f6cdfb2aa9976d
Attaches a simple dirty flag (one shot change detection) to the supplied model, then once the model changes, autosaves the model using the supplied key every autoSaveIntervalInSeconds seconds.
[ { "docid": "30c7d516f3d89063e076cf77119f8019", "score": "0.54642534", "text": "function autoSaveModel(viewModel, saveUrl, options) {\n\n var defaults = {\n storageKey:window.location.href+'.autosaveData',\n autoSaveIntervalInSeconds:60,\n restoredDataWarningSelector:\"#restoredData\",\n resultsMessageId:\"save-result-placeholder\",\n timeoutMessageSelector:\"#timeoutMessage\",\n errorMessage:\"Failed to save your data: \",\n successMessage:\"Save successful!\",\n errorCallback:undefined,\n successCallback:undefined\n };\n\n var config = $.extend(defaults, options);\n\n var serializeModel = function() {\n return (typeof viewModel.modelAsJSON === 'function') ? viewModel.modelAsJSON() : ko.toJSON(viewModel);\n };\n var autoSaveModel = function() {\n amplify.store(config.storageKey, serializeModel());\n if (viewModel.dirtyFlag.isDirty()) {\n window.setTimeout(autoSaveModel, config.autoSaveIntervalInSeconds*1000);\n }\n }\n\n if (typeof viewModel.dirtyFlag === 'undefined') {\n viewModel.dirtyFlag = ko.simpleDirtyFlag(viewModel);\n }\n viewModel.dirtyFlag.isDirty.subscribe(\n function() {\n if (viewModel.dirtyFlag.isDirty()) {\n autoSaveModel();\n }\n }\n );\n\n viewModel.saveWithErrorDetection = function(successCallback, errorCallback) {\n $(config.restoredDataWarningSelector).hide();\n var json = serializeModel();\n // Store data locally in case the save fails.plan\n amplify.store(config.storageKey, json);\n\n return $.ajax({\n url: saveUrl,\n type: 'POST',\n data: json,\n contentType: 'application/json',\n success: function (data) {\n if (data.error) {\n showAlert(config.errorMessage + data.detail + ' \\n' + data.error,\n \"alert-error\",config.resultsMessageId);\n if (typeof errorCallback === 'function') {\n errorCallback(data);\n }\n if (typeof config.errorCallback === 'function') {\n config.errorCallback(data);\n }\n\n } else {\n showAlert(config.successMessage,\"alert-success\",config.resultsMessageId);\n amplify.store(config.storageKey, null);\n viewModel.dirtyFlag.reset();\n if (typeof successCallback === 'function') {\n successCallback(data);\n }\n if (typeof config.successCallback === 'function') {\n config.successCallback(data);\n }\n }\n },\n error: function (data) {\n bootbox.alert($(config.timeoutMessageSelector).html());\n if (typeof errorCallback === 'function') {\n errorCallback(data);\n }\n if (typeof config.errorCallback === 'function') {\n config.errorCallback(data);\n }\n }\n });\n }\n\n}", "title": "" } ]
[ { "docid": "ac8d1709595685dfe712b822daacd4cf", "score": "0.6007879", "text": "function autosave() {\r\n\tif(!changes){\r\n\t\tsetTimeout(save,30000);\r\n\t\tchanges=true;\r\n\t}\r\n}", "title": "" }, { "docid": "03368293a1ec59fdbe0725acee885705", "score": "0.56064135", "text": "function automaticSave() {\n setTimeout(() => {\n let newValue = simplemde.value()\n // skip this method if value not changed\n if (oldValue != newValue) {\n repo.save(newValue)\n reloadGitLog()\n }\n return automaticSave()\n }, AUTO_SAVE_TIME);\n}", "title": "" }, { "docid": "081e79dcde3908eb6b2bf97fed1201f3", "score": "0.5348627", "text": "function startAutosave() {\n saveStateDebounced()\n emitter.on(`*`, () => saveStateDebounced())\n}", "title": "" }, { "docid": "1262b874bd344b83d1ce435fef79cd06", "score": "0.5264776", "text": "function autoSaveModel(viewModel, saveUrl, options) {\n\n var serializeModel = function() {\n return (typeof viewModel.modelAsJSON === 'function') ? viewModel.modelAsJSON() : ko.toJSON(viewModel);\n };\n\n var defaults = {\n storageKey:window.location.href+'.autosaveData',\n autoSaveIntervalInSeconds:60,\n restoredDataWarningSelector:\"#restoredData\",\n resultsMessageSelector:\"#save-result-placeholder\",\n timeoutMessageSelector:\"#timeoutMessage\",\n errorMessage:\"Failed to save your data: \",\n successMessage:\"Save successful!\",\n errorCallback:undefined,\n successCallback:undefined,\n blockUIOnSave:false,\n blockUISaveMessage:\"Saving...\",\n blockUISaveSuccessMessage:\"Save successful\",\n serializeModel:serializeModel,\n pageExitMessage: 'You have unsaved data. If you leave the page this data will be lost.',\n preventNavigationIfDirty: false,\n defaultDirtyFlag:ko.simpleDirtyFlag\n };\n var config = $.extend(defaults, options);\n\n var autosaving = false;\n\n var deleteAutoSaveData = function() {\n amplify.store(config.storageKey, null);\n };\n var saveLocally = function(data) {\n amplify.store(config.storageKey, data);\n };\n\n\n function confirmOnPageExit(e) {\n // If we haven't been passed the event get the window.event\n e = e || window.event;\n\n // For IE6-8 and Firefox prior to version 4\n if (e) {\n e.returnValue = config.pageExitMessage;\n }\n\n // For Chrome, Safari, IE8+ and Opera 12+\n return config.pageExitMessage;\n };\n\n var onunloadHandler = function(e) {\n autosaving = false;\n deleteAutoSaveData();\n\n return confirmOnPageExit(e);\n };\n\n var autoSaveModel = function() {\n if (!autosaving) {\n return;\n }\n\n if (viewModel.dirtyFlag.isDirty()) {\n amplify.store(config.storageKey, serializeModel());\n window.setTimeout(autoSaveModel, config.autoSaveIntervalInSeconds*1000);\n }\n };\n\n viewModel.cancelAutosave = function() {\n autosaving = false;\n deleteAutoSaveData();\n if (config.preventNavigationIfDirty) {\n window.onbeforeunload = null;\n }\n };\n\n if (typeof viewModel.dirtyFlag === 'undefined') {\n viewModel.dirtyFlag = config.defaultDirtyFlag(viewModel);\n }\n viewModel.dirtyFlag.isDirty.subscribe(\n function() {\n if (viewModel.dirtyFlag.isDirty()) {\n autosaving = true;\n\n if (config.preventNavigationIfDirty) {\n window.onbeforeunload = onunloadHandler;\n }\n window.setTimeout(autoSaveModel, config.autoSaveIntervalInSeconds*1000);\n }\n else {\n viewModel.cancelAutosave();\n }\n }\n );\n\n viewModel.saveWithErrorDetection = function(successCallback, errorCallback) {\n if (config.blockUIOnSave) {\n blockUIWithMessage(config.blockUISaveMessage);\n }\n $(config.restoredDataWarningSelector).hide();\n\n var json = config.serializeModel();\n\n // Store data locally in case the save fails.plan\n amplify.store(config.storageKey, json);\n\n return $.ajax({\n url: saveUrl,\n type: 'POST',\n data: json,\n contentType: 'application/json'\n }).done(function (data) {\n if (data.error) {\n if (config.blockUIOnSave) {\n $.unblockUI();\n }\n showAlertWithSelector(config.errorMessage + data.detail + ' \\n' + data.error,\n \"alert-error\",config.resultsMessageSelector);\n if (typeof errorCallback === 'function') {\n errorCallback(data);\n }\n if (typeof config.errorCallback === 'function') {\n config.errorCallback(data);\n }\n\n } else {\n if (config.blockUIOnSave) {\n blockUIWithMessage(config.blockUISaveSuccessMessage);\n }\n else {\n showAlertWithSelector(config.successMessage, \"alert-success\", config.resultsMessageSelector);\n }\n viewModel.cancelAutosave();\n viewModel.dirtyFlag.reset();\n if (typeof successCallback === 'function') {\n successCallback(data);\n }\n if (typeof config.successCallback === 'function') {\n config.successCallback(data);\n }\n }\n })\n .fail(function (data) {\n if (config.preventNavigationIfDirty) {\n window.onbeforeunload = null;\n }\n if (config.blockUIOnSave) {\n $.unblockUI();\n }\n var message = $(config.timeoutMessageSelector).html();\n if (message) {\n bootbox.alert(message, function() {\n if (config.preventNavigationIfDirty) {\n window.onbeforeunload = onunloadHandler;\n }\n });\n }\n if (typeof errorCallback === 'function') {\n errorCallback(data);\n }\n if (typeof config.errorCallback === 'function') {\n config.errorCallback(data);\n }\n });\n\n }\n\n}", "title": "" }, { "docid": "8448dbfe5cbe06a5b5a4fa8f4bd4cc50", "score": "0.52493846", "text": "doAutoSave() {\n }", "title": "" }, { "docid": "cd4390a82a16f518d5105210ee0ab311", "score": "0.52258736", "text": "_updateContentsModel(model) {\n const newModel = {\n path: model.path,\n name: model.name,\n type: model.type,\n content: undefined,\n writable: model.writable,\n created: model.created,\n last_modified: model.last_modified,\n mimetype: model.mimetype,\n format: model.format\n };\n const mod = this._contentsModel ? this._contentsModel.last_modified : null;\n this._contentsModel = newModel;\n this._ycontext.set('last_modified', newModel.last_modified);\n if (!mod || newModel.last_modified !== mod) {\n this._fileChanged.emit(newModel);\n }\n }", "title": "" }, { "docid": "666c182c1ea8c49efd251f0d9ea4643e", "score": "0.5163748", "text": "function update(updatedModel, force) {\n\t\t\tupdatedModel = updatedModel || this;\n\t\t\tforce = typeof force === 'boolean' ? force : false;\n\t\t\t\n\t\t\tif (force || !this.isEqual(updatedModel, false)) {\n\t\t\t\tthis.setData(updatedModel);\n\t\t\t\tthis.cacheCurrentState(false);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a2c08e006b969a1d21f8e6628bf0d2dc", "score": "0.5149728", "text": "doAutoSaveChanges() {\n const {doSaveFn} = this.props;\n if (!this.isDirty()) return;\n\n doSaveFn()\n .then(this.onPostDone)\n .catch(this.onPostError);\n }", "title": "" }, { "docid": "e77236e8a95d949c67cc567582e415bc", "score": "0.5081478", "text": "async autosaveLoop() {\n while ( true ) { // eslint-disable-line no-constant-condition\n try {\n this.saveToFile();\n }\n catch( e ) {\n this.setError( `autosave error: ${e} ${e.stack}` );\n }\n await sleep( 5 * 60 * 1000 ); // Run this every 5 minutes\n }\n }", "title": "" }, { "docid": "569a31a10fb5f9b34850803f9a2fd118", "score": "0.5068899", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n var rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1\n /* DetectChanges */\n );\n }", "title": "" }, { "docid": "175c5d4eefbefeaf2b1a3dace0337dc7", "score": "0.5014792", "text": "function basic(element, model, key) {\n\t\tmodel.on('update', function(m, k) {\n\t\t\telement.setAttribute('data-basic', m[k]);\n\t\t});\n\n\t\telement.setAttribute('data-basic', model[key]);\n\t}", "title": "" }, { "docid": "cd68fe454b824b7c3fa0bf878afee768", "score": "0.49835995", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n var rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1\n /* DetectChanges */\n );\n}", "title": "" }, { "docid": "417c93cae4597115ba076aa907123e05", "score": "0.49708262", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n var rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "338cbfe2ae2250d254f24b0a03610a60", "score": "0.49614742", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n const rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "338cbfe2ae2250d254f24b0a03610a60", "score": "0.49614742", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n const rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "338cbfe2ae2250d254f24b0a03610a60", "score": "0.49614742", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n const rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "338cbfe2ae2250d254f24b0a03610a60", "score": "0.49614742", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n const rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "338cbfe2ae2250d254f24b0a03610a60", "score": "0.49614742", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n const rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "338cbfe2ae2250d254f24b0a03610a60", "score": "0.49614742", "text": "function markDirty(component) {\n ngDevMode && assertDefined(component, 'component');\n const rootView = markViewDirty(getComponentViewByInstance(component));\n ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');\n scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "55e66736a7d0ae908a7382f0eaad8def", "score": "0.49302855", "text": "autoSaveInterval() {\n return 0;\n }", "title": "" }, { "docid": "513b110955370392f5c82abff66319b0", "score": "0.49223804", "text": "function updateGameModel(model) {\r\n initializeModel(model);\r\n}", "title": "" }, { "docid": "01e7b17be8dc486c15cbb0967184e557", "score": "0.49099693", "text": "function onSave( editor )\r\n\t{\r\n\t\t// Don't fire auto save.\r\n\t\tautosaveWorking = true;\r\n\t\t// don't fire beforeunload.\r\n\t\teditor.config.autosaveUseOnBeforeUnload = false;\r\n\t\t// cleanup.\r\n\t\twindow.clearInterval( autosaveInterval );\r\n\t\twindow.clearTimeout( autosaveTimeoutDefaultDirtyIcon );\r\n\t\twindow.clearTimeout( autosaveTimeoutBetweenRequests );\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "5d373aea0590cca131b00b4eeedfa5f9", "score": "0.48772895", "text": "function save(model) {\n // who knows what this does\n }", "title": "" }, { "docid": "e9e0ebc848523ee7efbb55cb93d31acf", "score": "0.4855279", "text": "startPendingSave() {\n if (this._pendingSave) {\n clearTimeout(this._pendingSave)\n }\n this._pendingSave = setTimeout(() => {\n this._pendingSave = null\n this.save(true)\n }, 1000)\n }", "title": "" }, { "docid": "47d8fe6ba9d88383802dc3265806efa6", "score": "0.4793934", "text": "periodicSave(that){\n\t\tif(FileManager.canSave()){\t\n\t\t\tFileManager.SaveGame(that, false);\n\t\t}\n\t\t\n\t\tsetTimeout(() => {that.periodicSave(that)}, 480000);\n\t}", "title": "" }, { "docid": "686105e17bd1d67b97d35793f7c4a5b2", "score": "0.47831506", "text": "function updateModelStub(model) {\n const now = new Date();\n return _extends({}, model, {\n updatedAt: now\n });\n}", "title": "" }, { "docid": "31d551e140602b01a7729f3566ec7a90", "score": "0.47652894", "text": "function autoBind(key, el) {\n var element = $(el);\n if(!element.attr('ng-model')) {\n var camVarName = element.attr(constants.DIRECTIVE_CAM_VARIABLE_NAME);\n if(camVarName) {\n element.attr('ng-model', camVarName);\n }\n }\n }", "title": "" }, { "docid": "7cf7ca25bbdab76e2fd34d8f7ec14b53", "score": "0.47405455", "text": "async doUpdate () {\n\t\tif (Object.keys(this.changes).length === 0) {\n\t\t\t// nothing to save\n\t\t\treturn;\n\t\t}\n\t\t// do the update\n\t\tconst op = { $set: this.changes };\n\t\tthis.updateOp = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.collection,\n\t\t\tid: this.existingModel.id\n\t\t}).save(op);\n\t\tObject.assign(this.existingModel.attributes, this.changes);\n}", "title": "" }, { "docid": "68d3cd81a2380ef161320f87daa7f3c5", "score": "0.47071293", "text": "function AutoSaveLoad() {}", "title": "" }, { "docid": "a36efc017eb5693c67db1cadfcc99bf2", "score": "0.47044703", "text": "function save(key) {\n return function(value) {\n s[key] = value;\n storage.write(SETTINGS_FILE, s);\n WIDGETS[\"batwarn\"].reload();\n };\n }", "title": "" }, { "docid": "baa2d0ad94a34eb16dc16a23a56eee96", "score": "0.47011048", "text": "function updateModel() {\n scope.$apply(function () {\n \tngModel.$setViewValue(ck.getData());\n \t});\n \t}", "title": "" }, { "docid": "869e396e33f1d07a57054525a04d513a", "score": "0.46919885", "text": "save() {\n this._requireSave = true;\n }", "title": "" }, { "docid": "82b092c92509ba267a42ebafcc2fdbf1", "score": "0.46809", "text": "setDirty() {\n this.#isDirty = true;\n }", "title": "" }, { "docid": "e7d93b58544c17ac93a336f39028d397", "score": "0.46687737", "text": "function addPersistedTimestamp(model) {\n if (model && (model.persisted === undefined)) {\n model.persisted = model.modified !== undefined ?\n model.modified : now();\n }\n\n return model;\n }", "title": "" }, { "docid": "720e9b2803221b363464e6a5450e0c70", "score": "0.46544358", "text": "function markViewDirty(lView){while(lView&&!(lView[FLAGS]&128/* IsRoot */)){lView[FLAGS]|=8/* Dirty */;lView=lView[PARENT];}lView[FLAGS]|=8/* Dirty */;ngDevMode&&assertDefined(lView[CONTEXT],'rootContext should be defined');var rootContext=lView[CONTEXT];scheduleTick(rootContext,1/* DetectChanges */);}", "title": "" }, { "docid": "a638df43f013567fcded571f999b65ee", "score": "0.4653724", "text": "function bbSetAttrs( model, attrs, opts ){\n\t 'use strict';\n\t var options = opts || {};\n\t\n\t // Extract attributes and options.\n\t var unset = options.unset,\n\t silent = options.silent,\n\t changes = [],\n\t changing = model._changing,\n\t current = model.attributes,\n\t attrSpecs = model.__attributes;\n\t\n\t model._changing = true;\n\t\n\t if( !changing ){\n\t model._previousAttributes = new model.Attributes( current );\n\t }\n\t\n\t if( model._changed ) model._changed = null;\n\t\n\t // For each `set` attribute, update or delete the current value.\n\t // Todo: optimize for complete attrs set. Iterate through attributes names array,\n\t // or (may be better) create precompiled loop unrolled forEach, extracting specs\n\t // and values.\n\t // Beware of single attr update with options. Need deep refactoring to remove penalty.\n\t for( var attr in attrs ){\n\t var attrSpec = attrSpecs[ attr ],\n\t isChanged = attrSpec ? attrSpec.isChanged : genericIsChanged,\n\t val = unset ? undefined : attrs[ attr ];\n\t\n\t if( isChanged( current[ attr ], val ) ){\n\t changes.push( attr );\n\t }\n\t\n\t current[ attr ] = val;\n\t }\n\t\n\t // Trigger all relevant attribute changes.\n\t if( !silent ){\n\t if( changes.length ){\n\t model._pending = options;\n\t }\n\t for( var i = 0, l = changes.length; i < l; i++ ){\n\t attr = changes[ i ];\n\t trigger3( model, 'change:' + attr, model, current[ attr ], options );\n\t }\n\t }\n\t\n\t // You might be wondering why there's a `while` loop here. Changes can\n\t // be recursively nested within `\"change\"` events.\n\t if( changing ){\n\t return model;\n\t }\n\t if( !silent ){\n\t while( model._pending ){\n\t options = model._pending;\n\t model._pending = false;\n\t model._changeToken = {};\n\t trigger2( model, 'change', model, options );\n\t }\n\t }\n\t\n\t model._pending = false;\n\t model._changing = false;\n\t\n\t return model;\n\t}", "title": "" }, { "docid": "c30015a32051d41856291e29a8222f71", "score": "0.46473873", "text": "function markDirty(component){ngDevMode&&assertDefined(component,'component');markViewDirty(getComponentViewByInstance(component));}///////////////////////////////", "title": "" }, { "docid": "ea2ee849bf08162c05242ff5e7db21dc", "score": "0.46387747", "text": "static async saveObject(key, value) {\n await FirebaseUtils.addUpdateCommand(getUserRefKeyOnFirebase() + \"/keys/\" + key, value);\n }", "title": "" }, { "docid": "5830efd574d1c70498435a92337feaa3", "score": "0.46215957", "text": "function save() {\n\t\tdocument.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n\t\tmyDiagram.isModified = false;\n\t}", "title": "" }, { "docid": "ebd1045bf6abb454223a4de708404720", "score": "0.46142295", "text": "handleModelChange(model, value, opts) {\n this.setValue(value, opts);\n }", "title": "" }, { "docid": "76e1c289895d606c9d504472b2d8ec83", "score": "0.45933688", "text": "loadDirty() {\n this.dirty = true;\n\n if (this.dirtyCallback) {\n this.dirtyCallback();\n }\n }", "title": "" }, { "docid": "f228cc8a4c7d9c4a0b05f7661452b4a1", "score": "0.45881078", "text": "function saveKey() {\n chrome.storage.sync.set(\n {\n azurekey: document.getElementById('key').value\n }, function () {\n var status = document.getElementById('status');\n status.textContent = 'New key saved.';\n setTimeout(function () {\n status.textContent = '';\n }, 2000);\n document.getElementById('key').value = '***';\n });\n}", "title": "" }, { "docid": "7243e381d8fe19a7201c60f66f42a3d4", "score": "0.45862716", "text": "function save() {\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n }", "title": "" }, { "docid": "433317e965842e327e256864e0592bb4", "score": "0.45769987", "text": "persistKey(successCallback) {\n let secret = this.model;\n let secretData = this.modelForData;\n let isV2 = this.isV2;\n let key = secretData.get('path') || secret.id;\n\n if (key.startsWith('/')) {\n key = key.replace(/^\\/+/g, '');\n secretData.set(secretData.pathAttr, key);\n }\n\n return secretData.save().then(() => {\n if (!secretData.isError) {\n if (isV2) {\n secret.set('id', key);\n }\n if (isV2 && Object.keys(secret.changedAttributes()).length) {\n // save secret metadata\n secret\n .save()\n .then(() => {\n this.saveComplete(successCallback, key);\n })\n .catch(e => {\n this.set(e, e.errors.join(' '));\n });\n } else {\n this.saveComplete(successCallback, key);\n }\n }\n });\n }", "title": "" }, { "docid": "8318839a1c105b4146bad1867c62fca4", "score": "0.45547265", "text": "async function setPersistent(key, data) {\n return true;\n}", "title": "" }, { "docid": "af20ea6844aac1ec982d0c1a936bc503", "score": "0.45447648", "text": "function justSave() {\n interpolateAndSave(false);\n }", "title": "" }, { "docid": "c267bf9cebc2ff3f765df707fae56eca", "score": "0.45384625", "text": "function save() {\r\n document.getElementById('mySavedModel').value = myDiagram.model.toJson();\r\n myDiagram.isModified = false;\r\n}", "title": "" }, { "docid": "d87ff591e50d149ac4f2fbb0f4c86e87", "score": "0.45358935", "text": "function markViewDirty(view) {\n var currentView = view;\n while (currentView && !(currentView[FLAGS] & 64 /* IsRoot */)) {\n currentView[FLAGS] |= 4 /* Dirty */;\n currentView = currentView[PARENT];\n }\n currentView[FLAGS] |= 4 /* Dirty */;\n ngDevMode && assertDefined(currentView[CONTEXT], 'rootContext should be defined');\n var rootContext = currentView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "829eda7c0562c009a6165a68f249bc9e", "score": "0.4533142", "text": "needToUpdate(key, hashable, saveHash = false) {\n const data = this.getCacheData();\n const savedHash = data[key];\n\n let notSavedBefore = false;\n if (savedHash === undefined) {\n notSavedBefore = true;\n }\n\n const currentHash = this.generateHash(hashable);\n let needsToBeUpdated = false;\n if (notSavedBefore) {\n needsToBeUpdated = true;\n } else if (currentHash !== savedHash) {\n needsToBeUpdated = true;\n }\n\n if (needsToBeUpdated && saveHash) {\n const data = {};\n data[key] = currentHash;\n this.writeCacheData(data);\n } else if (needsToBeUpdated) {\n this.cachedHash.set(key, currentHash);\n }\n\n return needsToBeUpdated;\n }", "title": "" }, { "docid": "ceb2b330c1787b144b8f2995758ce9de", "score": "0.453154", "text": "function markViewDirty(lView) {\n while (lView && !(lView[FLAGS] & 128 /* IsRoot */)) {\n lView[FLAGS] |= 8 /* Dirty */;\n lView = lView[PARENT];\n }\n lView[FLAGS] |= 8 /* Dirty */;\n ngDevMode && assertDefined(lView[CONTEXT], 'rootContext should be defined');\n var rootContext = lView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "ceb2b330c1787b144b8f2995758ce9de", "score": "0.453154", "text": "function markViewDirty(lView) {\n while (lView && !(lView[FLAGS] & 128 /* IsRoot */)) {\n lView[FLAGS] |= 8 /* Dirty */;\n lView = lView[PARENT];\n }\n lView[FLAGS] |= 8 /* Dirty */;\n ngDevMode && assertDefined(lView[CONTEXT], 'rootContext should be defined');\n var rootContext = lView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "30befd008398fdf5bc7808bc0540afd3", "score": "0.45242316", "text": "save(model) {\n return model.save();\n }", "title": "" }, { "docid": "c537435d76ef5d7cb0b029f9f1ff0d50", "score": "0.45228758", "text": "function save(){\r\n\tconsole.log(\"Auto-saving Database..\");\r\n\tjsonfile.writeFile(\"./channels.json\", channels, function (err) {\r\n\t\tif (err){\r\n\t\t\tconsole.log(err);\r\n\t\t}\r\n\t})\r\n\tchanges=false;\r\n\tconsole.log(\"Autosave Complete\");\r\n}", "title": "" }, { "docid": "54d45abbf18091e8daacfcec1034f4f7", "score": "0.45106885", "text": "function postAutoSave() {\n\t\t\t$.ajax({\n\t\t\t\turl: SITEURL+ADMIN+\"/blog/autosave\",\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata:$('.blog').serialize(),\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\tvar result = jQuery.parseJSON(data);\n\t\t\t\t\tif(result.status != 'no_save') {\n\t\t\t\t\t\t$('#post_id').val(result.post_id);\n\t\t\t\t\t\t$('#autosave-msg').html(result.time);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "33020f5cdaf0c8a0717b6772943b1d60", "score": "0.4505332", "text": "function saveModel(){\r\n model.save('downloads://my_model');\r\n}", "title": "" }, { "docid": "c804e802e975ab394881c88ca0c6fabd", "score": "0.44982928", "text": "function syncModel() {\n\t\t\t\t\t//if the change was caused by us syncing to redactor, we dont need to trigger another sync\n\t\t\t\t\tif (scope.$$phase) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tredactorSync = true;\n\t\t\t\t\tscope.$apply(function() {\n\t\t\t\t\t\tvar markdown = rem.render(red.get());\n\t\t\t\t\t\tngModel.$setViewValue(markdown);\n\t\t\t\t\t});\n\t\t\t\t\tredactorSync = false;\n\t\t\t\t}", "title": "" }, { "docid": "301d4087ca3ff32eaaad30da2e0c38a0", "score": "0.4492343", "text": "function save(key) {\r\n return function (value) {\r\n s[key] = value;\r\n storage.write(SETTINGS_FILE, s);\r\n //WIDGETS[\"activepedom\"].draw();\r\n };\r\n }", "title": "" }, { "docid": "e5b7a8bbd12943047aaa60f7c1ec6bb6", "score": "0.44730645", "text": "_autoChanged(newValue){this.enabled=newValue}", "title": "" }, { "docid": "d99c2bcccbc5aa9a420fba95e1ad3859", "score": "0.44725513", "text": "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "title": "" }, { "docid": "18ad65eecfd55ff43dac987e6ffae368", "score": "0.4471785", "text": "function startAutoSaveTimer(index) {\n\t// Ok, this is called when the user changes a cell, so keep track of it:\n\tcalendarDayHasChanged(index);\n\t\n\t// This code hooks our autoSaveIsInfoSaved function in place of the default is_info_saved\n\tif (is_info_saved != autoSaveIsInfoSaved) {\n\t\tautoSaveIsInfoSavedOrig = is_info_saved;\n\t\tis_info_saved = autoSaveIsInfoSaved;\n\t}\n\t\n\t// This code hooks our onunloadevent handler\n\tif (window.onbeforeunload != bodyOnBeforeUnloadHandler) {\n\t\twindow.onbeforeunload = bodyOnBeforeUnloadHandler;\n\t}\n\n\t// If a timer is already running, stop it\n if (autoSaveTimers[index] != null)\n\t\tstopAutoSaveTimer(index);\n\n // Set a timer\n autoSaveTimers[index] = setTimeout('calendarAutoSave(' + index + ');', autoSaveTimeout);\n}", "title": "" }, { "docid": "739bf232ac290a4a3d42fe5ed60a977b", "score": "0.44690803", "text": "function updateValues() {\n \n document.getElementById(\"autosave\").innerHTML = \"Auto-Saving in \" + timer + \" Last Save: \" + lastSave;\n }", "title": "" }, { "docid": "6947702bd9c8d44e61694ded725a6341", "score": "0.44632757", "text": "function handleUpdateEvent(model) {\n\t\t\tvar matches = this.matchesQuery(model);\n\t\t\tvar existsInCollection = this.in(model);\n\n\t\t\tif (!existsInCollection && matches) {\n\t\t\t\tthis.addModel(model, true);\n\t\t\t} else if (existsInCollection && !matches) {\n\t\t\t\tthis.removeModel(model);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6be0ed7e0fee8702f18ad8673750a406", "score": "0.44578478", "text": "static checkSaveTimer() {\n // Debugging line.\n Helper.printDebugLine(Crawler.checkSaveTimer, __filename, __line);\n\n let time = new Date();\n\n if (time < Global.get('saveTimer')) return;\n\n // Set new timer.\n time.setMinutes(time.getMinutes() + 1); // Save again in one minute.\n Global.set('saveTimer', time);\n\n // Don not try to start a saving process when already exists.\n if (DelayedSave.isSaving()) return;\n\n // Save all collected data.\n instance.delayedSave.saveAll().then(() => {\n }).catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "383d394978d190409ab6a1a8c4e88c70", "score": "0.44574648", "text": "function updateModel(model_name) {\n\tinjection.config.model_name = model_name;\n\tinjection.config.model_path = injection.config.model_dir + \"/\" + model_name;\n\n\tinjection.refreshModel();\n\n\tgui.__folders['Geometric Properties'].updateDisplay()\n}", "title": "" }, { "docid": "e100d245ab33b3213852cb43c3eba6a6", "score": "0.44547257", "text": "function _cleanupDirtyModel (collection, model , response, options) {\n var newKey, jerryHall, url, dirtyList;\n\n url = collection.url || model.url;\n // on updates model.url is function that points to actual url called\n if ( typeof model.url !== 'string' ) {\n url = model.urlRoot || collection.model.prototype.urlRoot || collection.model.prototype.url;\n }\n dirtyList = localStorage.getItem( '' + url + '_dirty' );\n // remove from the dirty list regardless of key type\n dirtyList = _removeItem ( dirtyList, model.jerryHallId || model.id );\n if (dirtyList && dirtyList.length) {\n localStorage.setItem( '' + url + '_dirty', dirtyList );\n } else {\n localStorage.removeItem( '' + url + '_dirty' );\n }\n // if the id has not changed then no response from the server so no copy to delete\n if ( model.jerryHallId && model.jerryHallId !== model.id) {\n newKey = model.id;\n // remove key from dirty list\n // delete dirty (temp) version and update keys array to value from backend\n //old model\n jerryHall = collection.find ( function ( doc ) { return doc.jerryHallId && doc.jerryHallId === model.jerryHallId && doc.id !== newKey; });\n if ( jerryHall) {\n jerryHall.destroy({ local: true, remote: false, dualSync: false, cleanDirty: true } ); // new models have destroy overridden for offline create and delete, cleanDirty disables this\n collection.remove( jerryHall , { local: true, remote: false, dualSync: false , silent:true } );\n } else {\n // remove url manually from local storage\n options.store.destroy( { id: model.jerryHallId} );\n }\n // well I never new that null is defined as a type of object\n if ( typeof response === 'object' && response ) {\n newKey = response[ ( model.idAttribute || 'id') ] || newKey;\n }\n }\n return newKey;\n }", "title": "" }, { "docid": "22eda7223fb3fb4e1ec36d68b62655be", "score": "0.44471154", "text": "function save() {\n saveDiagramProperties();\t// do this first, before writing to JSON\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n}", "title": "" }, { "docid": "509d976ab449b6ade3af0ac26e0321ea", "score": "0.44361556", "text": "onWillSaveWaitUntil(handler) {\r\n this._willSaveWaitUntil = handler;\r\n }", "title": "" }, { "docid": "509d976ab449b6ade3af0ac26e0321ea", "score": "0.44361556", "text": "onWillSaveWaitUntil(handler) {\r\n this._willSaveWaitUntil = handler;\r\n }", "title": "" }, { "docid": "3f3993eae6e4762479cfa55697742445", "score": "0.44301093", "text": "_mutateModel() {\n let model = this.get('model');\n let layerProperties = this.get('getLayerProperties')();\n\n for (let attr of Object.keys(layerProperties)) {\n model.set(attr, layerProperties[attr]);\n }\n }", "title": "" }, { "docid": "2dd023089e03a48c3bb235350aabc177", "score": "0.44288573", "text": "async update () {\n\t\tif (this.dontSaveIfExists) {\n\t\t\t// or don't bother if the derived class says so\n\t\t\tthis.model = this.existingModel;\n\t\t\treturn;\n\t\t}\n\t\tawait this.determineChanges();\n\t\tawait this.doUpdate();\n\t}", "title": "" }, { "docid": "03c793b0b80d4160342f6e81d187c446", "score": "0.44271427", "text": "function setModel (model) {\n assert.equal(typeof model, 'object', 'barracks.store.model: model should be an object')\n models.push(model)\n }", "title": "" }, { "docid": "03c793b0b80d4160342f6e81d187c446", "score": "0.44271427", "text": "function setModel (model) {\n assert.equal(typeof model, 'object', 'barracks.store.model: model should be an object')\n models.push(model)\n }", "title": "" }, { "docid": "fce8d7bf0e7a5fcc38576ad5f8e106bc", "score": "0.44084162", "text": "save() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "title": "" }, { "docid": "9d97eec1a2789212ec65be980770b5ba", "score": "0.44045728", "text": "_watchForChanges(file) {\n // if the development mode is active we return\n if (!this.api.config.general.developmentMode) {\n return;\n }\n\n // watch for changes on the model file\n this.api.configs.watchFileAndAct(file, () => {\n // log a information message\n this.api.log(\n `\\r\\n\\r\\n*** rebooting due to model change (${file}) ***\\r\\n\\r\\n`,\n \"info\"\n );\n\n // remove require cache\n delete require.cache[require.resolve(file)];\n\n // reload Stellar\n this.api.commands.restart.call(this.api._self);\n });\n }", "title": "" }, { "docid": "52fce866840160e14e1744c26e6a414d", "score": "0.43967056", "text": "function SP_ContinueAutoSave()\n{\n\tvar userAgentInfo = navigator.userAgent.toLowerCase();\n\t\n\tif(userAgentInfo.indexOf('msie') != -1)\n\tif(typeof mcAutoSaver != 'undefined')\n\t{\n\t\tif(arguments[0] == true)\n\t\t{\n\t\t\tAllowAutoSave = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\tAllowAutoSave = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "65bb3b90dff4617fbbcfcb52ff8978ca", "score": "0.4393846", "text": "function registerModelLatch(path, m) {\n var id = m.package ? m.package + '.' + m.name : m.name;\n\n GLOBAL.lookupCache_[id] = undefined;\n UNUSED_MODELS[id] = true;\n\n // TODO(adamvy): Remove this once we no longer have code depending on models to being in the global scope.\n if ( ! m.package )\n Object.defineProperty(GLOBAL, m.name, { get: function() { return path[m.name]; }, configurable: true });\n\n //console.log(\"Model Getting defined: \", m.name, X.NAME);\n Object.defineProperty(path, m.name, {\n get: function () {\n // console.time('registerModel: ' + id);\n USED_MODELS[id] = true;\n delete UNUSED_MODELS[id];\n Object.defineProperty(path, m.name, {value: null, configurable: true});\n\n var work = [];\n // console.time('buildModel: ' + id);\n var model = JSONUtil.mapToObj(X, m, Model, work);\n // console.timeEnd('buildModel: ' + id);\n\n if ( work.length > 0 ) {\n model.extra__ = aseq.apply(null, work);\n }\n\n X.registerModel(model);\n\n // console.timeEnd('registerModel: ' + id);\n return model;\n },\n configurable: true\n });\n }", "title": "" }, { "docid": "baf342af74f61076d7851cb14e7a496d", "score": "0.4391152", "text": "function updateTime() {\n console.log(\"updateTime()\");\n store.timeModel.update();\n}", "title": "" }, { "docid": "0060c7d7f898234368f656a58bee258a", "score": "0.43843326", "text": "flush () {\n const changes = this.model.flush()\n const computedsAboutToBecomeDirty = this.strictRender ? computedDependencyStore.getStrictUniqueEntities(changes) : computedDependencyStore.getUniqueEntities(changes)\n\n computedsAboutToBecomeDirty.forEach((computed) => {\n computed.flag()\n })\n this.emit('flush', changes)\n }", "title": "" }, { "docid": "6617e7bc09a357d08f69ddb33c760b88", "score": "0.438417", "text": "function autosave(...args) {\n function wait() {\n const pending = new Promise((resolve, reject) => {\n let canRun = true\n emitter.emit('start', ...args)\n\n // warn user if changes not yet saved\n function reset() {\n canRun = false\n // clear state for next run\n emitter.emit('reset', undefined, ...args)\n Object.assign(autosave, {\n run: fn,\n cancel: Function.prototype,\n runLater: autosave,\n pending: undefined,\n })\n }\n\n async function cancel() {\n reset()\n emitter.emit('cancel', undefined, ...args)\n return Promise.resolve(false).then(resolve, reject)\n }\n\n // capture debounced function\n function run(...args) {\n if (!canRun) { return } // noop if cancelled\n emitter.emit('run', ...args)\n\n reset()\n fn(...args).then((result) => {\n emitter.emit('done', result, ...args)\n return resolve(result)\n }, (error) => {\n // emits fail instead of error as we don't want unhandled error bubbling behaviour\n emitter.emit('fail', error, ...args)\n return reject(error)\n })\n return pending\n }\n\n Object.assign(autosave, {\n run,\n cancel,\n runLater: debounce(run, waitTime),\n })\n })\n return pending\n }\n\n if (!autosave.pending) {\n autosave.pending = wait()\n }\n autosave.runLater(...args) // run debounced save with latest args\n return autosave.pending\n }", "title": "" }, { "docid": "511fdf0b36e068f682547bb2a88a6631", "score": "0.43833053", "text": "function setModified() {\n //console.log('setModified', isModified);\n if (!isModified) {\n isModified = true;\n $(window).on('beforeunload', warnModified);\n $('.save').removeAttr('disabled');\n }\n }", "title": "" }, { "docid": "acdd852aacffcd076c86dae2b93792a1", "score": "0.43786174", "text": "function saveSpeed() {\n chrome.storage.sync.set({ settings: speedObj }, () => {\n console.log('Saved: ', speedObj);\n });\n }", "title": "" }, { "docid": "593bce52971e10d17839127bfce53730", "score": "0.43744618", "text": "async preSave (options = {}) {\n\t\tif (this.existingModel) {\n\t\t\tthis.model = this.existingModel;\n\t\t\tif (this.dontSaveIfExists) {\n\t\t\t\t// we have a document that matches the input attributes, and there's no need\n\t\t\t\t// to make any changes, just pass it back to the client as-is\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.attributes = Object.assign({}, this.existingModel.attributes, this.attributes, { id: this.existingModel.id });\n\t\t} else if (this.useId) {\n\t\t\tthis.attributes.id = this.useId;\n\t\t}\n\n\t\t// create a new model with the passed attributes, and let the model pre-save itself ...\n\t\t// this is where pre-save validation of the attributes happens\n\t\tthis.model = this.model || new this.modelClass(this.attributes);\n\t\ttry {\n\t\t\tawait this.model.preSave({ ...options, new: !this.existingModel });\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow this.errorHandler.error('validation', { info: error });\n\t\t}\n\t}", "title": "" }, { "docid": "4c78f0d468485ade723cfe062167aaba", "score": "0.43685135", "text": "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "title": "" }, { "docid": "f5ae0cc8c40e12c4e9571650fe2d58c7", "score": "0.4358453", "text": "setModel(model) {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }", "title": "" }, { "docid": "eb369649a453912f43acc372b0df6e11", "score": "0.43530774", "text": "function save(){\n if (!isSaveAllowed) {\n log('Save was temporarily disabled until you decide what to do with previously saved content.');\n return;\n }\n\n var data = getFormData();\n data['_autosaveTime'] = now();\n var key = getKey();\n\n if(typeof key === 'string' && key.length > keyPrefix.length && typeof data === 'object'){\n localStorage.setItem(key.trim(), JSON.stringify(data));\n\n log('Content saved.');\n }\n\n removeOldEntries();\n}", "title": "" }, { "docid": "69556d477c12f22e1c0eb58ac95cd81d", "score": "0.4352815", "text": "function autosave (paneItem) {\n if (!atom.config.get('atom-notes.enableAutosave')) return\n if (!__guard__(paneItem, x => x)) return\n let uri = __guard__(paneItem.getURI, f => f.call(paneItem))\n if (!uri) return\n let modified = __guard__(paneItem.isModified, f => f.call(paneItem))\n if (!modified) return\n if (!NotesFs.isNote(uri)) return\n __guard__(paneItem.save, f => f.call(paneItem))\n}", "title": "" }, { "docid": "b4cd54f5887cde4da8c29512720104a4", "score": "0.43497935", "text": "update () {\n /* istanbul ignore else */\n if (this.lazy) {\n this.dirty = true;\n } else if (this.sync) {\n this.run();\n } else {\n queueWatcher(this);\n }\n }", "title": "" }, { "docid": "9552867cbabe3f35e2df1bf4c900a7b6", "score": "0.43465632", "text": "function notifyViewsOfModelUpdate(modelID) {\n //console.log('Model update: ',modelID);\n\n var viewArry = _modelViewBindingMap[modelID];\n\n if (viewArry) {\n viewArry.forEach(function (view) {\n _view.updateView(view);\n });\n }\n }", "title": "" }, { "docid": "78c6aabbf5baabbc6077980f59b2da73", "score": "0.4341089", "text": "static removeModel(key) {\n delete Model.instanceMap[key];\n }", "title": "" }, { "docid": "e8b8556341b2f9bca1ae6cf8c17da93e", "score": "0.43358287", "text": "__applyModelChanges() {\n this.buildLookupTable();\n this._applyDefaultSelection();\n }", "title": "" }, { "docid": "11703e5b3aa6b385d82cc01157981f54", "score": "0.4328921", "text": "function mapper_track_and_mark_not_stale(pointer,key) {\n\tpointer.stale = false;\n\tmapper_features[key] = pointer;\n}", "title": "" }, { "docid": "cdbd400f19dd59d63ee49b3466e8967e", "score": "0.43270826", "text": "function save(key, value) { return local.save(key, value); }", "title": "" }, { "docid": "94d696103d1cd57cd9abec773e30e8fe", "score": "0.43186966", "text": "function actuallySave() {\n var inputs = document.getElementsByTagName('input');\n var data = {\n details: details\n };\n var isDefault = true;\n for(var i = 0; i < inputs.length; ++i) {\n if(inputs[i].type == 'checkbox') {\n data[inputs[i].id] = inputs[i].checked;\n if(isDefault && inputs[i].checked != (DEFAULT_FALSE.indexOf(inputs[i].id) === -1)) {\n isDefault = false;\n }\n }\n else {\n data[inputs[i].id] = inputs[i].value;\n if(isDefault && inputs[i].value) {\n isDefault = false;\n }\n }\n }\n twitch.configuration.set('broadcaster', CONFIG_VERSION, JSON.stringify(data));\n document.getElementById(\"reset\").disabled = isDefault;\n if(saveCallTimeout) {\n clearTimeout(saveCallTimeout);\n }\n saveCallTimeout = undefined;\n hideUnsaved();\n }", "title": "" }, { "docid": "76c34c03778b5a5b184bc762d944e78a", "score": "0.4313694", "text": "function objectUpdate(obj) {\n if(obj.hasOwnProperty(\"syncState\")) {\n if(obj.syncState > 0) { obj.syncState = 2; }\n } else {\n obj = _.cloneDeep(_stripAngularHashKeys(obj));\n obj.syncState = 0;\n obj.pk = \"TESTING!!!\";\n //var element = _parseProperty(obj, view_model.primaryKeyProperty);\n //console.log(\"Interestingly, element is: \" + element);\n //console.log(_parseProperty(obj, view_model.primaryKeyProperty));\n _.set(obj, view_model.primaryKeyProperty, _generateUUID());\n //element = _generateUUID();\n //console.log(\"Interestingly, element is: \" + element);\n console.log(\"This element's pk value was:\" + obj.pk);\n }\n _patchLocal(_stripAngularHashKeys([obj]), function(response) {\n if(view_model.pushSync) newSyncThree(_notifyObservers);\n });\n }", "title": "" }, { "docid": "ec2b595c70dcb75148f4e04eb7a540e2", "score": "0.43133578", "text": "startTimerInterval() {\n const intervalConfig = 250;\n const checkPointConfig = intervalConfig * 4 * 10;\n this.set('isCountingDown', true);\n var lastTick = Date.now();\n \n let intervalId = setInterval(function() {\n // This can get really fun if the user starts moving the machine settings\n // For this app it is not the case we want to handle that scenario\n // Recommended: Use the server to handle the countdowns which brings up\n // interesting cases for keeping in sync\n let now = Date.now();\n let delta = now - lastTick;\n lastTick = now;\n\n this.decrementProperty('countDownRemainingMilis', delta);\n this.incrementProperty('milisSinceLastSave', delta);\n \n let isFinished = this.isTaskFinished() || this.isCountDownFinished();\n \n if(isFinished) {\n this.endTimerInterval();\n }\n \n if(this.get('milisSinceLastSave') > checkPointConfig || isFinished) {\n this.saveSpentTime();\n }\n \n }.bind(this), intervalConfig);\n this.set('intervalTimerId', intervalId);\n }", "title": "" }, { "docid": "b664c83a6c373a02c1b21f065f470fa0", "score": "0.4310729", "text": "function wsToggleIntervalSave (element) {\n\tvar id = $(element).attr('id')\n\tvar splitResult = id.split('-')\n\tvar formId = splitResult[1]\n\tvar text = $(element).text()\n\tif ($(element).hasClass('ws-interval-on')) {\n\t\t$(element).removeClass('ws-interval-on')\n\t\t$(element).removeClass('btn-primary')\n\t\t$(element).addClass('btn-secondary')\n\t\t$(element).addClass('ws-interval-off')\n\t\t$(element).text(wsAutoSaveButtonOff)\n\t} else {\n\t\t$(element).removeClass('ws-interval-off')\n\t\t$(element).removeClass('btn-secondary')\n\t\t$(element).addClass('btn-primary')\n\t\t$(element).addClass('ws-interval-on')\n\t\t$(element).text(wsAutoSaveButtonOn)\n\t\tif (window.wsAjax) {\n\t\t\t$('#' + formId).find('input[type=button]').each(function () {\n\t\t\t\tif (typeof $(this).attr('onclick') !== 'undefined' && $(this).attr('onclick') !== false) {\n\t\t\t\t\tsetGlobalAutoSave(this, formId)\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\t$('#' + formId).find('input[type=submit]').each(function () {\n\t\t\t\tsetGlobalAutoSave(this, formId)\n\t\t\t})\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f5b3f30e451d516a678b30ca936e85b6", "score": "0.4294632", "text": "function setTimeModel(model) {\n _model = model;\n model.addTimePeriodChangeListener({\n timePeriodChanged : function(start, end) {\n redrawAll();\n }\n });\n\n model.addTimeSelectionChangeListener({\n selectedTimeChanged : function(time) {\n moveSliderTo(timeToPos(time));\n }\n });\n\n model.addForecastStartTimeChangeListener({\n forecastStartTimeChanged : function(time) {\n redrawScaleBackground();\n }\n });\n\n model.addAnimationEventsListener({\n loadAnimationStartedCb : loadAnimationStartedCb,\n loadFrameStartedCb : loadFrameStartedCb,\n loadFrameCompleteCb : loadFrameCompleteCb,\n loadGroupProgressCb : loadGroupProgressCb,\n loadCompleteCb : loadCompleteCb,\n animationFrameContentReleasedCb : animationFrameContentReleasedCb,\n frameChangedCb : frameChangedCb\n });\n\n redrawAll();\n }", "title": "" }, { "docid": "8204c17437b309faf58f7e06c2185eb6", "score": "0.42921692", "text": "save () { this.store.saveSync() }", "title": "" }, { "docid": "3bc584a30cdc8329e2736cd91ec43c4a", "score": "0.42902076", "text": "async saveModel() {\n if (this.model == null) {\n throw new Error('Cannot save model before creating model.');\n } else {\n return await this.model.save(this.modelSavePath_);\n }\n }", "title": "" }, { "docid": "bda9346fe63494a541bde5e1d674153e", "score": "0.4282609", "text": "function keyTyped() {\n if (key === 's') {\n console.log(\"saving file\");\n\n // name the file with the current date and time\n //save(year() + \"-\" + month() + \"-\" + day() + \"_\" + hour() + \"-\" + minute() + \"-\" + second());\n\n save(\"image.jpg\");\n }\n}", "title": "" } ]
a1d99ec01d280086fdfd1f353a5ba5d9
The label for the checkbox on the passed row
[ { "docid": "2112415789d891c8feb4ac6383c60c5c", "score": "0.8742206", "text": "checkboxLabel(row) {\n if (!row) {\n return `${this.isAllSelected() ? 'deselect' : 'select'} all`;\n }\n return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;\n }", "title": "" } ]
[ { "docid": "7b8217eff0a0a4ea7f780977a0f78a67", "score": "0.8777864", "text": "checkboxLabel(row) {\n if (!row) {\n return `${this.isAllSelected() ? 'select' : 'deselect'} all`;\n }\n return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;\n }", "title": "" }, { "docid": "cbdf87b44a341bdea30468044dd02464", "score": "0.87633187", "text": "checkboxLabel(row) {\n if (!row) {\n return `${this.isAllSelected() ? 'select' : 'deselect'} all`;\n }\n return `${this.accselection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;\n }", "title": "" }, { "docid": "570d607ac6e7bb95814d10e2a068cd99", "score": "0.678243", "text": "_getCellLabel(column,row){return\"Cell \"+this._getLabel(column,\"Column\")+this._getLabel(row,\"Row\")}", "title": "" }, { "docid": "6aad022bf86928bb32527391cc73f6d1", "score": "0.64788383", "text": "_getCellLabel(column, row) {\n return (\n \"Cell \" + this._getLabel(column, \"Column\") + this._getLabel(row, \"Row\")\n );\n }", "title": "" }, { "docid": "a1615bf45aebfce795672a5d83de345e", "score": "0.629926", "text": "static getCheckboxForRow(selected, checkboxHandler, cellType) {\n const CellComponent = `${cellType}`;\n return (\n <CellComponent key='meta-check' className='run-table-container'>\n <div>\n <input type='checkbox' checked={selected} onChange={checkboxHandler} />\n </div>\n </CellComponent>\n );\n }", "title": "" }, { "docid": "f905566dc59dd101e5b24ad358c64957", "score": "0.62794536", "text": "function _checkboxLabelClick() {\n // Get checkbox next to the label\n var $checkbox = $(this).prev().children().first(); // Toggle the checkbox\n\n $checkbox.attr('checked', !$checkbox.attr('checked'));\n }", "title": "" }, { "docid": "65037cf27b61eba3f2840d5260fd7942", "score": "0.6040817", "text": "FACILITY_ITEM_CHECKBOX(i) { return $(`div[kendo-grid=\"facilityGrid\"] tr:nth-child(${i}) input[ng-model=\"dataItem.isVerified\"]`)}", "title": "" }, { "docid": "5302ac86b1ff2ad60cc838d5f386ef7f", "score": "0.5976945", "text": "function getNLCheckboxValue( fld )\n{\n\tif (!fld)\n \treturn;\n\n\treturn fld.checked;\n}", "title": "" }, { "docid": "dfcf3f42c275e521288924a5f7366ba6", "score": "0.59625185", "text": "checkbox(name, value, checked, label) {\r\n let id = name + '_' + value;\r\n return this.node({\r\n type: 'checkbox',\r\n name,\r\n value,\r\n checked,\r\n label,\r\n id,\r\n });\r\n }", "title": "" }, { "docid": "e563e702ccfe1b1f1c8250afaf2afb1d", "score": "0.59523004", "text": "get label() {\n const labels = this.selectedLabels;\n if (labels.length <= 1) {\n return labels[0] || '';\n }\n // multiple mode, do according to UX specs\n const output = labels.join(MULTIPLE_LABEL_SEPARATOR);\n return output.length > MULTIPLE_LABEL_MAX_SIZE ? `${output.slice(0, MULTIPLE_LABEL_MAX_SIZE - 3)}...` : output;\n }", "title": "" }, { "docid": "018f37381ed251598c96444364446130", "score": "0.59506005", "text": "function checkboxTemplate(name, value, label){\n var $tpl=\"<li>\";\n $tpl+=\"<input type='checkbox' name='\"+name+\"' value='\"+value+\"' />\";\n $tpl+=label;\n $tpl+=\"</li>\";\n return $tpl;\n }", "title": "" }, { "docid": "73f1929de59afbc5c05fdacf568e4c8e", "score": "0.5926051", "text": "cellTypeCheckBox() {\n const checkboxList = this.base.createNestedMarkup(this.cellElement, 'dxp-checkbox', [this.data.celldata]);\n checkboxList[0]['componentOnReady']().then((checkboxElement) => {\n const checkboxDiv = checkboxElement ? checkboxElement.querySelector('.dxp-checkbox') : checkboxElement.querySelector('.dxp-checkbox');\n checkboxDiv.style.background = 'transparent';\n const COL_KEY = this.data.header['column_key'];\n const COL_KEY_VALUE = typeof COL_KEY === 'function' ? COL_KEY(this.data.row) : COL_KEY;\n if (COL_KEY !== undefined) {\n const checked = typeof COL_KEY_VALUE === 'boolean' ? COL_KEY_VALUE : this.data.row[COL_KEY_VALUE];\n checkboxElement['setChecked'](checked);\n }\n if (this.data.celldata.value === 'select') {\n checkboxElement.setAttribute('dxpgrid', 'select');\n }\n if (this.data.celldata.value === 'selectall') {\n checkboxElement.setAttribute('dxpgrid', 'selectall');\n checkboxElement.setChecked(this.data.celldata.selected);\n }\n });\n }", "title": "" }, { "docid": "3c0579980f3b67084464ce47c62de47c", "score": "0.591007", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "227b70d777ad2f546deafdc8da988ab1", "score": "0.59030694", "text": "get title() {\n return 'Checkbox';\n }", "title": "" }, { "docid": "df555fa36e5a6c19969115782ac46bbb", "score": "0.5896614", "text": "_createCheckboxRow(key, value, htmlId) {\n let tr = $(\"<tr class='widget-config-item'></tr>\");\n let checked = value == true ? \" checked\" : \"\";\n $(tr).html('<td class=\"widget-conf-label\" key-id=\"' + key + '\" title=\"' + window.iotlg[key + \"_Tooltip\"] + '\">' + key + '</td><td class=\"widget-config-data\" input_fmt=\"checkbox\"><input class=\"widget-config-input\" type=\"checkbox\" id=\"' + htmlId + '\"' + checked + '></td>');\n return tr;\n }", "title": "" }, { "docid": "015789a97ed4f32bf7633d67f551a9f7", "score": "0.58939326", "text": "getLabel() {\n return '';\n }", "title": "" }, { "docid": "126d9c3764022faba7dac1f739e3a501", "score": "0.5891903", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "e49e8edadadcab659d33e1e274dbd8fa", "score": "0.58797246", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "c7e45a9a37ec7e9b23a0d7d3c5e4cbae", "score": "0.58794475", "text": "function createCheckedCheckbox(labelName, attributeName) {\n var createdCheckboxContent = '<input type=\"checkbox\" name=\"' + attributeName + '\" value=\"' + attributeName + '\" id=\"' + attributeName + ' \" checked disabled/>' + '<label for=\"' + attributeName + '\">' + labelName + '</label><br>';\n return createdCheckboxContent;\n }", "title": "" }, { "docid": "b55a18d89fd1226cf76becb788791511", "score": "0.58694744", "text": "function styleCheckbox(table) {\n\t/**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n*/\n}", "title": "" }, { "docid": "57159a7db572be65689e346bfb935487", "score": "0.5863227", "text": "function styleCheckbox(table) {\r\n /**\r\n $(table).find('input:checkbox').addClass('ace')\r\n .wrap('<label />')\r\n .after('<span class=\"lbl align-top\" />')\r\n \r\n \r\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n .find('input.cbox[type=checkbox]').addClass('ace')\r\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n */\r\n }", "title": "" }, { "docid": "73f81e3086cbc3cdcbb5d886b86f298f", "score": "0.5848688", "text": "getLabel() {}", "title": "" }, { "docid": "7e3837b4a9629284872fe7a172d18563", "score": "0.5833643", "text": "getRowLabelIndex(label) {\n return this.rowLabels.indexOf(find(this.rowLabels, label));\n }", "title": "" }, { "docid": "8096c79ada1dc6d5adfa2b5e5cb16c29", "score": "0.5824813", "text": "function LabelValue(label){\n return label;\n}", "title": "" }, { "docid": "fe0452878efc1c26526a494a0514f3f0", "score": "0.579742", "text": "get matCheckboxSelection() { return this._name; }", "title": "" }, { "docid": "63d3a0f62601e840fe2625eb5b83bfd7", "score": "0.5795853", "text": "get label() {\n return this.getLabel();\n }", "title": "" }, { "docid": "33fc1ebf9ab67041b680781ff2d0d620", "score": "0.57863915", "text": "function styleCheckbox(table) {\r\n\t\t/**\r\n\t\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\r\n\t\t * .after('<span class=\"lbl align-top\" />')\r\n\t\t * \r\n\t\t * \r\n\t\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\r\n\t\t * />').after('<span class=\"lbl align-top\" />');\r\n\t\t */\r\n\t}", "title": "" }, { "docid": "e18507651141be950b8c1101941f9305", "score": "0.5784829", "text": "selectRow(event) {\n const selected = event.target.checked;\n const target = event.target.name;\n // eslint-disable-next-line radix\n const iteration = parseInt(target.substring(3, target.length));\n this.displayRows[iteration].checked = selected;\n }", "title": "" }, { "docid": "78fbe1e45ec2ed69bba4754b7e69e874", "score": "0.57826287", "text": "label(attributeName) {\n const arg = this.args[attributeName];\n return arg ? arg.label : null;\n }", "title": "" }, { "docid": "d6d94bad12c22901485ac85115ab2caa", "score": "0.5771432", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "42e3e05c7d4397712807073fe8ab57b8", "score": "0.5771171", "text": "get label(){ return this.get('label') || this.values.join('; '); }", "title": "" }, { "docid": "ebcb365bcd4e7a67aaee49b9cce2278b", "score": "0.57618576", "text": "get selectedLabels() {\n return this.selection.map(selected => this.getItemPropertyValue(selected, 'label') || '');\n }", "title": "" }, { "docid": "6949d162b4e70614e0e9eac7aab79f43", "score": "0.57617766", "text": "function findLabelForCheckbox(id) {\n var labels = document.getElementsByClassName('textboxLabel');\n var targetId = \"label-\" + id;\n for (var i = 0; i < labels.length; i++) {\n var label = labels[i];\n if (label.id === targetId) {\n return label;\n }\n }\n return null;\n}", "title": "" }, { "docid": "2f21b8479d229dbfad2de44f25340395", "score": "0.5756899", "text": "function label(d) {\n var model = d.model || d.data.model;\n var id = d.id || d.data.id;\n return model + \": \" + id;\n }", "title": "" }, { "docid": "12d5437c5d16afd72253534ee5b0b963", "score": "0.5754531", "text": "mainLabel() {\n const selectedText = this.props.intl.formatMessage({ id: 'Terra.form.select.selected' });\n let label;\n if (this.props.display) {\n label = `${this.props.display} ${selectedText}, ${this.ariaLabel()}`;\n } else if (this.props.placeholder) {\n label = `${this.props.placeholder}, ${this.ariaLabel()}`;\n }\n\n return label || this.ariaLabel();\n }", "title": "" }, { "docid": "2325c8e6fb1e6fac86ab8f02de7a5ccf", "score": "0.5730718", "text": "function getOptionsCheckbox(funkName,dataItrName,index) {\n return \"<label><input id='options\" + index + \"'disabled='disabled' type='checkbox' onchange='\" + funkName + \"(!$(this).is(':checked'));'><span data-itr='\" + dataItrName + \"'></span></label>\";\n }", "title": "" }, { "docid": "f30e562ce50d3f6aa7ba7bf0a3ac2ab7", "score": "0.5720138", "text": "function styleCheckbox(table) {\n\t/**\n\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\n\t * .after('<span class=\"lbl align-top\" />')\n\t * \n\t * \n\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\n\t * />').after('<span class=\"lbl align-top\" />');\n\t */\n\t}", "title": "" }, { "docid": "f30e562ce50d3f6aa7ba7bf0a3ac2ab7", "score": "0.5720138", "text": "function styleCheckbox(table) {\n\t/**\n\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\n\t * .after('<span class=\"lbl align-top\" />')\n\t * \n\t * \n\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\n\t * />').after('<span class=\"lbl align-top\" />');\n\t */\n\t}", "title": "" }, { "docid": "f30e562ce50d3f6aa7ba7bf0a3ac2ab7", "score": "0.5720138", "text": "function styleCheckbox(table) {\n\t/**\n\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\n\t * .after('<span class=\"lbl align-top\" />')\n\t * \n\t * \n\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\n\t * />').after('<span class=\"lbl align-top\" />');\n\t */\n\t}", "title": "" }, { "docid": "5553e5f10431d22d05a24fad5211e696", "score": "0.5706295", "text": "function ApexDataLabels() { }", "title": "" }, { "docid": "5553e5f10431d22d05a24fad5211e696", "score": "0.5706295", "text": "function ApexDataLabels() { }", "title": "" }, { "docid": "5ce349eae18f23a6acef97b213c3f960", "score": "0.57019556", "text": "function styleCheckbox(table) {\r\n\t\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t\r\n\t}", "title": "" }, { "docid": "4e62aa7ae26c773fe71cd7ff6e4c9790", "score": "0.56980836", "text": "function styleCheckbox(table) {\r\n\t/**\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t*/\r\n\t}", "title": "" }, { "docid": "596dc74ad68c05a41ab17359426bf5cb", "score": "0.569598", "text": "function labelChecked() {\n $('label').removeClass('input-checked');\n $(this).addClass('input-checked');\n }", "title": "" }, { "docid": "b1353363bb5e824b67f165edd9e30d6d", "score": "0.5695508", "text": "getValue() { return this._checkbox.getValue(); }", "title": "" }, { "docid": "8830eb99c27a30b82114f8958077f6b5", "score": "0.5693343", "text": "get label() {\n return this.i.eo;\n }", "title": "" }, { "docid": "8830eb99c27a30b82114f8958077f6b5", "score": "0.5693343", "text": "get label() {\n return this.i.eo;\n }", "title": "" }, { "docid": "cf15d3e9800825ce688579977ae1cd7f", "score": "0.56892", "text": "function addRowLabel(label) {\n rowLabels.indexOf(label) > -1 || rowLabels.push(label);\n }", "title": "" }, { "docid": "96041c80aed3f8cbc2c5d6bbb917a580", "score": "0.5681381", "text": "getItemLabel(item) {\n return item.label || item.textContent || '';\n }", "title": "" }, { "docid": "b1ced2a66b97a572b466be62cfe05ed2", "score": "0.5680551", "text": "function createMenuLabel(grammarRule, initChecked) {\n const checkboxLabel = document.createElement('label');\n checkboxLabel.classList.add(\"checkbox-label\");\n\n const checkbox = document.createElement('input');\n checkbox.setAttribute('type', 'checkbox');\n checkbox.checked = initChecked;\n CommandIde.addEventListener(checkbox, 'change', () => $ctrl.api.changeDefaultRulePreferences(grammarRule.name, checkbox.checked));\n checkboxLabel.append(checkbox);\n\n const checkmark = document.createElement('span');\n checkmark.classList.add(\"checkmark\");\n checkboxLabel.append(checkmark);\n\n const labelText = document.createElement('span');\n labelText.classList.add(\"label-text\");\n labelText.textContent = grammarRule.descriptiveName;\n checkboxLabel.append(labelText);\n\n return checkboxLabel;\n }", "title": "" }, { "docid": "fe7654ac4c20f952d3c299db4abb54b8", "score": "0.5652959", "text": "labeled() {\n return getLabels(this.grid);\n }", "title": "" }, { "docid": "7181cc6988aca2bc3b2bf8ccbd6ac2cf", "score": "0.5647151", "text": "_label(label) {\n return `${label}${label && this.required ? '*' : ''}`;\n }", "title": "" }, { "docid": "aff1300d8dd043cbf50286e64f1dff74", "score": "0.56366456", "text": "isThisCheckboxLabeless() {\n return this.type==='checkbox' && typeof this.label===\"undefined\";\n }", "title": "" }, { "docid": "8fc82fa3323c2536a07102ebcf692a25", "score": "0.56353223", "text": "function ApexDataLabels() {}", "title": "" }, { "docid": "f402f56162c2980a144916235db321fa", "score": "0.56266004", "text": "checkBoxMaker(inputField, title ,label) {\n let titleElement = null;\n if (title !== '') {\n titleElement = (\n <h2>\n <div className=\"textHeader\">{title}</div>\n </h2>\n );\n }\n return (\n <div>\n {titleElement}\n <div className=\"form-check\">\n <input class=\"form-check-input\" className=\"styleCheckBox\" type=\"checkbox\" value=\"\" id=\"check1\" onClick={this.checkClick.bind(this, inputField)}/>\n <label className=\"form-check-label\" for=\"defaultCheck1\">\n {label}\n </label>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "2183342a477665f49df5e3e0640d5887", "score": "0.5601862", "text": "function createCheckbox(labelName, attributeName) {\n var createdCheckboxContent = '<input type=\"checkbox\" name=\"' + attributeName + '\" value=\"' + attributeName + '\" id=\"' + attributeName + '\"/>' + '<label for=\"' + attributeName + '\">' + labelName + '</label><br>';\n return createdCheckboxContent;\n }", "title": "" }, { "docid": "6d4c7320b6cafce447fbf10e83713a47", "score": "0.559107", "text": "function styleCheckbox(table) {\n\t\t/**\n\t\t\t$(table).find('input:checkbox').addClass('ace')\n\t\t\t.wrap('<label />')\n\t\t\t.after('<span class=\"lbl align-top\" />')\n\n\n\t\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t\t*/\n\t}", "title": "" }, { "docid": "c0fed49252f5725940e3a38b817046d9", "score": "0.55863845", "text": "function getLabel() {\n\n var label = '';\n\n if (element.get(0).tagName.toLowerCase() == 'input') {\n\n label = element.val();\n\n } else {\n\n label = element.text();\n\n }\n\n\n return label;\n\n }", "title": "" }, { "docid": "a89e6b8f24338266aa48973d62dcca24", "score": "0.55853075", "text": "function label(t) {\n return t;\n}", "title": "" }, { "docid": "212bf8064c7254375474a2218af9c822", "score": "0.5574263", "text": "function addCheckboxGrid ( cbxId,title,name,value,command,data,checked,\n onChange,holderId,\n row,col,rowSpan,colSpan ) {\n\n if (document.getElementById(cbxId))\n return;\n\n var cell = getGridCell ( holderId,row,col );\n\n if (cell) {\n\n cell.rowSpan = rowSpan;\n cell.colSpan = colSpan;\n\n var options = \"\";\n if (name.length>0)\n options = options + \" name=\\\"\" + name + \"\\\"\";\n if (value.length>0)\n options = options + \" value=\\\"\" + value + \"\\\"\";\n if (checked)\n options = options + \" checked\";\n if (command.length>0)\n options = options + \" onclick=\\\"checkboxClicked(this,'\" +\n command + \"','\" + data + \"');\\\"\";\n if (onChange.length>0)\n options = options + \" onChange=\\\"\"+onChange+\"\\\" \";\n\n $(\"<label id=\\\"\"+cbxId+\"-label\"+\"\\\" for=\\\"\" + cbxId +\n \"\\\" style=\\\"white-space:nowrap\\\">\" +\n \"<input id=\\\"\"+cbxId+\"\\\" type=\\\"checkbox\\\"\" + options + \"/>\" +\n title + \"</label>\")\n .appendTo(cell);\n\n }\n\n return cell;\n\n}", "title": "" }, { "docid": "ebe9cc9a49620351b0244309ac05717f", "score": "0.5570133", "text": "function styleCheckbox(table) {\n\t/**\n\t\t$(table).find('input:checkbox').addClass('ace')\n\t\t.wrap('<label />')\n\t\t.after('<span class=\"lbl align-top\" />')\n\n\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t*/\n\t}", "title": "" }, { "docid": "ebe9cc9a49620351b0244309ac05717f", "score": "0.5570133", "text": "function styleCheckbox(table) {\n\t/**\n\t\t$(table).find('input:checkbox').addClass('ace')\n\t\t.wrap('<label />')\n\t\t.after('<span class=\"lbl align-top\" />')\n\n\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t*/\n\t}", "title": "" }, { "docid": "7274d94573974924ff3f178517f72add", "score": "0.5559437", "text": "function Checkbox(label, v) {\r\n if (Array.isArray(v)) {\r\n return bind.Checkbox(label, v);\r\n }\r\n else {\r\n const ref_v = [v()];\r\n const ret = bind.Checkbox(label, ref_v);\r\n v(ref_v[0]);\r\n return ret;\r\n }\r\n }", "title": "" }, { "docid": "80a358fc68f5dab6d162a6fd5525cfbc", "score": "0.5556567", "text": "renderLabel(value, choiceText, inReview) {\n if (inReview) {\n return (\n <input\n className=\"inputChoice\"\n type=\"checkbox\"\n value={value}\n checked={this.state.checked}\n disabled\n onChange={() => this.onStateChanged()}\n />\n );\n }\n return (\n <input\n className=\"inputChoice\"\n type=\"checkbox\"\n value={value}\n checked={this.state.checked}\n onChange={() => this.onStateChanged()}\n />\n );\n }", "title": "" }, { "docid": "2bcc9e9558bef9775f32857130801e2c", "score": "0.5546268", "text": "function nodeLabel(d, i) {\n if (d?.label === undefined) { return d.id; }\n return d.label;\n }", "title": "" }, { "docid": "a6a4bf929574aabd7685de4a2be0db23", "score": "0.55386764", "text": "function updateLabel(data){\r\n\t\t\t labels = data.Rows.map(function(item){\r\n\t\t\t\treturn item.Label;\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "73e8e62fcecf4278444621a85a8bc9a2", "score": "0.5531935", "text": "getLabel() {\r\n return this._getNodeFromCompilerNodeIfExists(this.compilerNode.label);\r\n }", "title": "" }, { "docid": "2ff5766c36fd5df386707e79a900ef1a", "score": "0.5525397", "text": "checkboxClicked(event) {\n const emitJSON = { actionName: this.data.header['column_action'] || 'checkboxData', row: this.data.row, details: event.detail };\n this.dxpDataGridEvents.emit(emitJSON);\n }", "title": "" }, { "docid": "489662b30964e9318855088afab21622", "score": "0.5524354", "text": "function renderCheckbox(val) {\n var checkedImg = '/bundles/netresearchtimetracker/js/ext-js/resources/themes/images/default/menu/checked.gif';\n var uncheckedImg = '/bundles/netresearchtimetracker/js/ext-js/resources/themes/images/default/menu/unchecked.gif';\n var result = '<div style=\"text-align:center;height:13px;overflow:visible\"><img style=\"vertical-align:-3px\" src=\"'\n + (val ? checkedImg : uncheckedImg)\n + '\" /></div>';\n\n return result;\n}", "title": "" }, { "docid": "62a7f22cad9e9bdfb2ee16a02ff4ae20", "score": "0.5518757", "text": "get label() {\n return this.labels[0];\n }", "title": "" }, { "docid": "86d517edafd1cda6de81aa3638c1b56a", "score": "0.55148876", "text": "function createCheckBoxRow(rowObject) {\n \n var newLine = document.createElement(\"br\");\n var newCheckBoxInput = document.createElement(\"input\");\n var newLabel = document.createElement(\"label\");\n \n var labelText = document.createTextNode(rowObject.rowName + \" \");\n \n newLabel.setAttribute(\"id\", \"rowLabel\" + (countRows + 1));\n newCheckBoxInput.setAttribute(\"id\", \"inputField\" + (countRows + 1));\n newCheckBoxInput.setAttribute(\"type\", \"checkbox\");\n newCheckBoxInput.checked = rowObject.isChecked;\n \n if (rowObject.rowValidationType === \"Mandatory\") {\n newCheckBoxInput.setAttribute(\"class\", \"mandatoryField\");\n }\n \n newLabel.appendChild(labelText);\n \n frmForm.appendChild(newLine);\n frmForm.appendChild(newLabel);\n frmForm.appendChild(newCheckBoxInput);\n frmForm.appendChild(newLine.cloneNode(true));\n}", "title": "" }, { "docid": "0bc127b00cc853018adae7688b05dc55", "score": "0.54904705", "text": "_getLabelId() {\n var _a;\n return ((_a = this._parentFormField) === null || _a === void 0 ? void 0 : _a.getLabelId()) || '';\n }", "title": "" }, { "docid": "fb2336b658c571eba82610ba21ab5d94", "score": "0.54893845", "text": "function labelFn(label) {\n return \" - \" + label;\n }", "title": "" }, { "docid": "a326d9ee4ef15ff4a2e67c650ae249ad", "score": "0.5480286", "text": "function getBooleanInputValue( row, fieldAPI ){\n\tif( !gridInfoByField.hasOwnProperty( fieldAPI )){\n\t\tthrow( \"gridInfoByField[\" + fieldAPI + \"] does not exist\" );\n\t}\n\tvar el = jq( row ).find( createFieldInputSelector( fieldAPI ) );\n\tif( !el || el.length < 1 ){\n\t\t//-- @TODO: investigate further - this happens if there is a select that hasn't been used yet... (facepalm)\n\t\treturn( jq( row ).find( createFieldSelector( fieldAPI ) + \" div\" ).text() );\n\t} else {\n\t\treturn( el.is(\":checked\") );\n\t}\n}", "title": "" }, { "docid": "c3bb2146b2b9d8884fcb355676047f74", "score": "0.54747975", "text": "function getString(cnt, data){\n str += '<tr>'\n str += '<th><input id=\"checkall\" type=\"checkbox\" name=\"checkall\"></th>'\n str += '<th scope=\"row\">'+ cnt + '</th>';\n str += '<td>' + data.ifsc + '</td>';\n str += '<td>' + data.bank_id + '</td>';\n str += '<td>' + data.branch + '</td>';\n str += '<td>' + data.address + '</td>';\n str += '<td>' + data.city + '</td>';\n str += '<td>' + data.district + '</td>';\n str += '<td>' + data.state + '</td>';\n str += '</tr>';\n return str;\n}", "title": "" }, { "docid": "1096b35e1592cb9c820a1d72122e678b", "score": "0.5461838", "text": "getLabel() {\n return this.viewValue;\n }", "title": "" }, { "docid": "1096b35e1592cb9c820a1d72122e678b", "score": "0.5461838", "text": "getLabel() {\n return this.viewValue;\n }", "title": "" }, { "docid": "f1374ef1e637da1d7c030d6484da737b", "score": "0.545976", "text": "function CheckBox({ checked, uniqueId }) {\n return (\n <div className=\"status\">\n <input type=\"checkbox\" defaultChecked={checked} className=\"checkbox-round\" id={`checked-${uniqueId}`} />\n <label htmlFor={`checked-${uniqueId}`}></label>\n </div>\n )\n}", "title": "" }, { "docid": "2ab992e7806a23a175cf8349708d144e", "score": "0.5453844", "text": "get label() {\n return this._label || \"\";\n }", "title": "" }, { "docid": "f210379a273e7abd06bafd2a19878879", "score": "0.5450934", "text": "function btnSuccessAjaxResp(data) {\n var trHTML = '';\n $.each(data, function (key, value) {\n trHTML +=\n '<tr><td>' + value.id +\n '</td><td>' + value.sifra +\n '</td><td>' + value.punoIme +\n '</td><td>' + value.espb +\n '</td><td>' + value.semestar +\n '</td><td>' + value.priznatESPB +\n '</td><td>' + value.espb +\n '</td><td><label><input ' + 'value= ' + value.espb + ' type=\"checkbox\" id=\"idch\">Признат</input></label>' +\n '</td></tr>';\n });\n return trHTML;\n}", "title": "" }, { "docid": "c463cf92406f7de96f0ab89e93ae9d07", "score": "0.5450228", "text": "render() {\n const checkboxes = this.props.form.value.contents.map(content => {\n const childPath = this.props.form.path + \".\" + content.value\n content.checked = get(childPath, \"toggle\")\n\n return <div key={childPath}>\n <input\n type=\"checkbox\"\n className=\"k-checkbox\"\n id={childPath}\n defaultChecked={content.checked}\n onClick={(event) => this.props.updateState(childPath, event.target.checked)} />\n <label className=\"k-checkbox-label\" htmlFor={childPath}>{content.text}</label>\n </div>\n })\n\n return <div className=\"k-form-field\">\n <LabelTooltip form={this.props.form} />\n {checkboxes}\n </div>\n }", "title": "" }, { "docid": "a597c0c4b2a5fd518c7d1e09a71b4bae", "score": "0.5434681", "text": "function checkboxClicked()\n {\n \n //Get current table\n var table = document.getElementById(\"dataTable\");\n var rowCount = table.rows.length;\n \n //Loop through all rows\n for(var i=0; i<rowCount; i++)\n {\n var row = table.rows[i];\n var chkbox = row.cells[0].childNodes[0];\n var textbox = row.cells[1].childNodes[0];\n \n //checkbox is checked\n if(null != chkbox && true == chkbox.checked)\n {\n if(null != textbox)\n {\t\t\n textbox.style.setProperty(\"text-decoration\", \"line-through\");\n }\n }\n \n //checkbox is not checked\n else\n {\n textbox.style.setProperty(\"text-decoration\", \"none\");\n }\n \n }\n //Save\n saveToDoList();\n }", "title": "" }, { "docid": "5f6f7766476c7a648fb3e2d0146dcf1c", "score": "0.5429669", "text": "function setupLabel() {\n\tif ($('.label_check input').length) {\n\t\t$('.label_check').each(function(){ \n\t\t\t$(this).removeClass('c_on');\n\t\t});\n\t\t$('.label_check input:checked').each(function(){ \n\t\t\t$(this).parent('label').addClass('c_on');\n\t\t}); \n\t};\n\t\n}", "title": "" }, { "docid": "54b94927839a19e191d52bd737e95aa4", "score": "0.5420781", "text": "makeLabel() {\r\n\r\n //De-structure the required props\r\n const { valueEngineType } = this.props;\r\n\r\n let label;\r\n\r\n if (valueEngineType === 'petrol') {\r\n label = document.getElementById('optn-petrol').innerText;\r\n } else if (valueEngineType === 'diesel') {\r\n label = document.getElementById('optn-diesel').innerText;\r\n } else if (valueEngineType === 'hybrid') {\r\n label = document.getElementById('optn-hybrid').innerText;\r\n } else if (valueEngineType === 'electric') {\r\n label = document.getElementById('optn-electric').innerText;\r\n }\r\n return label;\r\n }", "title": "" }, { "docid": "68655c30c31ecb49314dc6afeca252ae", "score": "0.5414107", "text": "function getCheckboxString(i, attendeeEntry, columns, date, fullName) {\n\n // The offset of 3 is dependent on the first 3 elements of attendeeEntry being non-activities (firstName, lastName, time)\n var index = parseInt(i) + 3;\n\n var hasDoneActivity = attendeeEntry[index];\n var col = columns[i][2];\n\n var box = \"<input type=\\\"checkbox\\\" \"\n + (hasDoneActivity ? \"checked\" : \"\")\n + \" onclick=\\\"selectActivity('\" + fullName + \"','\" + col + \"', '\" + date + \"')\\\">\";\n\n return box;\n}", "title": "" }, { "docid": "6452cfd4a2be7c7f2c752b6376348713", "score": "0.5412038", "text": "function getCheckboxString(i, attendeeEntry, columns, date, fullName) {\n\n // The offset of 3 is dependent on the first 3 elements of attendeeEntry being non-activities (firstName, lastName, time)\n var index = parseInt(i) + 4;\n\n var hasDoneActivity = attendeeEntry[index];\n var col = columns[i][2];\n\n var box = \"<input type=\\\"checkbox\\\" \"\n + (hasDoneActivity ? \"checked\" : \"\")\n + \" onclick=\\\"selectActivity('\" + fullName + \"','\" + col + \"', '\" + date + \"')\\\">\";\n\n return box;\n}", "title": "" }, { "docid": "fa928e7757a2b54fa007c767e5e5e02a", "score": "0.5392522", "text": "get toolbarItemLabel()\n {\n }", "title": "" }, { "docid": "8b557d0ad111264985ad93884a9c9a8a", "score": "0.53920126", "text": "function labelFn (label) {\n return 'y = ' + label;\n }", "title": "" }, { "docid": "dbde959f99e4f30772055ea3de184ccd", "score": "0.5388329", "text": "get labels() {\n if (this.hasDataItems()) {\n return this.selectedDataItems.map(item => this.composer.getItemPropertyValue(item, 'label'));\n }\n return this.selectedSlotItems.map(item => this.getItemLabel(item));\n }", "title": "" }, { "docid": "5f24d43b50abeb48c5dde1c0c63b30bf", "score": "0.5387351", "text": "function containsLabel(v)\n {\n var container = $('#' + id);\n if ($.inArray(v, labels) !== -1)\n {\n return true;\n }\n var found = false;\n $(container).find('input[type=checkbox]').each(function() {\n if ($(this).val() === v)\n {\n found = true;\n }\n });\n return found;\n }", "title": "" }, { "docid": "03881dfb0fac8e0eece32b2bf17b623a", "score": "0.538319", "text": "function getCheckboxValue(el, checked) {\r\n const key = checked ? '_trueValue' : '_falseValue';\r\n return key in el ? el[key] : checked;\r\n}", "title": "" }, { "docid": "4bcfa970dc003101d05581b1759ad14a", "score": "0.53775907", "text": "getLabel() { return this.labelP.innerText; }", "title": "" }, { "docid": "58c4e7dcc4858d9f3f66be1c1e0beb28", "score": "0.5360468", "text": "function CLC_Content_FindLabelText(target){\r\n var logicalLineage = CLC_GetLogicalLineage(target);\r\n var labelText = \"\";\r\n for (var i=0; i < logicalLineage.length; i++){\r\n if (logicalLineage[i].tagName && (logicalLineage[i].tagName.toLowerCase() == \"label\")){\r\n labelText = labelText + \" \" + logicalLineage[i].textContent;\r\n }\r\n }\r\n return labelText;\r\n }", "title": "" }, { "docid": "c070bb55fca634b8e735f9812fb8ba04", "score": "0.5357243", "text": "getLabel() {\n\t\tif (this.labels)\n\t\t\treturn this.labels[this.step] || null\n\t\telse\n\t\t\treturn null\n\t}", "title": "" }, { "docid": "6cc7b323e501e895564715b4a7bfd9c7", "score": "0.5346408", "text": "function InsertCheckbox(row, ID) {\r\n var td = document.createElement(\"td\");\r\n var chk = document.createElement(\"input\");\r\n \r\n td.align = \"center\";\r\n td.style.backgroundColor = \"#DFCCA6\";\r\n chk.id = ID;\r\n chk.type = \"checkbox\";\r\n \r\n if(ID == 0) {\r\n chk.addEventListener(\"click\", SelectAll, false);\r\n chk.name=\"AllCheckbox\";\r\n } else {\r\n chk.name=\"VillageCheckbox\";\r\n }\r\n \r\n td.appendChild(chk);\r\n row.insertBefore(td, row.cells[0]);\r\n }", "title": "" }, { "docid": "a3c7ca1694b22027dd6cf68b7d1b04bd", "score": "0.53434616", "text": "_defaultRenderer(root, _column, { item, selected }) {\n let checkbox = root.firstElementChild;\n if (!checkbox) {\n checkbox = document.createElement('vaadin-checkbox');\n checkbox.setAttribute('aria-label', 'Select Row');\n checkbox.addEventListener('checked-changed', this.__onSelectRowCheckedChanged.bind(this));\n root.appendChild(checkbox);\n }\n\n checkbox.__item = item;\n checkbox.__rendererChecked = selected;\n checkbox.checked = selected;\n }", "title": "" }, { "docid": "5a8316f2df54fbfac7cdc1973f990722", "score": "0.53153247", "text": "get label(){\n return this._label;\n }", "title": "" }, { "docid": "2e0cb8517397f5b8ae182b27217b574e", "score": "0.53139013", "text": "function getCheckboxValue(el, checked) {\n const key = checked ? '_trueValue' : '_falseValue';\n return key in el ? el[key] : checked;\n}", "title": "" }, { "docid": "2e0cb8517397f5b8ae182b27217b574e", "score": "0.53139013", "text": "function getCheckboxValue(el, checked) {\n const key = checked ? '_trueValue' : '_falseValue';\n return key in el ? el[key] : checked;\n}", "title": "" }, { "docid": "2e0cb8517397f5b8ae182b27217b574e", "score": "0.53139013", "text": "function getCheckboxValue(el, checked) {\n const key = checked ? '_trueValue' : '_falseValue';\n return key in el ? el[key] : checked;\n}", "title": "" } ]
7d14a0fd8bcc54794fd64c1c1298ef1c
numResults str number of searchresults
[ { "docid": "bf54b6bc93793a9823bf4a6605b55c42", "score": "0.0", "text": "function Leaderboard(props) {\n return(\n <>\n <HeaderLeaderboard />\n <div className=\"leaderboard_search-section\">\n <h3 className=\"leaderboard_title\">Find any member.</h3>\n\n <div className=\"search-frame\">\n <div className=\"search_icon\"></div>\n <input placeholder=\"Search Members...\" style={{margin:\"24px 0px\"}}></input>\n <div className=\"search_divider\" style={{margin:\"15px 10px\"}}></div>\n <div className=\"filter_icon\" style={{margin:\"20px 10px\"}}></div>\n <select style={{margin:\"21px 0px\"}}>\n <option>Filter...</option>\n <option>1</option>\n <option>2</option>\n </select>\n <div className=\"blue_button-search\" style={{margin:\"15px\"}}>\n <span className=\"blue_button-search-text\">Search</span>\n </div>\n </div>\n </div>\n\n <div className=\"leaderboard_body-section\">\n <div className=\"leaderboard_body-current_search\">\n <div className=\"leaderboard_body-current_search-terms-container\">\n <p className=\"text-normal\">Current Search</p>\n <div className=\"leaderboard_body-current_search-terms\">\n <SearchPhrasePanel searchTerm=\"dearchitect\"/>\n <SearchPhrasePanel searchTerm=\"sapatos\"/>\n </div>\n </div>\n\n <div className=\"leaderboard_body-current_search-categories-container\">\n <p className=\"text-normal\" style={{marginBottom:\"20px\"}}>Refine by Categories</p>\n\n <div class=\"checkbox-container\">\n <input type=\"checkbox\" className=\"checkbox\"/>\n <p className=\"text-light-small\" style={{margin:\"3px 0px 0px 0px\"}}>Most Transactions</p>\n </div>\n\n <div class=\"checkbox-container\">\n <input type=\"checkbox\" className=\"checkbox\"/>\n <p className=\"text-light-small\" style={{margin:\"3px 0px 0px 0px\"}}>Oldest Join Date</p>\n </div>\n\n <div class=\"checkbox-container\">\n <input type=\"checkbox\" className=\"checkbox\"/>\n <p className=\"text-light-small\" style={{margin:\"3px 0px 0px 0px\"}}>Newest Join Date</p>\n </div>\n </div>\n\n\n </div>\n \n <div className=\"leaderboard_body-results\">\n <p className=\"text-light\">Showing {props.numResults} results</p>\n <div className=\"leaderboard_body-results-container\">\n <LeaderboardSearchPanel \n username=\"dearchitect#7745\" \n memberSince=\"Jan 1, 2012\"\n avatarUrl=\"https://cdn.discordapp.com/avatars/638784999293976635/06d1e75f49559a1b16e6d127ec1c4fbf.jpg\"\n\n transactions=\"100\"\n lastTransaction=\"Mar 24, 2021\"\n\n latestTransactionUsername=\"dearchitect#7745\"\n latestTransactionAvatarUrl=\"https://cdn.discordapp.com/avatars/638784999293976635/06d1e75f49559a1b16e6d127ec1c4fbf.jpg\"\n />\n <LeaderboardSearchPanel username=\"sapatos#7745\" memberSince=\"Jan 1, 2012\" />\n </div>\n </div>\n </div>\n\n\n <Footer />\n </>\n\n )\n}", "title": "" } ]
[ { "docid": "3b4cad5c18b1ba64484f64c9db47cbb6", "score": "0.70394474", "text": "function getResultsCount() {\n const resultsReturned = $('.facetwp-template .row').children().length;\n\n $('.archive-header__count span').text(resultsReturned);\n }", "title": "" }, { "docid": "cd35eaddf927f6d26d9f5a641eff3a5b", "score": "0.66940856", "text": "function numPages(){\n if(isSearched) {\n return Math.ceil(searchedResults.length / recordsPerPage);\n } else {\n return Math.ceil(data.length / recordsPerPage);\n }\n}", "title": "" }, { "docid": "d9ed65f646ec9b52e5eaccba1f85e56e", "score": "0.6675939", "text": "get matchCount() {\r\n return this._results.length;\r\n }", "title": "" }, { "docid": "e1791bbac16afab85d989db602061874", "score": "0.6640874", "text": "get matchCount() {\n return this._results.length;\n }", "title": "" }, { "docid": "092a011f3302cd49c98aa58c4265176b", "score": "0.65555", "text": "function getMoreResults() {\n if (searchTerm.length > 0) {\n fetchData(searchTerm, pageCount + 1);\n setPageCount(prevCount => prevCount + 1);\n }\n }", "title": "" }, { "docid": "81ec830be3e31e31b7ad7e90d5ed5020", "score": "0.64974815", "text": "function updateSearchResultCount(count) {\n var resultString;\n //if no results were found, provide some ideas on improving the query to the end-user\n if (count === 0) {\n resultString = \"No results found. Try expanding the location radius, time frame, or just leaving the location and radius fields blank and doing a keyword search.\";\n } else {\n resultString = \"Found \" + count + \" results.\";\n }\n\n //clear the old search results count and add the updated one\n $('#searchResultCount').remove();\n $('#searchResultCountContainer').append('<div id=\"searchResultCount\">' + resultString + '</div>');\n}", "title": "" }, { "docid": "2132c3a968e59362f90f59fc344e1e65", "score": "0.6442811", "text": "get matchCount() \n {\n return this._result.length;\n }", "title": "" }, { "docid": "bddc4770cca3b4bcb2108e6e43780f5f", "score": "0.64407426", "text": "function display_csd_resultnum(result) {\n let numresult;\n if (typeof result === 'undefined') numresult = 0;\n else (numresult = result.total);\n document.getElementById(\"found_csd\").innerHTML = \"Found \" + numresult + \" structures\";\n }", "title": "" }, { "docid": "a4c3ed960fac19550b75156c7b254b2a", "score": "0.62968993", "text": "resultCount() {\n const res = this.records().length;\n this.logger.log('analyze-all', 'resultCount:', res);\n return res;\n }", "title": "" }, { "docid": "fae499218aac634f7df090dd6f1a93fa", "score": "0.6245071", "text": "function displayTotalResults(_response){\r\n\tcleanTotalResults();\r\n\t\r\n\t$(\"#searchResultsText\").prepend(\"A total of <b>\"+ _response.totalItems +\"</b> results have been found with the keyword <b>\"+ _searchText +\"</b>\");\r\n}//displayTotalResults", "title": "" }, { "docid": "f9a28c60fa0ecc71008650fe456eb3ec", "score": "0.60268", "text": "function countResultsInSarif(sarif) {\n let numResults = 0;\n for (const run of JSON.parse(sarif).runs) {\n numResults += run.results.length;\n }\n return numResults;\n}", "title": "" }, { "docid": "04b357c30b877377199a2e66296527b6", "score": "0.6009485", "text": "count (ngram, options) {\n const matchingDocs = this.findDocs(ngram, options)\n return matchingDocs.length\n }", "title": "" }, { "docid": "c1f82af8beee8729752f546893d5f786", "score": "0.60069376", "text": "function getCountsQ(state) {\n return appendCountsQs(state)([state.parameters.searchString.current]).join(\" \");\n}", "title": "" }, { "docid": "527af92cde2aa7f0fe3a16df4641302d", "score": "0.60032684", "text": "function SearchResults(data){this.resultsCount=data.PrimaryQueryResult.RelevantResults.TotalRows;this.items=convertRowsToObjects(data.PrimaryQueryResult.RelevantResults.Table.Rows.results,this.resultsCount)}", "title": "" }, { "docid": "d6df183b66b916cbdabdcaf1ad7fa739", "score": "0.5997934", "text": "function updateDisplays(numResults) {\n // Handling the messages\n if (numResults === 0) {\n showMessage(\"#results-none\");\n } else {\n if (numResults % 10 !== 1 || numResults === 11) {\n $(\"#results-found\").text(numResults + \" bjórar fundust.\");\n } else { // Result of the form 1+10k, k=0, 2, 3, 4, ...\n $(\"#results-found\").text(numResults + \" bjór fannst\");\n }\n showMessage(\"#results-found\");\n }\n}", "title": "" }, { "docid": "5dc896219cbd83318cd729bc8560358d", "score": "0.5940386", "text": "function resCount() {\r\n count = 0;\r\n for (var key in imagesDict) {\r\n if (imagesDict[key]._result != \"\") {\r\n count++;\r\n }\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "00f86cdddac05c514f5b15b9891a5208", "score": "0.5939713", "text": "function results() {\n const numberImages = Array.from(searchResultsContainer.querySelectorAll(\"img\"));\n const comment = document.querySelector(\".results-comment\");\n\n if ((numberImages.length > 1) || (numberImages.length == 0)) {\n comment.innerHTML = `\n <h2 class=\"main-text\">Showing ${numberImages.length} photos</h2>`;\n } else if (numberImages.length == 1) {\n comment.innerHTML = `\n <h2 class=\"main-text\">Showing ${numberImages.length} photo</h2>`;\n }\n}", "title": "" }, { "docid": "0a3a502f638f29bc7c3f61dbbf7d3d0a", "score": "0.5939053", "text": "function checkResultCount() {\n if (searchDone == 1 && $(\".search-results-list li\").length == 0) {\n $(\"#filterContentTypes\").find(\"input\").each(function() {\n filterThis($(this));\n });\n searchResultCount = $(\".search-results-list-temp > li:visible\").length;\n if (searchResultCount == 0) {\n $(\".search-results-column > .search-results-subheading\").text(\"Search Result\");\n $(\".searchStatus\").text(\"No result found for current filter\");\n } else {\n if (searchResultCount == 1) {\n $(\".search-results-column > .search-results-subheading\").text(\"Search Result\");\n $(\".searchStatus\").text(\"One result found for current filter\");\n } else {\n $(\".search-results-column > .search-results-subheading\").text(\"Search Results\");\n $(\".searchStatus\").text(searchResultCount + \" results found for current filter\");\n }\n }\n } else {\n if ($(\".search-results-list li\").length == 0 && $(\".search-results-column > p\").text().length == 0) {\n $(\".search-results-column > .search-results-subheading\").text(\"Filtering results...\");\n $(\".searchStatus\").html('Filtering results <img src=\"/hc/theme_assets/539845/200023575/loading.GIF\">');\n } else {\n if (searchDone == 1) {\n //remove default search result\n $(\".search-results-list\").hide();\n $(\".search-results-list\").empty();\n //show our new result\n $(\".search-results-list-temp\").show();\n $(\"#filterContentTypes\").find(\"input\").each(function() {\n filterThis($(this));\n });\n if (preFilterCount == 0) {\n $(\".search-results-column > .search-results-subheading\").text(\"Search Result\");\n $(\".searchStatus\").text(\"No result found for '\" + searchQuery + \"'\");\n } else {\n if (preFilterCount == 1) {\n $(\".search-results-column > .search-results-subheading\").text(\"Search Result\");\n $(\".searchStatus\").text(\"One result found for '\" + searchQuery + \"'\");\n } else {\n $(\".search-results-column > .search-results-subheading\").text(\"Search Results\");\n $(\".searchStatus\").text(preFilterCount + \" results for '\" + searchQuery + \"'\");\n }\n }\n }\n }\n }\n $(\".search-results-column\").find(\"p\").text($(\".search-results-column\").find(\"p\").text().replace(/\\@[\\w-()]+\\s/ig, \"\"))\n }", "title": "" }, { "docid": "0dec1097ea2302d21334b4cd2cb2f2c3", "score": "0.5938355", "text": "function showResults(){\n\t\tif (noResultsCounter < 1 ) {\t\n\t\t\t\tif (searchValue !== \"\") {\n\t\t\t\t\tnoResults = \"No Results for '\" + searchValue + \".'\";\n\t\t\t\t\tprint(noResults);\n\t\t\t\t\tdocument.getElementById(\"response\").style.display = \"inline\";\n\t\t\t\t\t\tnoResults = \"\";\t\n\t\t\t\t} else {\n\t\t\t\t\tdocument.getElementById(\"response\").style.display = \"none\";\t\t\t\t\t\n\t\t\t\t}\n\t\t} else {\t\n\t\t\tnoResults = \"\";\t\n\t\t\tdocument.getElementById(\"response\").style.display = \"none\";\t\n\t\t}\n\t}", "title": "" }, { "docid": "793873de9aadb808e3a983e840267cbc", "score": "0.5909874", "text": "function countMatches() {\n $(\"span.foundLELELEL\").each(function() {\n if(isElementVisible($(this))) numMatches++;\n });\n}", "title": "" }, { "docid": "4bb2d381ba56871bc99a0851e9d14126", "score": "0.5895705", "text": "renderResults() {\n\t\tconst count = Object.keys(this.results)\n\t\t\t.map(name => this.results[name].length)\n\t\t\t.reduce((acc, x) => acc + x);\n\t\tconsole.log(this.results);\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<p>Here are the minimum spreads. Check the dev console for all {count} results</p>\n\t\t\t\t{Object.keys(this.results).map((name, i) => this.renderResult(name, this.results[name], i))}\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "28c94b7d98d3d0d77b7055acaff2582f", "score": "0.5889703", "text": "function getOccurance() {\n\n var occ = {};\n var text = req.body.firstName + \" matches \" + req.body.secondName;\n var str = text.toLowerCase().replace(/\\s+/g, '');\n var arr = str.split('');\n\n var matchStringNum = \"\";\n\n for (var i = 0, c = arr.length; i < c; i++) {\n if (occ[arr[i]]) occ[arr[i]]++;\n else occ[arr[i]] = 1;\n }\n\n for (var i in occ) {\n console.log('count of ' + i + ' -> ' + occ[i]);\n matchStringNum += occ[i];\n }\n\n return matchStringNum;\n\n }", "title": "" }, { "docid": "96d8e2647584028abf04234011bc6cb7", "score": "0.5885557", "text": "function displayCount() {\n\tif (marks.length > 0) {\n\t\tvar num = current + 1;\n\t} else {\n\t\tvar num = 0;\n\t}\n\tvar rsc = document.createElement('span');\n\trsc.id = \"_regexp_search_count\";\n\trsc.innerHTML = num + \" of \" + marks.length + \" matches.\";\n\n\t// disappear when mouseover and reappear when mouseout\n\trsc.addEventListener('mouseover', function(event) {\n\t\tdocument.getElementById(\"_regexp_search_count\").style.opacity = \"0\";\n\t});\n\trsc.addEventListener('mouseout', function(event) {\n\t\tdocument.getElementById(\"_regexp_search_count\").style.opacity = \"1\";\n\t});\n\n\tdocument.getElementsByTagName('body')[0].appendChild(rsc);\n}", "title": "" }, { "docid": "a6029d2a4b39856359f297257c5635dc", "score": "0.5852833", "text": "function displayFilterResults(mostWanted) {\r\n if (mostWanted.length < 1) {\r\n alert(\"Your search did not return any results\");\r\n }\r\n else {\r\n alert((\"Your search retured \" + mostWanted.length +\" results:\\n\\n\") + (indexNames(mostWanted)) + \"\\nPlease press 'OK' to continue.\");\r\n }\r\n}", "title": "" }, { "docid": "3c6736d18426889f7491debc74220a09", "score": "0.58039296", "text": "function showNasaSearchResults() {\n //* get search result count\n let search_count = sessionStorage.getItem(\"nasa_search_count\");\n for (var idx = 1; idx <= search_count; idx++) {\n let search_result = getNasaSearchItem(idx);\n console.log(\"search result {\" + idx + \"}:\");\n console.log(search_result);\n }\n } // end of function showNasaSearchResults()", "title": "" }, { "docid": "814bfae70622f74dcdc1b91fb5638b81", "score": "0.58013695", "text": "function showResults() {\n console.log(totalClicks + \" this is working yes?\");\n}", "title": "" }, { "docid": "eb353a0428e9556148ed39f4b09d2882", "score": "0.58010715", "text": "get matchCountTemplate() {\n return this.query ? html `\n <span part=\"match-count\">${this.t('MATCHES_NUM', { numMatched: this.filterCount })}</span>\n ` : html ``;\n }", "title": "" }, { "docid": "896183542fb469a06f5e721341e097f7", "score": "0.57467896", "text": "printResults(inputString) {\n if (this.results.length === 0) {\n console.log(chalk.red.bold('No results found!'))\n return false;\n }\n let output = '', i = 0;\n console.log(chalk.bold(this.results.length + ' Result(s):'));\n this.results.forEach((val, index) => {\n if (val.start !== 0) {\n output += inputString.substring(i, val.start);\n }\n i = val.start + val.arr.length;\n output += chalk.black.bgGreen(inputString.substring(val.start, i));\n // Print any remaining characters\n if ((index === this.results.length - 1) && (i < inputString.length)) {\n output += inputString.substr(i);\n }\n });\n console.log(output);\n }", "title": "" }, { "docid": "93045ac4caff55b914baeafdb7ddd09a", "score": "0.57463723", "text": "function countNumMatched(query) {\n var qryREActual = (function() {\n if (typeof(query) === 'string') {\n // escape special characters used by RegExp\n var queryTxtForRE = query.replace(/([.[(+*?])/g, '\\\\$1');\n if (queryTxtForRE.toLowerCase() === queryTxtForRE) {\n // case insenstive search\n return new RegExp(queryTxtForRE, 'gi');\n } else {\n return new RegExp(queryTxtForRE, 'g');\n }\n } else if (RegExp.prototype.isPrototypeOf(query)) {\n // query is already a regex, create a global version\n return new RegExp(query.source,\n 'g' + (query.ignoreCase ? 'i' : '') + (query.multiline ? 'm' : '')\n );\n } else {\n throw new TypeError('countNumMatched(query): query must be a string or RegExp: ', query);\n }\n })(); // qryREActual = (function()\n\n var matches = cm.getValue().match(qryREActual);\n matches = (matches ? matches.length : 0);\n return matches;\n } // function countNumMatched()", "title": "" }, { "docid": "89e9f42adc9c5f0230fefc2bfb28c49f", "score": "0.5724109", "text": "function assert_results_label_count(aCount) {\n let resultsLabel = mc.e(\"qfb-results-label\");\n if (aCount == 0) {\n if (resultsLabel.value != resultsLabel.getAttribute(\"noresultsstring\")) {\n throw new Error(\n \"results label should be displaying the no messages case\"\n );\n }\n } else {\n let s = resultsLabel.value;\n s = s.substring(0, s.indexOf(\" \"));\n if (parseInt(s) !== aCount) {\n throw new Error(\n \"Result count is displaying \" + s + \" but should show \" + aCount\n );\n }\n }\n}", "title": "" }, { "docid": "c957a1877c82ca11dfd63afa71cac5af", "score": "0.571663", "text": "function giveNoPages(noResults){\n var pages = Math.floor(noResults/50)\n if((noResults % 50) > 0){\n pages ++\n }\n return pages\n}", "title": "" }, { "docid": "e2cc524361e7ee29a0cc944a203d38e2", "score": "0.5715892", "text": "function updateResultCounts( total, from, size ) {\n\t\t\tvar $resultCount = $( '.total-search-results' );\n\t\t\tvar $resultCurPage = $( '#results-count .current-page' );\n\t\t\tvar pageFinish;\n\n\t\t\tif ( 0 === from ) {\n\t\t\t\tfrom = 1;\n\t\t\t}\n\n\t\t\tif ( total < size ) {\n\t\t\t\tpageFinish = total;\n\t\t\t} else {\n\t\t\t\tif ( total < ( from + size ) ) {\n\t\t\t\t\tpageFinish = total;\n\t\t\t\t} else {\n\t\t\t\t\tpageFinish = ( from - 1 ) + size;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$resultCount.text( Number( total ) );\n\t\t\t$resultCurPage.text( Number( from ) + '-' + Number( pageFinish ) );\n\t\t}", "title": "" }, { "docid": "dfd73d4efc900fd7ba9b59f796ac60bb", "score": "0.5711632", "text": "function prepareMultipleResultsPage(results) {\n resetMultipleResultsPage();\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n let newItemText = `${result.firstName} ${result.lastName}`;\n addItemTo(newItemText, \"option\", \"peopleSelection\", result.id, \"multipleResults\", i);\n }\n document.getElementById(\"multipleResultsCount\").value = results.length;\n}", "title": "" }, { "docid": "0141b3223ee854457350cf7752006905", "score": "0.57114786", "text": "function nodeStats(resultsArray) {\n let length = resultsArray.length;\n const tally = resultsArray.reduce((acc, currentValue) => acc + currentValue);\n return console.log(\n `you have ${length} projects with node_modules with a total size of ${tally}`\n );\n}", "title": "" }, { "docid": "754d6cc31a6da3c369fb26cbabc485e3", "score": "0.5711016", "text": "function queryDescSuccess(tx, results) {\r\n\tvar len = results.rows.length;\r\n\talert(len);\r\n}", "title": "" }, { "docid": "80009a738260d00ad1650ccbccb16f2c", "score": "0.5707073", "text": "getResultText() {\n var cantCorrectas = 0 ;\n\n this.questions.forEach(q => {\n if(q.correctAnswer == q.selectedAnswer)\n {\n cantCorrectas = cantCorrectas + 1;\n }\n });\n return cantCorrectas + ' de ' + this.questions.length;\n }", "title": "" }, { "docid": "6756452c3e5f76d67f594482bd6b1620", "score": "0.56981194", "text": "function displayAllResults(park, info) {\n var display = \"\";\n var count = 1;\n if(info.data.length == 0) {\n display = \"<p id='noResult'>No results found. Please try again.</p>\";\n }\n else {\n for(var i = 0; i < info.data.length; i++) {\n var lower1 = info.data[i].fullName.toLowerCase();\n var lower2 = park.toLowerCase();\n if(lower1.includes(lower2)) {\n display += \"<p id='result\" \n + count++ \n + \"' class='searchResultItem' onclick=\\\"seeResultsFromSearch('\" \n + info.data[i].fullName \n + \"')\\\">\" + info.data[i].fullName \n + \"</p>\";\n }\n }\n }\n document.getElementById(\"searchList\").innerHTML = display;\n}", "title": "" }, { "docid": "1b26c05830bb7dde1ed9fdb7ce5d07d5", "score": "0.5688211", "text": "function searchAll (){\n\telas.searchAll(\"icolor\",\"users\")\n .then (data => {\n console.log(data);\n console.log(data.length);\n });\n}", "title": "" }, { "docid": "41b362ea0936096cc469c03a1b483db5", "score": "0.5668704", "text": "function msgSearchExpectCount(aCount, aFulltextStr) {\n // Let the GlodaMsgSearcher build its query\n let searcher = new GlodaMsgSearcher(null, aFulltextStr);\n let conn = GlodaDatastore.asyncConnection;\n let query = searcher.buildFulltextQuery();\n\n // Brace yourself, brutal monkey-patching NOW\n let sql, args;\n let oldFunc = GlodaDatastore._queryFromSQLString;\n GlodaDatastore._queryFromSQLString = function(aSql, aArgs) {\n sql = aSql;\n args = aArgs;\n };\n query.getCollection();\n GlodaDatastore._queryFromSQLString = oldFunc;\n\n // Bind the parameters\n let stmt = conn.createStatement(sql);\n for (let [iBinding, bindingValue] of args.entries()) {\n GlodaDatastore._bindVariant(stmt, iBinding, bindingValue);\n }\n\n let i = 0;\n stmt.executeAsync({\n handleResult(aResultSet) {\n for (\n let row = aResultSet.getNextRow();\n row;\n row = aResultSet.getNextRow()\n ) {\n i++;\n }\n },\n\n handleError(aError) {\n do_throw(new Error(\"Error: \" + aError.message));\n },\n\n handleCompletion(aReason) {\n if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {\n do_throw(new Error(\"Query canceled or aborted!\"));\n }\n\n if (i != aCount) {\n mark_failure([\n \"Didn't get the expected number of rows: got\",\n i,\n \"expected\",\n aCount,\n \"SQL:\",\n sql,\n ]);\n do_throw();\n }\n async_driver();\n },\n });\n stmt.finalize();\n return false;\n}", "title": "" }, { "docid": "a2ef166fcbd2bc5b1adde3e1994f10a6", "score": "0.56599236", "text": "function renderResults(results, allResults) {\n if (results.length <1 && allResults && allResults.length < 1) {\n return;\n }\n\n function displayableScore(score) {\n return (100 - (score * 100)).toFixed(2);\n }\n\n function shorten(str, maxLen=80, separators = '/[\\.\\?]/') {\n if (str.length <= maxLen) return str;\n var shorter;\n var pos = str.replace(/^.{80}/,\"\").match(/[^a-z ]/i)['index'] + maxLen;\n shorter = str.substr(0, pos);\n if (shorter.charAt(shorter.len -1) != '.') {\n shorter += \" ...\";\n }\n return shorter;\n }\n\n function summarize(item, score) {\n var parts = item.contents.split(/[\\n\\r]/g);\n var summary;\n if (showCategoryAndTags) {\n var category = item.categories ? \"In the \" + item.categories[0] + \" gallery\" : \"\";\n var description = shorten(parts[0]);\n summary = category + \" with tags \" + item.tags.join(\", \") + \": \" + description;\n } else {\n summary = shorten(parts[0]);\n }\n if (showScores) {\n summary += \" - Score:\" + displayableScore(score);\n }\n return summary;\n }\n\n function list_item(result) {\n var li = document.createElement('li');\n var classes = li.getAttribute('class');\n li.setAttribute('class', classes ? classes + ' ' : '' + 'search_item');\n var ahref = document.createElement('a');\n ahref.href = result.item.permalink;\n ahref.text = result.item.title;\n li.append(ahref);\n li.append(document.createTextNode(\" - \" + summarize(result.item, result.score)));\n return li;\n }\n\n // Show the first maxResults matches\n var resultsSoFar = [],\n remaining = results.length;\n\n results.slice(0, maxResults).forEach(function (result) {\n var li = list_item(result);\n searchResultsList.appendChild(li);\n resultsSoFar.push(result.item.permalink);\n });\n\n if (resultsSoFar.length < maxResults && useAllContent) {\n // Fill in additional from allResults, filtering those included in results\n allResults = allResults.filter(function(value, index, arr) {\n return ! resultsSoFar.includes(value.item.permalink);\n });\n allResults.slice(resultsSoFar.length, maxResults).forEach(function (result) {\n // Maybe you want to filter out low scoring results too?\n // Maybe anything less than 20% of the top scoring item?\n // Or perhaps when the score is less than half of the preceeding score?\n var li = list_item(result);\n searchResultsList.appendChild(li);\n resultsSoFar.push(result.item.permalink);\n });\n remaining = allResults.length - resultsSoFar.length;\n } else {\n remaining -= resultsSoFar.length;\n }\n if (remaining > 0 && showScores) {\n // Tell user there are more yet\n // Bonus yak-shaving points for stats on score distribution\n // see https://stackoverflow.com/questions/48719873/how-to-get-median-and-quartiles-percentiles-of-an-array-in-javascript-or-php\n var li = document.createElement('li');\n var p = document.createElement('p');\n p.appendChild(document.createTextNode(\"... and \" + remaining + \" more\"));\n li.append(p);\n searchResultsList.appendChild(li);\n };\n}", "title": "" }, { "docid": "6c134e59aa79dbe1b93209e63166c9b6", "score": "0.56566143", "text": "async loadMoreResults() {\n this.offset += this.pageLimit;\n const nextPage = this.searchResults.slice(this.offset, this.offset + this.pageLimit);\n console.debug('search index results: ', nextPage);\n this.#renderSearchResults(nextPage);\n }", "title": "" }, { "docid": "e538f946f9aabc816e031ade0d54c111", "score": "0.56490904", "text": "compileResultSize(result) {\n let size = 0;\n\n if (Array.isArray(result)) {\n result.forEach(section => size += section.data.length);\n } else {\n size = result.data.length + result.sourceMap.toString().length;\n }\n\n return size;\n }", "title": "" }, { "docid": "6e6e5d9c201138127f6f570ff41e5ff5", "score": "0.5647475", "text": "function showResults() {}", "title": "" }, { "docid": "55e510991f6ff7d4f2c70aa95a5755a7", "score": "0.5622829", "text": "function getPageCount() {\n return Math.ceil(dataObj.length / resPerPage);\n}", "title": "" }, { "docid": "375dde73d60619e55ddf2eb2f00258c1", "score": "0.5619856", "text": "async countProperty(searchType, searchDetail) {\n try {\n\n await this.selenium.write(searchType, \"css\", \".search-clients>.select-css\")\n await this.selenium.write(searchDetail, \"css\", \".search-clients>input[type='text']\")\n if (!await this.selenium.isElementExists(\"css\", \".clientDetails>th\")) {\n console.log(`The property ${searchDetail} of ${searchType} is not found`);\n return false;\n }\n\n let totalPages = await this.selenium.findElementBy(\"css\", \".page-numbers>.page:nth-child(4)\")\n totalPages = await totalPages.getText();\n totalPages = parseInt(totalPages, 10)\n console.log(totalPages)\n let currentPageListNum = 0;\n let holder\n console.log(currentPageListNum)\n for (let i = 0; i < totalPages; i++) {\n holder = await this.selenium.findElementListBy(\"css\", \".clientDetails\")\n currentPageListNum += await holder.length;\n console.log(`counting ${searchType} : ${currentPageListNum1}`)\n await this.selenium.clickElement(\"css\", \"img[name='next']\")\n }\n return currentPageListNum;\n }\n catch (error) {\n console.log(`Something went wrong with countProperty:${error}`)\n }\n }", "title": "" }, { "docid": "94f9e9840a619d2e2a91d3779308ac9c", "score": "0.5609795", "text": "function Occurence(count,mainstr,searchstr)\n{\n var offset=0;\n for (i=0;i<count;i++)\n {\n var n = mainstr.substring(offset).indexOf(searchstr);\n if (n>0)\n {\n offset+=n+ searchstr.length;\n }\n else\n {\n println (\"error\");\n return -1\n }\n //print (offset);\n //print(mainstr.substring(offset)) \n }\n //print (\"returning \"+offset)\n return offset;\n}", "title": "" }, { "docid": "1e035fad56926d6f5f774fb68d3d1b46", "score": "0.560961", "text": "function renderResults(results) {\n searchResults.innerHTML = \"\";\n\n for (var i = 0, length = results.length; i < length; i++) {\n let zettel = results[i];\n let result = document.createElement(\"li\");\n let zettelLink = makeZettelLink(zettel);\n result.appendChild(zettelLink);\n searchResults.appendChild(result);\n }\n}", "title": "" }, { "docid": "eccac08247d20647c369c5167629efe2", "score": "0.5607325", "text": "function findNumKeywordHits(keyWords, searchField){\n\t\t\tlet orderedLists = new Array();\t//list of applicable study lists\n\t\t\tkeyWords = getIndividualWords(searchField.value.toLowerCase());\n\n\t\t\t//Finds the number of times each keyword shows up in the title of each study list\n\t\t\tfor (let i = 0; i < listOfLists.length; i++){\n\t\t\t\tlet numFound = 0;\t//Number of keyword hits found\n\t\t\t\t\n\t\t\t\tfor (let j = 0; j < keyWords.length; j++){\n\t\t\t\t\tlet currentString = listOfLists[i][1].toLowerCase();\t//The title of the current study list\n\t\t\t\t\t\n\t\t\t\t\t//find each instance of each keyword\n\t\t\t\t\twhile(currentString.indexOf(keyWords[j]) != -1){\n\t\t\t\t\t\tnumFound++;\n\t\t\t\t\t\tcurrentString = currentString.substring(currentString.indexOf(keyWords[j]) + keyWords[j].length);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\torderedLists.push([listOfLists[i][1], numFound]);\t//Associates each list with its number of hits\n\t\t\t}\n\n\t\t\treturn orderedLists;\n\t\t}", "title": "" }, { "docid": "271db50be996ba16a5105be1660c3452", "score": "0.55989695", "text": "nextSearchResult() {\n if (this.searchSelection + 1 <= this.searchResults.length - 1) {\n this.searchSelection++;\n }\n }", "title": "" }, { "docid": "f8f95b15a8b6867abfdf789eefb0c5c2", "score": "0.5598493", "text": "function showItemCount(query) {\n var q = new ActiveXObject(\"GoogleDesktop.QueryAPI\");\n\n // Call the QueryEx method so that we can turn off the asynchronous\n // loading of record items. It's not needed since all we're interested\n // in is the total item count.\n var qx = q.QueryEx(g_securityCookie, query);\n\n // Turn off the default asynchronous behavior.\n qx.SetOption(\"async\", false);\n\n // Execute the query synchronously and get back a recordset object\n var set = qx.Execute();\n // Get the number of results from the recordset's count property.\n message(\"Total matches for '\" + query + \"': \" + set.count);\n}", "title": "" }, { "docid": "82f95ee04f29ebb8df8b170c1383653d", "score": "0.5582199", "text": "function displayNumEntries() {\n //display length of fitlered list\n document.getElementById(\"entry-count\").innerHTML = filteredDatasetMonth.length;\n}", "title": "" }, { "docid": "a5bcdd44c81f0f88bae260f1b58c23af", "score": "0.5577956", "text": "function runPeopleSearch(){\n\t\tvar searchString = 'https://webapp.whitman.edu/directory/jsonp.cfm?q='+s.query+'&callback=?';\n\t\t$.getJSON(searchString, function (data) {\n\t\t\tif (data.results.length > 0){\n\t\t\t\ts.totalResults\t+= data.results.length;\n\t\t\t\ts.peopleResults = formatPeopleResults(data.results); /*[1]*/\n\t\t\t\ts.peopleResults = s.peopleResults.slice(0,s.resCount); /*[2]*/\n\t\t\t\tpopulateList(s.peopleResults); /*[3]*/\n\t\t\t\tif (s.totalResults > s.resCount){\n\t\t\t\t\taddMoreLink(); /*[4]*/\n\t\t\t\t}\n\t\t\t\ts.loader.css({'display':'none'});\n\t\t\t\tdone();\n\t\t\t}\n\t\t\telse{\n\t\t\t\thideAll();\n\t\t\t\tdone();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "da0111d8bcc28d27c1ca4ac8ccf49192", "score": "0.5576511", "text": "searchItems(searchTerm) {\r\n\t\tconst countItems = this.state.data.filter(item => \r\n\t\t\titem.name.toLowerCase().includes(searchTerm.toLowerCase()));\r\n \t\treturn countItems.length;\r\n }", "title": "" }, { "docid": "fe105ec45876317de549be84b8c16ebf", "score": "0.5572197", "text": "function printRepoCount() {\n //convert response into Json\n var responseObj = JSON.parse(this.responseText);\n //if no such user exists, the number of total count by his username is 0.\n //So if no such user exists, show no search results.\n if(responseObj.total_count==0){\n searchResult.innerHTML = \"No search Results\";\n searchMessage.innerHTML = '<h1><b>No User found!</b></h1>';\n }\n //Set top message to show numbers\n else{\n searchMessage.innerHTML = '<h1>Users </h1><h4>There are a total of <b>' + responseObj.total_count + '</b> GitHub users found who have their user names starting with <i>\"' + searchCtrl.value + '\"</i>. <br/>Top 30 are displayed below. </h4>';\n\n //Construct html\n var html = '';\n\n //all users are listed in items.\n for (var i = 0; i < responseObj.items.length; i++) {\n //get user\n var user = responseObj.items[i];\n\n //construct html to be displayed\n html += '<div class=\"col-sm-2\">';\n html += '<img src=\"' + user.avatar_url + '\" class=\"logo-small\"/>';\n html += '<a href=\"' + user.html_url + '\" target=\"_blank\" > <h4>' + user.login + '</h4></a>';\n html += '<span class=\"badge\">' + user.score + '</span><br/><br/>';\n html += '</div>';\n\n\n }\n //set html of result div to show all data on ui\n searchResult.innerHTML = html;\n }\n}", "title": "" }, { "docid": "d25fe944b2628ded324bd5383ef9d2ee", "score": "0.55624735", "text": "function displayResults(results) {\n var resultsCounter = results.length;\n for (var i = 0; i < resultsCounter; i++) {\n information += \n \"<div>\" \n + \"<strong>Result \" + (i+1) \n + \" of \" + resultsCounter + \"</strong>\"\n + \"</div>\";\n displayInformation(results[i]);\n }\n }", "title": "" }, { "docid": "d00b3e0bd2f8d0003d3746b71bcc6d44", "score": "0.55519736", "text": "findNumberofQuestions() {\n API.findTotalQuestions({\n unitId: this.state.units\n }).then(res => {\n this.setState({questions: res.data.length});\n this.getResults();\n })\n }", "title": "" }, { "docid": "cb733cfdbea925e9640ec2bc5c0eedee", "score": "0.55428016", "text": "function updateCountsInclusive(selector, key, renderFunction, result, jQ){\n var items = $(selector);\n //iterate over each displayed value of the criterion \n items.each(function(){ \n var c = $(this), count = 0;\n if(result.length > 0){\n var queryString = {};\n queryString[key] = c.val(); \n count = jQ.where(queryString).count;\n }\n //render text using the appropriate function\n renderFunction(c, count);\n }); \n }", "title": "" }, { "docid": "be6faa1315589980c7e0412b619f4a13", "score": "0.55248743", "text": "function resultsHandler(length, callback) {\n var count = 0;\n var results = {};\n return function (err, r, word) {\n if (err) {\n console.log(err);\n } else {\n r.forEach(function (q) {\n if (!results.hasOwnProperty(q._id)) {\n results[q._id] = {\n query: q.query,\n rank: 0,\n matchKeywords: []\n };\n }\n results[q._id].rank += 1;\n results[q._id].matchKeywords.push(word);\n });\n\n count += 1;\n // if we are done collect results\n if (count >= length) {\n var resultsArr = Object.keys(results).map(function (id) {\n return results[id];\n });\n console.log('results array', resultsArr);\n resultsArr.sort(function (a, b) {\n return a.rank - b.rank;\n });\n callback(resultsArr);\n }\n }\n }\n}", "title": "" }, { "docid": "b0625bfbc22ed55f930226def19ba5ed", "score": "0.55030376", "text": "function countOccurrences(searchTerm) {\n let count = 0;\n let startIndex = 0;\n while (true) {\n let index = sentence.indexOf(searchTerm, startIndex);\n if (index == -1) {\n break;\n }\n count++;\n startIndex = index + 1;\n }\n return count;\n}", "title": "" }, { "docid": "b0625bfbc22ed55f930226def19ba5ed", "score": "0.55030376", "text": "function countOccurrences(searchTerm) {\n let count = 0;\n let startIndex = 0;\n while (true) {\n let index = sentence.indexOf(searchTerm, startIndex);\n if (index == -1) {\n break;\n }\n count++;\n startIndex = index + 1;\n }\n return count;\n}", "title": "" }, { "docid": "bfe7e5de367ae4e8e2aa4ae5556bca6e", "score": "0.54940265", "text": "function displayResults(results, start, total) {\n SEARCH_RESULT_LIST.empty();\n SEARCH_HEADER.text(`Displaying results ${start} - ${start+results.length-1} of ${total}`);\n SEARCH_RESULT_LIST.attr('start', start);\n results.forEach((park) => {\n //get park physical address\n const addressObj = park.addresses.find(_addressObj => _addressObj.type == 'Physical');\n SEARCH_RESULT_LIST.append(`\n <li>\n <a href=\"${park.url}\" target=\"_blank\">${park.fullName}</a>\n <p>${park.description}</p>\n ${addressObj != undefined\n ? `<p>${addressObj.line1}, ${addressObj.city}, ${addressObj.stateCode} ${addressObj.postalCode}</p>` \n : '<br>'}\n </li>`);\n })\n}", "title": "" }, { "docid": "d858ec47c59086d65b7510c303bf8a2a", "score": "0.54909366", "text": "function GetPaginationDetails() {\n var nSearchResultLimit = 0;\n if (pg_nSearchResultsLimit > gArrSortedProductRefs.length) {\n nSearchResultLimit = gArrSortedProductRefs.length;\n } else {\n nSearchResultLimit = pg_nSearchResultsLimit;\n }\n //\n // Calculate number of pages\n //\n var nPages = 0;\n if (nSearchResultLimit !== 0) // if result limit is non zero\n {\n nPages = Math.floor((gArrSortedProductRefs.length) / nSearchResultLimit);\n if ((gArrSortedProductRefs.length) % nSearchResultLimit !== 0) {\n nPages++;\n }\n }\n return [nSearchResultLimit, nPages];\n}", "title": "" }, { "docid": "e553d035a965a05bd3427d4b12937d4f", "score": "0.54874027", "text": "function ResulT_ideasearch(result){\t\t\t\n\t//echo search\n\t$('#IdeA').html(result);\n\t\t\t\t\n\t//echo search num\n\tvar search=$('.idea_own').length;\n\t$('#SearchinfO_searchnumcon').text(search);\n\t\n\t//hidden tips\n\t$('#LoadiN_tip1').css({display:'none',top:0,left:0});\t\n\t$('#LoadiN_tipstr1').html('');\t\t\t\t\t\t\t\n}", "title": "" }, { "docid": "aa96841e8a57ee8bded9e320e014590f", "score": "0.5482139", "text": "function CountStrings(text, search)\n{\n\tvar re = new RegExp(search, \"g\");\n\tvar match = text.match(re);\n\tif(math == null) return 0;\n\treturn text.match(re).length;\n}", "title": "" }, { "docid": "6ed8e58beb5de015ac6044c683b9ddbd", "score": "0.5471836", "text": "function displaySearchResults(results, store) {\n var searchResults = document.getElementById('search-results');\n if (results.length) { // Are there any results?\n var appendHTMLString = '';\n\n for (var i = 0; i < results.length; i++) { //Loop through the results and append the string as HTML\n console.log(results[i]);\n var item = store[results[i].ref];\n appendHTMLString += '<h2>Search Results</h2> <ul>'\n appendHTMLString += '<li><a href=\"' + item.Url + '\"><h3>' + item.Name + '</h3></a>';\n appendHTMLString += '<p>' + item.Description.substring(0, 500) + '...</p></li></ul>';\n }\n\n searchResults.innerHTML = appendHTMLString;\n } else {\n searchResults.innerHTML = '<li>No results found</li>';\n }\n }", "title": "" }, { "docid": "1160c4d6250901116644b6bcfae3b19f", "score": "0.546308", "text": "function renderResults(results){\n var $resultsContainer = $(\"#search-results\");\n\n $resultsContainer.html(\"\");\n\n var count = 0;\n $.each(results, function(i, item){\n var fullPath = '/edit.html?src=src/' + item.path;\n var segments = item.path.split(\"/\");\n var title = segments.pop();\n var path = segments.join('/');\n\n if(/boot\\.json$/.test(title)){\n segments = path.split(\"/\");\n title = segments.pop();\n path = segments.join('/');\n fullPath = 'boot.html?src=src\\\\' + item.path.replace(/\\//g, \"\\\\\");\n }\n\n title = title.replace(/\\.(?:json|js)$/, '');\n\n var html = getTemplateHtml(\"#result-row-template\", {\n title : title,\n path : path,\n fullPath : fullPath,\n score : item.score\n });\n\n\n $resultsContainer.append(html);\n count++;\n });\n\n if(count === 0){\n $resultsContainer.html(\"<div class='searching'>No Results.</div>\");\n }\n }", "title": "" }, { "docid": "f92b185252cf7fb8898c944480b5c328", "score": "0.5461041", "text": "function getNumberOfRecords(filters, mapRecord) {\n return new Promise((resolve, reject) => {\n getSearchRecords(filters, mapRecord).then(result => {\n resolve(result.length);\n }).catch(err => {\n reject(\"Error getting number of records.\", err);\n });\n });\n}", "title": "" }, { "docid": "a27cc5d1cb364b638f52e716df9f168e", "score": "0.54605", "text": "function numPages() {\r\n return Math.ceil(objJson.length / recordsPerPage);\r\n}", "title": "" }, { "docid": "f91619f46a87db1df5a8925e4b15777b", "score": "0.5447928", "text": "function fetchResults(searchQuery) {\n // when fetchResults() is called, whatever is passed in as an argument (the user’s searchQuery) will be interpolated into our endpoint variable as the value of the &srsearch= parameter\n const endpoint = `https://en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&origin=*&srlimit=20&srsearch=${searchQuery}`;\n \n fetch(endpoint)\n .then(response => response.json())\n .then(data => {\n const results = data.query.search;\n displayResults(results); \n });\n}", "title": "" }, { "docid": "f672b7e501f362b9e9183d218f59f87d", "score": "0.5437826", "text": "function requestSearchInfo(){\t\n\t\t$http.get('data/articles.json').success(function(data) {\n\t\t\t$scope.articles = processArticleList(data.articleList);\n\t\t\t$scope.searchResultNum = $scope.articles.length;\t\t\n\t\t});\t\n\t}", "title": "" }, { "docid": "f672b7e501f362b9e9183d218f59f87d", "score": "0.5437826", "text": "function requestSearchInfo(){\t\n\t\t$http.get('data/articles.json').success(function(data) {\n\t\t\t$scope.articles = processArticleList(data.articleList);\n\t\t\t$scope.searchResultNum = $scope.articles.length;\t\t\n\t\t});\t\n\t}", "title": "" }, { "docid": "207d05c03d3d8480dfb540e726545a5c", "score": "0.5431699", "text": "function updateResultsCounter() {\n\tvar artistScore = '<p>' +\"Correct Artist: \" +correctArtCounter+ '</p>';\n\t$(\"#artistResults\").html(artistScore);\n\tvar guitarScore = '<p>' +\"Correct Guitars: \"+correctGitCounter+ '</p>';\n\t$(\"#guitarResults\").html(guitarScore);\n}", "title": "" }, { "docid": "b60af1d2d92851493c86f3aca8f0d249", "score": "0.54237604", "text": "async countingAndValidate(input, searchBy){\n try {\n await this.selenium.write(input, \"css\", \".search-clients input:nth-child(1)\")\n await this.selenium.write(searchBy, \"className\", \"select-css\") \n\n //check the result, get the first and last page of the result\n let sum = 0\n let firstPage = await this.selenium.getTextFromElement(\"css\", \".page-numbers span:nth-child(2)\")\n console.log(`first page: ${firstPage}`)\n let lastPage = await this.selenium.getTextFromElement(\"css\", \".page-numbers span:nth-child(4)\")\n console.log(`last Page: ${lastPage}`)\n\n //check after the search. if element exist get the text\n let checkResualt = await this.selenium.isElementExists(\"className\", \"clientDetails\")\n let countingPages = 0\n while(checkResualt == true && countingPages < lastPage){\n let findword = await this.selenium.findElementListBy(\"className\", \"clientDetails\")\n for(let i of findword){\n let getTextSold = await this.selenium.getTextFromElement(\"className\", \"clientDetails\", i)\n sum = sum +1\n }\n await this.selenium.clickElement(\"css\", \"img[name='next']\") \n countingPages++\n }\n console.log(`counting the word: ${input}, in client page, the number of time its appear: ${sum}`) \n \n console.log(\"success to count and validate\")\n return sum\n } catch (error) {\n console.error(\"get error while try to count and validate\")\n return false\n }\n }", "title": "" }, { "docid": "afe2ee3bc6a2bc2b8b45c4fb1c863013", "score": "0.5416385", "text": "function searchAll() {\n elas.searchAll(\"icolor\", \"users\").then(function (data) {\n console.log(data);\n //console.log(data.length);\n });\n}", "title": "" }, { "docid": "8c64988793920483f5126db4f85f3784", "score": "0.5414941", "text": "function displaySearchResults(s) { // in this function, the s parameter refers to search results passed in\n\n $('#num-results').html(s.length);\n \n var temporaryLayer;\n var alertHtml;\n \n if (s.length === 1000) {\n alertHtml = '<div class=\"alert alert-danger\" role=\"alert\"><strong>Your search returned too many results. Only the first 1000 will be displayed below.</strong> Adjust your search parameters to return more specific records.</div>';\n } else if (s.length > 100 && s.length < 1000) {\n alertHtml = '<div class=\"alert alert-warning\" role=\"alert\"><strong>Your search returned more than 100 results.</strong> All of them are displayed below. You may wish to adjust your search parameters to return more specific records.</div>';\n } else {\n alertHtml = '';\n }\n\n var resultsHtml = // all of the output html will be stored in this variable\n '<h2>Seach Results</h2>' +\n alertHtml + // were any alerts called above?\n '<p>' +\n 'Found <strong>' + s.length + '</strong> results in ';\n \n var seriesArray = []; // this will allow the application to group search results by map series\n \n for (i = 0; i < s.length; i++) { // loop through every search result and create an array containing all series names\n if (seriesArray.indexOf(s[i].properties.SERIES_TIT) < 0) {\n seriesArray.push(s[i].properties.SERIES_TIT); // if series is not already in array, add it\n }\n }\n \n if ( seriesArray.indexOf(null) >= 0 ) { // if a null value shows up in series list, call it something more descriptive\n var index = seriesArray.indexOf(null);\n seriesArray[index] = \"No associated series\";\n }\n \n resultsHtml += ('<strong>' + seriesArray.length + '</strong> series.</p>')\n \n for (j = 0; j < seriesArray.length; j++) { // create headings and lists for each category in the search results\n resultsHtml += (\n '<h3>' + seriesArray[j] + '</h3>'\n + '<ul class=\"list-group\">'\n + makeCategorizedList(seriesArray[j])\n + '</ul>'\n )\n }\n \n function makeCategorizedList(cat) { // create individual <li>s for each <ul> created in the for loop above\n var listToReturn = '';\n for (h = 0; h < s.length; h++) {\n \n var loc = s[h].properties.LOCATION;\n var date = s[h].properties.DATE;\n var rec = s[h].properties.RECORD;\n var oid = s[h].properties.OBJECTID;\n var ser = s[h].properties.SERIES_TIT;\n \n if (loc === null){\n loc = '';\n } else {\n loc = ': ' + loc;\n }\n \n if (cat === ser) {\n listToReturn += ('<li class=\"list-group-item\"><a href=\"#\" class=\"show-map-outline-link\" id=\"show-outline-' + oid +'\"><i class=\"fa fa-lg fa-map\" aria-hidden=\"true\"></i></a><a href=\"#\" class=\"attr-modal-link\" id=\"info-' + oid + '\" data-toggle=\"modal\" data-target=\"#attrModal\"><i class=\"fa fa-lg fa-info-circle aria-hidden=\"false\"></i></a><span class=\"search-result\">' + date + ' &ndash; ' + rec + loc + '</span>');\n listToReturn += searchResultsBookmarkDetermine(oid.toString());\n listToReturn += '</li>';\n } else if (cat === \"No associated series\" && ser === null) { // need this to deal with series containing a null value\n listToReturn += ('<li class=\"list-group-item\"><a href=\"#\" class=\"show-map-outline-link\" id=\"show-outline-' + oid +'\"><i class=\"fa fa-lg fa-map\" aria-hidden=\"true\"></i></a><a href=\"#\" class=\"attr-modal-link\" id=\"info-' + oid + '\" data-toggle=\"modal\" data-target=\"#attrModal\"><i class=\"fa fa-lg fa-info-circle aria-hidden=\"false\"></i></a><span class=\"search-result\">' + date + ' &ndash; ' + rec + loc + '</span>');\n listToReturn += searchResultsBookmarkDetermine(oid.toString());\n listToReturn += '</li>';\n \n }\n }\n return listToReturn;\n }\n \n function searchResultsBookmarkDetermine (q) {\n if (savedRecords.indexOf(q) >= 0){\n return ('<a href=\"#\" class=\"bookmark-link remove-bookmark\" id=\"remove-bookmark-' + q + '\"><i class=\"fa fa-lg fa-bookmark\" aria-hidden=\"false\"></i></a>')\n } else {\n return ('<a href=\"#\" class=\"bookmark-link add-bookmark\" id=\"add-bookmark-' + q + '\"><i class=\"fa fa-lg fa-bookmark-o\" aria-hidden=\"false\"></i></a>')\n }\n }\n \n $('#search-results').html( // once everything else is done, change the \"search-results\" div's html to match that of the resultsHtml variable\n resultsHtml\n )\n .promise()\n .done(function(){\n $('#tab-results').click();\n });\n \n /////////////////////////////////////////////////\n // show feature boundary link //\n /////////////////////////////////////////////////\n \n $('.show-map-outline-link').on('click', function(){\n // grab the current zoom level and bounds right away -- to be used with the return to previous extent link\n var rememberLastExtent = {\n zoom: theMap.getZoom(),\n bounds: theMap.getBounds()\n };\n removeAllOutlines();\n var featureId = $(this).attr('id').replace('show-outline-', '');\n var geodexBoundsQuery = L.esri.query({\n url: mapService\n });\n geodexBoundsQuery\n .where('\"OBJECTID\" = '+ featureId);\n geodexBoundsQuery.run(function(error, featureToDisplay, response){\n var thisFeaturesGeometry = featureToDisplay.features[0].geometry.coordinates[0];\n for (i = 0; i < thisFeaturesGeometry.length; i++) {\n thisFeaturesGeometry[i].reverse();\n }\n temporaryLayer = L.polygon(thisFeaturesGeometry, {color: 'red'});\n // check to see if outlined feature is in current map extent; pan to it if not\n var currentExtent = theMap.getBounds();\n var containTest = currentExtent.contains(thisFeaturesGeometry); // returns true if outline is in current extent, false if not\n if(containTest === false) {\n var panToHere = temporaryLayer.getBounds().getCenter(); // if necessary, pan to the center of the outline\n theMap.panTo(panToHere, {\n animate: true\n });\n }\n \n temporaryLayerGroup = L.layerGroup([temporaryLayer]);\n temporaryLayerGroup.addTo(theMap);\n outlineOnMap = true;\n });\n \n /////////////////////////////////////////////////\n // return to previous extent //\n /////////////////////////////////////////////////\n \n $('.previous-extent').on('click', function(){\n theMap.panTo(rememberLastExtent.bounds);\n theMap.zoomTo(rememberLastExtent.zoom);\n $(this).remove();\n });\n \n });\n \n /////////////////////////////////////////////////\n // click on bookmark icon //\n /////////////////////////////////////////////////\n \n $('.bookmark-link').on('click', function(){\n \n // use the link's class to determine whether or not this is an \"add\" or \"remove\" bookmark link\n var thisIsAddLink = $(this).hasClass('add-bookmark');\n \n if(thisIsAddLink) {\n $('#no-saved-records').empty();\n var bookmarkThis = $(this).attr('id').replace('add-bookmark-', '');\n savedRecords.push(bookmarkThis);\n $(this).removeClass('add-bookmark');\n $(this).addClass('remove-bookmark');\n $(this).attr('id', ('remove-bookmark-' + bookmarkThis));\n $(this).html('<i class=\"fa fa-lg fa-bookmark\" aria-hidden=\"false\"></i>')\n $('#num-bookmarked').html(savedRecords.length);\n } else {\n var unbookmarkThis = $(this).attr('id').replace('remove-bookmark-', '');\n var unbookmarkIndex = savedRecords.indexOf(unbookmarkThis);\n if (unbookmarkIndex > -1) {\n savedRecords.splice(unbookmarkIndex, 1);\n }\n $(this).removeClass('remove-bookmark');\n $(this).addClass('add-bookmark');\n $(this).attr('id', ('add-bookmark-' + unbookmarkThis));\n $(this).html('<i class=\"fa fa-lg fa-bookmark-o\" aria-hidden=\"false\"></i>')\n $('#num-bookmarked').html(savedRecords.length);\n }\n \n updateRecordsList();\n \n });\n \n /////////////////////////////////////////////////\n // saved records display function //\n /////////////////////////////////////////////////\n \n function updateRecordsList() {\n \n createExportTable();\n \n var exportTable = $('#export-table').tableExport();\n \n // generate <li>s\n var bookmarksHtml = '';\n for (w = 0; w < savedRecords.length; w++) {\n bookmarksHtml += ('<li>' + savedRecords[w] + '</li>');\n }\n \n $('#saved-records-list').html(bookmarksHtml);\n }\n \n /////////////////////////////////////////////////\n // export table //\n /////////////////////////////////////////////////\n \n function createExportTable(){\n \n $('#export-table').empty();\n \n //to change which attributes appear in the exported Excel file, simply update this array!\n var exportTableAttributes = ['OBJECTID', 'DATE', 'CATLOC'];\n \n // create the table head\n var exportTableHtml = '<thead><tr>';\n for (w = 0; w < exportTableAttributes.length; w++) {\n exportTableHtml += ('<td>' + exportTableAttributes[w] + '</td>');\n }\n exportTableHtml += '</tr></thead><tbody>';\n \n // to create the table body, we must query all of the saved records\n var exportTableQuery = L.esri.query({\n url: mapService\n });\n \n // loop through all of the saved records to create an sql query\n var exportTableSql = '';\n for(u = 0; u < savedRecords.length; u++) {\n exportTableSql += ('OBJECTID = ' + savedRecords[u]);\n if (u !== (savedRecords.length - 1)){\n exportTableSql += ' OR ';\n }\n }\n\n // run the sql query we just made\n exportTableQuery.where(exportTableSql).fields(exportTableAttributes).returnGeometry(false);\n exportTableQuery.run(function(error, sqlResult, response){\n // now use the query results to create the table body\n for(n = 0; n < sqlResult.features.length; n++) {\n exportTableHtml += '<tr>'\n for(m = 0; m < exportTableAttributes.length; m++){\n var getThisAttr = exportTableAttributes[m];\n exportTableHtml += ('<td>' + sqlResult.features[n].properties[getThisAttr] + '</td>');\n }\n exportTableHtml += '</tr>'\n if (n === (sqlResult.features.length -1)) {\n exportTableHtml += '</tbody>';\n $('#export-table').html(exportTableHtml);\n }\n }\n $('#export-table').tableExport({\n fileName: 'geodexrecords',\n formats: ['xls']\n });\n });\n \n }\n\n /////////////////////////////////////////////////\n // attribute table vocabulary //\n /////////////////////////////////////////////////\n \n // these domains are used in multiple attributes; might as well store them separately\n var yearTypeDomain = {\n \"97\" : \"Approximate Date\",\n \"98\" : \"Publication Date\",\n \"99\" : \"Compilation Date\",\n \"100\" : \"Base Map Date\",\n \"102\" : \"Field Checked\",\n \"103\" : \"Image Year\",\n \"104\" : \"Photography to\",\n \"105\" : \"Photo Inspected\",\n \"106\" : \"Image Date\",\n \"108\" : \"Preliminary Edition\",\n \"109\" : \"Compiled From Map Dated\",\n \"110\" : \"Interim Edition\",\n \"112\" : \"Printed\",\n \"113\" : \"Printed Circa\",\n \"114\" : \"Revised\",\n \"115\" : \"Situation/Survey\",\n \"116\" : \"Transportation Network\",\n \"118\" : \"Provisional Edition\",\n \"120\" : \"Photo Revised\",\n \"121\" : \"Edition of\",\n \"119\" : \"Magnetic Declination Year\"\n };\n \n var subsDomain = {\n \"0\": \"Not assigned\",\n \"1\": \"Global Coverage\",\n \"2\": \"Regional Coverage\",\n \"3\": \"Nautical, Aeronautical, and Lake Charts\",\n \"4\": \"USGS Topographic Quads\"\n };\n \n /*\n maintaining the structure of this is very important!\n - each attribute that needs changing (or has values that need changing) is a key in the valuesVocab object\n - the value for the key is one array that should not exceed two values\n - the first value in the array is the new name for the attribute\n - the second value is the array is an object containing definitions for individual values -- this is OPTIONAL\n - attributes can be left out of this object entirely to maintain their default attribute names/value names\n */\n \n var valuesVocab = {\n \"CATLOC\" : [\"Catalog Location\"],\n \"DATE\" : [\"Date\"],\n \"EDITION_NO\" : [\"Edition Number\"],\n \"GDX_FILE\" : [\"GDX Series\"],\n \"GDX_NUM\" : [\"GDX File Number\"],\n \"GDX_SUB\" : [\"GDX Subtype\", subsDomain],\n \"HOLD\" : [\"Holdings\"],\n \"ISO_TYPE\" : [\"Isobar Type\", {\n \"1\" : \"Isobars Feet\",\n \"2\" : \"Isobars Fathoms\",\n \"3\" : \"Isobars Meters\",\n \"4\" : \"Contours Feet\",\n \"5\" : \"Contours Meters\",\n \"6\" : \"Multiple Isobar Types\",\n \"7\" : \"No Isobar Indicated\"\n }],\n \"ISO_VAL\" : [\"Isobar Value\"],\n \"LAT_DIMEN\" : [\"Latitude Dimension\"],\n \"LOCATION\" : [\"Location\"],\n \"LON_DIMEN\" : [\"Latitude Dimension\"],\n \"MAP_FOR\" : [\"Map Format\", {\n \"0\" : \"Not assigned\",\n \"211\" : \"180° Longitude X-over entry\",\n \"212\" : \"180° Longitude X-over entry\",\n \"47\" : \"County format\",\n \"998\" : \"Geologic map\",\n \"50\" : \"Inset on quad\",\n \"48\" : \"Irregular format\",\n \"996\" : \"Printed map - 2 color\",\n \"995\" : \"Printed map - colored\",\n \"42\" : \"Quad not entirely mapped\",\n \"49\" : \"Quad with inset\",\n \"45\" : \"Special quadrangle\",\n \"41\" : \"Standard quadrangle\",\n \"44\" : \"Std quad with extensions\",\n \"43\" : \"Std quad with overlap\"\n }],\n \"MAP_TYPE\" : [\"Map Type\", {\n \"0\" : \"Not assigned\",\n \"30\" : \"Administrative map\",\n \"1\" : \"Aerial photograph\",\n \"6\" : \"Aeronautical chart\",\n \"7\" : \"Bathymetric map\",\n \"21\" : \"Coal map\",\n \"5\" : \"Geologic map\",\n \"4\" : \"Hydrogeologic map\",\n \"11\" : \"Land use map\",\n \"12\" : \"Nautical chart\",\n \"13\" : \"Orthophoto map\",\n \"14\" : \"Planimetric map\",\n \"998\" : \"Printed map - 2 color\",\n \"997\" : \"Printed map - colored\",\n \"996\" : \"Printed map - monochrome\",\n \"995\" : \"Projection not indicated\",\n \"15\" : \"Reference map\",\n \"16\" : \"Road map\",\n \"22\" : \"Satellite image map\",\n \"24\" : \"Shaded relief map\",\n \"18\" : \"Topo map (contours)\",\n \"23\" : \"Topo map (form lines)\",\n \"19\" : \"Topo map (hachures)\",\n \"25\" : \"Topo map (irr interval)\",\n \"20\" : \"Topo map (layer tints)\"\n }],\n \"PRIME_MER\" : [\"Prime Meridian\", {\n \"0\" : \"Not assigned\",\n \"157\" : \"Athens PM\",\n \"999\" : \"C¢rdoba PM\", // is this correct?\n \"148\" : \"Copenhagen PM\",\n \"135\" : \"Ferro PM\",\n \"131\" : \"Greenwich PM\",\n \"132\" : \"Madrid PM\",\n \"146\" : \"Munich PM\",\n \"142\" : \"Paris PM\",\n \"138\" : \"Quito PM\",\n \"147\" : \"Rome PM\"\n }],\n \"PROJECT\" : [\"Projection\", {\n \"0\": \"Not assigned\",\n \"163\" : \"Azimuthal equidistant\",\n \"185\" : \"Bonne\",\n \"199\" : \"Cassini\",\n \"182\" : \"Conic equidistant\",\n \"183\" : \"Conic\",\n \"171\" : \"Cylindrical\",\n \"180\" : \"Gauss-Krüger\",\n \"999\" : \"Gauss-Krüger\",\n \"164\" : \"Gnomonic\",\n \"186\" : \"Lambert conformal conic\",\n \"175\" : \"Mercator\",\n \"176\" : \"Miller\",\n \"998\" : \"Munich PM\",\n \"187\" : \"Polyconic\",\n \"198\" : \"Polyhedric\",\n \"161\" : \"Not indicated\",\n \"178\" : \"Sinusoidal\",\n \"168\" : \"Stereographic\",\n \"179\" : \"Transverse Mercator\"\n }],\n \"PRODUCTION\" : [\"Production\", {\n \"0\" : \"Not assigned\",\n \"38\" : \"Blue line print\",\n \"39\" : \"Blueprint\",\n \"37\" : \"Negative microform\",\n \"35\" : \"Negative photocopy\",\n \"34\" : \"Positive photocopy\",\n \"32\" : \"Printed map - 2 color\",\n \"31\" : \"Printed map - colored\",\n \"33\" : \"Printed map - monochrome\"\n }],\n \"PUBLISHER\" : [\"Publisher\"],\n \"RECORD\" : [\"Record\"],\n \"RUN_DATE\" : [\"Run Date\"],\n \"SCALE\" : [\"Scale\"],\n \"SERIES_TIT\" : [\"Series\"],\n \"Shape_Area\" : [\"GIS Shape Area\"],\n \"Shape_Length\" : [\"GIS Shape Length\"],\n \"X1\" : [\"West\"],\n \"X2\" : [\"East\"],\n \"Y1\" : [\"North\"],\n \"Y2\" : [\"South\"],\n \"YEAR1_TYPE\" : [\"Year 1 Type\", yearTypeDomain],\n \"YEAR1\" : [\"Year 1\"],\n \"YEAR2_TYPE\" : [\"Year 2 Type\", yearTypeDomain],\n \"YEAR2\" : [\"Year 2\"],\n \"YEAR3_TYPE\" : [\"Year 3 Type\", yearTypeDomain],\n \"YEAR3\" : [\"Year 3\"],\n \"YEAR4_TYPE\" : [\"Year 4 Type\", yearTypeDomain],\n \"YEAR4\" : [\"Year 4\"]\n };\n \n \n /////////////////////////////////////////////////\n // click on info icon, get modal with attrs //\n /////////////////////////////////////////////////\n\n $('.attr-modal-link').on('click', function(){\n \n // what record are we currently looking at? use the assigned id to figure it out\n var featureToLookup = ($(this).attr('id')).replace('info-', '');\n \n // get the properties for the record\n var geodexAttrQuery = L.esri.query({\n url: mapService\n });\n geodexAttrQuery\n .where('\"OBJECTID\" = '+ featureToLookup);\n \n geodexAttrQuery.run(function(error, featureWeFound, response){\n \n var attr = featureWeFound.features[0].properties;\n var attrKeys = Object.keys(attr);\n \n // and now it's time to populate our modal with the attributes!\n $('#attrModalLabel').html('<strong>Attributes:</strong> ' + attr.DATE + ' &ndash; ' + attr.RECORD);\n \n // procedurally generate the table, because we're lazy and doing it manually sounds boring\n for (b = 0; b < attrKeys.length; b++) {\n // grab the current attribute\n var currentAttribute = attrKeys[b];\n // grab the current value for the current attribute\n var currentValue = attr[currentAttribute];\n \n // check to see if this attribute is in \"valuesVocab\" above; change the vocabulary if so\n if(currentAttribute in valuesVocab){\n if (valuesVocab[currentAttribute].length > 1){ // see if the attribute has value vocab first\n currentValue = valuesVocab[currentAttribute][1][currentValue];\n }\n currentAttribute = valuesVocab[currentAttribute][0];\n }\n \n // generate the html for the secondary attributes\n var tableRowHtml;\n if (currentAttribute === \"NautChartID\" || currentAttribute === \"OBJECTID\"){\n // do nothing\n } else if (currentValue === null || currentValue === \"Not assigned\" || currentValue === undefined){ // color these values differently\n tableRowHtml = ( '<tr><td><strong>' + currentAttribute + '</strong></td><td><span class=\"null-value\">Not assigned</span></td></tr>' );\n if (b === 0 || b <= ((attrKeys.length / 2) - 1)) { // throw the first half of all attributes in table #1\n $('#attr-table-1>tbody').append(tableRowHtml);\n } else { // throw the rest in table #2\n $('#attr-table-2>tbody').append(tableRowHtml);\n }\n } else {\n tableRowHtml = ( '<tr><td><strong>' + currentAttribute + '</strong></td><td>' + currentValue + '</td></tr>' );\n if (b === 0 || b <= ((attrKeys.length / 2) - 1)) { // throw the first half of all attributes in table #1\n $('#attr-table-1>tbody').append(tableRowHtml);\n } else { // throw the rest in table #2\n $('#attr-table-2>tbody').append(tableRowHtml);\n }\n }\n }\n \n });\n \n });\n }", "title": "" }, { "docid": "9580d14d800b9c65f35ac64208490f8d", "score": "0.54131204", "text": "getResults() {\n var amount = this.state.answersCount;\n return amount;\n }", "title": "" }, { "docid": "b8d9bfdbd5ec2fc0c2d9cfbe073c77fa", "score": "0.5412404", "text": "function TestComp({ term }) {\n const [result] = useSearch({\n input: term,\n documents: testData,\n keys: [\"name.first\", \"company\"]\n })\n\n return (\n <div>\n <span data-testid=\"result\">{result.length}</span>\n </div>\n )\n}", "title": "" }, { "docid": "fc7e667e8bea18b17cdfa7bf3618cb01", "score": "0.54089797", "text": "function displayResults(results) {\n if(results.length === 0) {\n hideResultArea();\n showMessage('Query fetched zero results', 'warning');\n return;\n }\n\n populateList(results);\n updateResultsCount(searchResults.length);\n showMessage('');\n showResultArea();\n }", "title": "" }, { "docid": "8f51e86d891a9c7e0d6ce41bd2f674a3", "score": "0.5381547", "text": "function count() {\n return count;\n }", "title": "" }, { "docid": "f1dffb3f96a7ba275329a09ec2592c0a", "score": "0.537938", "text": "function count()\r\n\t{\r\n\t\treturn probList.length;\r\n\t}", "title": "" }, { "docid": "20bddf8852ea01946563d5c48ecae65f", "score": "0.5377438", "text": "function showSearchResults(results) {\n alert(results);\n console.log(results);\n}", "title": "" }, { "docid": "36b4dd558295f5160d76a099ff95e19b", "score": "0.5373764", "text": "function retrieveResults() {\n const barInput = searchBar.value\n fetch (url + 'term=' + `${barInput}` + '&limit=20' + '&entity=song')\n .then(res => res.json())\n .then (data => {\n for (let x of data.results){\n createResults(x)\n}\n})\n}", "title": "" }, { "docid": "4cf547b8d11efed4dad3b84e66d32777", "score": "0.5356643", "text": "function printResults(results) {\n for (var url in results) {\n var over = results[url].over;\n var under = results[url].under;\n var total = over + under;\n\n console.log(url + \" : \" + over + \"/\" + total + \" exceeded \" + threshold + \" ms\");\n }\n}", "title": "" }, { "docid": "02c6ec8fe40f79c0a14a10926210b62b", "score": "0.53560054", "text": "howManyMatch(stringToSearch, string) {\n const regex = new RegExp(string,\"g\");\n return (stringToSearch.match(regex) || []).length;\n }", "title": "" }, { "docid": "f1585869f97f593a67d155580fbf6aff", "score": "0.53557557", "text": "function updateHits(){\n iHits++;\n oHitsOutput.textContent = String(iHits);\n}", "title": "" }, { "docid": "92374f3bffe0e22ada6dfe4bd72da055", "score": "0.53553617", "text": "function rankResults(matches, query) {\n query = query || '';\n matches = matches || [];\n\n // We replace dashes with underscores so dashes aren't treated\n // as word boundaries.\n var queryParts = query.toLowerCase().replace(/-/g, '_').match(/\\w+/g) || [''];\n\n for (var i = 0; i < matches.length; i++) {\n var totalScore = (matches[i].extraRank || 0) * 200;\n\n for (var j = 0; j < queryParts.length; j++) {\n var partialAlnumRE = new RegExp(queryParts[j]);\n var exactAlnumRE = new RegExp('\\\\b' + queryParts[j] + '\\\\b');\n totalScore += resultMatchScore(exactAlnumRE, partialAlnumRE, j, matches[i]);\n }\n\n matches[i].__resultScore = totalScore;\n }\n\n matches.sort(function(a, b) {\n var n = b.__resultScore - a.__resultScore;\n if (n == 0) // lexicographical sort if scores are the same\n n = (a.fullname < b.fullname) ? -1 : 1;\n return n;\n });\n}", "title": "" }, { "docid": "dc70c159c1b8d64c035992eb190c8883", "score": "0.53532815", "text": "function displayResults(results) {\r\n const searchResults = document.querySelector('.searchResults');\r\n searchResults.innerHTML = '';\r\n const result = results[0];\r\n const url = encodeURI(`https://en.wikipedia.org/wiki/${result.title}`);\r\n\r\n searchResults.insertAdjacentHTML('beforeend',\r\n `<div class=\"resultItem\">\r\n <h3 class=\"resultItem-title\">\r\n <a href=\"${url}\" target=\"_blank\" rel=\"noopener\">${result.title}</a>\r\n </h3>\r\n <span class=\"resultItem-snippet\">${result.snippet}</span><br>\r\n </div>`\r\n );\r\n}", "title": "" }, { "docid": "a9c8524c619ce4abad93f70bfe29bc29", "score": "0.5348488", "text": "static numPages(str){\n return /page=(\\d+)p(\\d+)/.exec(str).slice(1);\n }", "title": "" }, { "docid": "da1711f3f345c77252ac650e294741ce", "score": "0.5339383", "text": "function relevance(result) {\n let relevance = 0;\n\n relevance = Math.max(0, 8 - result.match.chunks) << 7;\n\n if (result.match.caseMatch) {\n relevance *= 2;\n }\n\n if (result.match.prefix) {\n relevance += 2048;\n }\n\n relevance += Math.max(0, 255 - result.key.length);\n\n return relevance;\n}", "title": "" }, { "docid": "c617b214123ebd6c10768cd9dc70d651", "score": "0.533708", "text": "constructor() {\n\n /** The array of results for display in the GUI. */\n this.results = [];\n\n class ResultCounts {\n numLexicons() { return Object.keys(this).length; }\n }\n /** The result counts per language */\n this.resultCounts = new ResultCounts();\n\n /** Array of active search timeout handles. */\n this.activeSearches = [];\n\n /** The helper object for checking if an entry matches the filter settings. */\n this.resultsFilter = new ResultsFilter();\n\n /** Variables needed to keep track of current search progress. */\n this.totalSize = 0;\n this.processedCount = 0;\n }", "title": "" }, { "docid": "5683af9369e8efc89badd40c1670e35a", "score": "0.5319065", "text": "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "title": "" }, { "docid": "1158db1b1337cf292b1b2fba1dc3e431", "score": "0.5314226", "text": "function results() {\n //loop through the answerTracker array to determine if choosen answer was correct, incorrect or unaswered\n for (var i = 0; i < answerTracker.length; i++) {\n if (answerTracker[i] == true) {\n rights++;\n }\n if (answerTracker[i] == false) {\n wrong++;\n }\n if (answerTracker[i] == undefined) {\n unAnswered++;\n }\n }\n\n //show result page and display results to result page\n $('#resultTitle').show();\n $('#carouselExampleFade').hide();\n $('#Correct').html('Correct: ' + rights);\n $('#Incorrect').html('Incorrect: ' + wrong);\n $('#Unanswered').html('Unanswered: ' + unAnswered);\n }", "title": "" }, { "docid": "a0071bfc560cea7e227c3a17fa1eebfc", "score": "0.5313503", "text": "function replyOccurences(x, passedTag){\n var searchCount =0;\n for(var i = 0; i < x.length; i++) {\n if (x[i][passedTag]){\n try {\n if(searchCount>=searchCountLimit)\n break;\n tempReply.html('<a href=\"url\">'+x[i][passedTag]+'</a>');\n searchCount++;\n }\n catch(err) {\n tempReply.markdown(occurenceError);\n }\n }\n }\n tempReply.markdown(searchEndedMsg);\n tempReply.markdown('این جستجو محدود بود و فقط '+ searchCountLimit\n + 'تا عکس تونستی پیدا کنی😟' + '\\n'+\n 'میتونی این محدودیت رو از منو تغییر بدی. 😊');\n}", "title": "" }, { "docid": "eb52f63cdbcf232f33106f57423c3f92", "score": "0.53104216", "text": "update_results_count(page, amount) {\n\t\tconst first = (page - 1) * PER_PAGE + 1;\n\t\tconst last = Math.min(amount, page * PER_PAGE);\n\t\tthis.$results_count.innerHTML = \"\";\n\t\tthis.$results_count.appendChild(\n\t\t\thtml(`<em>Showing results ${first}-${last} of ${amount}</em>`)[0]\n\t\t);\n\t\tthis.$pagers.forEach((p) => p.update_results_count(page, amount));\n\t\tconst last_page = Math.ceil(amount / PER_PAGE);\n\t\tthis.$pages.innerText = `Page ${page}/${last_page}`;\n\t}", "title": "" }, { "docid": "97f3d1d3c9d574c6938f6c85806846d2", "score": "0.530809", "text": "function afterSearchDone(response) {\n var hits = response.hits.hits;\n \n for(var i=0; i<hits.length; i++)\n resultArray.push(hits[i].fields[FIELD_URI][0]);\n \n setQueryDivField(\"queryTime\", eval(response.took/1000) + \" s\");\n setQueryDivField(\"queryNumberOfResults\", hits.length);\n \n hideLoadingAnimation();\n \n printPagination(resultArray);\n $(\".pagination li:first-child a:first-child\").click();\n}", "title": "" }, { "docid": "52b8c99d5051368f97ed82a94284cf08", "score": "0.5306011", "text": "function count(numString) {\n return numString.length;\n}", "title": "" }, { "docid": "55221becad89fd8339f9e83e752dd26c", "score": "0.529596", "text": "function textCounter(){\n\tvar total = ($('#txt_outfitName').length > 0)? $('#txt_outfitName').val().length : 0;\n\t$('#outfit_name_length').text(total);\t\n\tvar prdtotal = $('.textCount').val().length;\n\t$('#product_desc_length').text(prdtotal);\n\n}", "title": "" }, { "docid": "3412010862d8be20b348a99017f1abd1", "score": "0.5293632", "text": "function resultNum() {\n\tvar _len = $('.list').find('.piece').find('i').length,\n\t\t_footNum = $('.result').find('.piece').find('i'),\n\t\t_i = 0,\n\t\t_resultNum = 0\n\tfor(; _i < _len; _i++) {\n\t\tvar _txt = $('.list').find('.piece').eq(_i).find('i').text()\t\n\t\t_resultNum += +(_txt)\t\n\t}\n\t_footNum.text(_resultNum)\n}", "title": "" }, { "docid": "974c7a26a00f8ac196e6dca90029a838", "score": "0.5293378", "text": "function nwtCounter() {\n let wordsTyped = myText.value.split(\" \").length; \n nwtTotal.innerHTML = wordsTyped++;\n }", "title": "" }, { "docid": "f867b0d14ceb6782c2678bb0c721e6d0", "score": "0.52917904", "text": "function countStr(str){\n\t\tvar num = 0;\n\t\tconsole.log(str);\n\t\tfor(var i = 0; i < bodies.length;i++){\n\t\t\tvar name = bodies[i].name.replace(/[0-9 ]/g, '');\n\t\t\tif(name==str){\n\t\t\t\tnum+=1;\n\t\t\t}\n\t\t}\n\t\treturn num;\n\t}", "title": "" }, { "docid": "0626c4902a9a5ec73fcbb1f607359e4c", "score": "0.52883244", "text": "function addResults(){\n\t\ts.combinedResults = s.combinedResults.concat(s.pageResults);\n\t}", "title": "" } ]
5a4d2a21d9a8b58d8857d4aac9e54197
Clone and return a new ReactElement using element as the starting point. See
[ { "docid": "32218d3188f78fb856a639594bb5fd9b", "score": "0.0", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" } ]
[ { "docid": "0dac755a461c5f0bb66ed677f0d446c3", "score": "0.6698122", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "69abb7ccea3f7d13d5aa1513963f24be", "score": "0.66940486", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\"));\n }\n }\n })();\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "d49dd6af0ee6aa6540cd41f65aedf390", "score": "0.6662003", "text": "function cloneElement(element, config, children) {\r\n if (!!(element === null || element === undefined)) {\r\n {\r\n throw Error(\r\n 'React.cloneElement(...): The argument must be a React element, but you passed ' +\r\n element +\r\n '.'\r\n )\r\n }\r\n }\r\n\r\n var propName // Original props are copied\r\n\r\n var props = _assign({}, element.props) // Reserved names are extracted\r\n\r\n var key = element.key\r\n var ref = element.ref // Self is preserved since the owner is preserved.\r\n\r\n var self = element._self // Source is preserved since cloneElement is unlikely to be targeted by a\r\n // transpiler, and the original source is probably a better indicator of the\r\n // true owner.\r\n\r\n var source = element._source // Owner will be preserved, unless ref is overridden\r\n\r\n var owner = element._owner\r\n\r\n if (config != null) {\r\n if (hasValidRef(config)) {\r\n // Silently steal the ref from the parent.\r\n ref = config.ref\r\n owner = ReactCurrentOwner.current\r\n }\r\n\r\n if (hasValidKey(config)) {\r\n key = '' + config.key\r\n } // Remaining properties override existing props\r\n\r\n var defaultProps\r\n\r\n if (element.type && element.type.defaultProps) {\r\n defaultProps = element.type.defaultProps\r\n }\r\n\r\n for (propName in config) {\r\n if (\r\n hasOwnProperty.call(config, propName) &&\r\n !RESERVED_PROPS.hasOwnProperty(propName)\r\n ) {\r\n if (\r\n config[propName] === undefined &&\r\n defaultProps !== undefined\r\n ) {\r\n // Resolve default props\r\n props[propName] = defaultProps[propName]\r\n } else {\r\n props[propName] = config[propName]\r\n }\r\n }\r\n }\r\n } // Children can be more than one argument, and those are transferred onto\r\n // the newly allocated props object.\r\n\r\n var childrenLength = arguments.length - 2\r\n\r\n if (childrenLength === 1) {\r\n props.children = children\r\n } else if (childrenLength > 1) {\r\n var childArray = Array(childrenLength)\r\n\r\n for (var i = 0; i < childrenLength; i++) {\r\n childArray[i] = arguments[i + 2]\r\n }\r\n\r\n props.children = childArray\r\n }\r\n\r\n return ReactElement(\r\n element.type,\r\n key,\r\n ref,\r\n self,\r\n source,\r\n owner,\r\n props\r\n )\r\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646337", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "6918c4eefc5ad7fc8dfa2e4133640d49", "score": "0.6633374", "text": "function cloneElement(element, config, children) {\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "531b07864d6965b15954d7cefacbfe63", "score": "0.66278744", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "4aa29f37f2345a7add7c22e41517bde9", "score": "0.662777", "text": "function cloneElement(element, config, children) {\n\t if (!!(element === null || element === undefined)) {\n\t {\n\t throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n\t }\n\t }\n\n\t var propName; // Original props are copied\n\n\t var props = _assign({}, element.props); // Reserved names are extracted\n\n\n\t var key = element.key;\n\t var ref = element.ref; // Self is preserved since the owner is preserved.\n\n\t var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n\t // transpiler, and the original source is probably a better indicator of the\n\t // true owner.\n\n\t var source = element._source; // Owner will be preserved, unless ref is overridden\n\n\t var owner = element._owner;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t // Silently steal the ref from the parent.\n\t ref = config.ref;\n\t owner = ReactCurrentOwner.current;\n\t }\n\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t } // Remaining properties override existing props\n\n\n\t var defaultProps;\n\n\t if (element.type && element.type.defaultProps) {\n\t defaultProps = element.type.defaultProps;\n\t }\n\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t if (config[propName] === undefined && defaultProps !== undefined) {\n\t // Resolve default props\n\t props[propName] = defaultProps[propName];\n\t } else {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\t } // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\n\n\t var childrenLength = arguments.length - 2;\n\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\n\t props.children = childArray;\n\t }\n\n\t return ReactElement(element.type, key, ref, self, source, owner, props);\n\t }", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.66137296", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66114366", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "aa015fe7220260dc8aef294d7014597b", "score": "0.6608502", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\n 'React.cloneElement(...): The argument must be a React element, but you passed ' +\n element +\n '.',\n );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (\n hasOwnProperty.call(config, propName) &&\n !RESERVED_PROPS.hasOwnProperty(propName)\n ) {\n if (\n config[propName] === undefined &&\n defaultProps !== undefined\n ) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(\n element.type,\n key,\n ref,\n self,\n source,\n owner,\n props,\n );\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.65955603", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "8d78b48ccf75f3231d7db370aebdc3cb", "score": "0.65855044", "text": "function cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "8d78b48ccf75f3231d7db370aebdc3cb", "score": "0.65855044", "text": "function cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "693954e8883b7217f7767bbd61d65b7e", "score": "0.6551766", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\n \"React.cloneElement(...): The argument must be a React element, but you passed \" +\n element +\n \".\"\n );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = \"\" + config.key;\n } // Remaining properties override existing props\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (\n hasOwnProperty.call(config, propName) &&\n !RESERVED_PROPS.hasOwnProperty(propName)\n ) {\n if (\n config[propName] === undefined &&\n defaultProps !== undefined\n ) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d73e6d7656811a429ef571c33cdc7e64", "score": "0.6540665", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "d73e6d7656811a429ef571c33cdc7e64", "score": "0.6540665", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "d73e6d7656811a429ef571c33cdc7e64", "score": "0.6540665", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "d73e6d7656811a429ef571c33cdc7e64", "score": "0.6540665", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "d73e6d7656811a429ef571c33cdc7e64", "score": "0.6540665", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "ce8be28e85f38b1df84e1eea673fe6c2", "score": "0.6529637", "text": "function cloneElement(element, props) {\n if (props.style && element.props.style) {\n props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);\n }\n\n if (props.className && element.props.className) {\n props.className = element.props.className + \" \" + props.className;\n }\n\n return /*#__PURE__*/_react.default.cloneElement(element, props);\n}", "title": "" }, { "docid": "729fb6d2c01c2fd8fa69ec52dacdb30b", "score": "0.65254873", "text": "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "729fb6d2c01c2fd8fa69ec52dacdb30b", "score": "0.65254873", "text": "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "729fb6d2c01c2fd8fa69ec52dacdb30b", "score": "0.65254873", "text": "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "729fb6d2c01c2fd8fa69ec52dacdb30b", "score": "0.65254873", "text": "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "729fb6d2c01c2fd8fa69ec52dacdb30b", "score": "0.65254873", "text": "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "3f82ce1bfee1b84302200e030b54fcb4", "score": "0.6518719", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "3f82ce1bfee1b84302200e030b54fcb4", "score": "0.6518719", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "3f82ce1bfee1b84302200e030b54fcb4", "score": "0.6518719", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "3f82ce1bfee1b84302200e030b54fcb4", "score": "0.6518719", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" } ]
2f590f5cf69ddf4d9525a7636d097ed7
Iterate over all items in the store.
[ { "docid": "2d80cda63987f3bf8c9fed176955b5c3", "score": "0.0", "text": "function iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}", "title": "" } ]
[ { "docid": "d63eb6665d870f83c9ea8ce15db6d8fa", "score": "0.66622674", "text": "function forEach(callback) {\n forEachPropertyIn(store, callback);\n }", "title": "" }, { "docid": "c4629b08cc1ddbcb83bf2df2f63bd288", "score": "0.6608123", "text": "*[Symbol.iterator] () {\n for ( let item of this.items ) {\n yield item;\n }\n }", "title": "" }, { "docid": "3f40928108218598860d122960ba7aab", "score": "0.64899224", "text": "renderAllItems() {\r\n\t\tfor (const item of this.items) {\r\n\t\t\tthis.renderItem(item);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a0e7a7071a11f71deeeb3ff34af7789c", "score": "0.6400491", "text": "loadAllItems() {\n this.itemDao.findAll().forEach(i => this.loadItem(i.getId()));\n }", "title": "" }, { "docid": "832e22b96ed98179521e7470bc2deeec", "score": "0.6376361", "text": "getItems(callback){\n if(Object.keys(this.items).length != this.item.length){\n for (let item of Object.keys(this.item)) {\n ItemModelManage.getInstance().getItem((itemModel) => {\n this.items[item] = itemModel\n \n if(Object.keys(this.items).length == Object.keys(this.item).length){\n \n callback(this.items)\n }\n\n }, this.item[item])\n }\n }else{\n callback(this.items)\n }\n }", "title": "" }, { "docid": "16d9e34cf8fba0d19354f12e5d777964", "score": "0.61993134", "text": "getStoreItems() {\n\t\treturn storeItems;\n\t}", "title": "" }, { "docid": "3e87b907a520b719250e9ef3fbc0d5b4", "score": "0.61484736", "text": "forEach(callback) {\n if( NotEmpty(callback) ) {\n if(this._dbType === \"inmemory\") {\n new Map(Object.entries(this._data)).forEach( (value, key) => {\n callback( { [key]: value } );\n });\n return;\n }\n\n var keys = this._readStoreSync();\n for(var i=0; i<keys.length; i++) {\n var keyName = path.basename( keys[i], ITEM_EXTENSION );\n var keyValue = this._readDisk(keyName);\n callback( keyValue );\n }\n }\n }", "title": "" }, { "docid": "c830fb4bda2745647ed4a0d4ecec7e3a", "score": "0.6087527", "text": "*[Symbol.iterator]() {\n let self=this;\n for(let i=0; i<self.items.length; i++) {\n yield self.items[i];\n }\n }", "title": "" }, { "docid": "8463b55a30294cba7c0ab0a850303303", "score": "0.6055866", "text": "async displayAllItems() {\n const rows = await db.getAllItems(this.connection);\n return this.logProductRows(rows);\n }", "title": "" }, { "docid": "7690e2924b13cf01495c77ac6e24c40c", "score": "0.60097843", "text": "function getItems() {\n return items;\n }", "title": "" }, { "docid": "89f4d34be9f46a5d253006d8e9bfdb4a", "score": "0.59373236", "text": "getItems ()\n {\n return (this._items);\n }", "title": "" }, { "docid": "89f4d34be9f46a5d253006d8e9bfdb4a", "score": "0.59373236", "text": "getItems ()\n {\n return (this._items);\n }", "title": "" }, { "docid": "f5cc79a4ef35d65a80e8e5d1f47e4575", "score": "0.5897362", "text": "function iterator(data){\n data.forEach(function(item){\n console.log(\"Item:\", item)\n })\n}", "title": "" }, { "docid": "5c10665639916a5c1fd66e0664f98421", "score": "0.5894636", "text": "async items(parent, args, ctx, info) {\n const items = await ctx.db.query.items();\n return items;\n }", "title": "" }, { "docid": "2bbd0596dae18077b26725a442054950", "score": "0.58532935", "text": "function getAll(objectStore, keyRange, onSuccess) {\n if (typeof objectStore.getAll === 'function') {\n // use native getAll\n objectStore.getAll(keyRange).onsuccess = onSuccess;\n return;\n }\n // fall back to cursors\n var values = [];\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (cursor) {\n values.push(cursor.value);\n cursor[\"continue\"]();\n } else {\n onSuccess({\n target: {\n result: values\n }\n });\n }\n }\n\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n}", "title": "" }, { "docid": "578de41278fc9066510c0278c97fa0aa", "score": "0.58406836", "text": "*[Symbol.iterator]() {\n for (let product of this._products) {\n yield product;\n }\n }", "title": "" }, { "docid": "26e24869e531b8d5639af770af998a2c", "score": "0.58063287", "text": "getItems() {\n return this.items;\n }", "title": "" }, { "docid": "26e24869e531b8d5639af770af998a2c", "score": "0.58063287", "text": "getItems() {\n return this.items;\n }", "title": "" }, { "docid": "26e24869e531b8d5639af770af998a2c", "score": "0.58063287", "text": "getItems() {\n return this.items;\n }", "title": "" }, { "docid": "e95ec33e9f97647c7ddd4a0e18cefdb6", "score": "0.577841", "text": "*[Symbol.iterator]() {\n for (const [mine, items] of this._entries) {\n for (const item of items) {\n yield [mine, item];\n }\n }\n }", "title": "" }, { "docid": "c9e976ceea9278dc4354f5669e061eee", "score": "0.57778287", "text": "get items() {\n return this._items.slice();\n }", "title": "" }, { "docid": "82b6eed63c6a6fbd7d8b16620bc12515", "score": "0.5777625", "text": "get items() {\n return this._items;\n }", "title": "" }, { "docid": "1abd69048fa9ead527afa4492b868462", "score": "0.5777593", "text": "[Symbol.iterator]() {\n return this.items[Symbol.iterator]();\n }", "title": "" }, { "docid": "1abd69048fa9ead527afa4492b868462", "score": "0.5777593", "text": "[Symbol.iterator]() {\n return this.items[Symbol.iterator]();\n }", "title": "" }, { "docid": "12c3a0361924d2873d1389596d9169b5", "score": "0.57655966", "text": "function runStore() {\n connection.connect(function (err) {\n if (err) throw err;\n //list items\n connection.query('SELECT item_id, product_name, price, stock_quantity FROM products', function (err, result) {\n if (err) throw err;\n for (var i = 0; i < result.length; i++) {\n console.log(\n \"Item id: \" +\n result[i].item_id +\n \" || Name: \" +\n result[i].product_name +\n \" || Price: \" +\n result[i].price +\n \" || Stock: \" +\n result[i].stock_quantity\n );\n\n }\n purchase();\n });\n });\n}", "title": "" }, { "docid": "ab9101827f341f365946e27ee30a67dd", "score": "0.572625", "text": "function iterateStorage(func) {\n for (let index = 0; index < localStorage.length; index++) {\n const itemName = localStorage.key(index);\n const item = getItemFromStorage(itemName);\n func(item, itemName, item.type, item.position, index);\n }\n}", "title": "" }, { "docid": "aba36d855ba042302f2c3c2ecc3fa645", "score": "0.571972", "text": "function getAll(objectStore, keyRange, onSuccess) {\n if (typeof objectStore.getAll === 'function') {\n // use native getAll\n objectStore.getAll(keyRange).onsuccess = onSuccess;\n return;\n }\n // fall back to cursors\n var values = [];\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (cursor) {\n values.push(cursor.value);\n cursor.continue();\n } else {\n onSuccess({\n target: {\n result: values\n }\n });\n }\n }\n\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n}", "title": "" }, { "docid": "aba36d855ba042302f2c3c2ecc3fa645", "score": "0.571972", "text": "function getAll(objectStore, keyRange, onSuccess) {\n if (typeof objectStore.getAll === 'function') {\n // use native getAll\n objectStore.getAll(keyRange).onsuccess = onSuccess;\n return;\n }\n // fall back to cursors\n var values = [];\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (cursor) {\n values.push(cursor.value);\n cursor.continue();\n } else {\n onSuccess({\n target: {\n result: values\n }\n });\n }\n }\n\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n}", "title": "" }, { "docid": "aba36d855ba042302f2c3c2ecc3fa645", "score": "0.571972", "text": "function getAll(objectStore, keyRange, onSuccess) {\n if (typeof objectStore.getAll === 'function') {\n // use native getAll\n objectStore.getAll(keyRange).onsuccess = onSuccess;\n return;\n }\n // fall back to cursors\n var values = [];\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (cursor) {\n values.push(cursor.value);\n cursor.continue();\n } else {\n onSuccess({\n target: {\n result: values\n }\n });\n }\n }\n\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n}", "title": "" }, { "docid": "7c6a00bcce92006e90a828464e1840e8", "score": "0.5714424", "text": "items() {\n return new algorithm_1.ArrayIterator(this._items);\n }", "title": "" }, { "docid": "7c6a00bcce92006e90a828464e1840e8", "score": "0.5714424", "text": "items() {\n return new algorithm_1.ArrayIterator(this._items);\n }", "title": "" }, { "docid": "eaa65287df8d39f5a1ddbd5d5d45472f", "score": "0.5705823", "text": "getItems() {\n return this.items;\n }", "title": "" }, { "docid": "5ed78c5cac6c9a7c2c715c275205cc9a", "score": "0.5699757", "text": "function runStore() {\n connection.query(\n \"SELECT item_id, item_name, price FROM products;\",\n function(err, res) {\n if (err) throw err;\n else {\n numItems = res.length;\n for (i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \") \" + res[i].item_name + \" | $\" + res[i].price);\n }\n console.log(\"\\n0) Exit\\n\");\n ask();\n }\n }\n )\n}", "title": "" }, { "docid": "137d057d53da1757d3b3b18a00135753", "score": "0.56953806", "text": "getItems() {\n\t\treturn this.shoppingItems;\n\t}", "title": "" }, { "docid": "f4d7c59da7226146d608ccb775e40e86", "score": "0.5693163", "text": "async function grabAllItems() {\n try {\n const res = await axios.get(\n \"https://frozen-peak-86991.herokuapp.com/cart\"\n );\n setItems(res.data);\n\n // const res2 = await axios.get(\"https://frozen-peak-86991.herokuapp.com/television\");\n // setItems(res2.data);\n\n // const res3 = await axios.get(\"https://frozen-peak-86991.herokuapp.com/computer\");\n // setItems(res3.data);\n } catch (e) {\n console.error(e, e.message);\n }\n }", "title": "" }, { "docid": "2898dfcb3774f004d5f38c1f4dc02f0d", "score": "0.566282", "text": "all() {\n return Object.values(this.databaseStore)\n }", "title": "" }, { "docid": "8dbfbba8f5171b419ba8e8af0673cf6b", "score": "0.566094", "text": "function loadShopItems() {\n for (let i = 0; i < itemsList.length; i++) {\n loadShopItemsDisplay(i);\n };\n loadShopButtons();\n}", "title": "" }, { "docid": "d1acdab5888284aaf45cfb0a71df0b39", "score": "0.56456727", "text": "getItems() {\n return this._items.slice(0);\n }", "title": "" }, { "docid": "9ed789e631c92d934e62b1b6e2da7210", "score": "0.5645038", "text": "getAll() {\n meteredGET(\n '/api/items',\n () => this.dispatchServerAction(kActions.ITEM_GETALL, kStates.LOADING),\n data => this.dispatchServerAction(kActions.ITEM_GETALL, kStates.SYNCED, data),\n err => this.dispatchServerAction(kActions.ITEM_GETALL, kStates.ERRORED, err)\n );\n }", "title": "" }, { "docid": "64ad225d2215caf5ed5693b13c6ea728", "score": "0.56407523", "text": "forEach(callback) {\r\n for (const [id, item] of __classPrivateFieldGet(this, _pairs)) {\r\n callback(item, id);\r\n }\r\n }", "title": "" }, { "docid": "743003afdd5d3fc77c98c8933e9389f6", "score": "0.56382245", "text": "function entries() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n var items = [];\n return eachCursor(customStore, function (cursor) {\n return items.push([cursor.key, cursor.value]);\n }).then(function () {\n return items;\n });\n}", "title": "" }, { "docid": "60d8c927a01c5a4e3b26cb74694f580f", "score": "0.5632426", "text": "function iterate(item) {\n if (typeof(item.focus) == 'function') {\n item.focus();\n //return;\n }\n\n // Break out of loop once the keyboard is gone\n if (Ti.App.keyboardVisible) {\n return;\n }\n\n if (item.views !== undefined) { // scrollable view\n for (var i in item.views) {\n iterate(item.views[i]);\n }\n }\n\n if (item.sections !== undefined) { // table view\n for (var i in item.sections) {\n iterate(item.sections[i]);\n }\n }\n\n if (item.rows !== undefined) { // table rows\n for (var i in item.rows) {\n iterate(item.rows[i]);\n }\n }\n\n if (item.children !== undefined) { // view\n for (var i in item.children) {\n iterate(item.children[i]);\n }\n }\n }", "title": "" }, { "docid": "c0ed93bfdb022112f5d8942d7b6f65a0", "score": "0.56309444", "text": "function each(collection, action) {\n if(Array.isArray(collection)) {\n for(var i = 0; i < collection.length; i++) {\n action(collection[i], i, collection);\n }\n } else {\n for (var key in collection) {\n action(collection[key], key, collection);\n }\n }\n}", "title": "" }, { "docid": "c4bf30e7ac1d14cbb4e0a7f0c1e66513", "score": "0.56206346", "text": "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "title": "" }, { "docid": "c4bf30e7ac1d14cbb4e0a7f0c1e66513", "score": "0.56206346", "text": "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "title": "" }, { "docid": "c4bf30e7ac1d14cbb4e0a7f0c1e66513", "score": "0.56206346", "text": "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "title": "" }, { "docid": "6d24a1fc84f4457124cffde41b0b83ee", "score": "0.5603834", "text": "items() {\n return this._filter();\n }", "title": "" }, { "docid": "64a6241e244c3b38dfad6d768a90fe4c", "score": "0.56027013", "text": "function iterate(item) {\n if ((item.apiName === 'Ti.UI.TextField') || (typeof(item.blur) == 'function')) {\n item.blur();\n\n // Break out of loop once the keyboard is gone\n if (OS_IOS && ! Ti.App.keyboardVisible) {\n return;\n }\n }\n\n if (item.views !== undefined) { // scrollable view\n for (var i in item.views) {\n iterate(item.views[i]);\n }\n }\n\n if (item.sections !== undefined) { // table view\n for (var i in item.sections) {\n iterate(item.sections[i]);\n }\n }\n\n if (item.rows !== undefined) { // table rows\n for (var i in item.rows) {\n iterate(item.rows[i]);\n }\n }\n\n if (item.children !== undefined) { // view\n for (var i in item.children) {\n iterate(item.children[i]);\n }\n }\n }", "title": "" }, { "docid": "02ea063e22bacb63784a6dea9611c308", "score": "0.5589423", "text": "static getAllFromIDB() {\n return DBHelper.openIDB().then(function(db){\n if(!db) return;\n\n var store = db.transaction(dbOBJECTSTORE).objectStore(dbOBJECTSTORE);\n // console.log(store); // testing\n return store.getAll();\n });\n }", "title": "" }, { "docid": "6e9f540bdff774ea64751a7853fc8701", "score": "0.55488414", "text": "getAll(store) {\n\t\treturn this.dbPromise.then(function(db) {\n\t\t\tvar tx = db.transaction(store);\n\t\t\tvar objectStore = tx.objectStore(store);\n\t\t\treturn objectStore.getAll();\n\t\t});\n\t}", "title": "" }, { "docid": "8be55829334db95dd652ed16dc01b911", "score": "0.55429727", "text": "visitAll() {\n const objects = this.tile.objects;\n for (const object of objects) {\n this.visitObject(object);\n }\n }", "title": "" }, { "docid": "77ffd7046e75b2067a5e5fece9498b32", "score": "0.55206084", "text": "getItems() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n // Ignore the call if it's the very first time\n // and launchOnStartup !== true.\n if (!this.launchOnStartup) {\n this.launchOnStartup = true;\n return;\n }\n // Set as Loading\n this._isLoading = true;\n // Generate a requestId.\n // This will be used when the request is finished,\n // so the data don't get overlapped by slower async responses\n // that have been previously called and have not get an answer yet\n const contextRequestId = Object(uuid__WEBPACK_IMPORTED_MODULE_3__[\"v4\"])();\n this.lastUrlRequestId = contextRequestId;\n try {\n // Build params & filters\n const queryParams = this.buildQueryParams();\n const filters = this.buildFilters();\n const response = yield this.getItemsCallTask(queryParams, filters);\n // If it's the latest call, then assign the items.\n // We also assign the trackBy property so that the ngFor\n // function refreshes the view.\n if (contextRequestId === this.lastUrlRequestId) {\n this.totalLength = response.total;\n this.refreshGlobalCheckbox();\n this.reloadDataFinished.next(response);\n this.setTrackBy(contextRequestId, response.items);\n this._displayedItems = response.items;\n }\n // If it's the latest call, tell the UI we are done\n // requesting and filtering the data\n this.refreshGlobalCheckbox();\n return response;\n }\n finally {\n yield AngularUtilities.waitLifecycle();\n if (contextRequestId === this.lastUrlRequestId) {\n this._isLoading = false;\n }\n }\n });\n }", "title": "" }, { "docid": "17c40c033536608ca576a4f92998f977", "score": "0.55174613", "text": "function values() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n var items = [];\n return eachCursor(customStore, function (cursor) {\n return items.push(cursor.value);\n }).then(function () {\n return items;\n });\n}", "title": "" }, { "docid": "badc446c55343b2feb45bbcded91e093", "score": "0.55146015", "text": "function everythingInStore() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw err;\n //======================no error go to the next step ===\n // console.log(res)\n res.forEach(function(res) {\n // console.log(res);\n console.log(\"Item Id :\" + res.item_id + \" , name : \" + res.product_name + \" , Dept : \" + res.department_name + \", Price\" + res.price + \"\\n\");\n console.log(\"-----------------------------------------------------------------------------------\");\n });\n selectProductId();\n\n });\n}", "title": "" }, { "docid": "a967e4b9c7ab1cf48aa397b7ae10902f", "score": "0.55119336", "text": "*entries() {\r\n for (const [id, item] of __classPrivateFieldGet(this, _pairs)) {\r\n yield [id, item];\r\n }\r\n }", "title": "" }, { "docid": "acc1e24ed0aa49a84bf8ebbf17260b26", "score": "0.5486809", "text": "function iteratorFor(items) {\n var iterator = {\n next: function () {\n var value = items.shift();\n return {\n done: value === undefined,\n value: value,\n };\n },\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }", "title": "" }, { "docid": "6cfd223a6e66f43ef8e4c4dca19db676", "score": "0.54801154", "text": "get items() {\n return this.state.items;\n }", "title": "" }, { "docid": "d294ae59f565d49123e40f3acde37c13", "score": "0.54744244", "text": "fetchItems() {\n fetch(`${this.endpoint}/items`)\n .then(resp => resp.json())\n .then(items => {\n for (const item of items) {\n let i = new Item(item)\n i.pushToDOM()\n }\n })\n }", "title": "" }, { "docid": "2caad8dd06e4b4ee9e82aa466745cbc7", "score": "0.54743767", "text": "function iterateInventory(inventory, evaluateInventory) {\n inventory.forEach((elem) => {\n evaluateInventory(elem);\n });\n return inventory;\n}", "title": "" }, { "docid": "944dea55b1b5462e6c9b1529779e156e", "score": "0.54584754", "text": "onIteration() {}", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.54457754", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.54457754", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.54457754", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "c09d4b53e802c9e5f8c5355f11eb2ed5", "score": "0.54413366", "text": "async function fnWithAsyncLoop() {\n // for async (const item of items)\n for (const item of await Promise.all(items)) {\n const result = item;\n console.log(result);\n };\n\n console.log('Done!');\n}", "title": "" }, { "docid": "c2f72b1898a6e2ddeed77ad6b62bea73", "score": "0.54377115", "text": "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n \n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n \n return iterator\n }", "title": "" }, { "docid": "f0c01387693de0aa9240e7b2fd71553c", "score": "0.5429727", "text": "forEach(f) {\n this._items.forEach(f);\n }", "title": "" }, { "docid": "edb0176412f589e2b13e1f516a080801", "score": "0.5426707", "text": "function iterateAll() {\r\n computeBuildings();\r\n computePlayerNetRevenue();\r\n applyPlayerNetRevenue();\r\n}", "title": "" }, { "docid": "9a9bce05c3af73827df48873df7f49aa", "score": "0.54222894", "text": "searchAllItems() {\n const currentItems = this.state.currentItems;\n this.setState({\n currentItems: [],\n });\n const location = this.state.location;\n for (const item of currentItems) {\n this.searchNewItem(item.name);\n }\n }", "title": "" }, { "docid": "e134c8959c29eb941e3c607afaca2dc7", "score": "0.54202545", "text": "*[Symbol.iterator]() {\n\t\tconst internal = storage.get(this);\n\t\tconst { path } = internal;\n\n\t\tif (!('entries' in internal) && this.isDirectory()) {\n\t\t\tinternal.entries = FS.readdirSync(path, {\n\t\t\t\tencoding: 'utf8',\n\t\t\t\twithFileTypes: true\n\t\t\t});\n\t\t}\n\n\t\tconst { entries } = internal;\n\n\t\tif (entries) {\n\t\t\tfor (let i = 0; i < entries.length; ++i) {\n\t\t\t\tyield entries[i];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ade25d78a52a32536c09e420c8d8e396", "score": "0.5416298", "text": "function Iter(item) {\n this.item = item\n}", "title": "" }, { "docid": "df8b5892a016152135e516e647f47606", "score": "0.54149544", "text": "function each(collection, callback){\n\n if(!collection)return;\n for(var i = 0,l = collection.length;i < l;i += 1){\n\n callback(collection[i]);\n };\n }", "title": "" }, { "docid": "85233121959d821073f23db2b5c9314f", "score": "0.54135907", "text": "function iteratorFor(items) {\r\n var iterator = {\r\n next: function () {\r\n var value = items.shift()\r\n return { done: value === undefined, value: value }\r\n },\r\n }\r\n\r\n if (support.iterable) {\r\n iterator[Symbol.iterator] = function () {\r\n return iterator\r\n }\r\n }\r\n\r\n return iterator\r\n }", "title": "" }, { "docid": "ab343770af1f1b2e57b849d81f03d151", "score": "0.54075515", "text": "function getItems() {\n\t\t\tconsole.log(db);\n\t\t\t\n\t\t\tconsole.log(\"Selecting items from database...\");\n\t\t\tdb.transaction(function(tx) {\n\t\t\t\ttx.executeSql(\"SELECT * FROM ACTMAIN\",[],querySuccess, databaseError);},databaseError);\t\n\t\t}", "title": "" }, { "docid": "6ae0216c042c79b1e099fc5b9412d38e", "score": "0.53875756", "text": "function iteratorFor(items) {\n var iterator = {\n next: function () {\n var value = items.shift();\n return {\n done: value === undefined,\n value: value\n };\n }\n };\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n return iterator;\n }", "title": "" }, { "docid": "10886112aebae15dc931df90e345db3b", "score": "0.53869945", "text": "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.53862643", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.53862643", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.53862643", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.53862643", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.53862643", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "551ea0a5a51bb82a058eed89bc8b7a29", "score": "0.5385601", "text": "function displayItems() {\n\tconnection.query(\"SELECT * FROM products\", function (err, res) {\n\t\tif (err) throw err;\n\t\tconsole.log(\"\\nWelcome to our webstore! Below are all of our available products.\\n\")\n\t\tfor (i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"ID number: \" + res[i].item_id + \n\t\t\t\t\t\t\" | Product Name: \" + res[i].product_name +\n\t\t\t\t\t\t\" | Price: $\" + res[i].price + \"\\n---------------\");\n\t\t}\n\t\tbuyItem()\n\t})\n}", "title": "" }, { "docid": "b61a754aad21367ab9fcca08e4431340", "score": "0.53811616", "text": "function forEach() {\n\tfor ( let value of this.sampleGenerator() ) {\n\t\tconsole.log(value)\n\t}\n}", "title": "" }, { "docid": "2b3b7271462bcbd287298bd012ffea7a", "score": "0.53759056", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift();\n\t return {done: value === undefined, value: value}\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t };\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "31606bedebc781d68c16fd75cd1a2d74", "score": "0.5369823", "text": "function findAllItems() {\n return itemModel.find();\n}", "title": "" }, { "docid": "0d8508b9227e2c2d04154ac507ff85ba", "score": "0.5354558", "text": "function getAllProducts(connection) {\n connection.query('select *from products', function (err, res) {\n if (err) { throw err };\n console.log(\"----------------------------------------------------------------\");\n for(var i = 0; i<res.length;i++){\n console.log(\"Item ID: \" + res[i].item_id +\" \"+ \"Product: \" + res[i].product_name.toUpperCase() + \" \" + \"Price: $\" + res[i].price + \" \" + \"Qty: \" + res[i].stock_quantity);\n console.log(\"----------------------------------------------------------------\")\n }\n managerPrompt();\n })\n}", "title": "" }, { "docid": "f9d3e4e04ac79bea34d9ed0975bc9290", "score": "0.5354116", "text": "function iteratorFor(items) {\r\n var iterator = {\r\n next: function() {\r\n var value = items.shift()\r\n return {done: value === undefined, value: value}\r\n }\r\n }\r\n\r\n if (support.iterable) {\r\n iterator[Symbol.iterator] = function() {\r\n return iterator\r\n }\r\n }\r\n\r\n return iterator\r\n }", "title": "" }, { "docid": "e25504322ecafea75ab7f140f54c5396", "score": "0.5348615", "text": "getAllItems(callback) {\n fetch(this.EbayURL + 'items')\n .then(response => response.json())\n .then(allItems => callback(allItems))\n }", "title": "" }, { "docid": "22204efc99e24ce45759ef10caec7cdb", "score": "0.5347239", "text": "function indexedDB_getAll(then) {\n\t\tvar transaction = html5indexedDB.db.transaction([filestoreName], \"readonly\");\n\t\tvar objectStore = transaction.objectStore(filestoreName);\n\t\tvar request = objectStore.openCursor();\n\t\tvar keys = [];\n\t\trequest.onerror = function(event) {\n\t\t\tif (then) {\n\t\t\t\tthen(request.errorCode, null);\n\t\t\t}\n\t\t};\n\t\trequest.onsuccess = function(event) {\n\t\t\tvar cursor = event.target.result;\n\t\t\tif (cursor) {\n\t\t\t\tkeys.push(cursor.key);\n\t\t\t\tcursor.continue();\n\t\t\t} else {\n\t\t\t\tif (then) {\n\t\t\t\t\tthen(null, keys);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "66a3aabb2bc5c512c3420ae6b7e7d61f", "score": "0.5345473", "text": "async *listWholeDatabase() {\n for (const record of COLLECTIONS) {\n console.log(record);\n const rec = record.replace(\"_\", \"/\");\n let [docs, next] = await this.doList(rec, null, 1000);\n for (const doc of docs) {\n yield doc;\n }\n while (next) {\n [docs, next] = await this.doList(rec, next, 1000);\n for (const doc of docs) {\n yield doc;\n }\n }\n }\n }", "title": "" }, { "docid": "aa74d3d5355889582d2d7ad6dd86f34b", "score": "0.5345004", "text": "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "title": "" }, { "docid": "6c769993f552d9d4725a3397e7d456fe", "score": "0.5342692", "text": "function each(collection, callback) {\n\t if (!collection) {\n\t return;\n\t }\n\t\n\t for (var i = 0, l = collection.length; i < l; i += 1) {\n\t callback(collection[i]);\n\t }\n\t }", "title": "" }, { "docid": "aae1a53ba7fde965e1c80b33b480e757", "score": "0.5339768", "text": "populate(cart) {\n cart.forEach((item) => {\n this.displayCartItem(item)\n })\n }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.53393793", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.53393793", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.53393793", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.53393793", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.53393793", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "cb664ba978446d602401c95cf08b1fe5", "score": "0.5338418", "text": "getItems() {\n return this.rxdux.selector$('items')\n .pipe(\n map((item) => Object.keys(item).map(k => item[k]))\n );\n }", "title": "" }, { "docid": "dfdef9dc460d395b5c1a7a14049f67f0", "score": "0.533275", "text": "function getAll() {\n return products;\n }", "title": "" }, { "docid": "eb2450d386860309e34009a1c479ea1c", "score": "0.5330506", "text": "getItems() {\n this.props.dispatch({\n type: 'FETCH_ITEMS'\n })\n }", "title": "" }, { "docid": "75d76bafca05bd9980a2307f7c39c295", "score": "0.5329762", "text": "getItems() {\n return this.shoppingList;\n }", "title": "" } ]
09c105ab6464fb4b824ef4477b7e33fb
returns a properly formated Note timestamp.
[ { "docid": "afefef3ca4346495f4890c569a38ba95", "score": "0.0", "text": "get timestamp(){\n return $filter('date')(this.createdAt, 'yy-MM-dd, H:mm')\n }", "title": "" } ]
[ { "docid": "758a7ceac0bdc62b899cff4b5abb8044", "score": "0.76603556", "text": "function formatNoteDate ( timestamp )\n{\n // Use the timestamp's toDate function to get a JS date object\n const date = timestamp.toDate()\n const day = date.getDate()\n const month = date.getMonth() + 1\n const year = date.getFullYear()\n let hour = date.getHours()\n let minutes = date.getMinutes()\n if ( hour < 10 ) hour = \"0\" + hour\n if ( minutes < 10 ) minutes = \"0\" + minutes\n\n return month + \"/\" + day + \"/\" + year + \" - \" + hour + \":\" + minutes\n}", "title": "" }, { "docid": "0d34c92188d378bf31f311b9464f0fc4", "score": "0.73445326", "text": "function timestampString() {\n\t return (new Date()).toISOString().replace(/T/, '.')\n}", "title": "" }, { "docid": "bf0608f5716f4721153769a9f75b5b79", "score": "0.72303534", "text": "function timestamp() {\r\n var now = new Date();\r\n return now.toLocaleString();\r\n}", "title": "" }, { "docid": "b5d2a84a64642cd992adb4da928768cd", "score": "0.7199832", "text": "function getTimestamp() {\n\tvar dt = new Date;\n\treturn dt.toISOString().replace(/(-\\d{2})T(\\d{2}:)/, '$1 $2').replace(/\\.(\\d+)Z/, \":$1\");\n}", "title": "" }, { "docid": "c26c2919ac092d0929d951325f172de1", "score": "0.7123102", "text": "function timestamp(){\n\t\n\tvar date = new Date();\n\t\n\t// Munge.\n\tvar y = date.getFullYear();\n\tvar m = date.getMonth() + 1;\n\tm = (m < 10 ? \"0\" : \"\") + m;\n\tvar d = date.getDate();\n\td = (d < 10 ? \"0\" : \"\") + d;\n\tvar h = date.getHours();\n\th = (h < 10 ? \"0\" : \"\") + h;\n\tvar min = date.getMinutes();\n\tmin = (min < 10 ? \"0\" : \"\") + m;\n\tvar s = date.getSeconds();\n\ts = (s < 10 ? \"0\" : \"\") + s;\n\t\n\t// Assemble.\n\treturn y +\"-\"+ m +\"-\"+ d + \"T\" + h + \":\" + min + \":\" + s;\n }", "title": "" }, { "docid": "d7cca103d2402328be468737eae74bdf", "score": "0.7092317", "text": "timestamp() {\n const d = new Date();\n return d.toUTCString(Date.now());\n }", "title": "" }, { "docid": "da7885370704994a4222ab9000ce4ea4", "score": "0.7029218", "text": "function getTimestamp() {\n\tvar date = new Date();\n\tdate = date.toISOString();\n\treturn date.substring(0,4) + date.substring(5,7) + date.substring(8,10) + date.substring(11,13) + date.substring(14,16) + date.substring(17,21);\n}", "title": "" }, { "docid": "456f92b2ead2fd1d25f35911f8426461", "score": "0.69779944", "text": "function timestamp() {\n let ps = v => v.toString().padStart(2, \"0\");\n let date = new Date();\n let year = date.getFullYear().toString();\n let month = ps(date.getMonth());\n let day = ps(date.getDay());\n let hours = ps(date.getHours());\n let minutes = ps(date.getMinutes());\n let seconds = ps(date.getSeconds());\n return `${year}${month}${day}${hours}${minutes}${seconds}`\n}", "title": "" }, { "docid": "3dc6af54cc3c1a8e60ee7d771a12b8a1", "score": "0.6974444", "text": "function getTimestamp() {\n let date = new Date();\n return (\n date.toLocaleDateString(\"en-US\", {\n month: \"2-digit\",\n day: \"2-digit\",\n year: \"numeric\"\n }) +\n \" \" +\n date.toLocaleTimeString(\"en-us\", {\n hour12: false\n })\n );\n}", "title": "" }, { "docid": "aa84b0a9ef24e6138c0a449bce2c4020", "score": "0.6957218", "text": "function timestamp() {\n var time = new Date();\n return '[' + time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds() + '] ';\n }", "title": "" }, { "docid": "1c6e6c8a5aeb90d9d273f39a8cf06ab2", "score": "0.6955086", "text": "static getTimestamp() {\n\t\treturn chalk.dim(chalk.white(`[${timestamp('HH:mm:ss')}]`));\n\t}", "title": "" }, { "docid": "88830e7d0566c1bebe9c848e1e205686", "score": "0.692337", "text": "static getStamp() {\n const date = new Date();\n return date.toISOString().slice(0, 19).replace(/-/g, \"\").replace(/:/g, \"\").replace(/T/g, \"\");\n }", "title": "" }, { "docid": "7b580e6906fc6895658d3428fc183b73", "score": "0.69097745", "text": "function getTimestamp() {\n return parseInt(+new Date() / 1000, 10); // use short form of getting a timestamp\n }", "title": "" }, { "docid": "0696f858c0def49881e525f4f0beee1f", "score": "0.6858026", "text": "function TimeStamp() {\n var TS = strftime('%F %T', new Date());\n return TS;\n}", "title": "" }, { "docid": "fb1df0e3aef5b769dbcede65d9e59e78", "score": "0.6798661", "text": "function timeStamp() {\n return (Date.now() / 1000 | 0) + ''\n}", "title": "" }, { "docid": "4add3e28b666967b45896831e2bb3a74", "score": "0.67811644", "text": "function get_ts_string(){\n var timestamp = new Date(); //record a timestamp\n var m_timestamp = moment(timestamp); \n return m_timestamp.format(\"MM/DD/YYYY HH:mm:ss Z\");\n}", "title": "" }, { "docid": "beceb6f5d4cebdd498ad208e43ada85a", "score": "0.67207557", "text": "function timestamp(ptr) {\n\tif (!Telko.logtime) { return ptr + \" \"; }\n\tvar time = new Date();\n\treturn\ttime.getFullYear()\t\t\t\t+ \"/\" +\n\t\t\tpad0(time.getMonth() + 1)\t\t+ \"/\" +\n\t\t\tpad0(time.getDate())\t\t\t+ \" \" +\t\t \n\t\t\tpad0(time.getHours())\t\t\t+ \":\" +\n\t\t\tpad0(time.getMinutes())\t\t\t+ \":\" +\n\t\t\tpad0(time.getSeconds())\t\t\t+ \".\" +\n\t\t\tpad0(time.getMilliseconds(), 3)\t+ \" \" +\n\t\t\tptr + \" \";\n}", "title": "" }, { "docid": "71dfc3f9a1bc4e013c4c7273d9c7e943", "score": "0.6716665", "text": "function getRecordingTimestamp() {\n if (recordingDuration != null) {\n return getMMSSFromMillis(recordingDuration);\n }\n return getMMSSFromMillis(0);\n }", "title": "" }, { "docid": "05bc520488c9639ae17ec2b058e9b375", "score": "0.6632614", "text": "function get_timestamp() {\n\n var now = new Date();\n\n return 'utc|' + now.getUTCFullYear() +\n '/' + (now.getUTCMonth() + 1) +\n '/' + now.getUTCDate() +\n '|' + now.getHours() +\n ':' + now.getMinutes() +\n ':' + now.getSeconds() +\n ':' + now.getMilliseconds();\n\n}", "title": "" }, { "docid": "dbff2109b398e5fe8ff0892d869b31a6", "score": "0.6620585", "text": "function getTimestamp() {\n return 6e5 * Math.round(new Date().getTime() / 6e5);\n }", "title": "" }, { "docid": "24367c7c917ef249e8e65ccd04b7c926", "score": "0.659937", "text": "function getNoteForDate(timestampNote)\n{\n\ttry{\n\t\n\t\tvar tmpNotes = getNoteArray();\n\t\tvar output = \"\";\n\t\t\n\t\tif(tmpNotes[timestampNote] !== undefined)\n\t\t{\n\t\t\toutput = tmpNotes[timestampNote];\n\t\t}\n\t\telse {\n\t\t\toutput = \"\";\n\t\t}\n\t\t\n\t\treturn output;\n\t\n\t}\n\tcatch(e)\n\t{\n\t\thandleError(\"Calendar.js getNoteForDate\", e);\n\t}\n\t\n}", "title": "" }, { "docid": "2f0fdb43831a697d1cf74689d492faad", "score": "0.65778", "text": "function getTimestamp() {\n\t\t\tvar now = new Date(),\n\t\t\t\tnowTs = now.getTime();\n\n\t\t\treturn nowTs;\n\t\t}", "title": "" }, { "docid": "302bd2abfe533a10bd779c7f0252a189", "score": "0.65572286", "text": "function timeStampPlz () {\n\tvar now = new Date();\n\tvar date = [ now.getMonth() + 1, now.getDate(), now.getFullYear() ];\n\tvar time = [ now.getHours(), now.getMinutes*(), now.getSeconds() ];\n\tvar suffix = ( time[0] < 12 ) ? \"AM\" : \"PM\";\n\ttime[0] = ( time[0] < 12 ) ? time[0] : time[0] - 12;\n\ttime[0] = time[0] || 12;\n\t\tfor ( var i = 1; i <3; i++ ) {\n\t\t\tif ( time[i] < 10 ) {\n\t\t\t\ttime[i] = \"0\" + time[i];\n\t\t\t}\n\t\t}\n\treturn date.join(\"/\") + \" \" + time.join(\":\") + \" \" + suffix;\n}", "title": "" }, { "docid": "f09415e72bfc09bc3ad7802fe1618cde", "score": "0.65529954", "text": "function getTimestamp(){\n let rightNow = new Date();\n return rightNow.getTime().toString();\n}", "title": "" }, { "docid": "f902728c20246f5e9a9316def3bb7408", "score": "0.6513612", "text": "function getTimeStamp(){\n\tvar d = new Date();\n\tvar date = d.toDateString();\n\tvar time = d.getHours() + \":\" + d.getMinutes()+\":\"+d.getSeconds();\n\treturn timestamp = date + \" \" + time;\t\n}", "title": "" }, { "docid": "9beb2fd49d7b0269110eea81adb8ab8d", "score": "0.6511736", "text": "function getTimestamp() {\n\t return Date.now();\n\t}", "title": "" }, { "docid": "fc8dbf674246831a526e45ace15c33c5", "score": "0.64865947", "text": "_getTimestamp() {\n let now = new Date();\n return now.toISOString().slice(0, 19).replace(/:/g, '_');\n }", "title": "" }, { "docid": "88efe6563dba9f0129e12af73cbe48b7", "score": "0.6474409", "text": "function getTimestamp () {\n return Math.round(Date.now() / 1000)\n}", "title": "" }, { "docid": "88efe6563dba9f0129e12af73cbe48b7", "score": "0.6474409", "text": "function getTimestamp () {\n return Math.round(Date.now() / 1000)\n}", "title": "" }, { "docid": "ef22f55ca6b4ac159dc802f01e1339ec", "score": "0.64676887", "text": "function timestamp() {\n return Math.round((new Date()).getTime() / 1000);\n}", "title": "" }, { "docid": "87bc2174e2394d080fdec64b74d244f3", "score": "0.6455206", "text": "function stamp(){ \n dt = (new Date);\n return `${dt.getSeconds()}.${dt.getMilliseconds()}`;\n}", "title": "" }, { "docid": "bad008df96f28205ce7d1769f8ee9574", "score": "0.6445642", "text": "static getTimestamp() {\n return Math.floor((new Date()).getTime() / 1000);\n }", "title": "" }, { "docid": "65e2fa4988f2a76e19aeafd08c6c854b", "score": "0.6425267", "text": "static getTimestampPrefix() {\n let d = new Date();\n let hours = (\"0\" + d.getHours()).slice(-2);\n let minutes = (\"0\" + d.getMinutes()).slice(-2);\n let seconds = (\"0\" + d.getSeconds()).slice(-2);\n let miliseconds = (\"00\" + d.getMilliseconds()).slice(-3);\n return hours + \":\" + minutes + \":\" + seconds + \".\" + miliseconds + \" \";\n }", "title": "" }, { "docid": "1e411e8c2a5a69df34b46d70eb90436b", "score": "0.63733536", "text": "readableTimestamp(timestamp) {\n return this.formatDate(timestamp).format('YYYY-MM-DD HH:mm:ss');\n }", "title": "" }, { "docid": "39472e5240eb2fe0882054a59c8c70ef", "score": "0.6359589", "text": "function getTimeStamp() {\n return moment().format('DD/MM/YYYY HH:mm:ss');\n}", "title": "" }, { "docid": "4bcb9aadbbdeb24f915fb3b08dd6223d", "score": "0.6353706", "text": "function getTimestamp(){\n let date = new Date();\n let year = date.getFullYear();\n let month = date.getMonth();\n let day = date.getDate();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n let milliseconds = date.getMilliseconds();\n let timestamp = year+\"-\"+month+\"-\"+day+\" \"+hours+\":\"+minutes+\":\"+seconds+\".\"+milliseconds;\n return timestamp;\n }", "title": "" }, { "docid": "69e778760bc86211d1e11c4336c3001f", "score": "0.63516515", "text": "getFormatedTime(timestamp){\n let date = new Date(timestamp);\n let hours = \"0\" + date.getHours();\n let minutes = \"0\" + date.getMinutes();\n\n return `${hours.substr(-2)} h ${minutes.substr(-2)}`\n }", "title": "" }, { "docid": "6ac17ce8e519a3fb11d3143bee155838", "score": "0.6345865", "text": "function timestamp ( message ) {\n return '<p>' + new Date().toLocaleTimeString() + ': ' + message + '</p>';\n }", "title": "" }, { "docid": "33e1a17a83b1a793d94651f8b3c2caaa", "score": "0.63445574", "text": "function getTimeStamp() {\n\t\t\tvar now = new Date();\n\t\t\treturn now.getTime();\n\t\t}", "title": "" }, { "docid": "33e1a17a83b1a793d94651f8b3c2caaa", "score": "0.63445574", "text": "function getTimeStamp() {\n\t\t\tvar now = new Date();\n\t\t\treturn now.getTime();\n\t\t}", "title": "" }, { "docid": "33e1a17a83b1a793d94651f8b3c2caaa", "score": "0.63445574", "text": "function getTimeStamp() {\n\t\t\tvar now = new Date();\n\t\t\treturn now.getTime();\n\t\t}", "title": "" }, { "docid": "c25dc4d7ec591639afb4c18568b8357f", "score": "0.6339152", "text": "function timestamp() {\n const now = new Date();\n return `${now.getHours()}:${now.getMinutes()}`;\n}", "title": "" }, { "docid": "037a10d3de7a52abf2563b3111b2c810", "score": "0.6331903", "text": "function getTime(timestamp) {\n const time = new Date(timestamp);\n let date = `${time.getDay()}-${time.getMonth()}-${time.getFullYear()} ${time.getHours()}:${time.getMinutes()}`;\n return date.replace(/\\b(\\d{1})\\b/g, '0$1');\n // return `${time.getHours()}:${leftPad(time.getMinutes(), 2, '0')}`;\n}", "title": "" }, { "docid": "78cca01e628dfdbbc0c565c94d5e142f", "score": "0.6325484", "text": "function getTimeStamp() {\n\t\t\treturn Date.now();\n\t\t}", "title": "" }, { "docid": "66eb038ef7a7c30cebfddaafac38d83f", "score": "0.63219494", "text": "function getTimeStamp() {\r\n\t\t\tvar now = new Date();\r\n\t\t\treturn now.getTime();\r\n\t\t}", "title": "" }, { "docid": "333e841efcbb16053bd8387d2a4ff108", "score": "0.62750494", "text": "function getTimestamp(d = new Date()) {\n\treturn `${d.getHours() > 12 ? d.getHours() - 12 : d.getHours()}:${d.getMinutes().toString().padStart(2, '0')}:${d.getSeconds().toString().padStart(2, '0')}`;\n}", "title": "" }, { "docid": "a93407e84e506a362906543d507ba115", "score": "0.6261218", "text": "function getTimeStamp() {\n var now = new Date();\n return now.getTime();\n }", "title": "" }, { "docid": "67c59f06710205b6bded49a59cac2154", "score": "0.62562686", "text": "static getDateTime(timestamp, format) {\n return (\n Formatter.getDate(timestamp, format) +\n \" \" +\n Formatter.getTime(timestamp, format)\n );\n }", "title": "" }, { "docid": "d4b8e203bd6b790ab44256117034e807", "score": "0.62559354", "text": "function timeStamp() {\r\n // Create a date object with the current time\r\n var now = new Date();\r\n // Create an array with the current month, day and time\r\n var date = [now.getMonth() + 1, now.getDate(), now.getFullYear()];\r\n // Create an array with the current hour, minute and second\r\n var time = [now.getHours(), now.getMinutes(), now.getSeconds()];\r\n // Determine AM or PM suffix based on the hour\r\n var suffix = (time[0] < 12) ? \"AM\" : \"PM\";\r\n // Convert hour from military time\r\n time[0] = (time[0] < 12) ? time[0] : time[0] - 12;\r\n // If hour is 0, set it to 12\r\n time[0] = time[0] || 12;\r\n // If seconds and minutes are less than 10, add a zero\r\n for (var i = 1; i < 3; i++) {\r\n if (time[i] < 10) {\r\n time[i] = \"0\" + time[i];\r\n }\r\n }\r\n // Return the formatted string\r\n return time.join(\":\") + suffix;\r\n}", "title": "" }, { "docid": "b6c5513ca7e6e3d3c701f99f183cd34f", "score": "0.6244551", "text": "function timestamp() {\n return Date.now();\n}", "title": "" }, { "docid": "8d6af6e184e30072fa42216f4cea3ae6", "score": "0.6240998", "text": "function timestamp(){\n function pad(n) {return n<10 ? \"0\"+n : n}\n var d = new Date()\n var dash = \"-\"\n var colon = \":\"\n var timezone_offset_min = new Date().getTimezoneOffset(),\n\toffset_hrs = parseInt(Math.abs(timezone_offset_min/60)),\n\toffset_min = Math.abs(timezone_offset_min%60),\n\ttimezone_standard;\n\n\tif(offset_hrs < 10)\n\t\toffset_hrs = '0' + offset_hrs;\n\n\tif(offset_min < 10)\n\t\toffset_min = '0' + offset_min;\n\tif(timezone_offset_min < 0)\n\t\ttimezone_standard = '+' + offset_hrs + ':' + offset_min;\n\telse if(timezone_offset_min > 0)\n\t\ttimezone_standard = '-' + offset_hrs + ':' + offset_min;\n\telse if(timezone_offset_min == 0)\n\t\ttimezone_standard = 'Z';\n return d.getFullYear()+dash+\n pad(d.getMonth()+1)+dash+\n pad(d.getDate())+\"T\"+\n pad(d.getHours())+colon+\n pad(d.getMinutes())+colon+\n pad(d.getSeconds())+\n pad(timezone_standard);\n}", "title": "" }, { "docid": "1e7918b4ead2c304ff9f043936f70112", "score": "0.6232166", "text": "function getTimestamp() {\n return new Date().getTime();\n }", "title": "" }, { "docid": "a903b6f9757f0847280be4a3bb25e3a0", "score": "0.62304354", "text": "static timestampToString(timestampMs) {\n const date = new Date();\n date.setTime(timestampMs);\n const seconds = date.getUTCSeconds().toString().padStart(\n /* targetLength= */ 2, /* padString= */ '0');\n const minutes = date.getUTCMinutes().toString().padStart(\n /* targetLength= */ 2, /* padString= */ '0');\n if (date.getUTCHours() == 0) {\n return `${minutes}:${seconds}`;\n }\n // We don't pad hours because lectures won't need two digits for hours.\n const hours = date.getUTCHours().toString();\n return `${hours}:${minutes}:${seconds}`;\n }", "title": "" }, { "docid": "f9989cd440b0078a5e6fe4326c398aee", "score": "0.6223696", "text": "function getDate(timestamp) {\n var tt = new Date(parseInt(timestamp) * 1000).toLocaleString();\n return tt;\n}", "title": "" }, { "docid": "6e4a7ff6e776c178536f92000d1e00bc", "score": "0.6217218", "text": "function timeStamp() {\n // Create a date object with the current time\n var now = new Date();\n\n // Create an array with the current month, day and time\n\n\n var date = [now.getFullYear(), now.getMonth()+1, now.getDate()];\n\n // Create an array with the current hour, minute and second\n var time = [now.getHours(), now.getMinutes()+1, now.getSeconds()];\n\n \n\n // Convert hour from military time\n time[0] = (time[0] < 12) ? time[0] : time[0] - 12;\n\n // If hour is 0, set it to 12\n time[0] = time[0] || 12;\n\n // If seconds and minutes are less than 10, add a zero\n for (var i = 1; i < 3; i++) {\n if (time[i] < 10) {\n time[i] = \"0\" + time[i];\n } \n }\n\n // Return the formatted string\n return date.join(\"-\") + ' ' + time.join(':') +'PM';\n }", "title": "" }, { "docid": "39f33141f34a5c374b0207ec6ca74a4d", "score": "0.6196617", "text": "function getCustomTimeStamp() {\n var dateFormat = {\n day: '2-digit',\n year: 'numeric',\n month: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false\n };\n var date = new Date();\n var dateString = date.toLocaleString(undefined, dateFormat); //first argument(locale) is mandatory\n return dateString.replace(/[\\/,\\s]+/g, '-') + \":\" + date.getMilliseconds();\n}", "title": "" }, { "docid": "c5dc2b2047b2099fdf96be4ff0d77f79", "score": "0.6180141", "text": "function nice_date(timestamp) {\n var now = parseInt(Date.now() / 1000);\n var diff = now - (timestamp / 1000);\n if (diff < 60) {\n return 'il y a '+diff+ ' s';\n } else if (diff < 300) {\n var val = Math.round(diff / 60);\n return 'il y a ' + val + ' min'+(val > 1 ? 's' : '');\n } else if (diff < 3600) {\n var val = Math.round(diff / 300) * 5;\n return 'il y a ' + val + ' min'+(val > 1 ? 's' : '');\n } else {\n var date = new Date(timestamp * 1000);\n return pad(date.getDate()) + '/' + pad(date.getMonth() + 1) + ' à ' + pad(date.getHours()) + ':' + pad(date.getMinutes());\n }\n}", "title": "" }, { "docid": "dbd2baad30ab33065b0c8f62b6d732df", "score": "0.61714756", "text": "function private_getDatestamp() {\n\tvar d = new Date();\n\treturn d.toLocaleString();\n }", "title": "" }, { "docid": "a2cf5a228059e1d5065d95ce6a9963c7", "score": "0.61707157", "text": "function getTimestamp(){\n\n var date = new Date();\n var year = date.getFullYear();\n var month = date.getMonth();\n if(month < 10){month = \"0\" + month;}\n var day = date.getDate();\n if(day < 10){day = \"0\"+ day;}\n var hour = date.getHours();\n if(hour < 10){hour = \"0\" + hour;}\n var minute = date.getMinutes();\n if(minute < 10){minute = \"0\" + minute;}\n var second = date.getSeconds();\n if(second < 10){second = \"0\" + second;}\n return(year + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + minute + \":\" + second);\n\n}", "title": "" }, { "docid": "6ee1e7d2099dde1813dc97c796d636a5", "score": "0.61209697", "text": "function getTimeStamp()\n{\n return(moment().format(\"YYYY-MM-DD hh:mm:ss\"));\n}", "title": "" }, { "docid": "dbc77a5b64ab1867ff25474799a2a1b9", "score": "0.6106188", "text": "function SOLACE_TS() {\n // unroll logic for speed\n var ddd = new Date();\n var\n hh = ddd.getHours() + \"\",\n mm = ddd.getMinutes() + \"\",\n ss = ddd.getSeconds() + \"\",\n ms = ddd.getMilliseconds() + \"\";\n\n hh = hh.length < 2 ? \"0\" + hh : hh;\n mm = mm.length < 2 ? \"0\" + mm : mm;\n ss = ss.length < 2 ? \"0\" + ss : ss;\n ms = ms.length < 3 ? \"0\" + ms : ms;\n ms = ms.length < 3 ? \"0\" + ms : ms; //twice: pad to 3\n\n return hh + \":\" + mm + \":\" + ss + \".\" + ms;\n}", "title": "" }, { "docid": "a46b72c889ba371c2d605068e32df408", "score": "0.6103069", "text": "function formattedDateTime(timestamp) {\r\n var date = new Date(timestamp * 1000);\r\n\r\n return (date.getFullYear() + '-' +\r\n padded((date.getMonth() + 1)) + '-' +\r\n padded(date.getDate()) + ' ' +\r\n padded(date.getHours()) + ':' +\r\n padded(date.getMinutes()) + ':' +\r\n padded(date.getSeconds()));\r\n }", "title": "" }, { "docid": "5ad83be132a618a5275a0b85625be21c", "score": "0.60866636", "text": "function dateTime(timestamp) {\n let days = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n let date = new Date(timestamp);\n let day = date.getDay();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n\n if (hours < 10) {\n hours = `0${hours}`;\n }\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n\n return `Last Updated: ${days[day]}, ${hours}:${minutes}`;\n}", "title": "" }, { "docid": "6aca3746aeca071168cdeab134704bcc", "score": "0.6084999", "text": "function ts()\n{ \n return \"[\"+ moment().format(\"YYYY/MM/DD HH:MM:SS\") +\"] \" \n}", "title": "" }, { "docid": "e480cab051a920f1e6f00be7ab017042", "score": "0.60828763", "text": "function getNow() {\n return new Date().toISOString().\n replace(/T/, ' '). // replace T with a space\n replace(/\\..+/, '') // delete the dot and everything after\n}", "title": "" }, { "docid": "c31a80e522c96639e1b642577d10cf4b", "score": "0.6082821", "text": "function make_pretty_timestamp(time) {\n var date = new Date(time);\n var year = '' + date.getFullYear() + '';\n year = year.substr(2);\n var month = date.getMonth() + 1;\n if (month < 10) {\n month = '0' + month;\n }\n var day = date.getDate();\n if (day < 10) {\n day = '0' + day;\n }\n var hour = date.getHours();\n if (hour < 10) {\n hour = '0' + hour;\n }\n var minutes = date.getMinutes();\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n var seconds = date.getSeconds();\n if (seconds < 10) {\n seconds = '0' + seconds;\n }\n return '' + month + '-' + day + '-' + year + ' ' + hour + ':' + minutes + ':' + seconds + '';\n}", "title": "" }, { "docid": "d04633d95d3348bdc8b2eca3d9d0137a", "score": "0.6072134", "text": "function formatTimeStamp(timeStamp) {\n return new Date(parseInt(timeStamp)).toString();\n}", "title": "" }, { "docid": "9b2dfac24f2f1fe35e156b299ef5c72a", "score": "0.607105", "text": "function timeStamp() {\n return Date.now().toString(36);\n}", "title": "" }, { "docid": "8b41d41735bc169650e188a8941a23d3", "score": "0.60656136", "text": "function timeString () {\r var now = new Date();\r return now.getTime()\r }", "title": "" }, { "docid": "c034c5dc10f0bf84bf3a5851e06f6b99", "score": "0.60648006", "text": "function timestampToString() {\n\n var d = new Date()\n\n var month_str = \"\";\n\n if ((d.getMonth() + 1) > 9) month_str = \"\" + (d.getMonth() + 1);\n else if ((d.getMonth() + 1) < 10) month_str = \"0\" + (d.getMonth() + 1);\n\n var day_str = \"\";\n if (d.getDate() > 9) day_str = \"\" + d.getDate();\n else if (d.getDate() < 10) day_str = \"0\" + d.getDate();\n\n var hour_str = \"\";\n if (d.getHours() > 9) hour_str = \"\" + d.getHours();\n else if (d.getHours() < 10) hour_str = \"0\" + d.getHours();\n\n var min_str = \"\";\n if (d.getMinutes() > 9) min_str = \"\" + d.getMinutes();\n else if (d.getMinutes() < 10) min_str = \"0\" + d.getMinutes();\n\n var sec_str = \"\";\n if (d.getSeconds() > 9) sec_str = \"\" + d.getSeconds();\n else if (d.getSeconds() < 10) sec_str = \"0\" + d.getSeconds();\n\n //var mytimestamp = \"\" + d.getFullYear() + \"-\" + (d.getMonth() + 1 ) + \"-\" + d.getDate() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds();\n var mytimestamp = \"\" + d.getFullYear() + \"-\" + month_str + \"-\" + day_str + \" \" + hour_str + \":\" + min_str + \":\" + sec_str;\n\n\n return mytimestamp;\n}", "title": "" }, { "docid": "7a4740954c3a090f1bfa544fd7756be2", "score": "0.60447484", "text": "function timestamp(str){\n return new Date(str).getTime(); \n}", "title": "" }, { "docid": "cbfc368e4d0f48baf542d0b0a29d384e", "score": "0.6033172", "text": "getTime(timestamp) {\n return new Date(timestamp).toLocaleTimeString()\n // return new Date(timestamp).getTime()\n }", "title": "" }, { "docid": "fa3fa952cde53d5753b70c702e45b097", "score": "0.60133684", "text": "function timeStamp(type){\r\n\tlet CurrTime=new Date();\r\n\tlet mo=CurrTime.getMonth()+1;if(mo<10){mo=\"0\"+mo;}let da=CurrTime.getDate();if(da<10){da=\"0\"+da;}let yr=CurrTime.getFullYear();\r\n\tlet hr=CurrTime.getHours();if(hr<10){hr=\"0\"+hr;}let min=CurrTime.getMinutes();if(min<10){min=\"0\"+min;}let sec=CurrTime.getSeconds();if(sec<10){sec=\"0\"+sec;}\r\n\tif(!type || type===1){\r\n\t\treturn \"`\"+mo+\"/\"+da+\"/\"+yr.toString().slice(2)+\"` **@** `\"+hr+\":\"+min+\"` \"\r\n\t}\r\n\tif(type===2) {\r\n\t\treturn \"[\"+yr+\"/\"+mo+\"/\"+da+\" @ \"+hr+\":\"+min+\":\"+sec+\"] \"\r\n\t}\r\n\tif(type===3) {\r\n\t\treturn \"`\"+yr+\"/\"+mo+\"/\"+da+\"` **@** `\"+hr+\":\"+min+\":\"+sec+\"`\"\r\n\t}\r\n}", "title": "" }, { "docid": "5951c3cf74872d3cf450852e16243db5", "score": "0.6006887", "text": "function timeStamp(){\n var time = new Date()\n var hour = timeFix( time.getHours() )\n var min = timeFix( time.getMinutes() );\n var finalDate = hour + ':' + min;\n return finalDate;\n }", "title": "" }, { "docid": "78ab6665239c214a85ee36e761c01ad1", "score": "0.59950465", "text": "function timeStamp() {\n let date = new Date()\n let current_hour = date.getHours()\n let current_minutes = date.getMinutes()\n current_minutes = (current_minutes < 10 ? \"0\" : \"\") + current_minutes\n let time = `${current_hour}:${current_minutes}`\n return time\n}", "title": "" }, { "docid": "9b3b5d527e562b8b68aaded3ff3960e1", "score": "0.5973075", "text": "function timestamp(s) {\n var d = document;\n var curTime = new Date();\n d.body.appendChild(d.createTextNode(s + ':\\t' + curTime.getTime() / 1000));\n d.body.appendChild(d.createElement('br'));\n}", "title": "" }, { "docid": "d1139bcc375a2dfd621c9c951f05ad00", "score": "0.59659135", "text": "function timestamp() {\n return microtime ? microtime.now() : new Date().getTime();\n }", "title": "" }, { "docid": "637d2a4a026817663760eb6267c31d64", "score": "0.59575874", "text": "function timestamp(str){\n return new Date(str).getTime();\n}", "title": "" }, { "docid": "d4e0c0fd7cd17270775f7925cd5ddd8d", "score": "0.5957587", "text": "function timeStamp() {\n//Create a date object with the current time\n var now = new Date();\n \n//Create an array with the current hour, minute and second\n var time = [now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds()];\n \n//If seconds and minutes are less than 10, add a zero\n for ( var i = 1; i < 3; i++ ) {\n if ( time[i] < 10 ) {\n time[i] = \"0\" + time[i];\n }\n }\n return time.join(\":\");\n}", "title": "" }, { "docid": "a49e0c9fd491ed2990b1e220f8e34ba8", "score": "0.59502006", "text": "function getTimestamp() {\n var date = new Date();\n var year = String(date.getFullYear()).padStart(2, '0');\n var month = String(date.getMonth() + 1).padStart(2, '0');\n var day = String(date.getDate()).padStart(2, '0');\n var hour = String(date.getHours()).padStart(2, '0');\n var min = String(date.getMinutes()).padStart(2, '0');\n var sec = String(date.getSeconds()).padStart(2, '0');\n var currentDate = day + '-' + month + '-' + year + ' ' + hour + ':' + min + ':' + sec;\n\n return currentDate;\n}", "title": "" }, { "docid": "ebcff462d47e249dbe68c6e4ed28aa3e", "score": "0.5928888", "text": "function getDatestamp(){\n var currentDateString = \"\";\n var datestamp = new Date();\n var time = datestamp.toTimeString();\n \n currentDateString += time.substr(0, time.indexOf(\" \")) + \" \";\n currentDateString += datestamp.toDateString()\n \n return currentDateString;\n}", "title": "" }, { "docid": "560b4174ac4f59ad834663df072a3a52", "score": "0.5925697", "text": "timeStamp() {\n\t\treturn new Date();\n\t}", "title": "" }, { "docid": "3b5deaa3aab2fe2823841b3f266143ce", "score": "0.59242916", "text": "getTimeString() {\n const date = new Date(Date.now()).toLocaleTimeString();\n return date;\n }", "title": "" }, { "docid": "692de6e35ea6a57aeb1fd41c6fab052a", "score": "0.59196573", "text": "getFormattedDate(timestamp) {\n let date = Moment.tz(timestamp, \"Europe/Warsaw\");\n return date.format('MMMM Do YYYY, H:mm:ss');\n }", "title": "" }, { "docid": "c9514049faaa56287d3b80f8993e8b04", "score": "0.5918518", "text": "function nowTime() {\n\treturn moment().format('YYYY-MM-DD HH:mm:ss.SSS')\n}", "title": "" }, { "docid": "0082883093be724d4c03260d04a5309b", "score": "0.5912593", "text": "function serverTimestamp() {\r\n return SERVER_TIMESTAMP;\r\n}", "title": "" }, { "docid": "9b4189874c6ce23e2a0123dbc155390f", "score": "0.59045225", "text": "static getHumanReadableTime(timestamp) {\n\t\tconst date = new Date(timestamp);\n\t\treturn date.toLocaleDateString() + \", \" + date.toLocaleTimeString();\n\t}", "title": "" }, { "docid": "1ead9442b1b16d7633e64da81f280701", "score": "0.5890466", "text": "function getTimeStamp(date) {\r\n\r\n return date.toLocaleTimeString(undefined, {hour12: false, hour: '2-digit', minute: '2-digit' });\r\n}", "title": "" }, { "docid": "b1933d45efb78f51873766f1ed4dcbad", "score": "0.588428", "text": "function serverTimestamp() {\n return SERVER_TIMESTAMP;\n}", "title": "" }, { "docid": "ef080d4b9c7f70ab49557371a5c5e438", "score": "0.5884048", "text": "function getTimeStamp() {\n return new Date().getTime();\n}", "title": "" }, { "docid": "a72771e20cc54c20a84ea0ede2cc4f8e", "score": "0.58823967", "text": "function getTimeStamp(){\n const today = new Date();\n const dd = String(today.getDate()).padStart(2, '0');\n const mm = String(today.getMonth() + 1).padStart(2, '0');\n const date = today.getFullYear()+'-'+mm+'-'+dd;\n const time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n const dateTime = date+' '+time;\n return dateTime;\n}", "title": "" }, { "docid": "51e66e5288c0a5e8e75f1cb0f5e09e10", "score": "0.58758926", "text": "function createTimestamp(){\n var min = new Date().getMinutes();\n var minutes;\n if(min < 10){\n minutes = \"0\" + min;\n }else {\n minutes = min;\n }\n return timestamp = new Date().getHours() + \":\" + minutes;\n }", "title": "" }, { "docid": "d9efe7778b6808bd219146aa63fa6c5f", "score": "0.5868033", "text": "getUnixTimestamp () {\n return Math.floor(this.now() / 1000)\n }", "title": "" }, { "docid": "6c6218eecfe3c18e67c20a09144bc4c1", "score": "0.58670646", "text": "function timestamp(str) {\n return makeDate(str).getTime();\n}", "title": "" }, { "docid": "8176da87e4c176f3a63dd09f01383059", "score": "0.58596534", "text": "_createUnixTimestampString(): string {\n let ts = Date.now();\n return (ts % 0xFFFFFFFF).toString(16) + '-';\n }", "title": "" }, { "docid": "47c779b1f92a59ed2eac2cba1dd88b90", "score": "0.58596236", "text": "function timeStamp(date) {\n var date = _.isUndefined(date) ? new Date() : new Date(date);\n return date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + (date.getDate() + 1)).slice(-2) + ' ' +\n date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() + '\\n';\n}", "title": "" }, { "docid": "e4aee51a89f16670c90d7093e6c005a9", "score": "0.58455104", "text": "timestamp_to_logdate (timestamp) {\n const timestamp_ms = timestamp * 1000\n return moment(timestamp_ms).format('HH:mm:ss UTC')\n }", "title": "" }, { "docid": "c3e5160135e924a9e6eb734b28ef5b04", "score": "0.5829626", "text": "function get_timestamp( action ){\n\t\t\t// get the date object\n\t\t\tvar date_obj = get_dates( action );\n\t\t\t\n\t\t\t// We need the date in a unix timestamp format. OK let's fix the offset here. We can just subtract it from the hours and it'll be ok.\n\t\t\tvar the_date = Date.UTC( date_obj.year, date_obj.month - 1, date_obj.day, date_obj.hour - MJJPostTimestamp.gmt_offset, date_obj.minute, date_obj.second );\n\n\t\t\t// get the seconds from the milliseconds above\n\t\t\tvar timestamp = Math.floor( the_date / 1000 );\n\t\t\treturn timestamp;\n\t\t}", "title": "" }, { "docid": "937b1a8d6fd278ee1de0f8ea653281b4", "score": "0.582291", "text": "function convertUnixTimestampToDateTimeString(unix_timestamp) {\n let dt = convertUnixTimestampToDate(unix_timestamp);\n let time = dt.toTimeString().substr(0, 5);\n let date = `${dt.getDate()}.${dt.getMonth() + 1}.${dt.getFullYear()}`;\n\n const nbsp = \"\\xa0\\xa0\";\n return `${time}${nbsp}${date}`;\n}", "title": "" }, { "docid": "c904ae380c651899d6eee2f79b48fda7", "score": "0.5821706", "text": "function show_timestamp( action ){\n\t\t\tvar unix_timestamp_stamp \t= \"<span style='margin-left: 25px'>Timestamp: <strong>\" + get_timestamp( action ) + \"</strong>\";\n\t\t\treturn unix_timestamp_stamp;\n\t\t}", "title": "" }, { "docid": "20ae23922aa56c4dec4f7ec0007962f8", "score": "0.58161277", "text": "function Timestamp () {\n return null;\n}", "title": "" } ]
0e7912d67d5b662d3c5120cdae898b10
Generate Appointment StartDate and EndDate By Slot and AppointmentDate
[ { "docid": "7de1eae5ecf3be181cfae845ad76c746", "score": "0.749594", "text": "function GenerateStartTimeAndEndTime(timeSlot, appointmentDate) {\n var result = new Object();\n // splitting string by operator (-); will return for two arraylist only\n var timeSlots = timeSlot.split(\"-\", 2);\n result['start'] = appointmentDate + ' ' + timeSlots[0].trim() + \":00\";\n result['end'] = appointmentDate + ' ' + timeSlots[1].trim() + \":00\";\n return result;\n }", "title": "" } ]
[ { "docid": "74f990b6919e0f582978603a154f3245", "score": "0.69994897", "text": "function GenerateDoctorSlots() {\n var Appointments = new Array();\n\n // =======get date range=====\n var fromDt = new Date($(\"#dtFrom\").val());\n var toDt = new Date($(\"#toDT\").val());\n\n var newend = toDt.setDate(toDt.getDate() + 1);\n var end = new Date(newend);\n\n //=====loop through each day=======\n while (fromDt < toDt) {\n //====ge day name for each date==========\n var dayName = moment(fromDt).format(\"dddd\");\n\n //=====match day with each shift1 and shift2 checkBox's checked day=======\n var shift1Day = $(\"#Shift1\").find(\"input.\" + dayName);\n var shift2Day = $(\"#Shift2\").find(\"input.\" + dayName);\n var AppointmentsDetails = new Array();\n\n //======if checkboxes is checked from shift 1======\n if (shift1Day.prop(\"checked\")) {\n var shift1parnt = shift1Day.parents(\"div.sch-app\");\n\n //=====get slots as per selected interval/slot time from shift 1\n var slotShift1 = getIntervals(\n shift1parnt.find(\"input.txtStart\").val(),\n shift1parnt.find(\"input.txtEnd\").val(),\n $(\"#Slot-time option:selected\").val()\n );\n\n for (var i in slotShift1)\n if (slotShift1.hasOwnProperty(i)) {\n var slots = slotShift1[i].split(\"-\");\n AppointmentsDetails.push({\n AppointmentStatus: \"Vacant\",\n AppointmentStartTime: slots[0],\n AppointmentEndTime: slots[1],\n AddedDate: new Date().toLocaleDateString(\"en-us\"),\n AddedBy: useLoginId,\n isActive: true,\n });\n }\n } //end of shift1Day====\n\n //======if checkboxes is checked from shift 2======\n if (shift2Day.prop(\"checked\")) {\n var shift2parnt = shift2Day.parents(\"div.sch-app\");\n\n //=====get slots as per selected interval/slot time from shift 2\n var slotShift2 = getIntervals(\n shift2parnt.find(\"input.txtStart\").val(),\n shift2parnt.find(\"input.txtEnd\").val(),\n $(\"#Slot-time option:selected\").val()\n );\n\n for (var i in slotShift2)\n if (slotShift2.hasOwnProperty(i)) {\n var slots = slotShift2[i].split(\"-\");\n AppointmentsDetails.push({\n AppointmentStatus: \"Vacant\",\n AppointmentStartTime: slots[0],\n AppointmentEndTime: slots[1],\n AddedDate: new Date().toLocaleDateString(\"en-us\"),\n AddedBy: useLoginId,\n isActive: true,\n });\n }\n } //end of shift2Day====\n\n //=============create list for appointments with sots====\n Appointments.push({\n DoctorId: parseInt(useLoginId),\n AppointmentDate: fromDt.toLocaleDateString(\"en-us\"),\n Shifts: \"1\",\n AddedBy: useLoginId,\n AddedDate: new Date().toLocaleDateString(\"en-us\"),\n ModifiedDate: \"1\",\n ModifiedBy: \"1\",\n isActive: true,\n AppointmentsDetails: AppointmentsDetails,\n });\n\n var newDate = fromDt.setDate(fromDt.getDate() + 1);\n fromDt = new Date(newDate);\n } //===end of while loop\n return Appointments;\n}", "title": "" }, { "docid": "eaedc91b951025c5d3da712ed9ef7210", "score": "0.6618955", "text": "function generateBookingCalendar(dayCount, slotMinutes, myWorkSchedule, serviceTime) {\n \n var slotsRequired = Math.ceil(serviceTime / slotMinutes);\n var days = [];\n for (i = 0; i < dayCount; i++) {\n var d1 = Date.today();\n d1.addDays(i);\n var todaysDate = d1.toString(\"d-MMM-yyyy\");\n var dayofWeek = d1.getDayName();\n var starttime = myWorkSchedule[dayofWeek].start;\n var endtime = myWorkSchedule[dayofWeek].end;\n var dow = d1.getDay();\n\n // Inject space into time to appease date parser\n starttime = starttime.replace('am', ' am');\n starttime = starttime.replace('pm', ' pm');\n endtime = endtime.replace('am', ' am');\n endtime = endtime.replace('pm', ' pm');\n \n d1 = new Date(todaysDate + ' ' + starttime);\n d2 = new Date(todaysDate + ' ' + endtime);\n \n // Calculate segments based on duration between starttime and endtime, divided by segment minutes\n workMinutes = getMinutesBetweenDates(d1, d2);\n segments = workMinutes / slotMinutes;\n slots = [];\n for (j = 0; j < segments; j++) {\n slot = d1.clone();\n \n // if this is a staffer's workday, then set 'booked' to false so clients can book appointments\n isWorkday = myWorkSchedule[dayofWeek].work == 'on' ? false : true;\n slots.push({\n 'booked': isWorkday\n , 'start': slot.toString(\"hh:mm tt\")\n , 'timestamp': slot\n });\n d1.addMinutes(slotMinutes);\n };\n day = {\n 'todaysDate': todaysDate\n , 'dayofWeek': dayofWeek\n , 'dow': dow\n , 'timeslots': slots\n };\n days.push(day);\n };\n $scope.days = days;\n \n \n // Now we block out time slots based on current bookings\n firebase.database().ref('/bookings/' + uid).once('value').then(function (snapshot) {\n console.log('in snapshot');\n snapshot.forEach(function (childSnapshot) { \n var bookingDate = childSnapshot.key;\n var bookingDetails = childSnapshot.val();\n var startOfBooking = new Date(bookingDate);\n var pastBooking = startOfBooking.compareTo(Date.today()) == -1 ? true : false;\n \n if( !pastBooking ) {\n var endOfBooking = startOfBooking.clone().addMinutes(bookingDetails.minutesToComplete - 1);\n \n // Loop thru bookings to block out time slots on view \n days.forEach(function (day) {\n day.timeslots.forEach(function (slot, index) {\n if( slot.timestamp.between(startOfBooking, endOfBooking)) {\n slot.booked = true;\n };\n \n if( day.timeslots.length - 1 === index ) { // Last slot of the day?\n // if this service takes longer than the last timeslot of the day, block if no overflow \n if( serviceTime > slotMinutes ) {\n if( !allowOverflow ) {\n slot.booked = true;\n }\n }\n }\n });\n });\n \n // Make a second pass and block out slots where there's not enough contiguous time for service\n days.forEach(function (day) {\n day.timeslots.forEach(function (slot, index) {\n if( !day.timeslots[index].booked ) { // Open slot?\n for(i = 0; i < slotsRequired; i++) {\n tempix = index + i;\n if( tempix < day.timeslots.length ) {\n startofAppointment = new Date(day.timeslots[tempix].timestamp);\n endofAppointment = startofAppointment.clone().addMinutes(slotMinutes);\n \n // End of a booking falls between an appointment slot (we have not blocke out yet, so BLOCK!)\n if( endOfBooking.between(startofAppointment, endofAppointment)) {\n //console.log('block out!!');\n //console.log(day.timeslots[tempix]);\n day.timeslots[index].booked = true;\n };\n };\n };\n };\n }); \n });\n }; // if not pastBooking\n\n });\n \n // Update the view\n $rootScope.$apply();\n });\n }", "title": "" }, { "docid": "b8a39ae18bff0516c3a0ba480fbde60c", "score": "0.618712", "text": "function makeAppointment()\n{\n\n\tvar startHour = doAction('REQ_GET_FORMVALUE', 'hour', 'hour');\n\tif (startHour) \n\t{\n\t\tif (startHour == ' ')\n\t\t\tstarthour = '8';\n\t}\n\telse\n\t\tstartHour = \"8\";\n\n\tvar startMin = doAction('REQ_GET_FORMVALUE', 'minutes', 'minutes');\n\tif (startMin) {}\n\telse\n\t\tstartMin = \"00\";\n\n\tvar startAMPM = doAction('REQ_GET_FORMVALUE', 'ampm', 'ampm');\n\tif (startAMPM) {}\n\telse\n\t\tstartAMPM = \"AM\";\n\n\tvar apptDate = doAction('REQ_GET_FORMVALUE', 'date', 'date');\n\tvar serviceID = doAction('REQ_GET_FORMVALUE', 'service_id', 'service_id');\n\tvar name = doAction('REQ_GET_FORMVALUE', 'name', 'name');\n\n\tvar duration = doAction('REQ_GET_FORMVALUE', 'duration', 'duration');\n\tif (duration) {}\n\telse\n\t\tduration = \"-\";\n\n\tvar address1 = doAction('REQ_GET_FORMVALUE', 'address1', 'address1');\n\tif (address1) {}\n\telse\n\t\taddress1 = \"-\";\n\n\tvar phone = doAction('REQ_GET_FORMVALUE', 'phone', 'phone');\n\tif (phone) {}\n\telse\n\t\tphone = \"-\";\n\n\tvar email = doAction('REQ_GET_FORMVALUE', 'email', 'email');\n\tif (email) {}\n\telse\n\t\temail = \"-\";\n\n\tvar comments = doAction('REQ_GET_FORMVALUE', 'comments', 'comments');\n\tif (comments) {}\n\telse\n\t\tcomments = \"-\";\n\n\tvar AppointmentID = doAction('REQ_GET_FORMVALUE', 'id', 'id');\n\n\tvar merchantViewer = doAction('REQ_GET_FORMVALUE', 'AppID', 'AppID');\n\tif (merchantViewer && merchantViewer == \"merchant\")\n\t\tvar apptStatus = ID_S_APPROVED;\n\telse\n\t\tvar apptStatus = ID_S_NEEDS_APPROVAL;\n\n\t\n//writebr(\"Calling with Insert!!!!\");\n//writebr(\"Sending date=|\", apptDate, \"| duration=\", duration, \", Time=\", startHour, \":\", startMin, startAMPM,\", SeviceID=\", serviceID);\n//writebr(\"name=\",name, \",address=\", address1, \",phone=\", phone, \",email=\", email, \", comments=\", comments);\n\n\t// Get the date formatted to #seconds since 1970...\n\tvar nYear = doAction('REQ_GET_FORMVALUE', 'val1', 'val1');\n\tvar nMonth = doAction('REQ_GET_FORMVALUE', 'val2', 'val2');\n\tvar nDate = doAction('REQ_GET_FORMVALUE', 'val3', 'val3');\n\n\tvar temp='';\n\tif (nYear && nMonth && nDate)\n\t{\n\t\ttemp = nYear + \", \" + months[nMonth] + \", \" + nDate;\n\t\ttemp = new Date(temp);\n\t\tvar date_ss = temp.getTime() / 1000;\n\t}\n\telse\n\t\tvar date_ss = \"-\";\n\n//writebr(\"Date_ss string=|\" + date_ss + \"|\");\nvar useHour = parseInt(startHour);\nvar useMinute = parseInt(startMin);\nvar useDuration = parseFloat(duration);\nif(isNaN(useDuration))\n\tuseDuration = 0;\nif (useHour == 12)\n\tuseHour = 0;\nif (startAMPM.toLowerCase() == \"pm\")\n\tuseHour += 12;\n\t\nvar startApptDate = new Date(nYear, nMonth, nDate, useHour, useMinute, 0);\nvar endApptDate = new Date(startApptDate.getTime() + (useDuration * 3600000));\nvar errMsg = validateAppt (startApptDate, endApptDate);\nif (errMsg.length > 0)\n\treturn (\"Appointment Rejected: Reason = \" + errMsg);\n\n\tif (AppointmentID)\n\t{\n//writeln(\"AppointmentID = \" + AppointmentID);\n\n\t\tvar resultBDO = doActionBDO('SVC_SET_APPOINTMENTS', 'Mode', 'Update', 'ID', parseInt(AppointmentID), 'StartHour', startHour, 'StartMin', startMin,\n\t\t\t\t\t\t\t'StartAMPM', startAMPM, 'Duration', duration, 'ServiceID', parseInt(serviceID), 'Name', name, 'Address1', address1,\n\t\t\t\t\t\t\t'Phone', phone, 'Email', email, 'Comments', comments, 'ApptDate', apptDate, 'Status', apptStatus,\n\t\t\t\t\t\t\t'Address2', '-', 'City', '-', 'State', '-', 'Zip', '-', 'Date_ss', date_ss.toString());\n\t}\n\telse\n\t{\n//writeln(\"Calling INSERT MODE, AppointmentID = \" + AppointmentID);\n\n\t\tvar resultBDO = doActionBDO('SVC_SET_APPOINTMENTS', 'Mode', 'Insert', 'StartHour', startHour, 'StartMin', startMin,\n\t\t\t\t\t\t\t'StartAMPM', startAMPM, 'Duration', duration, 'ServiceID', parseInt(serviceID), 'Name', name, 'Address1', address1,\n\t\t\t\t\t\t\t'Phone', phone, 'Email', email, 'Comments', comments, 'ApptDate', apptDate, 'Status', ID_S_APPROVED,\n\t\t\t\t\t\t\t'Address2', '-', 'City', '-', 'State', '-', 'Zip', '-', 'Date_ss', date_ss.toString());\n\n\t\t// Only raise the ON_SERVICE_REQUEST event if the appointment is new\n\t\tif (resultBDO.Success)\n\t\t\tdoAction('ON_SERVICE_REQUEST', 'OrderID', parseInt(resultBDO.ID));\n\n\t}\n\treturn \"\";\n}", "title": "" }, { "docid": "5637299a2a108403b45bace1c8d2548f", "score": "0.61312777", "text": "function createDoctorAppointmentPhone(doc, mem){\n var timeslot_holder = $('#time_holder').val();\n var dateslot_holder = $('#date_holder').val();\n\n if(timeslot_holder == '8am - 10am'){\n var timeslot_holder_start = '08:00:00';\n var timeslot_holder_end = '10:00:00';\n }else if(timeslot_holder == '10am - 12pm'){\n var timeslot_holder_start = '10:00:00';\n var timeslot_holder_end = '12:00:00';\n }else if(timeslot_holder == '12pm - 2pm'){\n var timeslot_holder_start = '12:00:00';\n var timeslot_holder_end = '14:00:00';\n }else if(timeslot_holder == '2pm - 4pm'){\n var timeslot_holder_start = '14:00:00';\n var timeslot_holder_end = '16:00:00';\n }else if(timeslot_holder == '4pm - 6pm'){\n var timeslot_holder_start = '16:00:00';\n var timeslot_holder_end = '18:00:00';\n }else if(timeslot_holder == '6pm - 8pm'){\n var timeslot_holder_start = '18:00:00';\n var timeslot_holder_end = '20:00:00';\n }else if(timeslot_holder == '8pm - 10pm'){\n var timeslot_holder_start = '20:00:00';\n var timeslot_holder_end = '22:00:00';\n }\n\n $.get(\"createDoctorAppointment.php?type=0&member=\"+mem+\"&doctor=\"+doc+\"&timestart=\"+timeslot_holder_start+\"&timeend=\"+timeslot_holder_end+\"&date=\"+dateslot_holder,function(data,status)\n {\n alert('Your appointment has been created.');\n });\n}", "title": "" }, { "docid": "1fbebf107b4e4291375b88c069512650", "score": "0.6104552", "text": "function calculateAvailabilities(appointmentSlots, openingSlots, startDate, availabilities) {\n for (let time in openingSlots) {\n if (!appointmentSlots[time]) {\n let days = openingSlots[time].diff(startDate, \"days\");\n availabilities[days].slots.push(openingSlots[time].format(TIME_FORMAT));\n }\n }\n}", "title": "" }, { "docid": "5d784deaf5425b18200b575c4c84b8b0", "score": "0.5974034", "text": "function validateAppt (startDateObj, endDateObj)\n{\n\tif (openScheduleCount <= 0)\n\t\tGetDailyHours();\n\tif (ScheduleCount <= 0)\n\t\tGetSpecialDays ();\n\t\n\tif (theOpenSchedule[shortDays[startDateObj.getDay()]].State.toLowerCase() == \"c\")\n\t\treturn \"Store Closed\";\n\tvar tmpStartDateObj = syncMonthYearDate (theOpenSchedule[shortDays[startDateObj.getDay()]].startDateObj, startDateObj);\n\tvar tmpEndDateObj = syncMonthYearDate (theOpenSchedule[shortDays[startDateObj.getDay()]].endDateObj, startDateObj);\n\n\tvar today = new Date();\n\tif (startDateObj.getTime() < today.getTime())\n\t\treturn \"Requested Appointment Time Occurs In The Past\";\n\tif (startDateObj.getTime() < tmpStartDateObj.getTime())\n\t\treturn \"Appointment Time Occurs Before Store Is Open\";\n\tif (startDateObj.getTime() >= tmpEndDateObj.getTime())\n\t\treturn \"Appointment Time Occurs After Store Is Closed\";\n\t\t\n\ttmpStartDateObj = syncMonthYearDate (theUnavailSchedule[shortDays[startDateObj.getDay()]].startDateObj, startDateObj);\n\ttmpEndDateObj = syncMonthYearDate (theUnavailSchedule[shortDays[startDateObj.getDay()]].endDateObj, startDateObj);\n\n\tif (startDateObj.getTime() >= tmpStartDateObj.getTime() && startDateObj.getTime() < tmpEndDateObj.getTime())\n\t\treturn \"Appointment Time Occurs During Unavailable Hours\";\n\n\tfor (var n = 0; n < ScheduleCount; n++)\n\t{\n\t\tif (theSchedule[n].startDateObj.getYear() == startDateObj.getYear() && \n\t\t\ttheSchedule[n].startDateObj.getMonth() == startDateObj.getMonth() &&\n\t\t\ttheSchedule[n].startDateObj.getDate() == startDateObj.getDate())\n\t\t{\n\t\t\tif (theSchedule[n].AllDay.toLowerCase() == \"y\")\n\t\t\t\treturn \"Store Closed\";\n\t\t\telse if (startDateObj.getTime() >= theSchedule[n].startDateObj.getTime() && \n\t\t\t\t\tstartDateObj.getTime() < theSchedule[n].endDateObj.getTime())\n\t\t\t\treturn \"Appointment Time Occurs During Unavailable Hours\";\n\t\t}\n\t}\n\n\treturn \"\";\n}", "title": "" }, { "docid": "2b1bbfd976e5d797767ad5b592bab032", "score": "0.5973516", "text": "function getTimeSlot(day, start, end) {\n var dSt = new Date(day),\n dEnd = new Date(day);\n dSt.setHours(start.h, start.m);\n dEnd.setHours(end.h, end.m);\n return {start: dSt, end: dEnd};\n}", "title": "" }, { "docid": "f1c35816fdd8e07d10dcda0949517b4f", "score": "0.57630974", "text": "addDayAppointments(event, day) {\n let current;\n if (day)\n current = moment(day).format('DD/MM/YYYY');\n else\n current = moment().format('DD/MM/YYYY');\n if (moment(event.start).format('DD/MM/YYYY') === current)\n // this.setToDisplayAndPush(event);\n this.todayAppointments.push(event);\n }", "title": "" }, { "docid": "6da75f4a3430cd4ea64cbd30a1953be0", "score": "0.57393813", "text": "function addTimes(TimeSlots, event_start, event_end, startDateCheck, endDateCheck) {\n let start = moment.max(event_start, startDateCheck);\n let end = moment.min(event_end, endDateCheck);\n let interval = end.diff(start, \"minutes\");\n for (let iter = 0; iter < interval; iter += 30) {\n let time = moment(start).add(iter, \"minutes\");\n TimeSlots[time.format(DATE_TIME_FORMAT)] = time;\n }\n}", "title": "" }, { "docid": "b57e8bdaa0ec112f31c6de7aba0ff1c0", "score": "0.5715743", "text": "function createCalendarEvent (startdate, enddate, appointment_type) {\r\n return new Promise((resolve, reject) => {\r\n calendar.events.insert({ auth: serviceAccountAuth,\r\n calendarId: calendarId,\r\n resource: {summary: appointment_type +' Appointment', description: appointment_type,\r\n //start: {dateTime: dateTimeStart},\r\n // end: {dateTime: dateTimeEnd}\r\n start : {date: startdate},\r\n end: {date: enddate},\r\n }\r\n }, (err, event) => {\r\n console.log(\"insert error\" + err);\r\n console.log(\"insert event\" + event);\r\n err ? reject(err) : resolve(event);\r\n }\r\n );\r\n /* calendar.events.list({\r\n auth: serviceAccountAuth, // List events for time period\r\n calendarId: calendarId,\r\n // timeMin: start_date.toISOString(),\r\n timeMin: \"2020-08-20T10:00:00Z\",\r\n timeMax: \"2020-08-30T10:00:00Z\"\r\n // timeMax: dateTimeEnd.toISOString()\r\n }, (err, calendarResponse) => {\r\n // Check if there is a event already on the Calendar\r\n console.log(calendarResponse);\r\n if (err || calendarResponse.data.items.length > 0) {\r\n console.log(\"inside conflict area\");\r\n reject(err || new Error('Requested time conflicts with another appointment'));\r\n } else {\r\n // Create event for the requested time period\r\n console.log(\"inserting\");\r\n \r\n } \r\n }); \r\n */\r\n });\r\n}", "title": "" }, { "docid": "67fe378c69cf2713c1a3c080c009c43a", "score": "0.5707943", "text": "function getMeetings(meetings, program) {\n const programStartDate = new Date(program.startDate);\n const programEndDate = new Date(program.endDate);\n const programStartTime = new Date(program.startTime);\n const programEndTime = new Date(program.endTime);\n const programDays = program.meetDays;\n let date = new Date(programStartDate);\n while (date <= programEndDate) {\n if (programDays.some(d => weekdays.indexOf(d.name) == date.getDay())) {\n let startTime = new Date(date);\n startTime.setHours(programStartTime.getHours());\n startTime.setMinutes(programStartTime.getMinutes());\n\n let endTime = new Date(date);\n endTime.setHours(programStartTime.getHours());\n endTime.setMinutes(programStartTime.getMinutes());\n meetings.push({ start: startTime, end: endTime });\n }\n date.setDate(date.getDate() + 1);\n }\n}", "title": "" }, { "docid": "95a726bc7c288d7c36bc6d8f6b04c51d", "score": "0.5658959", "text": "function getAvailableTimeSlotsByDate(clinicId, providerId, appointmentDate, index) {\n //console.log(index);\n //alert('Inside getAvailableTimeSlotsByDate');\n //providerId = 10041; Rawan Qais\n //$http.get('/afya-portal/anon/getAvailableTimeslotsForAGivenTenantDateAndDoctor?tenantId=' + clinicId + '&doctorId=' + providerId + '&appointmentDate=' + appointmentDate + '&visitType=' + $scope.appointmentVisitType).success(function (data) {\n $http.get($scope.clinicBaseURL7577 + '/clinicMaster/getAvailableTimeslotsForGivenDateAndDoctorAndBookAppointment?clinicId=' + clinicId + '&providerId=' + providerId + '&appointmentDate=' + appointmentDate + '&visitType=' + $scope.appointmentVisitType).success(function (data) {\n var tempSlotList = \"appointmentTimeSlots\" + index;\n // get required slots according to visitType\n var appointmentLists = $.map($.grep(data, function (obj, idx) {\n return (obj.visitType == $scope.appointmentVisitType);\n }), function (obj, idx) { return obj; });\n\n $scope[tempSlotList] = appointmentLists;\n if (data.length > 0)\n $scope.mySlot = $scope[tempSlotList][0]; // need to bind the default\n if( Object.prototype.toString.call( data ) === '[object Array]' ) {\n if (appointmentLists.length <= 0) {\n //sweetAlert('Sorry! There are no slots available for this date. Please Select another date.');\n sweetAlert({ title: \"\",text: 'Sorry! There are no slots available for this date. Please Select another date.',type: \"info\" });\n }\n }\n else if( typeof data === 'string' ) {\n if (appointmentLists.length <= 0) {\n sweetAlert(data);\n }\n }\n\n if (appointmentLists.length <= 0) {\n //sweetAlert('Sorry! There are no slots available for this date. Please Select another date.');\n sweetAlert(data);\n }\n //console.log(appointmentLists);\n }).error(function (data, status, headers, config) {\n //var s = data;\n if (data.indexOf(\"appointment from past\") > -1) {\n //\n var tempSlotList = \"appointmentTimeSlots\" + index;\n // get required slots according to visitType\n //var appointmentLists = null;\n\n $scope[tempSlotList] = null;// appointmentLists;\n sweetAlert({ title: \"Sorry\",text: 'Date has passed we all have moved ahead, select future dates',type: \"warning\" });\n }\n else\n sweetAlert({ title: \"Oops\",text: 'Please select an appointment Slot for moving ahead',type: \"error\" });\n });\n }", "title": "" }, { "docid": "b4cffff13eee14fda7c7f3f7cd13e154", "score": "0.5618278", "text": "generateTimeSlots() {\n var slots = [];\n var inPosition = 0;\n for (let i = 0; i < this._options.totalRounds; i++) {\n slots.push({\n name: \"work\",\n start: inPosition,\n end: inPosition + this._options.duration\n });\n\n slots.push({\n name: \"short_break\",\n start: inPosition + this._options.duration,\n end: inPosition + this._options.duration + this._options.shortBreakDuration\n });\n\n inPosition = inPosition + this._options.duration + this._options.shortBreakDuration;\n }\n\n slots.push({\n name: \"long_break\",\n start: slots[slots.length - 1].end,\n end: slots[slots.length - 1].end + this._options.longBreakDuration\n });\n\n console.log(slots);\n\n return slots;\n }", "title": "" }, { "docid": "24d3b41687b3d7634ea6d92d0c01c0ed", "score": "0.55953526", "text": "function generateCalendar () {\n\tlet calendar = generateCalendarArray();\n\n\tlet weekDay = 0;\n\tlet tableRow;\n\tfor (let i = 0; i < calendar.length; i++) {\n\t\t// Create the \"table row\" element\n\t\tif (weekDay == 0) {\n\t\t\ttableRow = document.createElement(\"TR\");\n\t\t\tdocument.getElementById(\"calendarTableBody\").appendChild(tableRow);\n\t\t}\n\t\t// Append the \"table cell\"\n\t\tlet tableCell = document.createElement(\"TD\");\n\t\tif (calendar[i].day) {\n\t\t\tlet dayNode = document.createElement(\"DIV\");\n\t\t\tdayNode.innerText = calendar[i].day;\n\t\t\tdayNode.classList.add(\"day-label\");\n\t\t\ttableCell.appendChild(dayNode);\n\n\t\t\t// Check if there's an existing appointment and append it in the calendar\n\t\t\tlet existingAppointment = dayExistingAppointment(calendar[i].day);\n\t\t\tif (existingAppointment) {\n\t\t\t\tlet appointmentNode = document.createElement(\"DIV\");\n\t\t\t\tappointmentNode.innerText = existingAppointment.title;\n\t\t\t\tappointmentNode.classList.add(\"appointment\");\n\t\t\t\ttableCell.appendChild(appointmentNode);\n\t\t\t}\n\n\t\t\tlet dayDate = new Date(currentYear, currentMonth, calendar[i].day);\n\t\t\tif (dayDate < currentDay) {\n\t\t\t\ttableCell.classList.add(\"not-selectable\");\n\t\t\t} else {\n\t\t\t\ttableCell.setAttribute(\"data-day\", calendar[i].day);\n\t\t\t\ttableCell.addEventListener('click', addOrEditAppointment);\n\t\t\t}\n\t\t} else {\n\t\t\ttableCell.classList.add(\"not-selectable\");\n\t\t}\n\t\ttableRow.appendChild(tableCell);\n\n\t\t// Determine the current week day\n\t\tweekDay = (weekDay == 6) ? 0 : weekDay + 1;\n\t}\n}", "title": "" }, { "docid": "620924eb32861296f67e9e15bc1270a4", "score": "0.5588082", "text": "function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) {\n\n $startTimeField.empty();\n $endTimeField.empty();\n\n for (var i = 0; i < timeslotTimes.length; i++) {\n var startTime = timeslotTimes[i].start;\n var endTime = timeslotTimes[i].end;\n var startSelected = \"\";\n if (startTime.getTime() === calEvent.start_time.getTime()) {\n startSelected = \"selected=\\\"selected\\\"\";\n }\n var endSelected = \"\";\n if (endTime.getTime() === calEvent.end_time.getTime()) {\n endSelected = \"selected=\\\"selected\\\"\";\n }\n $startTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + timeslotTimes[i].startFormatted + \"</option>\");\n $endTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\n\n $timestampsOfOptions.start[timeslotTimes[i].startFormatted] = startTime.getTime();\n $timestampsOfOptions.end[timeslotTimes[i].endFormatted] = endTime.getTime();\n\n }\n $endTimeOptions = $endTimeField.find(\"option\");\n $startTimeField.trigger(\"change\");\n }", "title": "" }, { "docid": "86c111433cad45aef1e9f6dfd4b2f086", "score": "0.55642873", "text": "function getDatesFromRepeat(){\n IDays = Session.get(\"facDaysSearch\");\n IfacType = Session.get(\"facTypeSearch\");\n Icapacity = Session.get(\"facCapacitySearch\");\n InumSessions = Session.get(\"facNumSessionSearch\");\n repeatOptions = Session.get(\"facReapeatOptionSearch\");\n startDateTime = Session.get(\"facStartDateTimeSearch\");\n endinDateTime = Session.get(\"facEndinDateTimeSearch\");\n // console.log(this);\n // console.log(startDateTime);\n \n //for use in repeat calculations\n console.log(\"startDateTime is printing:\");\n console.log(startDateTime);\n console.log(\"endDateTime is printing:\");\n console.log(endinDateTime);\n\n var result = [];\n\tconsole.log(repeatOptions);\n if(repeatOptions === undefined || repeatOptions.length == 0){\n var timeslot = {};\n timeslot.start = startDateTime;\n timeslot.end = endinDateTime;\n result.push(timeslot);\n } else {\n var startTime = {\n hour: moment(startDateTime).hour(),\n minute: moment(startDateTime).minute()\n }\n\n var endTime = {\n hour: moment(endinDateTime).hour(),\n minute: moment(endinDateTime).minute()\n }\n \n currentStartDate = moment(startDateTime);\n currentEndDate = moment(endinDateTime);\n\n var dayDif = currentEndDate.diff(currentStartDate, 'days');\n\n var dayAdd = 0;\n var currentDate;\n\n while (dayAdd < dayDif) {\n if (result.length >= InumSessions) {\n break;\n }\n currentDate = moment(currentStartDate).add(dayAdd, \"day\");\n\n currentDateISO = currentDate.isoWeekday();\n if(repeatOptions.indexOf(currentDateISO) > -1) {\n var timeslot = {};\n timeslot.start = moment(currentDate).hour(startTime.hour).minute(startTime.minute);\n timeslot.end = moment(currentDate).hour(endTime.hour).minute(endTime.minute); \n result.push(timeslot);\n }\n dayAdd += 1;\n\n } \n }\n\treturn result;\n}", "title": "" }, { "docid": "c2ded576b0354a6330f251e5cd907a32", "score": "0.55237746", "text": "function generateCalendarArray () {\n\tlet calendar = [];\n\tconst firstSlot = 0;\n\tlet tempSlot = firstSlot;\n\n\t// While tempSlot is less than firstWeekDayOfCurrentMonth, push empty slots to the calendar array\n\twhile (tempSlot < firstWeekDayOfCurrentMonth) {\n\t\tlet slot = {\n\t\t\tslot: tempSlot\n\t\t};\n\t\tcalendar.push(slot);\n\t\ttempSlot++;\n\t}\n\t// Append the days of the month in the calendar array\n\tfor (let i = 1; i <= daysOfCurrentMonth; i++) {\n\t\tlet slot = {\n\t\t\tslot: tempSlot,\n\t\t\tday: i\n\t\t};\n\t\tcalendar.push(slot);\n\t\ttempSlot++;\n\t}\n\t// Append the remaining empty slots to complete a week\n\twhile (calendar.length % 7 != 0) {\n\t\tlet slot = {\n\t\t\tslot: tempSlot\n\t\t};\n\t\tcalendar.push(slot);\n\t\ttempSlot++;\n\t}\n\n\treturn calendar;\n}", "title": "" }, { "docid": "bbe35cc4e40fe1f99b7727d6aac27370", "score": "0.5491531", "text": "function setupStartAndEndTimeFields($jstartTimeField, $jendTimeField, calEvent, timeslotTimes) {\n\n $jstartTimeField.empty();\n $jendTimeField.empty();\n\n for (var i = 0; i < timeslotTimes.length; i++) {\n var startTime = timeslotTimes[i].start;\n var endTime = timeslotTimes[i].end;\n var startSelected = \"\";\n if (startTime.getTime() === calEvent.start.getTime()) {\n startSelected = \"selected=\\\"selected\\\"\";\n }\n var endSelected = \"\";\n if (endTime.getTime() === calEvent.end.getTime()) {\n endSelected = \"selected=\\\"selected\\\"\";\n }\n $jstartTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + timeslotTimes[i].startFormatted + \"</option>\");\n $jendTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\n\n $jtimestampsOfOptions.start[timeslotTimes[i].startFormatted] = startTime.getTime();\n $jtimestampsOfOptions.end[timeslotTimes[i].endFormatted] = endTime.getTime();\n\n }\n $jendTimeOptions = $jendTimeField.find(\"option\");\n $jstartTimeField.trigger(\"change\");\n }", "title": "" }, { "docid": "d1099a6249ffbec0bec60b79f48824d9", "score": "0.54845864", "text": "function createCalendarEvent (dateTimeStart, dateTimeEnd) {\n return new Promise((resolve, reject) => {\n calendar.events.list({ // List all events in the specified time period\n auth: serviceAccountAuth,\n calendarId: calendarId,\n timeMin: dateTimeStart.toISOString(),\n timeMax: dateTimeEnd.toISOString()\n }, (err, calendarResponse) => {\n // Check if there exists any event on the calendar given the specified the time period\n if (err || calendarResponse.data.items.length > 0) {\n reject(err || new Error('Requested time conflicts with another appointment'));\n } else {\n // Create an event for the requested time period\n calendar.events.insert({ auth: serviceAccountAuth,\n calendarId: calendarId,\n resource: {summary: appointment_type +' Appointment', description: appointment_type,\n start: {dateTime: dateTimeStart},\n end: {dateTime: dateTimeEnd}}\n }, (err, event) => {\n err ? reject(err) : resolve(event);\n }\n );\n }\n });\n });\n}", "title": "" }, { "docid": "17469d49577df61940ba1bb39f07eee5", "score": "0.54769677", "text": "function verifySlotDateAndStartTime(slotDate, slotStartTime) {\n let slotStartTotalSeconds = (slotStartTime.split(\":\")[0] * 60 * 60) + (slotStartTime.split(\":\")[1] * 60);\n let currentTime = new Date();\n let today = new Date(new Date().setHours(0, 0, 0, 0));\n let tomorrow = new Date(new Date().setHours(0, 0, 0, 0));\n tomorrow.setDate(tomorrow.getDate() + 1);\n let currentTotalSeconds = (currentTime.getHours() * 60 * 60) + (currentTime.getMinutes() * 60) + currentTime.getSeconds();\n\n if (slotDate.getTime() < today.getTime()) {\n console.log(\"slot date is in past\");\n return false;\n }\n else if ((slotDate.getTime() == today.getTime()) && currentTotalSeconds > slotStartTotalSeconds) {\n console.log(\"slot time, now time: \", slotStartTime, currentTime);\n return false;\n }\n else {\n console.log(\"slot date is in future or today\");\n return true;\n }\n}", "title": "" }, { "docid": "fc2a6672f439895decd2a70c6f82f764", "score": "0.5470905", "text": "function generateSchedule(companies, applications, timeLeftAvailableToday, day, counter){\n // Filter only companies with students left.\n function hasStudentsLeft(company){ return company.chosenStudents.length > 0 && !company.isDone; }\n var companiesLeft = companies.filter(hasStudentsLeft);\n function resetCompany(c){\n c.currentTime = null;\n c.isDone = false;\n }\n if(companiesLeft.length === 0){\n vm.schedulingSuccess = true;\n companies.forEach(resetCompany);\n return companies;\n }\n\n // For each company, book a student from applications.\n function bookStudent(company){\n if(company.chosenStudents.length === 0 || company.isDone){\n return; // Do nothing\n }\n\t\t\t\tconsole.log(\"Now Working on: \" + company.name)\n // Assign company.day to correct day (if wed/thur).\n company.day = day === 'wed' ? company.wednesday : company.thursday;\n\n // If wrong day, just return\n if(!company.day){\n return;\n }\n\n // If first iteration, set currentTime.\n if(!company.currentTime){\n company.currentTime = company.day.starttime;\n }\n\n var startString = company.currentTime;\n var startInt = timeStrToInt(startString);\n var endInt = startInt + company.day.meetingLength;\n\n\n // If collide with lunch, move start to lunchEnd\n var start_hm = company.day.lunchstart.split(':');\n var end_hm = company.day.lunchend.split(':');\n var lunchStart = timeStrToInt(company.day.lunchstart);\n var lunchEnd = timeStrToInt(company.day.lunchend);\n\n if(startInt >= lunchStart && startInt < lunchEnd && endInt >= lunchStart && endInt <= lunchEnd){\n\t\t\t\t\tconsole.log(\"Company \" + company.name + \"Has to be moved till after their lunch\");\n startInt = lunchEnd;\n endInt = startInt + company.day.meetingLength;\n }\n company.currentTime = timeIntToStr(endInt);\n\n // Check that start isnt after this days endtime\n var day_endtime = timeStrToInt(company.day.endtime);\n if(startInt >= day_endtime){\n company.isDone = true;\n return;\n }\n\n // Check if meeting with same time already exists, if so return;\n var sameTimeMeetings = company.meetings.filter(checkIfExists);\n function checkIfExists(m){\n return m.startTime === timeIntToStr(startInt) && m.endTime === timeIntToStr(endInt) && m.day === day;\n }\n if(sameTimeMeetings.length > 0){\n return;\n }\n\n // Get latest application data from applicationList\n function mapIdToApplication(id){\n function idMatch (a) { return a._id === id; }\n var appl = applications.filter(idMatch)[0];\n // Set timeleft available today.\n appl.timeLeft = timeLeftAvailableToday(appl, startInt);\n return appl;\n }\n company.students = company.chosenStudents.map(mapIdToApplication);\n\n // Sort company.students by timeLeft\n function sortByTimeLeft(a1, a2){\n return a1.timeLeft > a2.timeLeft;\n }\n company.students.sort(sortByTimeLeft);\n\n function bookIfAvailable(students, start, end){\n if(students.length === 0){\n return null; // Do nothing.\n }\n var isFree = isAvailable(students[0].periodList, start, end);\n if(isFree){\n bookMeeting(students[0], company, start, end, day, false);\n return students[0];\n } else {\n return bookIfAvailable(students.slice(1), start, end);\n }\n }\n var bookedStudent = bookIfAvailable(company.students, startInt, endInt);\n\n // Check if no student booked, then book student with least time available.\n if(bookedStudent === null){\n bookMeeting(company.students[0], company, startInt, endInt, day, true);\n }\n }\n companies.forEach(bookStudent);\n\n // Booking done, prepare next iteration\n\n // Filter only applications with companies left.\n function hasCompaniesLeft(a){ return a.companies.length > 0; }\n applications.filter(hasCompaniesLeft);\n\n if(counter > 0){\n // Recursive call. Continue until no companies are left.\n counter--;\n return generateSchedule(companies, applications, timeLeftAvailableToday, day, counter);\n } else {\n companies.forEach(resetCompany);\n return companies;\n }\n }", "title": "" }, { "docid": "894e09ee380bb953dd32113cdd1a9689", "score": "0.5439588", "text": "function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) {\r\n\t\t$startTimeField.html(\"\");\r\n\t\t$endTimeField.html(\"\");\r\n for (var i = 0; i < timeslotTimes.length; i++) {\r\n var startTime = timeslotTimes[i].start;\r\n var endTime = timeslotTimes[i].end;\r\n var startSelected = \"\";\r\n if (startTime.getTime() === calEvent.start.getTime()) {\r\n startSelected = \"selected=\\\"selected\\\"\";\r\n }\r\n var endSelected = \"\";\r\n if (endTime.getTime() === calEvent.end.getTime()) {\r\n endSelected = \"selected=\\\"selected\\\"\";\r\n }\r\n $startTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + timeslotTimes[i].startFormatted + \"</option>\");\r\n $endTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\r\n\r\n }\r\n $endTimeOptions = $endTimeField.find(\"option\");\r\n $startTimeField.trigger(\"change\");\r\n }", "title": "" }, { "docid": "19cd0b762f6f2d959d23c47713feed59", "score": "0.54283375", "text": "function fillCalendar(data) {\n \n var backgroundColor = '';\n \n $.each(data, (index, item) => {\n backgroundColor = getRandomColor();\n\n start_time = item.start_time.split(':');\n start_hor = start_time[0];\n start_min = start_time[1];\n\n end_time = item.end_time.split(':');\n end_hor = end_time[0];\n end_min = end_time[1];\n\n start_date = new Date(item.start_date);\n start_d = start_date.getDate();\n start_m = start_date.getMonth()+1;\n start_y = start_date.getFullYear();\n\n end_date = new Date(item.end_date);\n end_d = end_date.getDate();\n end_m = end_date.getMonth()+1;\n end_y = end_date.getFullYear();\n\n /*In case of recurring event*/\n if(item.recurring == 1) { \n\n var aDay = 24 * 60 * 60 * 1000,\n range = { // your range\n start : start_date, // remember month is 0 based\n end : end_date\n },\n ranges = [];\n\n for (var i = range.start.getTime(), end = range.end.getTime(); i <= end;) {\n var first = new Date(i);\n var last = new Date(first.getFullYear(), first.getMonth() + 1, 0); // last day of the month\n if(item.recurring_type == 'every_week') {\n // in case of repetition every week\n ranges.push({\n start: moment(formatDate(first),'YYYY-MM-DD'),\n end: moment(formatDate(last),'YYYY-MM-DD').endOf('month'),\n })\n } else if(item.recurring_type == 'first_week') {\n // 1 to 7\n var cus_date_start = new Date(first.getFullYear(), first.getMonth(), 1);\n var cus_date_end = new Date(first.getFullYear(), first.getMonth(), 7);\n if( cus_date_start.getDate() >= first.getDate() && cus_date_end.getDate() <= last.getDate() ) {\n ranges.push({\n start: moment(formatDate(cus_date_start),'YYYY-MM-DD'),\n end: moment(formatDate(cus_date_end),'YYYY-MM-DD'),\n })\n }\n } else if(item.recurring_type == 'second_week') {\n // 8 to 14\n var cus_date_start = new Date(first.getFullYear(), first.getMonth(), 8);\n var cus_date_end = new Date(first.getFullYear(), first.getMonth(), 14);\n if( cus_date_start.getDate() >= first.getDate() && cus_date_end.getDate() <= last.getDate() ) {\n ranges.push({\n start: moment(formatDate(cus_date_start),'YYYY-MM-DD'),\n end: moment(formatDate(cus_date_end),'YYYY-MM-DD'),\n })\n }\n } else if(item.recurring_type == 'third_week') {\n // 15 to 21\n var cus_date_start = new Date(first.getFullYear(), first.getMonth(), 15);\n var cus_date_end = new Date(first.getFullYear(), first.getMonth(), 21);\n if( cus_date_start.getDate() >= first.getDate() && cus_date_end.getDate() <= last.getDate() ) {\n ranges.push({\n start: moment(formatDate(cus_date_start),'YYYY-MM-DD'),\n end: moment(formatDate(cus_date_end),'YYYY-MM-DD'),\n })\n }\n } else {\n // 22 to end\n var cus_date_start = new Date(first.getFullYear(), first.getMonth(), 22);\n \n ranges.push({\n start: moment(formatDate(cus_date_start),'YYYY-MM-DD'),\n end: moment(formatDate(last),'YYYY-MM-DD').endOf('month'),\n })\n }\n\n i = last.getTime() + aDay;\n }\n events_e.push({\n id : item.id,\n title : item.title.textCapitalize(),\n start : item.start_time,\n end : item.end_time,\n dow : JSON.parse(item.weekdays),\n ranges : ranges,\n backgroundColor : backgroundColor,\n borderColor : backgroundColor\n }); \n } else {\n start_date = new Date(item.start_date);\n start_d = start_date.getDate();\n start_m = start_date.getMonth(); // dont increase month by 1 in case of data from server\n start_y = start_date.getFullYear();\n \n end_date = new Date(item.end_date);\n end_d = end_date.getDate();\n end_m = end_date.getMonth(); // dont increase month by 1 in case of data from server\n end_y = end_date.getFullYear();\n\n events_e.push({\n id : item.id,\n title : item.title.textCapitalize(),\n start : new Date(start_y, start_m, start_d, start_hor, start_min),\n end : new Date(start_y, start_m, start_d, end_hor, end_min),\n backgroundColor : backgroundColor,\n borderColor : backgroundColor\n }); \n }\n \n });\n\n var cal_default_date_set = '';\n if(events_e.length === 0) {\n // if there's no batches\n cal_default_date_set = new Date();\n } else {\n // set the very first batch date\n // skip recurring event date\n $.each(events_e, (index, item) => {\n if(typeof(item.dow) === \"undefined\") {\n cal_default_date_set = item.start;\n return false;\n } \n });\n\n if(!cal_default_date_set) {\n cal_default_date_set = new Date();\n }\n }\n\n $('#calendar').fullCalendar({\n themeSystem: 'bootstrap3',\n header: {\n left: 'prev,next today',\n center: 'title',\n right: 'month,agendaWeek,listMonth'\n },\n defaultDate: new Date(),\n navLinks: true, // can click day/week names to navigate views\n eventLimit: true, // allow \"more\" link when too many events\n selectable: true,\n selectHelper: true,\n height: 600,\n editable: false,\n fixedWeekCount: false,\n titleRangeSeparator: ' \\u2014 ',\n viewRender: function(currentView) {\n // disable older and blank months where events are concerned\n var minDate = moment(),\n maxDate = moment(events_ori[(events_ori.length-1)].end_date);\n // Past\n if (minDate >= currentView.start && minDate <= currentView.end) {\n $(\".fc-prev-button\").prop('disabled', true); \n $(\".fc-prev-button\").addClass('fc-state-disabled'); \n }\n else {\n $(\".fc-prev-button\").removeClass('fc-state-disabled'); \n $(\".fc-prev-button\").prop('disabled', false); \n }\n },\n eventClick: function(calEvent) {\n var todayDate = moment(),\n eventDate = calEvent.start;\n \n if (eventDate >= todayDate) {\n selectEvent(calEvent, data);\n swal({\n title: \"{{alert_yeah}}\",\n text: \"{{e_bookings_selected_event}}\",\n timer: 2000,\n type: 'success',\n showConfirmButton: true,\n html: true,\n }); \n\n var y = $(window).scrollTop(); //your current y position on the page\n $(window).scrollTop(y+850);\n }\n else {\n // disable older and blank months where events are concerned \n swal({\n title: \"{{alert_oops}}\",\n text: \"{{e_bookings_booking_older_date}}\",\n timer: 2000,\n type: 'error',\n showConfirmButton: true,\n html: true,\n });\n }\n \n },\n eventRender: function(event, element, view){\n if(typeof event.ranges !== 'undefined') {\n return (event.ranges.filter(function(range){\n return (event.start.isBefore(range.end) &&\n event.end.isAfter(range.start));\n }).length)>0; \n }\n },\n events: function( start, end, timezone, callback ){\n var events = getEvents(start,end); //this should be a JSON request\n callback(events);\n },\n events: events_e,\n });\n}", "title": "" }, { "docid": "e117de3c7e281dfb6ee07dd815f4bb9d", "score": "0.54264146", "text": "collectDatesAvailable() {\n // eslint-disable-next-line no-restricted-syntax\n for (const date in this.bookedSlotsForFutureDates.appointment_info) {\n if (\n this.bookedSlotsForFutureDates.appointment_info[date].length ===\n this.timeSlots.length\n ) {\n this.datesNotAvailable.push(new Date(date).toLocaleDateString('en-CA'));\n }\n }\n this.loadDateTime = true;\n }", "title": "" }, { "docid": "14e421592cf325d8bd1ac6a688f2b3bc", "score": "0.542605", "text": "function createSlotSchedule(slot, container) {\r\n const div = document.createElement(\"div\"); // create the rectangular box\r\n div.classList.add(\"schedule\");\r\n div.classList.add(\"schedule-item\");\r\n \r\n const firstSpanWrapper = document.createElement(\"span\"); // first span contains the header (which slot is taken)\r\n const h4 = document.createElement(\"h4\");\r\n h4.textContent = \"Паркомясто: \" + slot[\"zone\"] + slot[\"code\"]; // for example: \"Паркомясто: B7\"\r\n firstSpanWrapper.appendChild(h4);\r\n \r\n const secondSpanWrapper = document.createElement(\"span\"); // second span contains information about the taken slot (when and for what interval)\r\n const p = document.createElement(\"p\");\r\n p.textContent = slot[\"date\"] + \", \" + slot[\"start_time\"] + \"—\" + slot[\"end_time\"]; // for example: \"2021-06-24, 15:00-17:00\"\r\n secondSpanWrapper.appendChild(p);\r\n \r\n // append both spans to the div element (the rectangular box)\r\n div.appendChild(firstSpanWrapper);\r\n div.appendChild(secondSpanWrapper);\r\n \r\n // append the rectangular box (which contains information about the given reserved slot) to the container element\r\n container.appendChild(div);\r\n }", "title": "" }, { "docid": "cc91250b55033dc76af35ebeb9204514", "score": "0.5421341", "text": "function buildTimetable(data, schedule) {\n var startTime;\n var endTime;\n var day;\n var days;\n var time;\n var conflict;\n var timeslots;\n\n // Iterate through the meeting sections\n for (let i = 0; i < data.meeting_sections.length; i++) {\n days = [];\n timeslots = [];\n\n // Iterate through a meeting section's timeslots\n conflict = false;\n startTime = 0;\n endTime = 0;\n for (let k = 0; k < data.meeting_sections[i].times.length; k++) {\n\n // If there is a conflict\n if (conflict == true) {\n break;\n }\n\n // Convert timeslots to numbers\n startTime = data.meeting_sections[i].times[k].start;\n endTime = data.meeting_sections[i].times[k].end;\n endTime /= 3600;\n startTime /= 3600;\n startTime += convertDayToNum(data.meeting_sections[i].times[k].day);\n endTime += convertDayToNum(data.meeting_sections[i].times[k].day);\n timeslots.push([startTime, endTime]);\n\n // Convert timeslots for front end\n day = abbreviateDay(data.meeting_sections[i].times[k].day);\n time = data.meeting_sections[i].times[k].start / 3600;\n days.push([day, time]);\n\n // Iterate through the selected courses to check for conflicts\n for (let m = 0; m < schedule.length; m++) {\n // If there is a conflict\n for (let j = 0; j < schedule[m].timeslots.length; j++) {\n if (startTime >= schedule[m].timeslots[j][0] && startTime <= schedule[m].timeslots[j][1]) {\n conflict = true;\n break;\n }\n }\n if (conflict == true) {\n break;\n }\n }\n }\n\n if (conflict == false) {\n schedule.push({ \"code\": data.code, \"name\": data.name, \"instructor\": data.meeting_sections[i].instructors, \"days\": days, \"timeslots\": timeslots, \"colour\": \"\", duration: data.meeting_sections[i].times[0].duration, location: data.meeting_sections[i].times[0].location });\n return schedule;\n }\n }\n return null;\n}", "title": "" }, { "docid": "8b37baea31448784de9c578f87edde4e", "score": "0.54207087", "text": "function searchForAppointments() {\n const date = document.appt_request_form.date.value;\n const duration = document.appt_request_form.duration_dropdown.value;\n // first validate the date and duration are appropriate\n if (!passesValidation(date, duration)) {\n return false;\n }\n\n // construct the HTTPRequest message\n message = `{\"foo\":\"get_available_appointments\", \"date\":\"${date}\", \"duration\":\"${duration}\"}`;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\n var info = JSON.parse(this.responseText);\n console.log(info);\n if (info.error != 1) {\n // First, format the date to be displayed\n var parts = date.split(\"-\");\n const day = parseInt(parts[2], 10);\n const month = parseInt(parts[1], 10);\n const year = parseInt(parts[0], 10);\n const formattedDate = \"\" + month + \"/\" + day + \"/\" + year;\n\n // if the day is unavailable (\"closed\"), display a special message to the user\n if (info.dayUnavailable == 1) {\n document.getElementById(\"closed_container\").style.display = \"flex\";\n document.getElementById(\"available_times_container\").style.visibility = \"hidden\";\n document.getElementById(\"closed_date\").innerHTML = formattedDate;\n\n return false;\n } else {\n document.getElementById(\"closed_container\").style.display = \"none\";\n document.getElementById(\"available_times_container\").style.visibility = \"visible\";\n }\n\n // get reference to container in which to display buttons\n const timesContainer = document.getElementById(\"display_available_container\");\n timesContainer.innerHTML = \"\";\n var i = 0\n // for each possible time\n for (i = 0; i < info.times.length; i++) {\n // format the start and end time\n var appStart = info.times[i][0];\n var startSuffix = \"am\";\n var appEnd = info.times[i][1];\n var endSuffix = \"am\";\n\n var timeParts = appStart.split(\":\");\n var startHour = parseInt(timeParts[0], 10);\n var startMin = parseInt(timeParts[1], 10);\n\n if (startHour >= 12) {\n startHour -= 12;\n startSuffix = \"pm\";\n }\n if (startHour == 0) {\n startHour = 12;\n }\n\n timeParts = appEnd.split(\":\");\n var endHour = parseInt(timeParts[0], 10);\n var endMin = parseInt(timeParts[1], 10);\n\n if (endHour >= 12) {\n endHour -= 12;\n endSuffix = \"pm\";\n }\n if (endHour == 0) {\n endHour = 12;\n }\n\n startHour = startHour.toString();\n startMin = startMin.toString().padStart(2, \"0\");\n endHour = endHour.toString();\n endMin = endMin.toString().padStart(2, \"0\");\n\n // construct a new button for this time that the user can select\n timesContainer.innerHTML += `<div class=\"col\" style=\"width:30%\"><button type=\"button\" id=\"timeSlot-${i}\" class=\"btn btn-info appointment-time\" onclick=\"confirmAppointment(${i})\" style=\"width:100%;\">${startHour}:${startMin}${startSuffix} - ${endHour}:${endMin}${endSuffix}</button></div>`;\n // after every three columns, break to a new line with this DOM element\n if ((i+1) % 3 == 0){\n timesContainer.innerHTML +=`\n\t\t\t\t\t\t<div class=\"w-100\"></div>`;\n }\n\n // store the information for this time in the display_available_container element\n $(\"#display_available_container\").data(\"start\" + i, info.times[i][0]);\n $(\"#display_available_container\").data(\"end\" + i, info.times[i][1]);\n $(\"#display_available_container\").data(\"startFormatted\" + i, \"\" + startHour + \":\" + startMin + \"\" + startSuffix);\n $(\"#display_available_container\").data(\"endFormatted\" + i, \"\" + endHour + \":\" + endMin + \"\" + endSuffix);\n $(\"#display_available_container\").data(\"dateFormatted\" + i, formattedDate);\n $(\"#display_available_container\").data(\"date\" + i, date);\n }\n // ensure formatting is correct by adding any (empty) columns to result in a multiple of three columns\n while ((i + 1) % 3 != 1) {\n timesContainer.innerHTML +=`\n <div class=\"col\" style=\"hidden\"></div>`;\n i++;\n }\n // add all the HTML\n document.getElementById(\"number-available\").innerHTML = info.times.length;\n // return false to stay on the page without refreshing\n return false;\n\n } else {\n // alert the user if anything went wrong\n alert(\"Unknown server-side error (fetching appointment durations).\");\n }\n }\n }\n xmlhttp.open(\"POST\", \"../../Backend/scheduling.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", 'application/json; charset=UTF-8');\n xmlhttp.send(message);\n return false;\n}", "title": "" }, { "docid": "c2c784fd0d6fb0f975f19605a5bf143d", "score": "0.53870887", "text": "function enableCalenderCustomer() {\n document.getElementById(\"appointment_date\").disabled=false;\n document.getElementById(\"time_slots\").disabled=true;\n var tmrrw = new Date();\n var dd = tmrrw.getDate()+1;\n var mm = tmrrw.getMonth()+1; //January is 0!\n var yyyy = tmrrw.getFullYear();\n if(dd<10){\n dd='0'+dd\n }\n if(mm<10){\n mm='0'+mm\n }\n\n tmrrw = yyyy+'-'+mm+'-'+dd;\n document.getElementById(\"appointment_date\").value=\"\";\n document.getElementById(\"appointment_date\").setAttribute(\"min\", tmrrw);\n}", "title": "" }, { "docid": "f2082e3366266ccd11f0fd41f20128f1", "score": "0.53340924", "text": "getSlotsInfoDict() {\n // 13 time slots per day\n const firstSlotTime = 9;\n const lastSlotTime = 21;\n\n var slotsInfoDict = {};\n \n // initialise slotsInfoDict; each key has an empty array (of slots)\n for (var slotTime = firstSlotTime; slotTime <= lastSlotTime; slotTime++) {\n slotsInfoDict[slotTime] = [];\n }\n\n // create ScheduleCells that correspond to each timeslot of the day\n this.props.timeslots.forEach(timeslot => {\n const startDateTimeStr = new Date(timeslot.startDateTime).toLocaleTimeString();\n const endDateTimeStr = new Date(timeslot.endDateTime).toLocaleTimeString();\n\n // start and end time (e.g., 9, 10, 13, etc)\n const startTimeHour = parseInt(startDateTimeStr.slice(0, 2));\n const endTimeHour = parseInt(endDateTimeStr.slice(0, 2));\n\n // date of the slot\n const dateStr = new Date(timeslot.startDateTime).toLocaleDateString();\n\n slotsInfoDict[startTimeHour].push({\n key: timeslot.id,\n scheduleId: timeslot.id,\n startTime: startTimeHour,\n endTime: endTimeHour,\n date: dateStr,\n businessId: timeslot.businessId,\n isAvailable: true,\n workerId: timeslot.workerId\n })\n })\n\n return slotsInfoDict;\n }", "title": "" }, { "docid": "d19ec83fe20cc20471d9395eb89e506a", "score": "0.532879", "text": "function getRange(date) {\n var firstDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1),\n difference = vm.startingDayMonth - firstDayOfMonth.getDay(), // vm.startingDayMonth = 1 (Monday) .getDay() = 0 (SUN) 1 (MON) 2 (TSU) ...\n numDisplayedFromPreviousMonth = (difference > 0) ? 7 - difference : -difference, // number of days to display from previous month\n startDate = new Date(firstDayOfMonth),\n endDate;\n\n if (numDisplayedFromPreviousMonth > 0) {\n startDate.setDate(-numDisplayedFromPreviousMonth + 1);\n }\n\n endDate = new Date(startDate);\n endDate.setDate(endDate.getDate() + 42);\n\n return {\n startTime: startDate,\n endTime: endDate\n };\n }", "title": "" }, { "docid": "43404b5cb8f19297f53a045e2f57d466", "score": "0.5319677", "text": "function getFreeTime(userConfig, startDateStr, endDateStr) {\n /* TODO: add logic to get meetings for the day. */\n var schedule = { start: { h: 9, m: 0 },\n lunch: { start: { h: 12, m: 0 },\n end: { h: 13, m: 0 } },\n end: { h: 18, m: 0 } },\n currentTime = null,\n timeSlots = [],\n dates = [],\n startDate, endDate;\n\n if (startDateStr == null) {\n startDate = new Date();\n } else {\n startDate = new Date(startDateStr);\n currentTime = { h: startDate.getHours(), m: startDate.getMinutes() };\n }\n if (endDateStr == null) endDate = new Date();\n else endDate = new Date(endDateStr);\n\n if (startDate.getHours() > schedule.end.h || startDate.getHours()==0) startDate = date.addDays(startDate, 1);\n\n if (userConfig.workSchedule!=undefined) schedule = userConfig.workSchedule;\n dates = getDates(startDate, endDate);\n\n dates.forEach(function(d, i){\n var tslot = null, start = schedule.start;\n if (i==0 && currentTime &&\n ( currentTime.h>schedule.start.h ||\n ( currentTime.h==schedule.start.h &&\n currentTime.m>schedule.start.m )) &&\n currentTime.h < schedule.end.h){\n start = currentTime;\n }\n\n if (schedule.lunch!=undefined) {\n tslot = getTimeSlot(d, start, schedule.lunch.start);\n var lunchslot = getTimeSlot(d, schedule.lunch.start, schedule.lunch.end);\n if (tslot.start < lunchslot.start) {\n tslot.type = \"free\";\n timeSlots.push(tslot);\n start = schedule.lunch.end;\n } else if (tslot.start < lunchslot.end) {\n start = schedule.lunch.end;\n }\n tslot = getTimeSlot(d, schedule.lunch.start, schedule.lunch.end);\n tslot.type = \"lunch\";\n tslot.title = \"Lunch\";\n timeSlots.push(tslot);\n tslot = getTimeSlot(d, start, schedule.end);\n tslot.type = \"free\";\n timeSlots.push(tslot);\n } else {\n tslot = getTimeSlot(d, start, schedule.endDateStr);\n tslot.type = \"free\";\n timeSlots.push(tslot);\n }\n });\n\n return timeSlots;\n}", "title": "" }, { "docid": "7f696831ce2df3c8655d410875847fc1", "score": "0.5318624", "text": "function _Appointment() {\r\n\t\t/**\r\n\t\t * Get all appointments in a specified time of the user logged in.\r\n\t\t * \r\n\t\t * @param\t{int}\t\tsTime\r\n\t\t * Starttime of the series.\r\n\t\t * @param\t{int}\t\teTime\r\n\t\t * Endtime of the series.\r\n\t\t * @param\t{function}\tcallback\r\n\t\t * Callback to be run after the data is provided.\r\n\t\t */\r\n\t\tthis.fetchAll = function(fetchAfterDate, fetchBeforeDate, callback) {\r\n\t\t\tvar _callback = {\r\n\t\t\t\tsuccess:\tfunction(data) {\r\n\t\t\t\t\tfor(var i = 0; i < data.length; i++) {\r\n\t\t\t\t\t\tdata[i] = JSON.parse(data[i]);\r\n\t\t\t\t\t\tdata[i].starttime = new Date(data[i].starttime);\r\n\t\t\t\t\t\tdata[i].endtime = new Date(data[i].endtime);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdata.sort(function(a, b) {\r\n\t\t\t\t\t\tif(a.starttime.getTime() == b.starttime.getTime()) {\r\n\t\t\t\t\t\t\treturn a.endtime.getTime() > b.endtime.getTime()\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn a.starttime.getTime() > b.starttime.getTime();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\tcallback(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar _request = {\r\n\t\t\t\tfetch_after_date:\tfetchAfterDate,\r\n\t\t\t\tfetch_before_date:\tfetchBeforeDate,\r\n\t\t\t\tcalendar: \t\t\t1\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t_this.Helper.getJsonData('/calendar/appointment/list/', _request, _callback);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Get a single exception.\r\n\t\t * \r\n\t\t * @param\t{int}\tseriesId\r\n\t\t * Id of the exception to fetch.\r\n\t\t * @param\t{int}\toccurence\r\n\t\t * The number of the occurence of the exception.\r\n\t\t */\r\n\t\tthis.show = function(appointmentId) {\r\n\t\t\tvar title\t= 'Show appointment';\r\n\r\n\t\t\tvar callback = function(parent) {\r\n\t\t\t\t_this.Helper.getForm('/calendar/appointment/view/' + appointmentId, parent, function() {\r\n\t\t\t\t\tsetTimeout(_this.View.show, 500);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t_this.Overlay.show(title, null, callback);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Get a single exception.\r\n\t\t * \r\n\t\t * @param\t{int}\tseriesId\r\n\t\t * Id of the exception to fetch.\r\n\t\t * @param\t{int}\toccurence\r\n\t\t * The number of the occurence of the exception.\r\n\t\t */\r\n\t\tthis.edit = function(appointmentId) {\r\n\t\t\tvar title\t= 'Edit appointment';\r\n\r\n\t\t\tvar callback = function(parent) {\r\n\t\t\t\t_this.Helper.getForm('/calendar/appointment/update/' + appointmentId, parent, function() {\r\n\t\t\t\t\tsetTimeout(_this.View.show, 500);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t_this.Overlay.show(title, null, callback);\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * Create a new exception.\r\n\t\t * \r\n\t\t * @param\t{int}\tseriesId\r\n\t\t * Id of the series of the exception.\r\n\t\t * @param\t{int}\toccurence\r\n\t\t * Occurence of the exception in the series.\r\n\t\t * @param\t{int}\tsTime\r\n\t\t * The starttime of the exception as UNIX timestamp.\r\n\t\t * @param\t{int}\teTime\r\n\t\t * The endtime of the exception of the series.\r\n\t\t * @param\t{int}\tnotes\r\n\t\t * Additional notes for the exception.\r\n\t\t */\r\n\t\tthis.create = function() {\r\n\t\t\tvar title\t= 'Create appointment';\r\n\r\n\t\t\tvar callback = function(parent) {\r\n\t\t\t\t_this.Helper.getForm('/calendar/appointment/create/', parent, function() {\r\n\t\t\t\t\tsetTimeout(_this.View.show, 500);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t_this.Overlay.show(title, null, callback);\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * Delete an exception.\r\n\t\t * \r\n\t\t * @param\t{int}\tseriesId\r\n\t\t * Id of the series the exception belongs to.\r\n\t\t * @param\t{int}\toccurence\r\n\t\t * Occurence of the exception in the series.\r\n\t\t */\r\n\t\tthis.deleteApp = function(appointmentId) {\r\n\t\t\tvar title\t= 'Delete appointment';\r\n\r\n\t\t\tvar callback = function(parent) {\r\n\t\t\t\t_this.Helper.getForm('/calendar/appointment/delete/' + appointmentId, parent, function() {\r\n\t\t\t\t\tsetTimeout(_this.View.show, 500);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t_this.Overlay.show(title, null, callback);\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "b0ef627dd4acbd04647503aa422a1593", "score": "0.5310533", "text": "get_all_slots(year, month){\n\t\ttry{\n\t\t\t// Return var\n\t\t\tvar ret = [];\n\t\t\t// Get total days of the month\n\t\t\tvar total_days = new Date(year, month, 0).getDate();\n\t\t\t// Array with all possible slots\n\t\t\tvar all_slots = [];\n\t\t\tfor (var i=0; i < total_days; i++){\n\t\t\t\t// Var to get the day as string type\n\t\t\t\tvar aux = (\"0\" + (i + 1)).slice(-2)\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T09:00:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T09:45:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T10:30:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T11:15:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T12:00:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T12:45:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T13:30:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T14:15:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T15:00:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T15:45:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T16:30:00Z');\n\t\t\t\tall_slots.push(year + '-' + month + '-' + aux + 'T17:15:00Z');\n\t\t\t}\n\t\t\tret = [all_slots, total_days];\n\t\t}\n\t\tcatch(error){\n\t\t\tthrow error;\n\t\t}\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "e8bae364ecf2a4b85a6faeb8459d30dc", "score": "0.52931255", "text": "function enableCalenderReceptionist() {\n document.getElementById(\"appointment_date\").disabled=false;\n document.getElementById(\"time_slots\").disabled=true;\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1; //January is 0!\n var yyyy = today.getFullYear();\n if(dd<10){\n dd='0'+dd\n }\n if(mm<10){\n mm='0'+mm\n }\n\n today = yyyy+'-'+mm+'-'+dd;\n document.getElementById(\"appointment_date\").value=\"\";\n document.getElementById(\"appointment_date\").setAttribute(\"min\", today);\n}", "title": "" }, { "docid": "20766eceee0bb4b2427be6f952fe84bf", "score": "0.527291", "text": "async function createSchedule(userId, startDateStr=null, endDateStr=null) {\n var userConfig = await getPreferences(userId);\n\n var pomodoroSize = userConfig.pomodoroSize,\n shortBreakSize = userConfig.shortBreakSize,\n longBreakSize = userConfig.longBreakSize,\n freeTime = getFreeTime(userConfig, startDateStr, endDateStr),\n availPomodoros = getNumOfPomodoroSlots(pomodoroSize, shortBreakSize, longBreakSize, freeTime),\n projects = await getProjects(userId),\n schedule = [],\n tasks = [],\n taskCount = 0,\n startDateObj = new Date(startDateStr);\n\n for (const project of projects) {\n var numOfTasks = Math.round(project.weight/100*availPomodoros.total);\n var retTasks = await getTasks(userId, project.projectId, numOfTasks);\n tasks = tasks.concat( retTasks );\n }\n\n availPomodoros.slots.forEach(function(timeslot, n) {\n var start_time = timeslot.start,\n tasksForSlot = tasks.slice(0, timeslot.count);\n tasks = tasks.slice(timeslot.count);\n\n if( n==0 && startDateObj > start_time ) {\n start_time = startDateObj;\n }\n\n if (timeslot.type !== 'free') {\n if (timeslot.type==\"lunch\") taskCount = 0;\n\n timeslot.start = timeslot.start.toISOString();\n timeslot.end = timeslot.end.toISOString();\n schedule.push(timeslot);\n return;\n }\n\n tasksForSlot.forEach(function(task){\n var end_time = date.addMinutes(start_time, pomodoroSize);\n schedule.push({\n title: task.taskName,\n desc: task.taskDescription,\n start: start_time.toISOString(),\n end: end_time.toISOString(),\n taskId: task.taskId,\n type: 'task',\n projectId: task.projectId\n });\n start_time = date.addMinutes(end_time, 0);\n if (taskCount<3) {\n end_time = date.addMinutes(start_time, shortBreakSize);\n /*\n schedule.push({\n title: 'Short Break',\n descr: 'Time to take a short break',\n start: start_time.toISOString(),\n end: end_time.toISOString(),\n type: 'break'\n });\n */\n taskCount++;\n } else {\n end_time = date.addMinutes(start_time, longBreakSize)\n /*\n schedule.push({\n title: 'Long Break',\n descr: 'Time to take a long break',\n start: start_time.toISOString(),\n end: end_time.toISOString(),\n type: 'break'\n });\n */\n taskCount=0;\n }\n start_time = end_time;\n });\n });\n pushScheduleToDb(userId, schedule);\n return schedule;\n}", "title": "" }, { "docid": "3d607dcb6a47736d0842da0e6ce23130", "score": "0.5270924", "text": "function eventInfo(eventList){\n var array = [];\n var length = eventList.length;\n var max = 5;\n for(var i = 1; i <= max; i++){\n var a = length -i;\n if(a >= 0){\n var dateString = eventList[a].date;\n var startDate = new Date().setHours(0);\n startDate = new Date(startDate).setMinutes(0);\n startDate = new Date(startDate).setMilliseconds(0);\n console.log(new Date(startDate));\n var endDate = new Date(new Date(startDate).getTime() + (7 * 24 * 60 * 60 * 1000));\n var arr = eventList[a].date.split(\".\");\n var date = new Date(arr[2], (arr[1]-1), arr[0])\n date = date.setMinutes(5);\n console.log(date);\n if(startDate <= date && endDate.getTime() >= date){\n var string = dateString+\" \"+eventList[a].title+\"\\n\";\n if(eventList[a].startTime != undefined) string += eventList[a].startTime;\n if(eventList[a].endTime != undefined) string += \"-\"+eventList[a].endTime;\n if(eventList[a].tag != undefined) string += \" - tag: \"+eventList[a].tag;\n if(eventList[a].link != undefined && eventList[a].link != \"\") string += \"\\nTo subscribe to this event please klick <\"+eventList[a].link+\"|here>\";\n array.push(interCompo.dropdownAtta(\n string,\n \"NO\", \"schedule_nofification_art_selection\", null\n ));\n } else {\n max++;\n }\n }\n }\n return array;\n}", "title": "" }, { "docid": "8b25711297f75fea68837bbc986db136", "score": "0.5262441", "text": "setFromSlots(timeSlot) {\n return ;\n if (!timeSlot)\n return ;\n }", "title": "" }, { "docid": "1498e778088141e6d257e747732ea7ec", "score": "0.52600884", "text": "async function showAppointments(req, res) {\n console.log(\"is doctor: \", req.session.currentUser.isDoctor);\n\n let appointments, upcomingAppointments = [], pastAppointments = [];\n\n if (req.session.currentUser.isDoctor) {\n appointments = await Appointment.find({\n \"slot.0.doctor.id\": req.session.currentUser._id\n }).sort({ \"slot.0.date\": -1 });\n // console.log(\"doc appoi: \", appointments);\n }\n else if (!req.session.currentUser.isDoctor) {\n appointments = await Appointment.find({\n user: req.session.currentUser._id\n });\n }\n appointments.forEach(appointment => {\n let boolean = verifySlotDateAndStartTime(appointment.slot[0].date, appointment.slot[0].startTime);\n if (boolean)\n upcomingAppointments.push(appointment);\n else\n pastAppointments.push(appointment);\n });\n res.render(\"appointments\", {\n upcomingAppointments: upcomingAppointments,\n pastAppointments: pastAppointments\n });\n}", "title": "" }, { "docid": "7109819184110ee9dc6902ad2e8e0cfb", "score": "0.5254183", "text": "function loadAppointments(dateString)\n{\n\tvar AppointmentList = new Array();\n\n\tvar resultBDO = doActionBDO('SVC_GET_APPOINTMENTS', 'Date', dateString);\n\t//writebr(\"resultBDO.Count=\" + resultBDO.Count);\n\n\tlocal_AppointmentCount= resultBDO.Count;\n\tfor (var i=0; i < local_AppointmentCount; i++)\n\t\tAppointmentList[i] = new Appointment(i, \"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\");\n\n\t// Now set needed values\n\tif (resultBDO.Count)\n\t{\n\t\tvar BDORows = resultBDO.GetLabels('APPT');\n\t\tBDORows.sort();\n\n\t\tfor (var i = 0; i < BDORows.length; i++)\n\t\t{\n\t\t\tvar apptBDO = eval(\"resultBDO.\" + PadLeft('APPT',i+1));\n\t\t\tif (apptBDO)\n\t\t\t{\n\t\t\t\tAppointmentList[i].ID = apptBDO.ID;\n\t\t\t\tAppointmentList[i].ServiceID = apptBDO.ServiceID;\n\t\t\t\tAppointmentList[i].Status = apptBDO.Status;\n\t\t\t\tAppointmentList[i].ApptDate = apptBDO.ApptDate;\n\t\t\t\tAppointmentList[i].StartHour = apptBDO.StartHour;\n\t\t\t\tAppointmentList[i].StartMin = apptBDO.StartMin;\n\t\t\t\tAppointmentList[i].StartAMPM = apptBDO.StartAMPM;\n\t\t\t\tAppointmentList[i].Duration = apptBDO.Duration;\n\t\t\t\tAppointmentList[i].Name = apptBDO.Name;\n\t\t\t\tAppointmentList[i].Address1 = apptBDO.Address1;\n\t\t\t\tAppointmentList[i].Address2 = apptBDO.Address2;\n\t\t\t\tAppointmentList[i].City = apptBDO.City;\n\t\t\t\tAppointmentList[i].State = apptBDO.State;\n\t\t\t\tAppointmentList[i].Zip = apptBDO.Zip;\n\t\t\t\tAppointmentList[i].Email = apptBDO.Email;\n\t\t\t\tAppointmentList[i].Phone = apptBDO.Phone;\n\t\t\t\tAppointmentList[i].Comments = apptBDO.Comments;\n\n//write(\"id=\",apptBDO.ID,\" ServiceID=\",apptBDO.ServiceID,\" Status=\",apptBDO.Status,\" Date=\",apptBDO.ApptDate,\" StartHour=\",apptBDO.StartHour,\":\",apptBDO.StartMin,apptBDO.StartAMPM,\" Dur=\",apptBDO.Duration);\n//writebr(\" Name=\",apptBDO.Name,\" Ad1=\",apptBDO.Address1,\" 2=\",apptBDO.Address2,\" City=\",apptBDO.City,\" state=\",apptBDO.State,\" zip=\",apptBDO.Zip);\n\n\t\t\t}\n\t\t}\n\t}\n\tAppointmentList.sort(apptObjSortByTime);\n\treturn AppointmentList;\n}", "title": "" }, { "docid": "9b97f5b892fe49c1f0586f574667d79f", "score": "0.5252333", "text": "function okButtonClicked() {\n // Update schedule name\n var schedule = document.getElementById(\"schedule_name\").value;\n var start = document.getElementById(\"start\").value;\n var end = document.getElementById(\"end\").value;\n\n var formattedstart = \"\"\n if (start.length === 7) {\n formattedstart = \"0\" + start;\n } else {\n formattedstart = start;\n }\n var formattedend = \"\"\n if (end.length === 7) {\n formattedend = \"0\" + end;\n } else {\n formattedend = end;\n }\n\n // Update start time\n\n if (start.length === 7) {\n start = \"0\" + start;\n }\n if (start.includes(\"AM\")) {\n if (start.substring(0, 2) === \"12\") {\n start = \"2017-12-20 00\" + start.substring(2, 5) + \":00\"\n } else {\n start = \"2017-12-20 \" + start.substring(0, 5) + \":00\"\n }\n } else {\n if (start.substring(0, 2) === \"12\") {\n start = \"2017-12-20 \" + start.substring(0, 5) + \":00\"\n } else {\n start = \"2017-12-20 \" + (Number(start.substring(0, 2)) + 12).toString() + start.substring(2, 5) + \":00\"\n }\n }\n\n\n // Update end time\n\n if (end.length === 7) {\n end = \"0\" + end;\n }\n if (end.includes(\"AM\")) {\n if (end.substring(0, 2) === \"12\") {\n end = \"2017-12-21 00\" + end.substring(2, 5) + \":00\"\n } else {\n end = \"2017-12-20 \" + end.substring(0, 5) + \":00\"\n }\n } else {\n if (end.substring(0, 2) === \"12\") {\n end = \"2017-12-20 \" + end.substring(0, 5) + \":00\"\n } else {\n end = \"2017-12-20 \" + (Number(end.substring(0, 2)) + 12).toString() + end.substring(2, 5) + \":00\"\n }\n }\n\n // Checking conflicts\n var hasConflict = false;\n var conflictedEvents = [];\n var plugload_option = document.querySelectorAll('input[name=\"Plug Loads\"]:checked');\n var repeat_option = document.querySelector('input[name=\"Repeat:\"]:checked').value;\n var days_to_loop_over = [\"2017-12-20\"]\n if (repeat_option === \"Every Day\") {\n days_to_loop_over = ['2017-12-18', '2017-12-19', '2017-12-20', '2017-12-21', '2017-12-22', '2017-12-23', '2017-12-24']\n }\n\n schedulerData.events.forEach(function(e) {\n var eStart = e.start;\n var eEnd = e.end;\n var start_for_this = \"\"\n var end_for_this = \"\"\n for (var day of days_to_loop_over) {\n start_for_this = day + start.substring(10, 19)\n end_for_this = day + end.substring(10, 19)\n if (e.resourceId === newEvent.resourceId) {\n if (((start_for_this >= eStart && start_for_this < eEnd) ||\n (end_for_this > eStart && end_for_this <= eEnd) ||\n (eStart >= start_for_this && eStart < end_for_this) ||\n (eEnd > start_for_this && eEnd <= end_for_this)) && (e.id !== newEvent.id)) {\n hasConflict = true;\n conflictedEvents.push(e)\n }\n }\n for (var plugload of plugload_option) {\n if (e.resourceId === plugload.value) {\n if ((start_for_this >= eStart && start_for_this < eEnd) ||\n (end_for_this > eStart && end_for_this <= eEnd) ||\n (eStart >= start_for_this && eStart < end_for_this) ||\n (eEnd > start_for_this && eEnd <= end_for_this)) {\n hasConflict = true;\n conflictedEvents.push(e);\n }\n }\n }\n }\n })\n\n // If there is a conflict, show alert and do nothing.\n if (hasConflict) {\n var message = \"Conflict occurred for the following events:\" // Change this message accordingly\n var day = \"\"\n for (var events of conflictedEvents) {\n if (newEvent.start.toString().includes(\"2017-12-18\")) {\n day = \"Monday\"\n }\n if (newEvent.start.toString().includes(\"2017-12-19\")) {\n day = \"Tuesday\"\n }\n if (newEvent.start.toString().includes(\"2017-12-20\")) {\n day = \"Wednesday\"\n }\n if (newEvent.start.toString().includes(\"2017-12-21\")) {\n day = \"Thursday\"\n }\n if (newEvent.start.toString().includes(\"2017-12-22\")) {\n day = \"Friday\"\n }\n if (newEvent.start.toString().includes(\"2017-12-23\")) {\n day = \"Saturday\"\n }\n if (newEvent.start.toString().includes(\"2017-12-24\")) {\n day = \"Sunday\"\n }\n var current_plugload_conflicted = schedulerData.getSlotById(events.resourceId).name\n message += `\\n- ${events.title} for ${current_plugload_conflicted} on ${day}`\n }\n alert(message)\n } else {\n newEvent.title = schedule + \" (\" + formattedstart + \" - \" + formattedend + \")\";\n schedulerData.updateEventStart(newEvent, start);\n schedulerData.updateEventEnd(newEvent, end);\n\n var rrule = \"\"\n if (repeat_option === \"Every Day\") {\n var updatedstart = \"2017-12-18\" + start.substring(10, 19)\n schedulerData.updateEventStart(newEvent, updatedstart)\n var updatedend = \"2017-12-18\" + end.substring(10, 19)\n schedulerData.updateEventEnd(newEvent, updatedend)\n newEvent.rrule=\"FREQ=DAILY;DTSTART=20171218T000000Z;UNTIL=20171224T235900Z\"\n rrule=\"FREQ=DAILY;DTSTART=20171218T000000Z;UNTIL=20171224T235900Z\"\n setTimeout(function() {document.getElementById(\"WednesdayCalendar\").click();},1)\n } else {\n if (newEvent.rrule === \"FREQ=DAILY;DTSTART=20171218T000000Z;UNTIL=20171224T235900Z\") {\n var name = newEvent.title;\n var new_start = newEvent.start\n var new_end = newEvent.end\n var new_slot = newEvent.resourceId\n schedulerData.removeEvent(newEvent);\n let anotherFreshId = 0;\n schedulerData.events.forEach(item => {\n if (item.id >= anotherFreshId) anotherFreshId = item.id + 1;\n });\n\n let anotherNewEvent = {\n id: anotherFreshId,\n title: name,\n start: new_start,\n end: new_end,\n resourceId: new_slot,\n bgColor: \"#06D6A0\",\n showPopover: false,\n rrule: \"\"\n };\n schedulerData.addEvent(anotherNewEvent);\n DemoData.events = schedulerData.events\n setTimeout(function(){document.getElementById(\"WednesdayCalendar\").click();},1)\n }}\n\n for (var plugload of plugload_option) {\n\n let newFreshId_plugload = 0;\n schedulerData.events.forEach(item => {\n if (item.id >= newFreshId_plugload) newFreshId_plugload = item.id + 1;\n });\n\n let newEvent_plugload = {\n id: newFreshId_plugload,\n title: newEvent.title,\n start: moment(start),\n end: moment(end),\n resourceId: plugload.value,\n bgColor: \"#06D6A0\",\n showPopover: false,\n rrule: rrule\n };\n schedulerData.addEvent(newEvent_plugload); // Check why new event disappears\n DemoData.events = schedulerData.events\n }\n\n if (start >= end || end <= start) {\n alert(\"Check your timings! Start time should be before end time.\")\n } else {\n // Update displayed calendar\n DemoData.events = schedulerData.events;\n window.wednesdayCalendar.setState({\n viewModel: schedulerData\n })\n }\n\n // Remove popup\n ReactDOM.unmountComponentAtNode(document.getElementById(\"popup-container-schedule\"));\n }\n }", "title": "" }, { "docid": "99b96f79806c8260646b98b83d5fed1c", "score": "0.52509344", "text": "function TimeSlotDateStart_Change()\n{\n\ttry\n\t{\n\t\tif( DebugModeProjectMilestoneTimeSlot )\n\t\t\twindow.alert( \"function TimeSlotDateStart_Change\" ); \n\t\t\n\t\tvar d, sDate;\n\t\t\n\t\t/* If Name is blank, then automatically fill in a string as \"Week Of a Monday's date\" */\n\t\tvar sName = myGetValue( \"cust_name\" );\n\t\tif( sName == null || sName == \"\" )\t\n\t\t{\n\t\t\td = myGetValue( \"cust_datestart\" );\n\t\t\tsDate = getMonday( d );\n\t\t\tif( sDate != null && sDate != \"\" )\t\n\t\t\t\tmySetValue( \"cust_name\", \"Week of \" + sDate );\n\t\t}\n\t\t\n\t\t/* If End Date is blank, then automatically fill in a Friday object */\n\t\tvar sEnd = myGetValue( \"cust_dateend\" );\n\t\t\n\t\tif( sEnd == null || sEnd == \"\" )\t\n\t\t{\n\t\t\tsDate = getFriday( d );\n\t\t\tif( sDate != null && sDate != \"\" )\t\n\t\t\t\tmySetValue( \"cust_dateend\", sDate );\n\t\t}\n\t}\n\tcatch( err )\n\t{\n\t\twindow.alert( \"function TimeSlotDateStart_Change error code \" + err );\n\t}\n}", "title": "" }, { "docid": "87900a4beefed39dd9e9d906e13378b6", "score": "0.5243034", "text": "function meetingSetup(input1, input2, dailyBound1, dailyBound2) {\n const availableTimeOutput = [];\n let sortedAndMergedArray = [];\n let startBound;\n let endBound;\n let index = 0;\n\n const timeConverter = (time) => {\n [hour, min] = time.split(\":\");\n return parseInt(hour) * 60 + parseInt(min);\n };\n\n const timeReConverter = (totalMin) => {\n let hour = Math.floor(totalMin / 60);\n let min = \"00\";\n if (totalMin % 60 != 0) min = \"30\";\n return `${hour}:${min}`;\n };\n\n const convertArrayToMin = (array) => {\n array.forEach((element) => {\n element[0] = timeConverter(element[0]);\n element[1] = timeConverter(element[1]);\n });\n };\n\n const convertArrayToHour = (array) => {\n array.forEach((element) => {\n element[0] = timeReConverter(element[0]);\n element[1] = timeReConverter(element[1]);\n });\n };\n\n const sortSchedule = (array1, array2) => {\n const sortedArray = [];\n sortedArray.push(...array1, ...array2);\n sortedArray.sort((a, b) => a[0] - b[0]);\n console.log(sortedArray);\n while (sortedArray.length > 1) {\n if (sortedArray[0][1] < sortedArray[1][0]) {\n sortedAndMergedArray.push(sortedArray.shift());\n } else if (\n sortedArray[1][0] <= sortedArray[0][1] &&\n sortedArray[0][1] <= sortedArray[1][1]\n ) {\n sortedArray.splice(0, 2, [sortedArray[0][0], sortedArray[1][1]]);\n } else if (sortedArray[0][1] > sortedArray[1][1]) {\n sortedArray.splice(1, 1);\n }\n }\n\n sortedAndMergedArray.push(sortedArray.shift());\n };\n\n if (timeConverter(dailyBound1[0]) > timeConverter(dailyBound2[0]))\n startBound = timeConverter(dailyBound1[0]);\n else startBound = timeConverter(dailyBound2[0]);\n\n if (timeConverter(dailyBound1[1]) > timeConverter(dailyBound2[1]))\n endBound = timeConverter(dailyBound2[1]);\n else endBound = timeConverter(dailyBound1[1]);\n\n convertArrayToMin(input1);\n convertArrayToMin(input2);\n sortSchedule(input1, input2);\n\n while (index > -1 && index < sortedAndMergedArray.length) {\n if (startBound < sortedAndMergedArray[index][0]) {\n availableTimeOutput.push([startBound, sortedAndMergedArray[index][0]]);\n break;\n } else if (\n sortedAndMergedArray[index][0] <=\n startBound <=\n sortedAndMergedArray[index][1]\n ) {\n availableTimeOutput.push([\n sortedAndMergedArray[index][1],\n sortedAndMergedArray[index + 1][0],\n ]);\n break;\n }\n index++;\n }\n\n index++;\n\n while (index > -1 && index < sortedAndMergedArray.length - 1) {\n if (\n sortedAndMergedArray[index][1] < endBound &&\n sortedAndMergedArray[index + 1][0] > endBound\n ) {\n availableTimeOutput.push([sortedAndMergedArray[index][1], endBound]);\n } else if (\n sortedAndMergedArray[index][1] < endBound &&\n sortedAndMergedArray[index + 1][0] < endBound\n ) {\n availableTimeOutput.push([\n sortedAndMergedArray[index][1],\n sortedAndMergedArray[index + 1][0],\n ]);\n }\n index++;\n }\n\n if (sortedAndMergedArray[index][1] < endBound) {\n availableTimeOutput.push([sortedAndMergedArray[index][1], endBound]);\n }\n\n convertArrayToHour(availableTimeOutput);\n\n return availableTimeOutput;\n}", "title": "" }, { "docid": "d1dc050d6c1d862845e74ef7a676410a", "score": "0.5241002", "text": "function setDates() {\n switch(vm.qrange.id){\n case 1:\n vm.startDate = moment(moment().date(),\"DD\").toDate();\n vm.startTime = moment(0, \"HH\").toDate();\n break;\n case 2:\n vm.startDate = moment(moment().weeks(),\"WW\").toDate();\n vm.startTime = moment(0, \"HH\").toDate();\n break;\n case 3:\n vm.startDate = moment(moment().month()+1,\"MM\").toDate();\n vm.startTime = moment(0, \"HH\").toDate();\n break;\n case 4:\n vm.startDate = moment(moment().year(),\"YYYY\").toDate();\n vm.startTime = moment(0, \"HH\").toDate();\n break;\n default:\n vm.startDate = moment().subtract(vm.qrange.value, vm.qrange.momentUnit).toDate();\n vm.startTime = moment().subtract(vm.qrange.value, vm.qrange.momentUnit).toDate();\n break;\n }\n vm.endDate = new Date();\n vm.endTime = new Date();\n }", "title": "" }, { "docid": "4c6ebb9f6fca5154556222dcf4962fdf", "score": "0.523264", "text": "function fillCells(appointment) {\n // Get the appointment's information\n const date = new Date(appointment.date);\n const time = appointment.time;\n const duration = appointment.duration;\n // Get the table's information\n const daysInRow = 6;\n const rowDuration = 30;\n const indexOffset = 1;\n\n // Locate the appointment's starting time\n var desiredTd = tableTimes.indexOf(time) * daysInRow + date.getDay() - indexOffset;\n // Fill the appointment's cell\n document.getElementsByTagName('td')[desiredTd].style = \"background-color: deeppink;\"\n // Insert the information into the correct cell\n document.getElementsByTagName('td')[desiredTd].innerHTML = `Booked`;\n // Fill sufficient cells for the appointment's duration\n if (duration > rowDuration) {\n document.getElementsByTagName('td')[desiredTd].style = \"border-bottom: none; background-color: deeppink\";\n desiredTd += daysInRow;\n document.getElementsByTagName('td')[desiredTd].style = \"border-top: none; background-color: deeppink\";\n document.getElementsByTagName('td')[desiredTd].innerHTML = ``;\n }\n if (duration > rowDuration * 2) {\n document.getElementsByTagName('td')[desiredTd].style = \"border-bottom: none; border-top: none; background-color: deeppink\";\n desiredTd += daysInRow;\n document.getElementsByTagName('td')[desiredTd].style = \"border-top: none; background-color: deeppink\";\n document.getElementsByTagName('td')[desiredTd].innerHTML = ``;\n }\n if (duration > rowDuration * 3) {\n document.getElementsByTagName('td')[desiredTd].style = \"border-bottom: none; border-top: none; background-color: deeppink\";\n desiredTd += daysInRow;\n document.getElementsByTagName('td')[desiredTd].style = \"border-top: none; background-color: deeppink\";\n document.getElementsByTagName('td')[desiredTd].innerHTML = ``;\n }\n}", "title": "" }, { "docid": "a56c545af0cf0d2c591612306015a9ec", "score": "0.5224195", "text": "function insertBookingIntoCalendar(responseUrl, description, roomId, startDate, timeSlot, duration, userName) {\n\tlet bookingSummary = `${description} by @${userName}`;\n let startTime = startDate.getISO8601DateWithDefinedTimeString(timeSlot);\n \n\tfor (let i = 0; i < duration; i++) {\n\t\tstartDate.addMinutes(30);\n\t}\n\tlet endTime = startDate.getISO8601TimeStamp();\n\n\n\tCalendarApp.queueForInsert(bookingSummary, startTime, endTime, roomId, 'confirmed', 'booked via slack', userName)\n\t\t.then((json) => {\n\t\t\tlet startDateTime = new Date(json.start);\n let endDateTime = new Date(json.end);\n \n console.log(`insertBookingIntoCalendar: Success, room: ${roomlist[roomId].name}, userName: ${userName}, startDateTime: ${startDateTime}, endDateTime: ${endDateTime}`)\n \n let msg = { text: `:tada: *Your booking is successful* :tada:`, replace_original: true }\n axios.post(responseUrl, msg)\n .catch((err) => console.log(err))\n\n\t\t}).catch((err) => {\n let msg = { text: `:crying_cat_face: *An error has occurred. To retry, use /book again.*`, replace_original: true }\n axios.post(responseUrl, msg)\n .catch((err) => console.log(err))\n\n\t\t\tconsole.log('Error insertBookingIntoCalendar: ' + JSON.stringify(err));\n throw err;\n });\n \n}", "title": "" }, { "docid": "edfe20df4d9a230aaf16decf5b40f9fe", "score": "0.5205915", "text": "function generateSchedule() {\n var range, failedTasks = [];\n\n // add required resources not supplied in resources array, the project\n // schedule and all task schedules to the resource manager (these will\n // be treated as resources to calculate valid reservations with)\n resMgr.addResource(taskGraph.resources, '', startDate);\n resMgr.addResource([{id: '_proj', available: sched}], '', startDate);\n resMgr.addResource(tasks, '_task', startDate);\n\n forwardPass(taskGraph.roots);\n range = getSummary(tasks, failedTasks);\n backwardPass(taskGraph.leaves, range[1]);\n\n return {\n scheduledTasks: scheduledTasks,\n failedTasks: failedTasks.length ? failedTasks : null,\n success: failedTasks.length === 0,\n start: range[0],\n end: range[1]\n };\n }", "title": "" }, { "docid": "5e7f7c5c0a432b8474d1700048b32e1b", "score": "0.52036905", "text": "function getBookedAppointments() {\n // Query the DB for the appointments\n const httpRequest = new XMLHttpRequest();\n var date;\n var month;\n if (weekDates[0].getDate() < 10) {\n date = \"0\" + weekDates[0].getDate();\n } else {\n date = weekDates[0].getDate();\n }\n if (weekDates[0].getMonth() + 1 < 10) {\n month = \"0\" + (weekDates[0].getMonth() + 1);\n } else {\n month = weekDates[0].getMonth() + 1;\n }\n const weekStartDate = `${weekDates[0].getFullYear()}/${month}/${date}`;\n httpRequest.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // Put the response into an object format\n bookedAppointments = JSON.parse(this.responseText);\n // Fill the table cells where the time is already taken on the specific day\n for (var i = 0; i < bookedAppointments.length; i++) {\n fillCells(bookedAppointments[i]);\n }\n }\n };\n\n httpRequest.open(\"GET\", `/client-appointment-query?sunday=${weekDates[0]}`, true);\n httpRequest.send();\n}", "title": "" }, { "docid": "01a352c680d050aa4c015508d635becf", "score": "0.51982844", "text": "function App() {\n const START_DATE = new Date(2021, 6, 10)\n const END_DATE = addDays(START_DATE, 6)\n const ls = window.localStorage\n // populate localStorage with 15 already scheduled appointments only if they don't yet exist\n if (!ls.getItem('preScheduledAppointments')) {\n savePreScheduledAppointments(START_DATE, END_DATE)\n }\n // get localStorage data\n const myAppointments = JSON.parse(ls.getItem('myAppointments'))\n const scheduledAppointments = JSON.parse(ls.getItem('preScheduledAppointments')).map(a => new Date(a))\n \n function addDays(date, days) {\n return new Date(date.getTime() + days * 24 * 60 * 60 * 1000)\n }\n\n // generate day components\n const days = []\n let key = 0\n let d = new Date(START_DATE)\n for (d; d <= END_DATE; d.setDate(d.getDate() + 1)) {\n key++\n days.push(\n <Day\n key={key}\n date={new Date(d)}\n myAppointments={myAppointments}\n scheduledAppointments={scheduledAppointments}\n />\n )\n }\n\n return (\n <div className='main-grid'>\n <div className='days-grid'>\n {days}\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "f979b1a03ae316d2ecdf2c23f9145c58", "score": "0.5189587", "text": "function getAllAppointment(){\n\n Utils.getDoctors().then(function(resp) {\n console.log(resp);\n if(resp.data.status == 'success'){\n angular.forEach(resp.data.message, function(Value, Key) {\n vm.doctorIds[Value.id] = Value.id;\n vm.doctorListDatas[Value.id] = Value.firstName+' '+Value.lastName;\n }); \n }\n \n });\n\n appointmentService.getAppointments().then(function(resp) {\n //console.log(resp);\n if(resp.data.status == 'success'){\n var object = {}; \n\n var datas = resp.data.message;\n angular.forEach(datas, function(value, key) {\n //console.log(value);\n //console.log(key);\n\n var today = new Date();\n var colorConfig;\n // var isToday = (today.toDateString() == value.appointmentStart.toDateString());\n //console.log(moment(value.appointmentStart).fromNow());\n var startDate = moment(value.appointmentStart).format(\"YYYY-MM-DD hh:mm\");\n var dbEndDate = moment(value.appointmentEnd).format(\"YYYY-MM-DD hh:mm\");\n\n var startrDate = moment(value.appointmentStart).format(\"YYYY-MM-DD\");\n var endDate = moment(today).format(\"YYYY-MM-DD\");\n\n var startMin = moment(value.appointmentStart).format(\"hh:mm\");\n var endMin = moment(value.appointmentEnd).format(\"hh:mm\");\n var endDateMin = moment(today).format(\"hh:mm\");\n\n var b = moment(startDate); //todays date\n var a = moment(dbEndDate); // another date\n\n var classname = \"futureCls\";\n \n if(startDate > endDate){\n colorConfig = calendarConfig.colorTypes.important;\n }else if(startrDate == endDate){\n if(endDateMin >= startMin && endDateMin <= endMin){\n colorConfig = calendarConfig.colorTypes.info;\n }else if(startMin > endDateMin){\n colorConfig = calendarConfig.colorTypes.important;\n }else if(startMin < endDateMin){\n classname = \"pastCls\";\n colorConfig = calendarConfig.colorTypes.warning;\n }\n }else{\n classname = \"pastCls\";\n colorConfig = calendarConfig.colorTypes.warning;\n }\n\n var remHours = a.diff(b, 'minutes');\n\n var data = {\n title: value.patient.firstName+' '+value.patient.lastName,\n description: value.doctor.firstName+' '+value.doctor.lastName,\n startsAt: new Date(value.appointmentStart),\n endsAt: new Date(value.appointmentEnd),\n remHour: remHours,\n color: colorConfig,\n draggable: false,\n resizable: false,\n cssClass: classname,\n appointmentId: value.id\n };\n\n vm.events.push(data);\n\n var divHeight = '0px';\n\n if(remHours == 15){\n divHeight = '50px';\n }else{\n var splithours = remHours/15;\n divHeight = (50*splithours) + 'px';\n }\n\n if(object.hasOwnProperty(startMin)){\n object[startMin][value.doctor.id] = [];\n data.divHeight = divHeight;\n object[startMin][value.doctor.id] = data;\n }else{\n object[startMin] = {};\n object[startMin][value.doctor.id] = [];\n data.divHeight = divHeight;\n object[startMin][value.doctor.id] = data;\n }\n\n \n });\n \n\n angular.forEach(object, function(value, key) {\n console.log(\"----doctor\")\n console.log(value); \n console.log(key);\n angular.forEach(vm.doctorIds, function(values, keys) {\n if (!(values in value)){\n console.log(values);\n object[key][values] = [];\n var arra = {\n \"title\": \"none\"\n };\n object[key][values] = arra;\n console.log('no');\n }\n });\n });\n\n console.log(object);\n\n console.log(\"----end doctor\")\n\n vm.eventsList = object;\n\n console.log(vm.eventsList);\n\n }\n\n\t\t\t$scope.doctorCount = Object.keys(vm.doctorListDatas).length;\n console.log(vm.doctorListDatas);\n \n });\n }", "title": "" }, { "docid": "3c1461c07e1a733e381188592f13eaa1", "score": "0.5188798", "text": "function getNextEvents (n) {\n var result = []\n var now = new Date()\n\n for (var i in appointments) {\n var entry = appointments[i]\n if (entry.start > now && entry.start < now.setDate(now.getDate() + n)) {\n result.push(entry)\n }\n }\n\n return result\n}", "title": "" }, { "docid": "619bc8baec4a16c1e08b9fadae4d9dd3", "score": "0.5186516", "text": "function buildStartCalendar(){\n $(\"#arkianePlanning-calendarStart\").datepicker($.extend({\n numberOfMonths: 2,\n showButtonPanel: true,\n minDate : settings.minBookingDate,\n maxDate : settings.maxBookingDate,\n firstDay : 1,\n beforeShowDay: function(date){\n var dateNext = addDay(date);\n // date is available day and is a start date\n if (($.inArray(dateNext.toISOString().substr(0,10), dt) != -1) && ($.inArray(dateNext.toISOString().substr(0,10), ds) != -1)) {\n return [true,\"ap-isBookable\",\"\"];\n // date is available but is not a start date\n } else if($.inArray(dateNext.toISOString().substr(0,10), dt) != -1) {\n return [false,\"ap-isAvailable\",\"\"];\n }else{\n // date is unavailable\n return [false,\"ap-isUnavailable\",\"\"];\n }\n },\n onSelect: function(selected, evnt){\n startDate = selected;\n $(\"input[name=startdate]\").val(startDate);\n console.log(\"CALENDAR START : Setting START date to \"+selected);\n //Waiting for AJAX retrieving dates\n $.when(getAvailableDate(startDate)).done(function(availableEndDateParameters){\n buildEndCalendar();\n $(\"#arkianePlanning-calendarStart\").hide();\n $(\"#arkianePlanning-calendarEnd\").datepicker(\"refresh\");\n $(\"#arkianePlanning-calendarEnd\").show();\n });\n }\n },settingsCulture));\n }", "title": "" }, { "docid": "a39e79d991ef9a282163246ddbc6eca5", "score": "0.51846874", "text": "async checkAppointment(){\n try {\n let appointmentDetails =await this.getAppointmentDetails()\n if(appointmentDetails === null || appointmentDetails === undefined){\n return 'You do not have any appointments today.'\n }\n else{\n let appointmentDate = appointmentDetails.date\n let currentDate = this.getCurrentDate()\n\n\n if(this.checkIfDatesAreSame(appointmentDate, currentDate) === true){\n if(this.getCurrentHour() < appointmentDetails.start_time){\n\n let chatLink = process.env.chatSite + appointmentDetails.meetingId\n return 'You have an appointment today at ' + \n appointmentDetails.start_time + \n \" <a href='\" + chatLink + \"' target ='_blank'>\" + chatLink \n\n\n }//end of if there is time for meeting\n else{\n return 'You missed your appointment'\n }\n }//end of if dates are same\n else{\n return 'Today No appointment'\n }\n }//end of there are appointments today\n } catch (error) {\n winston.error(error.stack)\n return 'There was an error, we are working on it!!'\n }\n }", "title": "" }, { "docid": "375c1f239b6a6ed51c6ed1868a73f046", "score": "0.5184517", "text": "function selectedEventFunc(selEvent) {\n events_id = selEvent.id;\n $('#events_id').val(events_id);\n $('#event_label').show();\n \n start_date = new Date(selEvent.start_date);\n\n start_d = start_date.getDate();\n start_m = start_date.getMonth()+1; // only increase month by one in case of eventClick\n start_y = start_date.getFullYear();\n\n end_date = new Date(selEvent.end_date);\n\n end_d = end_date.getDate();\n end_m = end_date.getMonth()+1; // only increase month by one in case of eventClick\n end_y = end_date.getFullYear();\n\n start_time = selEvent.start_time.split(':');\n start_time = start_time[0]+':'+start_time[1];\n\n end_time = selEvent.end_time.split(':');\n end_time = end_time[0]+':'+end_time[1];\n\n event_name = '<tr>'+'<td>{{e_bookings_event}} </td>'+'<td>'+selEvent.title.textCapitalize()+'</td>';\n duration = '<tr>'+'<td>{{e_bookings_duration}} </td>'+'<td>'+$.format.date(start_date, \"d MMM, yy\")+' - '+$.format.date(end_date, \"d MMM, yy\")+'</td>';\n timing = '<tr>'+'<td>{{e_bookings_timing}} </td>'+'<td>'+time24To12(start_time)+' - '+time24To12(end_time)+'</td>';\n \n // for booking details page\n $('#book_duration').html($.format.date(start_date, \"d MMM, yy\")+' - '+$.format.date(end_date, \"d MMM, yy\"));\n $('#book_timing').html(time24To12(start_time)+' - '+time24To12(end_time));\n\n booking_date = $.format.date(start_date, \"yyyy-MM-dd\");\n \n getBookedSeats(events_id ,booking_date, selEvent.start_time);\n\n setTimeout(function() {\n available_seats = selEvent.capacity - booked_seats;\n if((available_seats) == 0) {\n availability= '<tr class=\"text-danger\">'+'<td><strong>{{e_bookings_availability}} </strong></td>'+'<td>'+(available_seats)+'</td>';\n booked = '<tr class=\"text-danger\">'+'<td><strong>{{e_bookings_booked}} </strong></td>'+'<td>'+(booked_seats)+'</td>';\n } else {\n availability= '<tr class=\"text-success\">'+'<td><strong>{{e_bookings_availability}} </strong></td>'+'<td>'+(available_seats)+'</td>';\n booked = '<tr class=\"text-success\">'+'<td><strong>{{e_bookings_booked}} </strong></td>'+'<td>'+(booked_seats)+'</td>';\n }\n \n $('#event_label table tbody').html(event_name+duration+timing+availability+booked);\n $('#event_loader i').remove();\n\n // if available seat is 0 then reset & disable members\n if(available_seats == 0) {\n $('.members .row').not('.row:first').remove();\n $(\".members-toggle\").find(\"input,button,textarea,select\").prop('disabled', true);\n }\n }, 2000);\n \n $('#booking_date').val(booking_date);\n $('#start_time').val(selEvent.start_time);\n\n getNetFees();\n}", "title": "" }, { "docid": "85669d5118cbeb211e4bf6032efdc654", "score": "0.5184404", "text": "async function showRescheduleAppointment(req, res) {\n let appointmentId = req.params.appointmentId;\n console.log(\"id: \", appointmentId);\n\n try {\n let appointment = await Appointment.findById({\n _id: appointmentId,\n });\n let schedules = await Schedule.find({\n doctor: appointment.slot[0].doctor.id,\n date: { $gt: new Date(new Date().setHours(0, 0, 0, -1)) },\n }).\n populate({\n path: \"slots\",\n match: { status: \"Available\" }\n }).\n sort({ date: 1 });\n\n // console.log(\"schedules query: \", schedules);\n let days9 = createNextXDays(9);\n let days = {};\n days9.forEach(day => {\n days[day.getTime()] = null;\n });\n schedules.forEach((schedule, index) => {\n if (days['' + schedule.date.getTime() + ''] === null) {\n days[schedule.date.getTime()] = index;\n }\n });\n console.log(\"days after: \", days);\n return res.render(\"reschedule\", { schedules: schedules, days: days, appointment: appointment });\n\n } catch (error) {\n console.log(\"show reschedule Error: \", error);\n req.flash(\"error\", \"Internal Server Error, Retry!\");\n return res.redirect(\"back\");\n }\n}", "title": "" }, { "docid": "034515a21d457ba140d1db3731091c3d", "score": "0.5177374", "text": "function getAvailAppointmentDays(request, response) {\n let params = request.body.queryResult.parameters;\n let searchUin = params.shortUin.charAt(0) + 'XXX' +\n params.shortUin.substr(1,5);\n \n chkEligibility (searchUin, eligibility => {\n console.log(\"Eligibility switch \" + eligibility.status);\n let fulfillmentText = {};\n if (request.body.queryResult.action === \"requestChangeApptDay\" && \n eligibility.status === 1) {\n // change to 9 because cannot request change if you no prior appt\n eligibility.status = 9;\n } else if (request.body.queryResult.action === \"requestChangeApptDay\" && \n eligibility.status === 9) {\n // change to 1 because CAN change since there is prior appt\n eligibility.status = 1;\n }\n switch (eligibility.status) {\n case 1: {\n // For technical reasons not fully understood, not able\n // to encapsulate retrieval of all timeslots as a function\n // Retrieve all time slots: Start\n let allTimeSlotsArray = [];\n let allTimeSlots = firestore.collection('timeslot').get()\n .then(querySnapshot => {\n querySnapshot.forEach(doc => {\n console.log(doc.id, '==>', doc.data());\n let docRef = firestore.collection('timeslot').doc(doc.id);\n allTimeSlotsArray.push(docRef.get());\n });\n console.log (\"Complete retrieval of all time slots <no chks> \",\n allTimeSlotsArray.length);\n return Promise.all(allTimeSlotsArray);\n })\n .catch(err => {\n console.log('Error retrieving all time slots', err);\n return (\"Error retrieving all time slots\");\n }); // Retrieve all times slots: End\n \n allTimeSlots\n .then(results => {\n checkDaysAvail_SendResponse(results, params, response);\n console.log(\"Completed async availability checks for each \",\n \"timeslot, results pending\");\n return (\"Completed async availability checks for each timeslot\");\n })\n .catch(err => {\n console.log('Error checking availability for each timeslot',\n err);\n return (\"Error checking availability for each timeslot\");\n });\n break;\n }\n case 0: {\n fulfillmentText = {fulfillmentText: `${params.fullName}, ` +\n `you are not registered for TGA signing`};\n response.send(fulfillmentText);\n break;\n }\n case 9: {\n if (request.body.queryResult.action === \"requestChangeApptDay\") {\n fulfillmentText = {fulfillmentText: `${params.fullName}, ` +\n `you have NOT made an appointment yet`};\n response.send(fulfillmentText);\n } else {\n fulfillmentText = {fulfillmentText: `${params.fullName}, ` +\n `you have an existing appointment on ${eligibility.data.slot}`};\n response.send(fulfillmentText);\n }\n break;\n }\n }\n return \"Completed ALL appointment sessions retrieval \";\n });\n}", "title": "" }, { "docid": "baa03266f56c85b87a3b4aaac05674d2", "score": "0.5171409", "text": "function configureCalendar() {\n document.addEventListener('DOMContentLoaded', function() {\n // Create an array of all\n var userSlotIds = [];\n var userSlots = document.getElementsByClassName('userSlots');\n for (var i = 0; i < userSlots.length; i++) {\n userSlotIds.push(userSlots[i].getAttribute('id').substring(9));\n }\n\n dateFormat = {};\n var context = {};\n var startTime;\n var endTime;\n var numSelectedSlots = 0; //holds current number of selected slots for this event before actual submission\n var slotCounter = 0;\n var max_resv_per_attendee = document.getElementById('max_resv_per_attendee').value;\n if (max_resv_per_attendee == 0) {\n max_resv_per_attendee = Number.MAX_SAFE_INTEGER;\n }\n var calendarEl = document.getElementById('calendar');\n var modal = document.getElementById('exampleModal');\n var calendar = new FullCalendar.Calendar(calendarEl, {\n plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'bootstrap' ],\n themeSystem: 'bootstrap',\n defaultView: 'timeGridWeek',\n slotDuration: '00:30',\n editable: false,\n selectable: true,\n eventLimit : true,\n longPressDelay: 20,\n eventColor: '#000000',\n header: {\n left: 'prev,next today',\n center: 'title',\n right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'\n },\n eventTimeFormat: { // 07:30p.m.\n hour: '2-digit',\n minute: '2-digit',\n hour12: true\n },\n // Upon clicking an existing slot, show the modal to edit details\n eventClick: function(clickInfo) {\n var slotId = clickInfo.event.id; //retrives slot id #\n var startTime = clickInfo.event.start;\n var endTime = clickInfo.event.end;\n var location = document.getElementById('slotLocation' + slotId).value;\n var slotAttendee = document.getElementsByName('name' + slotId);\n var numUserResv = document.getElementById('numUserReservations').value;\n var numCurSelectedSlots = document.getElementsByName('resvSlotId').length;\n var maxAttendees = document.getElementById('maxAttendees' + slotId).value;\n if (maxAttendees == 0) {\n maxAttendees = Number.MAX_SAFE_INTEGER;\n }\n\n //logic for use cases: #resv per slot exceeded, #resv per event exceeded, or\n //limitations not exceeded.\n numResv = parseInt(numUserResv, 10);\n var totalResv = numCurSelectedSlots + numResv;\n\n if ($.inArray(slotId, userSlotIds) != -1) {\n // Do nothing\n }\n else if(totalResv >= max_resv_per_attendee){\n warningModalEvents();\n }\n else if(slotAttendee.length >= maxAttendees){\n warningModalSlots();\n }\n else{\n createModalBody(slotId);\n createSlotInputForm(slotId, startTime, endTime, location);\n }\n }\n });\n var existingSlots = document.getElementsByClassName('existingSlots');\n for (var i = 0; i < existingSlots.length; i++) {\n var slotId = existingSlots[i].getAttribute('id').substring(4);\n var startTime = new Date(document.getElementById('slotStart' + slotId).value);\n var endTime = new Date(document.getElementById('slotEnd' + slotId).value);\n var location = document.getElementById('slotLocation' + slotId).value;\n if ($.inArray(slotId, userSlotIds) != -1) {\n var calendarEvent = calendar.addEvent({id: slotId, start: startTime, end: endTime, title: \"Registered\", backgroundColor: '#D3832B'});\n }\n else {\n var calendarEvent = calendar.addEvent({id: slotId, start: startTime, end: endTime, title: location});\n }\n }\n calendar.render();\n });\n}", "title": "" }, { "docid": "357784ff32f394dfbad007c0226a34b6", "score": "0.51657134", "text": "timeslots_available(events_list){\n\t\ttry{\n\t\t\t// Return var\n\t\t\tvar ret = [];\n\t\t\t// Var to get the date\n\t\t\tvar date = (events_list[0]).split('T')[0];\n\t\t\t// Var with all possible time slots\n\t\t\tvar timeSlots = [date + 'T09:00:00.000Z', \n\t\t\t\tdate + 'T09:45:00.000Z',\n\t\t\t\tdate + 'T10:30:00.000Z',\n\t\t\t\tdate + 'T11:15:00.000Z',\n\t\t\t\tdate + 'T12:00:00.000Z',\n\t\t\t\tdate + 'T12:45:00.000Z',\n\t\t\t\tdate + 'T13:30:00.000Z',\n\t\t\t\tdate + 'T14:15:00.000Z',\n\t\t\t\tdate + 'T15:00:00.000Z',\n\t\t\t\tdate + 'T15:45:00.000Z',\n\t\t\t\tdate + 'T16:30:00.000Z',\n\t\t\t\tdate + 'T17:15:00.000Z'\n\t\t\t\t];\n\t\t\tevents_list.forEach(function(event){\n\t\t\t\t// Modify the Google Calendar output's format\n\t\t\t\t// to ISO 8601\n\t\t\t\tevent = event.split('Z')[0] + '.000Z';\n\t\t\t\t// Remove event from the var timeSlots\n\t\t\t\ttimeSlots = timeSlots.filter(e => e !== event);\n\t\t\t});\n\t\t\t// Calculate the end time for timeslots available\n\t\t\t// and change to output format\n\t\t\ttimeSlots.forEach(function(time){\n\t\t\t\tvar endTime = new Date(time);\n\t\t\t\tendTime.setMinutes(endTime.getMinutes() + 40);\n\t\t\t\tret.push({'startTime': time, 'endTime': endTime});\n\t\t\t})\n\t\t}\n\t\tcatch(error){\n\t\t\tthrow error;\n\t\t}\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "720bc887a602265a8d388dff0928ce87", "score": "0.51603407", "text": "createSlots() {\n var me = this,\n slotOrder = me.getSlotOrder(),\n hours = [],\n minutes = [],\n slots = [],\n ln, i;\n\n for (i = 0, ln = 24; i < ln; i++) {\n hours.push({\n text: i,\n value: i\n });\n }\n\n for (i = 0, ln = 60; i < ln; i = i + 5) {\n minutes.push({\n text: Ext.String.leftPad(i, 2, '0'),\n value: i\n });\n }\n\n slotOrder.forEach(function (item) {\n slots.push(me.createSlot(item, hours, minutes));\n });\n\n me.setSlots(slots);\n }", "title": "" }, { "docid": "1ee9f35ecb1268d95ae001699b620493", "score": "0.5153553", "text": "function addAppointment(event)\r\n{\r\n var first = document.getElementById(\"appointmentName\").value; //for appointment name\r\n if (first === \"\" || first.length === 0) //checks if empty\r\n {\r\n document.getElementById(\"label-appointmentName\").style.color = \"red\";\r\n event.preventDefault(); \r\n }\r\n else if(first>60)\r\n {\r\n document.getElementById(\"label-appointmentName\").style.color = \"red\";\r\n document.getElementById(\"label-appointmentName\").innerHTML = \"Name less then 60 characters\";\r\n event.preventDefault(); \r\n }\r\n else\r\n {\r\n document.getElementById(\"label-appointmentName\").innerHTML = \"Appointment Title\";\r\n document.getElementById(\"label-appointmentName\").style.color = \"#000\";\r\n }\r\n \r\n //Appointment Description\r\n var first = document.getElementById(\"appointmentDetails\").value; //for appointment name\r\n if(first>150)\r\n {\r\n document.getElementById(\"label-appointmentDetails\").style.color = \"red\";\r\n document.getElementById(\"label-appointmentDetails\").innerHTML = \"Name less then 60 characters\";\r\n event.preventDefault(); \r\n }\r\n else\r\n {\r\n document.getElementById(\"label-appointmentDetails\").innerHTML = \"Appointment Description\";\r\n document.getElementById(\"label-appointmentDetails\").style.color = \"#000\";\r\n }\r\n \r\n //Appointment start date\r\n var start =document.getElementById(\"start\").value; //for appointment start date/time\r\n if(!start.match(/^(([0]?[1-9]|1[0-2])([0-2]?[0-9]|3[0-1])[1-2]d{3}) (20|21|22|23|[0-1]?d{1}):([0-5]?d{1})$/))\r\n {\r\n document.getElementById(\"label-start\").style.color = \"red\";document.getElementById(\"label-start\").innerHTML = \"Enter valid date yyyy-mm-dd-hh-mm\";\r\n event.preventDefault(); \r\n }\r\n else\r\n {\r\n document.getElementById(\"label-start\").innerHTML = \"Start Date\";\r\n document.getElementById(\"label-start\").style.color = \"#000\";\r\n }\r\n \r\n //Appointment end date\r\n var end =document.getElementById(\"end\").value; //for appointment end date/time\r\n if(!end.match(/^(([0]?[1-9]|1[0-2])([0-2]?[0-9]|3[0-1])[1-2]d{3}) (20|21|22|23|[0-1]?d{1}):([0-5]?d{1})$/))\r\n {\r\n document.getElementById(\"label-end\").style.color = \"red\";document.getElementById(\"label-end\").innerHTML = \"Enter valid date yyyy-mm-dd-hh-mm\";\r\n event.preventDefault(); \r\n }\r\n else\r\n {\r\n document.getElementById(\"label-end\").innerHTML = \"End Date\";\r\n document.getElementById(\"label-end\").style.color = \"#000\";\r\n }\r\n \r\n /**********SEND DATE TO BACKEND********************************///\r\n /*********************************************************************\r\n ****************************************************************/\r\n}", "title": "" }, { "docid": "49e5dde00c7e3cd0cd6d595fbaa76e5b", "score": "0.51405984", "text": "function addPeriod(day, start, end) {\n var program = getWeekProgram()[day];\n program.push([start, end]);\n sortMergeProgram(day);\n setWeekProgram();\n}", "title": "" }, { "docid": "d9cc39c08908af9cbf0ff28cc8d2ae58", "score": "0.5138549", "text": "function calculateIDSWeekView(year, month, startDate, endDate, startHour, endHour, startMinutes, endMinutes){\n\n var eventIDS = [];\n\n while(startDate <= endDate){\n\n while((startHour <= endHour || startDate < endDate) && startHour <= 23){\n\n while((startMinutes < endMinutes || startHour < endHour || startDate < endDate) && startMinutes <= 59){\n eventIDS.push(calculateIDWeekView(year, month, startDate, startHour, startMinutes));\n startMinutes += 30;\n }\n startMinutes = 0;\n startHour++;\n }\n startHour = 0;\n startDate++;\n }\n\n return eventIDS;\n}", "title": "" }, { "docid": "7a71cbf921bba092d0c33ddb9891fc6e", "score": "0.513668", "text": "function getSchedule(){\r\n\t//var date = $('#datepicker').val();\r\n\tif(schedulerDate == \"\"){\r\n\t\talert(\"No date selected.\");\r\n\t\treturn;\r\n\t}\r\n\tvar data = new Object;\r\n\tfor(var i = 0; i < 24; i++){\r\n\t\tfor(var j = 0; j < 60; j += 15){\r\n\t\t\tvar hourExtra = \"\";\r\n\t\t\tvar minExtra = \"\";\r\n\t\t\tif(i < 10){\r\n\t\t\t\thourExtra = \"0\";\r\n\t\t\t}\r\n\t\t\tif(j < 10){\r\n\t\t\t\tminExtra = \"0\";\r\n\t\t\t}\r\n\t\t\tvar dropdown = \"dd-\" + hourExtra + i.toString() + \"-\" + minExtra + j.toString();\r\n\t\t\t//var dropdownVal = $(dropdown).val();\r\n\t\t\tvar dropdownVal = document.getElementById(dropdown).value;\r\n\t\t\t//alert(dropdownVal);\r\n\t\t\tif(dropdownVal != \"\"){\r\n\t\t\t\t//alert(dropdown + \" = \" + dropdownVal);\r\n\t\t\t\tvar hour;\r\n\t\t\t\tvar min;\r\n\t\t\t\tif(i < 10){\r\n\t\t\t\t\thour = \"0\" + i.toString();\r\n\t\t\t\t} else {\r\n\t\t\t\t\thour = i.toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(j < 10){\r\n\t\t\t\t\tmin = \"0\" + j.toString();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmin = j.toString();\r\n\t\t\t\t}\r\n\t\t\t\tdata[hour + ':' + min] = dropdownVal;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t/*\r\n\tif(!$.isEmptyObject(data)){\r\n\t\tdata['date'] = date;\r\n\t\treturn data;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\t*/\r\n\t//Need to send empty schedule in order to reset dates.\r\n\tdata['date'] = schedulerDate;\r\n\treturn data;\r\n}", "title": "" }, { "docid": "d6518c9fff011758fc5015722c9f9573", "score": "0.512822", "text": "function _initDates(date){\n var startDateTime = moment(date);\n startDateTime.hour(0);\n startDateTime.minute(0);\n startDateTime.seconds(0);\n startDateTime = startDateTime.utc();\n\n var endDateTime = moment(date);\n endDateTime.hour(23);\n endDateTime.minute(59);\n endDateTime.seconds(59);\n endDateTime = endDateTime.utc();\n\n var yesterdayDate = new Date();\n yesterdayDate.setDate(yesterdayDate.getDate()-1);\n yesterdayDate = yesterdayDate.setHours(0,0,0,0);\n\n var thisDate = new Date(date);\n thisDate = thisDate.setHours(0,0,0,0);\n\n var formattedDate = startDateTime.format(\"YYYY-MM-DD\");\n\n return [startDateTime, endDateTime, yesterdayDate, thisDate, formattedDate];\n}", "title": "" }, { "docid": "1a3be195815c1af451b2a018948b76bb", "score": "0.511794", "text": "function getSlotDetails(req, res, mainCondition) {\r\n\r\n var noOfItem = req.body.limit || 0;\r\n var pageNumber = req.body.page || 0;\r\n\r\n var aggQuery = [];\r\n aggQuery.push({ $match: mainCondition }, { $unwind: \"$slots\" }, { $match: mainCondition }, { \"$sort\": { \"slots.start\": 1 } });\r\n\r\n if (noOfItem > 0 && !!pageNumber > 0) {\r\n aggQuery.push({\r\n $skip: (noOfItem * (pageNumber - 1))\r\n });\r\n aggQuery.push({\r\n $limit: noOfItem\r\n });\r\n }\r\n\r\n var query = AppointmentSchedule.aggregate(aggQuery);\r\n\r\n query.exec(function(err, docs) {\r\n if (err) {\r\n //winston.error(err, { timestamp: Date.now(), pid: process.pid, url: req.url });\r\n return res.status(500).json({ error: 'ERRORS.RECORDNOTFOUND' });\r\n }\r\n\r\n if (!docs || !docs.length)\r\n return res.status(200).json({ appointments: [] });\r\n\r\n AppointmentSchedule.populate(docs, [\r\n { path: 'slots.patientuid', select: 'mrn titleuid firstname middlename lastname genderuid dateofbirth contact patientimageuid isanonymous' },\r\n { path: 'slots.statusuid', select: 'valuedescription' },\r\n { path: 'careprovideruid', select: 'name lastname' }\r\n ], function(err3, docs3) {\r\n if (err3) {\r\n //winston.error(err3, { timestamp: Date.now(), pid: process.pid, url: req.url });\r\n return res.status(500).json({ error: 'ERRORS.RECORDNOTFOUND' });\r\n }\r\n\r\n if (!docs3 || !docs3.length)\r\n return res.status(200).json({ appointments: [] });\r\n\r\n AppointmentSchedule.populate(docs3, [\r\n { path: 'slots.patientuid.genderuid', select: 'valuedescription', model: 'ReferenceValue' },\r\n { path: 'slots.patientuid.titleuid', select: 'valuedescription', model: 'ReferenceValue' }\r\n ], function(err2, docs2) {\r\n if (err2) {\r\n //winston.error(err2, { timestamp: Date.now(), pid: process.pid, url: req.url });\r\n return res.status(500).json({ error: 'ERRORS.RECORDNOTFOUND' });\r\n }\r\n\r\n res.status(200).json({ appointments: formOutContent(docs2) });\r\n });\r\n });\r\n });\r\n\r\n function formOutContent(docs2) {\r\n var outputdocs = [];\r\n if (docs2 != null && docs2.length > 0) {\r\n for (var k = 0; k < docs2.length; k++) {\r\n docs2[k].slots.department = docs2[k].department;\r\n docs2[k].slots.careprovideruid = docs2[k].careprovideruid;\r\n docs2[k].slots.appointmentdate = docs2[k].appointmentdate;\r\n docs2[k].slots.appointmentdate = docs2[k].appointmentdate;\r\n docs2[k].slots.scheduleuid = docs2[k]._id;\r\n\r\n var patient = docs2[k].slots.patientuid;\r\n outputdocs.push(docs2[k].slots);\r\n }\r\n }\r\n return outputdocs;\r\n }\r\n}", "title": "" }, { "docid": "502ed5439554c35ebfcd30c85c3300bc", "score": "0.51107275", "text": "collectTimeSlotsAvailable() {\n if (\n this.bookedSlotsForFutureDates.appointment_info !== undefined &&\n this.bookedSlotsForFutureDates.appointment_info[this.selectedDate] !==\n undefined\n ) {\n this.updatedTimeSlots = this.timeSlots.filter(\n time =>\n this.bookedSlotsForFutureDates.appointment_info[\n this.selectedDate\n ].findIndex(tm => tm === time) === -1\n );\n } else {\n this.updatedTimeSlots = this.timeSlots;\n }\n\n this.showTimeSlotDropdown = true;\n }", "title": "" }, { "docid": "a4b8c7e9aae8359dd75902595eba4c55", "score": "0.51037127", "text": "constructor() {\n this.timeSlots = [{\n id: 1,\n time: '9: AM',\n name: '',\n phone: ''\n },\n {\n id: 2,\n time: '10: AM',\n name: '',\n phone: ''\n },\n {\n id: 3,\n time: '11: AM',\n name: '',\n phone: ''\n },\n {\n id: 4,\n time: '12: AM',\n name: '',\n phone: ''\n },\n {\n id: 5,\n time: '1: PM',\n name: '',\n phone: ''\n },\n {\n id: 6,\n time: '2: PM',\n name: '',\n phone: ''\n },\n {\n id: 7,\n time: '3: PM',\n name: '',\n phone: ''\n },\n {\n id: 8,\n time: '4: PM',\n name: '',\n phone: ''\n },\n {\n id: 9,\n time: '5: PM',\n name: '',\n phone: ''\n },\n ]\n }", "title": "" }, { "docid": "35fa0e02ba510097823af11d096351b0", "score": "0.5103579", "text": "function makeMeetingTimes(day) {\n\n let first = day.set({ hour: 9, minute: 30 });\n let second = day.set({ hour: 12, minute: 30 });\n let third = day.set({ hour: 18, minute: 0 });\n let firstString = first.toLocaleString(DateTime.TIME_SIMPLE);\n let secondString = second.toLocaleString(DateTime.TIME_SIMPLE);\n let thirdString = third.toLocaleString(DateTime.TIME_SIMPLE);\n return {\n data: [first, second, third],\n strings: [firstString, secondString, thirdString]\n };\n }", "title": "" }, { "docid": "4b41f9ed2c5c825fba1f5e7bef0a331d", "score": "0.51004744", "text": "function getMeetings() {\n //don't try to do if Outlook isn't visible\n if (document.querySelector('#app') === null) {\n\n //todo - send a notification that the Outlook page isn't available\n return;\n }\n\n const meetingTimes = [];\n const meetings = document.querySelectorAll('div[draggable=\"true\"] div[role=\"button\"]');\n\n for (let j = 0; j < meetings.length; j++) {\n\n const meeting = meetings[j];\n const details = meeting.getAttribute('aria-label');\n const commaParts = details.split(', ');\n const datePart = commaParts[1]; // 'March 29'\n const timeParts = commaParts[2].split(' ');\n\n //handle all day events\n let startString, endString;\n if (details.startsWith('all day')) {\n // turn: \"all day event for Wednesday, June 3, 2020 Out of office\"\n // into new Date('March 29 2020 12:00 AM')\n startString = [datePart, timeParts[0], '12:00 AM'].join(' ');\n endString = [datePart, timeParts[0], '11:59 PM'].join(' ');\n } else {\n // turn \"event from Sunday, March 29, 2020 5:00 PM to 5:05 PM Outlook 5:00\"\n // into new Date('March 29 2020 5:00 PM')\n const timeParts = commaParts[2].split(' ');\n startString = [datePart, timeParts[0], timeParts[1], timeParts[2]].join(' ');\n endString = [datePart, timeParts[0], timeParts[4], timeParts[5]].join(' ');\n }\n //only care about meetings that have not already ended\n if (new Date(endString) > new Date()) {\n meetingTimes.push({\n start: new Date(startString),\n end: new Date(endString)\n });\n }\n\n }\n\n //sort by start time\n meetingTimes.sort((a, b) => a.start - b.start);\n\n //convert to strings to make it easier over in the device\n meetingTimes.forEach(meeting => {\n meeting.start = meeting.start.toString();\n meeting.end = meeting.end.toString();\n });\n const meetingData = JSON.stringify(meetingTimes);\n\n chrome.runtime.sendMessage({\n type: 'schedule',\n meetingData\n });\n}", "title": "" }, { "docid": "635779d87b31e64efb94d3dd284aefc1", "score": "0.50857997", "text": "function getUserInput(start) {\n // title\n var title = $(\"#title\").val();\n\n // allDay\n var allDay = $(\"#allDay\").is(':checked');\n\n // rrule\n var rrule = parseInt($(\"#rrule\").val());\n\n // give type based on whether rrule exists\n var type = (rrule != \"0\") ? 'repeat' : 'event';\n\n // endRepeat (\"\" if there is no rrule or if the event repeats forever)\n var endRepeat = ($(\"#end_repeat\").val()) ? toDatetime($(\"#end_repeat\").val(), 0, 0, 'AM') : null;\n\n // get start time data\n var start_date = $(\"#start_datepicker\").val();\n var start_hour = parseInt($(\"#start_hour\").val());\n var start_min = parseInt($(\"#start_min\").val());\n var start_ampm = $(\"#start_ampm\").val();\n\n // get end time data\n var end_date = $(\"#end_datepicker\").val();\n var end_hour = parseInt($(\"#end_hour\").val());\n var end_min = parseInt($(\"#end_min\").val());\n var end_ampm = $(\"#end_ampm\").val();\n\n // check the start and end inputs, set to certain defaults if the user was dumb\n\n // if they don't give a start date, set it to the start previously\n if (! start_date)\n start_date = DatetimetoSlashdate(start);\n // if all we have is a start date and minutes, make the event at midnight\n if (! start_hour) {\n start_hour = start.getHours();\n start_min = 0;\n start_ampm = \"AM\";\n }\n // if we have a start hour but no minutes, give zero minutes\n else if (start_hour && !start_min)\n start_min = 0;\n\n // same business for end inputs\n if (! end_date)\n end_date = DatetimetoSlashdate(end);\n if (! end_hour) {\n end_hour = 12;\n end_min = 0;\n end_ampm = \"AM\";\n }\n else if (end_hour && !end_min)\n end_min = 0;\n\n // Now we can finally convert these to actual datetimes\n // get start\n var start_datetime = toDatetime( start_date, start_hour, start_min, start_ampm);\n\n // get end\n var end_datetime = toDatetime( end_date, end_hour, end_min, end_ampm);\n\n\n // handle the cases where the end is before the start\n if (end_datetime < start_datetime) {\n end_datetime = dateChange(start_datetime, 0, 120);\n }\n // if start and end time are the same, let's say it's implied that we have an allDay event\n if (end_datetime == start_datetime)\n allDay = true;\n\n // make sure endRepeat is now before the start date\n if (endRepeat < start_datetime)\n endRepeat = null;\n\n // create object to return\n var userData = {\n title: title,\n start: start_datetime,\n end: end_datetime,\n allDay: allDay,\n type: type,\n rrule: rrule,\n endRepeat: endRepeat\n };\n\n // return this data object\n return userData;\n}", "title": "" }, { "docid": "ca27503a7e54ee95da623e4bc5442036", "score": "0.50773644", "text": "function beforeRenderStartDateTime($view, $dates, $leftDate, $upDate, $rightDate, where, enddt, parentStartDt, parentEndDt) {\r\n $log.debug(where + \" \" + $view + \" Parent Start:\" + (typeof parentStartDt === 'undefined' ? \"blank\" : moment( parentStartDt).format(\"YYYYMMDD HH:mm\")) + \r\n \" Parent end:\" + (typeof parentEndDt === 'undefined' ? \"blank\" : moment( parentEndDt).format(\"YYYYMMDD HH:mm \")) + \r\n \" end date:\" + (typeof enddt === 'undefined' ? \"blank\" : moment( enddt).format(\"YYYYMMDD HH:mm\")));\r\n \r\n var endDate = moment(\"20990101\",\"YYYYMMDD\");\r\n var startDate = moment(\"19700101\",\"YYYYMMDD\");\r\n if (enddt) {\r\n if ($view === 'hour' || $view === 'minute') {\r\n endDate = moment(enddt);\r\n } else {\r\n endDate = moment(enddt).endOf('day');\r\n }\r\n //endDate = moment(enddt); //.endOf('day'); \r\n }\r\n if (parentEndDt) {\r\n var parentEndDate = moment(parentEndDt).endOf('day');//.add(1, 'day'); //.subtract(1, 'minute');\r\n if (parentEndDate.valueOf() < endDate.valueOf()) {\r\n endDate = parentEndDate; \r\n } \r\n }\r\n \r\n /* if there is a master start date, this must be greater than it */\r\n if (parentStartDt) {\r\n startDate = moment(parentStartDt).startOf('day'); //.subtract(1, $view);//.add(1, 'hour');\r\n }\r\n for (var i = 0; i < $dates.length; i++) {\r\n //This is the DST fix.\r\n if ( $view !== 'hour' && $view !== 'minute' && moment($dates[i].localDateValue()).format(\"HH:mm\") === \"23:00\") {\r\n $dates[i].utcDateValue = moment($dates[i].utcDateValue).add(1, 'hour');\r\n }\r\n if ( moment($dates[i].localDateValue()).startOf($view) <= endDate.startOf($view) && moment($dates[i].localDateValue()).startOf($view) >= startDate.startOf($view) ) {\r\n $dates[i].selectable = true;\r\n $log.debug(\"start:\" + moment($dates[i].localDateValue()).format(\"YYYYMMDD HH:mm\") + ' - allowed between( ' + moment(startDate.valueOf()).format(\"YYYYMMDD HH:mm\") + \" & \" + moment(endDate.valueOf()).format(\"YYYYMMDD HH:mm\")+ ')');\r\n } else {\r\n $dates[i].selectable = false;\r\n $log.debug(\"start:\" + moment($dates[i].localDateValue()).format(\"YYYYMMDD HH:mm\") + ' - not allowed ' + moment(startDate.valueOf()).format(\"YYYYMMDD HH:mm\") + \" & \" + moment(endDate.valueOf()).format(\"YYYYMMDD HH:mm\")+ ')');\r\n }\r\n }\r\n \r\n }", "title": "" }, { "docid": "8e495b9cb80f548f5e9be384f9ef58d5", "score": "0.5077343", "text": "function getAppointmentInfo(){\n var count = $(\".appointment-data-unit\").length;\n var allEvents = [];\n for(i=0;i<count;i++){\n var addToEvents = {\n eventId: $(`.appointment-data-unit:nth-child(${i+1}) .app-id-data-field`).text(),\n profileId: $(`.appointment-data-unit:nth-child(${i+1}) .app-profid-data-field`).text(),\n clientId: $(`.appointment-data-unit:nth-child(${i+1}) .app-clientid-data-field`).text(),\n clientName: $(`.appointment-data-unit:nth-child(${i+1}) .app-clientname-data-field`).text(),\n startTime: $(`.appointment-data-unit:nth-child(${i+1}) .app-starttime-data-field`).text(),\n endTime: $(`.appointment-data-unit:nth-child(${i+1}) .app-endtime-data-field`).text(),\n eventDuration: $(`.appointment-data-unit:nth-child(${i+1}) .app-duration-data-field`).text(),\n eventDate: $(`.appointment-data-unit:nth-child(${i+1}) .app-startdate-data-field`).text(),\n eventNotes: $(`.appointment-data-unit:nth-child(${i+1}) .app-notes-data-field`).text()\n };\n allEvents.push(addToEvents);\n }\n return(allEvents);\n}", "title": "" }, { "docid": "fed9ac720f3d6f4890479962f9fec305", "score": "0.5071226", "text": "function updateSlotsFromSlotList() {\n\t\tslotsContainer.children('.'+cssSlot+', .'+cssSolidSlot).remove();\n\t\tvar startTimes = [];\n\t\tslotList.forAll(function(azslot){\n\t\t\tif (azslot.getPlanned_activities() != null && !azslot.getPlanned_activities().isEmpty()) {\n\t\t\t\tcreateSolidSlot(azslot.getStart_time().getHours().get() * 60 + parseInt(azslot.getStart_time().getMinutes().get()));\n\t\t\t} else {\n\t\t\t\tstartTimes.push(\n\t\t\t\t\t\tparseInt(azslot.getStart_time().getHours().get() * 60) + \n\t\t\t\t\t\tparseInt(azslot.getStart_time().getMinutes().get())\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t\tstartTimes.sort(function(a,b){return a-b;});\n\t\timAdjustingVisibleSlots = true;\n\t\tfor (var i = 0; i < startTimes.length; i++) {\n\t\t\t// deal with adjacent slots\n\t\t\tvar j = i + 1;\n\t\t\twhile (j < startTimes.length && startTimes[j] == parseInt(startTimes[j-1]) + parseInt(slotDuration)) { j++;}\n\t\t\tj--;\n\t\t\tif (i != j) {\n\t\t\t\tcreateSlot(startTimes[i], (1+j-i) * slotDuration);\n\t\t\t\ti = j;\n\t\t\t} else {\n\t\t\t\tcreateSlot(startTimes[i]);\n\t\t\t}\n\t\t}\n\t\timAdjustingVisibleSlots = false;\n\t}", "title": "" }, { "docid": "819f85ec83d6ee7496f74030d8760921", "score": "0.5045539", "text": "startMeeting(event) {\n console.info('Start Meeting');\n let meetingId = event.currentTarget.dataset.meetingid;\n console.info('Meeting Salesforce Id : ', meetingId);\n console.info('User cId: ', this.cId);\n\n // Get unique meeting Id\n let meetings = this.meetingsHistoryList;\n let uniqueId = '';\n\n let startDate, startTime, endDate, endTime;\n\n meetings.forEach(function (meeting) {\n console.info('meeting: ', meeting);\n if (meeting.index === meetingId) {\n uniqueId = meeting.uniqueMeetingId;\n startDate = meeting.startDate;\n startTime = meeting.startTime;\n endDate = meeting.endDate;\n endTime = meeting.endTime;\n }\n });\n console.info('Meeting uniqueId: ', uniqueId);\n this.updateMeetingUniqueId = uniqueId;\n\n let dt = new Date(startDate);\n let startTimeArr = startTime.split(':');\n dt.setHours(startTimeArr[0]);\n dt.setMinutes(startTimeArr[1]);\n\n let dtEnd = new Date(endDate);\n let endTimeArr = endTime.split(':');\n dtEnd.setHours(endTimeArr[0]);\n dtEnd.setMinutes(endTimeArr[1]);\n \n const miliisecNow = Date.now();\n const miliisecStart = dt.getTime();\n const miliisecEnd = dtEnd.getTime();\n\n if(miliisecNow < miliisecStart - 30*60000) {\n console.info('This meeting cannot be started earlier than 30 minutes before planning.');\n this.showToast('Error', 'This meeting cannot be started earlier than 30 minutes before planning.', 'error');\n } else if(miliisecNow > miliisecEnd) {\n console.info('The scheduled meeting is over. Create a new meeting.');\n this.showToast('Error', 'The scheduled meeting is over. Create a new meeting.', 'error');\n } else {\n // Log in as admin\n // Get AccessToken\n getAccessToken()\n .then(result => {\n console.info('result from CustomSettings response: ', result);\n const response = JSON.parse(result);\n this.accessToken = response.access_token;\n this.accountKey = response.account_key;\n\n this.loginData = {\n accessToken : response.access_token,\n accountKey : response.account_key\n };\n return this.loginData\n })\n .then(result => getUsers({data: result})\n .then(result => {\n console.info('Users Result: ', JSON.parse(result).results);\n let users = JSON.parse(result).results;\n\n // Set users to variable\n this.users = users;\n return users;\n })\n .catch(error => {\n this.showToast('Error getting users from GTM', 'error');\n console.error('Error getting users data: ', error);\n throw new Error('Error getting users from GTM');\n })\n .then(result => {\n let matched = null;\n\n // Set email\n let currentUserEmail = '';\n if (this.contactLogMeInEmail) {\n currentUserEmail = this.contactLogMeInEmail;\n } else {\n const email = this.contactEmail;\n console.info('User email: ', email);\n if(email.includes('@ean.org')) {\n // if email contains @ean.org\n currentUserEmail = email;\n console.info('Email includes @ean.org. Using email: ', currentUserEmail);\n } else {\n // if not\n currentUserEmail = email.replace(/@/g,'.') + '@ean.org';\n console.info('Email NOT includes @ean.org. Using email: ', currentUserEmail);\n }\n }\n\n result.forEach(function (user) {\n const userEmail = user.email;\n if(userEmail === currentUserEmail) {\n console.info('User matched: ', currentUserEmail);\n matched = user;\n }\n });\n // stored matched user or null\n if(matched) {\n this.matchedUser = matched;\n return getLicenses({data: this.loginData});\n } else {\n console.info('User not matched: ', currentUserEmail);\n this.matchedUser = null;\n throw new Error('User not matched');\n }\n // return getLicenses({data: this.loginData});\n })\n .then(result => {\n console.info('Licenses: ', JSON.parse(result).results);\n const licenses = JSON.parse(result).results;\n // Set license\n this.license = licenses[0];\n\n if(licenses[0].enabled) {\n this.showToast('Success',\n 'Licenses successfully received. License is valid.',\n 'success');\n this.license = licenses[0];\n } else {\n this.showToast('Success',\n 'Licenses successfully received. License is not activate.',\n 'error');\n }\n return result;\n })\n .catch(error => {\n this.showToast('Error getting licenses', 'error');\n console.error('Error getting licenses data: ', error);\n throw new Error('Error getting licenses');\n }))\n .then(result=> {\n if(this.matchedUser) {\n\n // ***** User is exist in LogMeIn *****\n console.info('User is exist on GTM.');\n\n this.startMeetingAsOwner(null);\n } else {\n\n // ***** User is NOT exist in LogMeIn *****\n console.error('User is not exist on GTM.');\n this.showToast('User is not exist on GTM.', 'error');\n throw new Error('User is not exist on GTM.');\n // TODO: add logic if user is not exist\n }\n });\n }\n }", "title": "" }, { "docid": "5a53e62b531082e806fed0be149da110", "score": "0.5041806", "text": "function getAppointment(id){\n var days = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"];\n \n // example id = Monday-12:00\n let day = id.split('-')[0];\n\n let numericDay = days.indexOf(day);\n console.log(numericDay);\n\n let cellDate = new Date(dateConfig.monday.getDate() + numericDay);\n console.log(cellDate);\n return cellDate.toString();\n}", "title": "" }, { "docid": "6000ade43ec5bc484f8e753757b63590", "score": "0.50403714", "text": "function initDatePeriod(dataNode,startId,endId,opts){\n var startDataNodeAttribute = startId;\n var endDataNodeAttribute = endId;\n if(typeof opts != 'undefined'){\n if(typeof opts.startDataNodeAttribute != 'undefined') startDataNodeAttribute = opts.startDataNodeAttribute;\n if(typeof opts.endDataNodeAttribute != 'undefined') endDataNodeAttribute = opts.endDataNodeAttribute;\n }\n \n //initialize values of start and end date from datanodeattributes\n if(dataNode[startDataNodeAttribute] != null){ \n var startDate = stringToDate(dataNode[startDataNodeAttribute],'yyyy-mm-dd');\n if(startDate != 'Invalid Date') $('#'+startId).val(dateToString(startDate,'dd/mm/yyyy'));\n }\n if(dataNode[endDataNodeAttribute] != null){ \n var endDate = stringToDate(dataNode[endDataNodeAttribute],'yyyy-mm-dd');\n if(endDate != 'Invalid Date') $('#'+endId).val(dateToString(endDate,'dd/mm/yyyy'));\n }\n \n \n \n $('#'+startId).datepicker({\n format : 'dd/mm/yyyy'\n });\n \n $('#'+endId).datepicker({\n format : 'dd/mm/yyyy'\n });\n \n //date logic for audition start and end\n $('#'+startId).change(function(){\n if($('#'+startId).val() == ''){\n $('#'+endId).val('');\n dataNode[startDataNodeAttribute] = '';\n dataNode[endDataNodeAttribute] = '';\n return;\n }\n \n var endTime = -1;\n var startDate = stringToDate($('#'+startId).val(),'dd/mm/yyyy');\n if(startDate == 'Invalid Date') {\n $('#'+startId).val('');\n return;\n }\n \n var endDate = startDate;\n \n if($('#'+endId).val() != ''){ \n endDate = stringToDate($('#'+endId).val(),'dd/mm/yyyy');\n endTime = Date.parse(endDate); \n }\n \n if(endTime == -1 || Date.parse(startDate) > endTime){\n $('#'+endId).val($('#'+startId).val()).datepicker('update');\n }\n \n dataNode[startDataNodeAttribute] = dateToString(startDate,'yyyy-mm-dd');\n dataNode[endDataNodeAttribute] = dateToString(endDate,'yyyy-mm-dd');\n $('.datepicker').hide();\n });\n \n $('#'+endId).change(function(){\n if($('#'+endId).val() == ''){\n $('#'+startId).val('');\n dataNode[startDataNodeAttribute] = '';\n dataNode[endDataNodeAttribute] = '';\n return;\n }\n \n var startTime = -1;\n var endDate = stringToDate($('#'+endId).val(),'dd/mm/yyyy');\n if(endDate == 'Invalid Date') endDate = new Date();\n var startDate = endDate;\n \n if($('#'+startId).val() != ''){ \n startDate = stringToDate($('#'+startId).val(),'dd/mm/yyyy');\n startTime = Date.parse(startDate); \n }\n if(startTime == -1 || Date.parse(endDate) < startTime){\n $('#'+startId).val($('#'+endId).val()).datepicker('update');\n }\n \n dataNode[startDataNodeAttribute] = dateToString(startDate,'yyyy-mm-dd');\n dataNode[endDataNodeAttribute] = dateToString(endDate,'yyyy-mm-dd');\n $('.datepicker').hide();\n });\n}", "title": "" }, { "docid": "f72e939f010de5b9bb73d5c0216b3635", "score": "0.50349385", "text": "function getApontamentosByDateRangeAndEquipe(beginDate, endDate, funcionario) {\n\n var dateAux = new Date(beginDate);\n var endDateAux = new Date(endDate);\n\n var objDateWorker = {\n date: {\n raw: beginDate,\n year: dateAux.getFullYear(),\n month: dateAux.getMonth(),\n day: dateAux.getDate(),\n hour: dateAux.getHours(),\n minute: dateAux.getMinutes(),\n finalInclude: true,\n final: {\n raw: endDate,\n year: endDateAux.getFullYear(),\n month: endDateAux.getMonth(),\n day: endDateAux.getDate(),\n hour: endDateAux.getHours(),\n minute: endDateAux.getMinutes()\n }\n },\n funcionario: funcionario\n };\n\n //Ajeita a formatação da data para não ter problema com a visualização\n $scope.periodoApontamento = [];\n\n appointmentAPI.getApontamentosByDateRangeAndFuncionario(objDateWorker).then(function successCallback(response){\n\n var apontamentosResponse = response.data;\n //console.log(\"!@# Apontamentos do funcionário: \", apontamentosResponse);\n //$scope.periodoApontamento = calcularBancoHoras(dateAux, endDateAux, 1, apontamentosResponse, funcionario);\n var objRetornoCalculo = calcularBancoHoras(dateAux, endDateAux, 1, apontamentosResponse, funcionario);\n\n $scope.periodoApontamento = objRetornoCalculo.arrayItemApontamentos;\n $scope.diasTrabalho = objRetornoCalculo.diasTrabalho;\n $scope.diasParaTrabalhar = objRetornoCalculo.diasParaTrabalhar;\n $scope.minutosTrabalhadosFtd = objRetornoCalculo.minutosTrabalhadosFtd;\n $scope.minutosParaTrabalharFtd = objRetornoCalculo.minutosParaTrabalharFtd;\n $scope.saldoFinalPositivoFtd = objRetornoCalculo.saldoFinalPositivoFtd;\n $scope.saldoFinalNegativoFtd = objRetornoCalculo.saldoFinalNegativoFtd;\n $scope.saldoFinalMesPos = objRetornoCalculo.saldoFinalMesPos;\n $scope.saldoFinalMesNeg = objRetornoCalculo.saldoFinalMesNeg;\n $scope.saldoFinalMesFtd = objRetornoCalculo.saldoFinalMesFtd;\n\n }, function errorCallback(response){\n \n $scope.errorMsg = response.data.message;\n });\n }", "title": "" }, { "docid": "439bec7dc9c02409aa8ff833c5eae2c3", "score": "0.50345564", "text": "function setupGanttDateRange() {\n var datePaddingScale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : self._viewMode;\n var datePaddingQty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : self.option.datePaddingQty;\n\n var checkTasks = function checkTasks(tasks, startDate, endDate) {\n tasks.forEach(function (task) {\n if (!startDate || task.startDate.getTime() < startDate.getTime()) startDate = task.startDate;\n if (!endDate || task.endDate.getTime() > endDate.getTime()) endDate = task.endDate;\n if (task.childTask) {\n var _checkTasks = checkTasks(task.childTask, startDate, endDate);\n\n var _checkTasks2 = slicedToArray(_checkTasks, 2);\n\n startDate = _checkTasks2[0];\n endDate = _checkTasks2[1];\n }\n });\n return [startDate, endDate];\n };\n // find min and max date\n\n var _checkTasks3 = checkTasks(self.tasks),\n _checkTasks4 = slicedToArray(_checkTasks3, 2),\n startDate = _checkTasks4[0],\n endDate = _checkTasks4[1];\n // date qty auto configuration\n\n\n if (typeof datePaddingQty === 'string') {\n var diff = DateUtil.diff(startDate, endDate, datePaddingScale);\n var count = datePaddingScale >= DateScale.MONTH ? 18 : 30;\n datePaddingQty = diff < count ? (count - diff) / 2 : 4;\n }\n // if user does not input range date, add padding date\n if (!self.option.startDate) {\n self.startDate = DateUtil.add(DateUtil.startOf(startDate, datePaddingScale), -datePaddingQty, datePaddingScale);\n }\n if (!self.option.endDate) {\n self.endDate = DateUtil.add(DateUtil.startOf(endDate, datePaddingScale), datePaddingQty, datePaddingScale);\n }\n }", "title": "" }, { "docid": "357a6935ba1f90619bd8e3c72fe7ceac", "score": "0.50335264", "text": "function dateRangeGenerator({\n maxDaysAhead,\n typicalStartHour,\n minDuration = 2,\n maxDuration = 8,\n rng = lowBias\n}) {\n return () => {\n const today = startOfDay(new Date());\n const dayOffset = rng(maxDaysAhead);\n const duration = random(minDuration, maxDuration);\n const startHour = typicalStartHour - 0.5 * duration;\n\n const startDate = addDays(addHours(today, startHour), dayOffset);\n const endDate = addHours(startDate, duration);\n\n return { startDate, endDate };\n };\n}", "title": "" }, { "docid": "8a77b512be9086fa7b0b5b51fa3f9a95", "score": "0.5028637", "text": "clearSlots(start, end) {\r\n for (var i = start ; i < end; i++)\r\n this.time_slots[i] = new Time_Slot(this.day_of_week, i, null);\r\n }", "title": "" }, { "docid": "7bad4864bde37dd21e2767298e8da6a4", "score": "0.50251293", "text": "function customRangeStart(input){\n return {\n maxDate:(input.id == \"startDate\" ?angular.element(\"#endDate\").datepicker(\"getDate\") : null)\n };\n }", "title": "" }, { "docid": "7bad4864bde37dd21e2767298e8da6a4", "score": "0.50251293", "text": "function customRangeStart(input){\n return {\n maxDate:(input.id == \"startDate\" ?angular.element(\"#endDate\").datepicker(\"getDate\") : null)\n };\n }", "title": "" }, { "docid": "7bad4864bde37dd21e2767298e8da6a4", "score": "0.50251293", "text": "function customRangeStart(input){\n return {\n maxDate:(input.id == \"startDate\" ?angular.element(\"#endDate\").datepicker(\"getDate\") : null)\n };\n }", "title": "" }, { "docid": "6efb1ac4b6ebb74223e0f42c02148978", "score": "0.5022652", "text": "function init() {\n displayPeriods(today);\n\n slotsPeriodSelector.addEventListener('input', (e) => {\n // Extract day, month, and year from dd/mm/yyyy format\n const startDateParts = e.target.selectedOptions[0].value.split(' ')[0].split('/');\n const startDate = new Date(startDateParts[2], startDateParts[1] - 1, startDateParts[0]);\n\n // Show slots for the week\n displayWeek(selectWeek(startDate));\n });\n\n requestAppointmentForm.addEventListener('submit', validateRequestForm);\n}", "title": "" }, { "docid": "61276eea86c15bb353724d66568b5a6c", "score": "0.50189626", "text": "function getDateFromIntent(intent) {\n\n var dateSlot = intent.slots.Date;\n // slots can be missing, or slots can be provided but with empty value.\n // must test for both.\n if (!dateSlot || !dateSlot.value) {\n // default to today\n return {\n displayDate: \"Today\",\n requestDateParam: \"date=today\"\n }\n } else {\n\n var date = new Date(dateSlot.value);\n\n // format the request date like YYYYMMDD\n var month = (date.getMonth() + 1);\n month = month < 10 ? '0' + month : month;\n var dayOfMonth = date.getDate();\n dayOfMonth = dayOfMonth < 10 ? '0' + dayOfMonth : dayOfMonth;\n var requestDay = \"begin_date=\" + date.getFullYear() + month + dayOfMonth +\n \"&range=24\";\n\n return {\n displayDate: alexaDateUtil.getFormattedDate(date),\n requestDateParam: requestDay\n }\n }\n}", "title": "" }, { "docid": "05bdba431be8844337162b0bb7bbad3f", "score": "0.5011726", "text": "function createEvents () {\r\n\r\n for(let i = 0; i < api.length; i++){\r\n let event = api[i].date;\r\n let myDate = new Date(event); \r\n let newDate = {\r\n //myDate.getDate()\r\n date: Math.floor((Math.random() * 31) + 1),\r\n //myDate.getMonth()\r\n month: Math.floor((Math.random() * 12) + 1),\r\n year: myDate.getFullYear(),\r\n };\r\n let testDate = `${newDate.year}-${newDate.month}-${newDate.date}`\r\n let myTestDate = new Date(testDate); //creates date format testDate\r\n\r\n newDate.day = myTestDate.getDay()+1; //sets day of week\r\n newDate.week = getWeekNumber(myTestDate); //sets week number by calling getWeekNumber\r\n\r\n assignMonth(newDate.month);\r\n assignWeek(newDate.week, newDate);\r\n assignDay(newDate.day);\r\n }\r\n }", "title": "" }, { "docid": "d9206bee5738fcf9fd0b9cd9ceb73a10", "score": "0.5010781", "text": "function drawPickerSetDate() {\n const slotDate = $('#pickupdate').data('date') || $('#slotsarea').data('firstavailableslotdate');\n\n if (slotDate && slotDate !== 'undefined') {\n const focusDate = new Date(slotDate).setHours(0, 0, 0, 0);\n const daystogo = Math.round((focusDate - new Date().setHours(0, 0, 0, 0)) / (1000 * 60 * 60 * 24));\n setFirstShownDate(daystogo, 3);\n\n const dayslot3 = `#radio-3-${slotDate}`;\n const dayslot7 = `#radio-7-${slotDate}`;\n $(dayslot3).attr('checked', 'checked');\n $(dayslot7).attr('checked', 'checked');\n drawSlots($(dayslot7));\n } else {\n drawPicker();\n }\n}", "title": "" }, { "docid": "019289baa4be4f1b37b96026124b9615", "score": "0.50068635", "text": "function getAppointments() {\n // all projects so set projectId to null\n lsAppts.getApptsAsync(null, _self.userId, _self.selectedDate)\n .then(success);\n\n function success(data) {\n _self.appts = data;\n }\n }", "title": "" }, { "docid": "7d38a8dcc87908a9304501fcd72e8de2", "score": "0.50052714", "text": "buildEventsDateFormat (events) {\n events.forEach(event => {\n event.datestart = moment(event.datestart, 'DD-MM-YYYY HH:mm')\n event.dateend = moment(event.dateend, 'DD-MM-YYYY HH:mm')\n })\n }", "title": "" }, { "docid": "2e71580cd7dbb4832e63bee42da03ed7", "score": "0.50043595", "text": "function getAppts() {\n var priorAppts = JSON.parse(localStorage.getItem(\"calEvents\")) || [];\n\n if(priorAppts !== null) {\n for(i=0; i < priorAppts.length; ++i){\n // Make sure this is the correct day. \n if(priorAppts[i].date == dtToday.format(\"dddd\" + \", \" + \"MMMM\" + \" \" + \"Do\" + \" \" + \"YYYY\")){\n document.querySelector(\".T-\" + priorAppts[i].timeslot).value = priorAppts[i].appt;\n }\n }\n }\n}", "title": "" }, { "docid": "b50acc4f6f88b4d166efd0baabcf1547", "score": "0.4989066", "text": "function slots(data) {\n\n var t = JSON.parse(data);\n\n var morningSlots = []\n var afternoonSlots = [];\n var eveningSlots = [];\n \n var morningSlotsDiv = document.getElementsByClassName(\"slotBoxMorning\")[0];\n var eveningSlotsDiv = document.getElementsByClassName(\"slotBoxEvening\")[0];\n var afternoonSlotsDiv = document.getElementsByClassName(\"slotBoxAfternoon\")[0];\n var noslots = \"<p>No slots</p>\";\n\n t.map((time) => {\n switch (time.type) {\n case 'M': morningSlots = createSlotsArray(time.Stime, time.Etime, time.duration);\n morningSlots.pop();\n break;\n case 'A': afternoonSlots = createSlotsArray(time.Stime, time.Etime, time.duration);\n afternoonSlots.pop();\n break;\n case 'E': eveningSlots = createSlotsArray(time.Stime, time.Etime, time.duration);\n eveningSlots.pop();\n break;\n default:console.log(\"nothing\")\n }\n\n });\n if (morningSlots.length > 0) {\n slotRender(morningSlots, morningSlotsDiv);\n } else {\n morningSlotsDiv.innerHTML = noslots;\n }\n\n if (afternoonSlots.length > 0) {\n slotRender(afternoonSlots, afternoonSlotsDiv);\n } else {\n afternoonSlotsDiv.innerHTML = noslots;\n }\n\n if (eveningSlots.length > 0) {\n slotRender(eveningSlots, eveningSlotsDiv);\n } else {\n eveningSlotsDiv.innerHTML = noslots;\n }\n\n}", "title": "" }, { "docid": "f8ea5c6981592f310e2ac65265834905", "score": "0.49870527", "text": "function daily_program_check_overlaping (event) {\n\n // Check if event is daily program\n if(!event.program_index) {\n return false;\n }\n\n\n // gets all event of the calendar\n var allevents = $('#calendar').fullCalendar('clientEvents');\n \n // For each event check if there is one with same date and that is a programm index\n for (index = 0; index < allevents.length; ++index) {\n // Check if it's a program_index\n if(allevents[index].program_index != null && allevents[index].program_index != \"\") {\n \n // Check if our event is ovelapping\n // (StartA <= EndB) and (EndA >= StartB)\n StartA = $.fullCalendar.formatDate(allevents[index].start, \"yyyy-MM-dd\");\n StartB = $.fullCalendar.formatDate(event.start, \"yyyy-MM-dd\");\n EndA = $.fullCalendar.formatDate(allevents[index].end, \"yyyy-MM-dd\");\n EndB = $.fullCalendar.formatDate(event.end, \"yyyy-MM-dd\");\n if (EndB == \"\")\n EndB = StartB;\n \n\n if ( (allevents[index].id != event.id) && (StartA <= EndB) && (EndA >= StartB) )\n {\n // To debug : val = allevents[index].title;\n return true;\n }\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "4dae367275342cad91fbf9923c585e29", "score": "0.49863914", "text": "function createOpenedSlot(start, end) {\n var frag = document.createDocumentFragment(),\n cont = document.createElement('div'),\n p = document.createElement('p'),\n li = document.createElement('li'),\n div = document.createElement('div');\n cont.classList.add('fj-time-slot');\n div.classList.add('fj-dropdown-container');\n p.innerHTML = 'Start Time';\n div.appendChild(p);\n p = document.createElement('ul');\n p.setAttribute('data-cur', 'start');\n p.classList.add('fj-dropdown-button');\n if(start === '-:- --') {\n li.innerHTML = '-:- --';\n p.appendChild(li);\n li = document.createElement('li');\n li.classList.add('is-active');\n li.innerHTML = '-:- --';\n p.appendChild(li);\n li = document.createElement('li');\n li.innerHTML = '-:- --';\n } else {\n li.innerHTML = start.clone()\n .subtract(5, 'm')\n .format('h:mm A');\n p.appendChild(li);\n li = document.createElement('li');\n li.classList.add('is-active');\n li.innerHTML = start.format('h:mm A');\n p.appendChild(li);\n li = document.createElement('li');\n li.innerHTML = start.clone()\n .add(5, 'm')\n .format('h:mm A');\n }\n p.appendChild(li);\n div.appendChild(p);\n cont.appendChild(div);\n p = document.createElement('p');\n p.innerHTML = 'to';\n cont.appendChild(p);\n div = document.createElement('div');\n div.classList.add('fj-dropdown-container');\n p = document.createElement('p');\n p.innerHTML = 'End Time';\n div.appendChild(p);\n p = document.createElement('ul');\n p.setAttribute('data-cur', 'end');\n p.classList.add('fj-dropdown-button');\n li = document.createElement('li');\n if(end === '-:- --') {\n li.innerHTML = '-:- --';\n p.appendChild(li);\n li = document.createElement('li');\n li.classList.add('is-active');\n li.innerHTML = '-:- --';\n p.appendChild(li);\n li = document.createElement('li');\n li.innerHTML = '-:- --';\n } else {\n li.innerHTML = end.clone()\n .subtract(5, 'm')\n .format('h:mm A');\n p.appendChild(li);\n li = document.createElement('li');\n li.classList.add('is-active');\n li.innerHTML = end.format('h:mm A');\n p.appendChild(li);\n li = document.createElement('li');\n li.innerHTML = end.clone()\n .add(5, 'm')\n .format('h:mm A');\n }\n p.appendChild(li);\n div.appendChild(p);\n cont.appendChild(div);\n frag.appendChild(cont);\n return frag;\n}", "title": "" }, { "docid": "9435b9dc563a357936e3f47b972b2a8e", "score": "0.49553433", "text": "function createNewAppointments() {\n var interval = 5; // if the script runs every 5 minutes; change otherwise\n var date = new Date();\n var day = date.getDay();\n var hour = date.getHours();\n if ([6,0].indexOf(day) > -1 || (day >=1 && day<=6 && (hour < 8 || hour >= 17))) {\n // var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;\n var threads = GmailApp.search('from:[email protected] subject:new appointment after:');\n var findDate = /^((Mon|Tue|Wed|Thur|Fri|Sat).+)$/gim;\n var findEmail = /^(([^<>()\\[\\]\\.,;:\\s@\\\"]+(\\.[^<>()\\[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/gim;\n var findPhone = /^\\+?[0-9]?\\s?\\(?[0-9]{3}\\)?\\s[0-9]{3}\\-?[0-9]{4}?$/gim;\n var breakL = /\\n/gim;\n var extDate = /([0-9]{1,2}\\s[a-zA-Z]{3}\\s[0-9]{4})|([0-9]{1,2}\\:[0-9]{1,2})/g;\n \n for (var i = 0; i < threads.length; i++) { \n // threads[i].markUnread();\n // Logger.log(threads[i].isUnread());\n if (threads[i].isUnread()){\n var messages = threads[i].getMessages();\n for (var i2 = 0; i2 < messages.length; i2++) { \n // messages[i2].markUnread();\n if(messages[i2].isUnread()){\n var str1 = messages[i2].getPlainBody();\n // Logger.log(str1);\n \n var calProps = {\n titles:[],\n dates:[],\n email: null,\n phone: null,\n name: null\n };\n \n var str_a = str1.split(breakL).filter(function(word,ix){\n if(word.match(extDate)){\n var dt = {\n from: new Date(word.match(extDate).join(\" \")+(word.match(/(pm)/)?' pm':' am')+\"-05:00\"),\n to : new Date(word.match(extDate).join(\" \")+(word.match(/(pm)/)?' pm':' am')+\"-05:00\")\n };\n dt.to = new Date(dt.to.setHours(dt.to.getHours() + 1));\n calProps.dates.push(dt);\n return true;\n }else if(word.match(findEmail)){\n calProps.email = word;\n return true\n }else if(word.match(findPhone)){\n calProps.phone = word;\n return true;\n }else{\n // look ahead\n if(findDate.test(str1.split(breakL)[ix+1])){\n calProps.titles.push(word);\n return true;\n }else if(findEmail.test(str1.split(breakL)[ix+1])){\n calProps.name = word;\n return true;\n }else{\n return false;\n }\n }\n });\n \n Logger.log(calProps);\n for(var i3=0; i3 < calProps.titles.length; i3++){\n var event = CalendarApp.getCalendarsByName('Salon Bookings')[0]\n .createEvent(\"Online Booking : Salon Appointment for \"+calProps.name,calProps.dates[i3].from,calProps.dates[i3].to,{\n location: \"29 Kings House Ave, Kingston, Jamaica\",\n guests: calProps.email,\n description: calProps.titles[i3]+\"\\n\\nMessage Body:\\n\"+str1\n });\n // event.setVisibility(Visibility.PUBLIC);\n Logger.log(\"EventId: \"+event.getId()+\"\\n\");\n Logger.log(\"EventTitle: \"+event.getTitle()+\"\\n\");\n Logger.log(\"EventST: \"+event.getStartTime()+\"\\n\");\n Logger.log(\"EventST: \"+event.getGuestList()+\"\\n\");\n }\n messages[i2].markRead();\n }\n \n }\n \n \n // threads[i].reply(\"I am out of office. Our business hours are: \\n Manufacturing (Mon-Wed 9am-5pm)\\n Salon (Thur-Sat 9am until our last client leaves), no bookings after 5pm.\\n\\n We apologize for any inconvenience caused: kindly allow until next business day to respond to any of your queries.\\n\\n Cheers,\\nSherelle Curtis Mrs\\nOwner\\Operator\\Team Lead\",{\n // htmlBody:\"I am out of office. Our business hours are: <ul><li>Manufacturing (Mon-Wed 9am-5pm)</li><li>The Beauty Bar (Thur-Sat 9am until our last client leaves), no bookings after 5pm.<</li></ul>\\n\\n We apologize for any inconvenience caused: kindly allow until next business day to respond to any of your queries.Cheers,\\nSherelle Curtis Mrs\\nOwner\\Operator\\Team Lead\",\n // noReply:true\n // });\n \n threads[i].markRead();\n threads[i].markImportant();\n }\n }\n }\n }", "title": "" }, { "docid": "ec87f54bd96d1017c368fc1c479ed542", "score": "0.4951256", "text": "async getReservations() {\n const reservations = await axios_1.default.get(`${this.baseURL}/reservations/current`, { headers: { 'Authorization': `Bearer ${this.accessToken}` } });\n const mappedRes = reservations.data.map((res) => {\n const parsedFrom = new Date(`${res.day}T${res.slot_name.split('-')[0]}`);\n const parsedTo = new Date(`${res.day}T${res.slot_name.split('-')[1]}`);\n if (parsedTo.getHours() < 6)\n parsedTo.setDate(parsedTo.getDate() + 1);\n return {\n reservationId: res.id,\n object: { id: res.object_id, name: res.object_name },\n parent: { id: res.parent_id, name: res.parent_name },\n slot: { id: res.slot_id, name: res.slot_name },\n from: parsedFrom,\n to: parsedTo\n };\n });\n return mappedRes;\n }", "title": "" }, { "docid": "41b7ac2ff134ca412f56b5d7c29159eb", "score": "0.49485886", "text": "function getDates() {\n\t//get and interpret the string gotten from the inputs as correct dates (subtract one from the month because Date expects the month to be zero-indexed and the input is not gotten that way)\n\tstartDate = new Date(parseISOString(document.getElementById('startDate').value));\n\tendDate = new Date(parseISOString(document.getElementById('endDate').value));\n\n\tconsole.log(`Start Date: ${startDate}; End Date: ${endDate}`);\n}", "title": "" }, { "docid": "c4afbd4f3edc0829e84168315475c3c4", "score": "0.4946938", "text": "function validateDateInput() {\n\t\n\t\n\tvar today = new Date();\n\tvar day = today.getDate();\n\tvar month = today.getMonth() + 1;\n\tvar year = today.getFullYear();\n\tif (day < 10) {\n\t\tday = '0' + day\n\t}\n\tif (month < 10) {\n\t\tmonth = '0' + month\n\t}\n\n\ttoday = year + '-' + month + '-' + day;\n\tconsole.log(\"Date: \"+today);\n\tdocument.getElementById(\"appointmentDate\").setAttribute(\"min\", today);\n}", "title": "" }, { "docid": "67db3763625065279147d5aeb1a3ea9c", "score": "0.49461034", "text": "function buildDateString(meetingStart, meetingEnd) {\n var dateFormat = \"dddd, MMMM Do *h:mm A*\";\n var dateString = '';\n\n if (meetingStart && meetingEnd) {\n if (meetingStart.isSame(meetingEnd)) {\n dateFormat = dateFormat + ', YYYY';\n dateString = meetingStart.format(dateFormat);\n } else if (meetingStart.isSame(meetingEnd, 'day')) {\n dateString = meetingStart.format(dateFormat) + meetingEnd.format(\"* - h:mm A*, YYYY\");\n } else {\n dateString = meetingStart.format(dateFormat);\n dateFormat = dateFormat + ', YYYY';\n\n if (!meetingStart.isSame(meetingEnd, 'year')) {\n dateString = meetingStart.format(dateFormat);\n }\n dateString = dateString + meetingEnd.format(\" - \" + dateFormat);\n }\n } else if (meetingStart) {\n meetingStart.format(dateFormat + ', YYYY');\n }\n\n console.assert(dateString, \"Meeting invite date string is empty!\");\n\n return dateString.replace(new RegExp(/\\*([^\\*]*)\\*/g), '<b>$1</b>');\n }", "title": "" }, { "docid": "48ff6ceb5f00ffc0524607a5206f87e8", "score": "0.49379924", "text": "function GetSpecialDays ()\n{\n\tvar resultBDO = doActionBDO('SVC_GET_SPECIAL_CLOSED_HOURS');\n\t//writebr(\"resultBDO.Count=\" + resultBDO.Count);\n\n\tScheduleCount=resultBDO.Count;\n\n\tfor (var i=0; i < ScheduleCount; i++)\n\t\ttheSchedule[i] = new TimeSlot(i, \"-\",\"12\",\"00\",\"PM\",\"12\",\"00\",\"PM\",\"N\",\"O\",\"07-APR-1969\");\n\n\t// Now set needed values\n\tif (resultBDO.Count)\n\t{\n\t\tvar BDORows = resultBDO.GetLabels('TIMESLOT');\n\t\tBDORows.sort();\n\n\t\tfor (var i = 0; i < BDORows.length; i++)\n\t\t{\n\t\t\tvar timeSlotBDO = eval(\"resultBDO.\" + PadLeft('TIMESLOT',i+1));\n\t\t\tif (timeSlotBDO)\n\t\t\t{\n\t\t\t\ttheSchedule[i].startDateObj = timeSlotBDO.DATETIME_START;\n\t\t\t\ttheSchedule[i].endDateObj = timeSlotBDO.DATETIME_END;\n\t\t\t\ttheSchedule[i].ID = timeSlotBDO.ID;\n\t\t\t\ttheSchedule[i].month = timeSlotBDO.DATETIME_START.getMonth();\n\t\t\t\ttheSchedule[i].year = (timeSlotBDO.DATETIME_START.getYear()+1900);\n\t\t\t\ttheSchedule[i].date = timeSlotBDO.DATETIME_START.getDate();\n\t\t\t\tif (timeSlotBDO.Allday == \"Y\")\n\t\t\t\t{\n\t\t\t\t\ttheSchedule[i].OpenHour = \"0\";\n\t\t\t\t\ttheSchedule[i].OpenMin = \"0\";\n\t\t\t\t\ttheSchedule[i].OpenAMPM = \"AM\";\n\t\t\t\t\ttheSchedule[i].CloseHour = \"0\";\n\t\t\t\t\ttheSchedule[i].CloseMin = \"0\";\n\t\t\t\t\ttheSchedule[i].CloseAMPM = \"AM\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttheSchedule[i].OpenHour = timeSlotBDO.DATETIME_START.getNonMilHours();\n\t\t\t\t\ttheSchedule[i].OpenMin = timeSlotBDO.DATETIME_START.getMinutes();\n\t\t\t\t\ttheSchedule[i].OpenAMPM = timeSlotBDO.DATETIME_START.getAmPm();\n\t\t\t\t\ttheSchedule[i].CloseHour = timeSlotBDO.DATETIME_END.getNonMilHours();\n\t\t\t\t\ttheSchedule[i].CloseMin = timeSlotBDO.DATETIME_END.getMinutes();\n\t\t\t\t\ttheSchedule[i].CloseAMPM = timeSlotBDO.DATETIME_END.getAmPm();\n\t\t\t\t}\n\t\t\t\ttheSchedule[i].AllDay = timeSlotBDO.Allday;\n\t\t\t\ttheSchedule[i].State = timeSlotBDO.OpenState;\n\t\t\t\ttheSchedule[i].ClosedDate = days[timeSlotBDO.DATETIME_END.getDay()] + \", \" +\n\t\t\t\t\t\t\t\t\t\t\tmonths[timeSlotBDO.DATETIME_END.getMonth()] + \" \" +\n\t\t\t\t\t\t\t\t\t\t\ttimeSlotBDO.DATETIME_END.getDate() + \", \" +\n\t\t\t\t\t\t\t\t\t\t\t(timeSlotBDO.DATETIME_END.getYear()+1900);\n\n//writebr(\"id=\",timeSlotBDO.ID,\",\",timeSlotBDO.Day,\" \",timeSlotBDO.StartHour,\":\",timeSlotBDO.StartMin,timeSlotBDO.StartAMPM,\" \",timeSlotBDO.EndHour,\":\",timeSlotBDO.EndMin,timeSlotBDO.EndAMPM,\" AllDay=\",timeSlotBDO.Allday,\", OpenState=\",timeSlotBDO.OpenState,\" ClosedDate=\",timeSlotBDO.ClosedDate);\n\n\t\t\t}\n\t\t}\n\t\ttheSchedule.sort(sortDates);\n\t}\n}", "title": "" }, { "docid": "04545af346c887f017b619836de0176f", "score": "0.49364364", "text": "function createEvents(courseName, courseDates, courseTime) {\n\tvar calEvents = [];\n\n\tfor(i in courseDates) {\n\t\tvar e = {\t\n\t\t\t\"id\": genID(),\n\t\t\t\"start\": new Date(START_YEAR, START_MONTH, courseDates[i], courseTime.startHour, courseTime.startMin),\n\t\t\t\"end\": new Date(START_YEAR, START_MONTH, courseDates[i], courseTime.endHour, courseTime.endMin),\n\t\t\t\"title\": courseName\n\t\t};\n\t\t\n\t\tcalEvents.push(e);\n\t}\n\t\n\treturn calEvents;\n}", "title": "" }, { "docid": "563e9591ac8a6fbef5dc2f9d47d308b9", "score": "0.4936131", "text": "addMeal(start, end, food_group) {\r\n for (var i = start ; i < end; i++)\r\n this.time_slots[i] = new Meal(this.day_of_week, i, 'M', food_group);\r\n }", "title": "" } ]
9a44510c46cb7dabf65daff744c464f8
Merge two blockquotes: `node` into `prev`, unless in CommonMark or gfm modes.
[ { "docid": "906e985ae08fbc14615c5e84673f3acf", "score": "0.8373044", "text": "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children);\n\n return previous\n}", "title": "" } ]
[ { "docid": "f77eab48fe6be901bec186091412c801", "score": "0.8341298", "text": "function mergeBlockquote(previous, node) {\n\t\tif (this.options.commonmark || this.options.gfm) {\n\t\t\treturn node\n\t\t}\n\n\t\tprevious.children = previous.children.concat(node.children);\n\n\t\treturn previous\n\t}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "e71800effdbdf1caa286d679e28db757", "score": "0.8317688", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "title": "" }, { "docid": "bb9b10e3c92a4a33907440094a3784dc", "score": "0.8310742", "text": "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node\n }\n\n prev.children = prev.children.concat(node.children)\n\n return prev\n}", "title": "" }, { "docid": "940e061cc4e5aa041e0e3563d41af958", "score": "0.82794994", "text": "function mergeBlockquote(prev, node) {\n\t if (this.options.commonmark) {\n\t return node;\n\t }\n\t\n\t prev.children = prev.children.concat(node.children);\n\t\n\t return prev;\n\t}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "53100df9e67464bf4bf9a360ceb991bc", "score": "0.59124845", "text": "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "title": "" }, { "docid": "df70c2319e307fe30126001c83b5d4f3", "score": "0.5886476", "text": "function mergeText(prev, node) {\n prev.value += node.value\n\n return prev\n}", "title": "" }, { "docid": "bd76a0698b5c8806e1078c8990c58b1c", "score": "0.5867887", "text": "function mergeText(prev, node) {\n\t prev.value += node.value;\n\t\n\t return prev;\n\t}", "title": "" }, { "docid": "5fff81a1601a4399759710a064277f9a", "score": "0.56670946", "text": "function mergeText(previous, node) {\n previous.value += node.value;\n\n return previous\n}", "title": "" }, { "docid": "0f11b2a3354511aec1d3debd9ada2255", "score": "0.56101316", "text": "function mergeText(previous, node) {\n\t\tprevious.value += node.value;\n\n\t\treturn previous\n\t}", "title": "" }, { "docid": "d8b2599a997c3a212e4da020a028eeca", "score": "0.54069006", "text": "function previousTextNode(root, node) {\n\tnode = previousNode(root, node, true);\n\twhile (node && node.nodeType !== 3) {\n\t\tnode = previousNode(root, node);\n\t}\n\treturn node;\n}", "title": "" }, { "docid": "afa1d0fc32c93d56d4ec0a1eef160bde", "score": "0.5251308", "text": "function prev(n){\n while((n = n.previousSibling) && n.nodeType != 1);\n return n;\n }", "title": "" }, { "docid": "bffbba0e43fd471a1e7789f982c0d0fd", "score": "0.52014124", "text": "function all$2(node) {\n\t\tbackticks(node);\n\n\t\tif (node.value === backtick) {\n\t\t\tnode.value = openingSingleQuote;\n\t\t} else if (node.value === singleQuote) {\n\t\t\tnode.value = closingSingleQuote;\n\t\t}\n\t}", "title": "" }, { "docid": "a5e497a12f17b2b08c2c402e7690b5be", "score": "0.5187553", "text": "function previousComment(e){\n if(!e) return '';\n var prev = e.previousSibling;\n if(prev.nodeType === 8) return prev.data.trim();\n return previousComment(prev);\n }", "title": "" }, { "docid": "10eb083429baba38a72a7dc761304aa5", "score": "0.5118849", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var previous = children[children.length - 1];\n var fn;\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote;\n node = fn.call(self, previous, node);\n }\n\n if (node !== previous) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node\n }", "title": "" }, { "docid": "9ec1ceec62412e910a813d5fa5ffd8f8", "score": "0.51008785", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var prev = children[children.length - 1]\n var fn\n\n if (\n prev &&\n node.type === prev.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, prev, node)\n }\n\n if (node !== prev) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "title": "" }, { "docid": "f2d51044cb3ef43c7f005a3fcf2835b6", "score": "0.50864345", "text": "function swapTwoDOMNodes(node1, node2) {\n if (node1.nextElementSibling === node2) {\n node1.parentNode.insertBefore(node2, node1);\n } else if (node2.nextElementSibling === node1) {\n node1.parentNode.insertBefore(node1, node2);\n }\n}", "title": "" }, { "docid": "76a5ed7bbe4654812bd36ae273fb6f9a", "score": "0.5077871", "text": "get previousElementSibling() { throw new Error(\"Mixin: NonDocumentTypeChildNode not implemented.\"); }", "title": "" }, { "docid": "24f2b49cc91341b0aff893c6c5f09c30", "score": "0.5067842", "text": "updatePreviousSibling(/*prev*/) {\n\n }", "title": "" }, { "docid": "dfb01b763db9c8c2e4e3215e43804fc2", "score": "0.5020502", "text": "function add(node, parent) {\n\t\t\t\tvar children = parent ? parent.children : tokens;\n\t\t\t\tvar previous = children[children.length - 1];\n\t\t\t\tvar fn;\n\n\t\t\t\tif (\n\t\t\t\t\tprevious &&\n\t\t\t\t\tnode.type === previous.type &&\n\t\t\t\t\t(node.type === 'text' || node.type === 'blockquote') &&\n\t\t\t\t\tmergeable(previous) &&\n\t\t\t\t\tmergeable(node)\n\t\t\t\t) {\n\t\t\t\t\tfn = node.type === 'text' ? mergeText : mergeBlockquote;\n\t\t\t\t\tnode = fn.call(self, previous, node);\n\t\t\t\t}\n\n\t\t\t\tif (node !== previous) {\n\t\t\t\t\tchildren.push(node);\n\t\t\t\t}\n\n\t\t\t\tif (self.atStart && tokens.length !== 0) {\n\t\t\t\t\tself.exitStart();\n\t\t\t\t}\n\n\t\t\t\treturn node\n\t\t\t}", "title": "" }, { "docid": "4c9dbe96e8353d818614d675618cbcce", "score": "0.50114757", "text": "updatePreviousSibling(prev) {\n\n }", "title": "" }, { "docid": "b45f65508e1b04ef5c2fdc528358e555", "score": "0.49852312", "text": "insertBefore(node) {\n if (this.fragment.hasChildNodes()) {\n node.parentNode.insertBefore(this.fragment, node);\n } else {\n const parentNode = node.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n\n while (current !== end) {\n next = current.nextSibling;\n parentNode.insertBefore(current, node);\n current = next;\n }\n\n parentNode.insertBefore(end, node);\n }\n }", "title": "" }, { "docid": "b45f65508e1b04ef5c2fdc528358e555", "score": "0.49852312", "text": "insertBefore(node) {\n if (this.fragment.hasChildNodes()) {\n node.parentNode.insertBefore(this.fragment, node);\n } else {\n const parentNode = node.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n\n while (current !== end) {\n next = current.nextSibling;\n parentNode.insertBefore(current, node);\n current = next;\n }\n\n parentNode.insertBefore(end, node);\n }\n }", "title": "" }, { "docid": "1505a20a84fb50ccd8f38601a259869f", "score": "0.49819902", "text": "function prevQuote() {\n changeBackground();\n if (data) {\n current = current - 1 < 0 ? data.length : current - 1;\n updateQuoteDOM(data[current]);\n }\n}", "title": "" }, { "docid": "d40f1013c67651a68b6b1177ce2625a7", "score": "0.49719402", "text": "function prevSpace(loc) {\n if (Empty.hasInstance(loc.content)) {\n throw new Error('prevSpace should be called when content is full');\n }\n\n return TreeZiper(Empty(), loc.before, [loc.content.tree].concat(loc.after), loc.parents);\n}", "title": "" }, { "docid": "81eabefa62e08e369d2df806f769d923", "score": "0.49718896", "text": "function getPreviousSibling(n) {\r\n\tdo n = n.previousSibling;\r\n\twhile (n && n.nodeType != 1);\r\n\treturn n;\r\n}", "title": "" }, { "docid": "597914b2479ba9de3384f6cce0c19055", "score": "0.49662593", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t\t// Add block quote deletion handler\n\t\t\t\teditor.on('keydown', function(e) {\n\t\t\t\t\tvar rng, container, offset, root, parent;\n\t\n\t\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\trng = selection.getRng();\n\t\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\t\toffset = rng.startOffset;\n\t\t\t\t\troot = dom.getRoot();\n\t\t\t\t\tparent = container;\n\t\n\t\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\t\n\t\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "27c4369695537a980b0f4d13f8abca24", "score": "0.4952091", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "27c4369695537a980b0f4d13f8abca24", "score": "0.4952091", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "27c4369695537a980b0f4d13f8abca24", "score": "0.4952091", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "1706a965547c512bda551d6bd67bdea2", "score": "0.4909963", "text": "static getPreviousTag()\n {\n let $tag;\n\n if (staticObject.$tagHistory.length) {\n // echo ' x ' + (end(staticObject.$tagHistory)) + \" {\" + implode(', ', staticObject.$tagHistory) + \"} \\n\";\n $tag = staticObject.$tagHistory.pop();\n return '</' + $tag + '>';\n }\n\n return '';\n }", "title": "" }, { "docid": "07a13598de3fd0a6d5a774a8de41bb8c", "score": "0.4898364", "text": "function getPreviousSibling(n)\r\n{\r\n\tvar x=n.previousSibling;\r\n\twhile (x.nodeType!=1)\r\n\t{\r\n\t\tx=x.previousSibling;\r\n\t}\r\n\treturn x;\r\n}", "title": "" }, { "docid": "0442553f38fb593e1ed092c39319845b", "score": "0.48591647", "text": "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n if (newFirst == null) {\n return newChild;\n }\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n do {\n newFirst.parentNode = parentNode;\n } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode);\n //console.log(parentNode.lastChild.nextSibling == null)\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n return newChild;\n}", "title": "" }, { "docid": "624af2148fa9b45e0c09ba19f767e99f", "score": "0.4856308", "text": "function _merge(n) {\n if (n.nodeType === Node.TEXT_NODE) {\n if (n.nextSibling && n.nextSibling.nodeType === Node.TEXT_NODE) {\n // merge next sibling into newNode\n n.textContent += n.nextSibling.textContent;\n // remove next sibling\n n.nextSibling.parentNode.removeChild(n.nextSibling);\n }\n\n if (n.previousSibling && n.previousSibling.nodeType === Node.TEXT_NODE) {\n // merge nodeNew into previousSibling\n n.previousSibling.textContent += n.textContent;\n // remove newNode\n n.parentNode.removeChild(n);\n }\n }\n }", "title": "" }, { "docid": "baae43b4a029bf5d2563b35a069c76f8", "score": "0.48555222", "text": "function trimNode(node) {\n\t\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\t\n\t\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (type != 9) {\n\t\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\t\tchildren = node.childNodes;\n\t\n\t\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tself.remove(node);\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn node;\n\t\t\t\t}", "title": "" }, { "docid": "90f99b23d02adbc1c3ee0ff1ea12c776", "score": "0.48413444", "text": "function onEnter(opts, event, change, editor) {\n var value = change.value;\n var startBlock = value.startBlock;\n\n\n if (!(0, _utils.getCurrentBlockquote)(opts, value)) {\n return undefined;\n }\n\n if (startBlock.text.length !== 0) {\n return undefined;\n }\n\n // Block is empty, we exit the blockquote\n event.preventDefault();\n return (0, _changes.unwrapBlockquote)(opts, change);\n}", "title": "" }, { "docid": "ec11769d36ffe8948796e3b88908cd9a", "score": "0.48229548", "text": "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n if (newFirst == null) {\n return newChild;\n }\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n do {\n newFirst.parentNode = parentNode;\n } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode);\n //console.log(parentNode.lastChild.nextSibling == null)\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n return newChild;\n }", "title": "" }, { "docid": "ec11769d36ffe8948796e3b88908cd9a", "score": "0.48229548", "text": "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n if (newFirst == null) {\n return newChild;\n }\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n do {\n newFirst.parentNode = parentNode;\n } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode);\n //console.log(parentNode.lastChild.nextSibling == null)\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n return newChild;\n }", "title": "" }, { "docid": "f57d905b3ca7fb5692fcc3dedc068f76", "score": "0.48101762", "text": "function removeSurroundingLineBreaks(prevNode, nextNode, composer) {\n var prevPrev = prevNode && wysihtml.dom.domNode(prevNode).prev({nodeTypes: [1,3], ignoreBlankTexts: true});\n if (isBr(nextNode)) {\n nextNode.parentNode.removeChild(nextNode);\n }\n if (isBr(prevNode) && (!prevPrev || prevPrev.nodeType !== 1 || composer.win.getComputedStyle(prevPrev).display !== \"block\")) {\n prevNode.parentNode.removeChild(prevNode);\n }\n }", "title": "" }, { "docid": "1da5c73ef39a5ce366634cdd06d7011e", "score": "0.48071775", "text": "function collapsePreviousNode() {\r\n let currentElement = containerElement.querySelector(\".node--current\");\r\n if (currentElement) {\r\n currentElement.classList.remove(\"node--current\");\r\n }\r\n }", "title": "" }, { "docid": "78c77f687be757a2500a1f3dcad231e7", "score": "0.47947863", "text": "* tryCombineWithLeft (op) {\n if (\n op != null &&\n op.left != null &&\n op.content != null &&\n op.left[0] === op.id[0] &&\n Y.utils.compareIds(op.left, op.origin)\n ) {\n var left = yield* this.getInsertion(op.left)\n if (left.content != null &&\n left.id[1] + left.content.length === op.id[1] &&\n left.originOf.length === 1 &&\n !left.gc && !left.deleted &&\n !op.gc && !op.deleted\n ) {\n // combine!\n if (op.originOf != null) {\n left.originOf = op.originOf\n } else {\n delete left.originOf\n }\n left.content = left.content.concat(op.content)\n left.right = op.right\n yield* this.os.delete(op.id)\n yield* this.setOperation(left)\n }\n }\n }", "title": "" }, { "docid": "69aff0bede132e4f3a56b5c71a5ea9f2", "score": "0.47871134", "text": "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n if (newFirst == null) {\n return newChild;\n }\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n var pre = nextChild\n ? nextChild.previousSibling\n : parentNode.lastChild;\n\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n do {\n newFirst.parentNode = parentNode;\n } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode);\n //console.log(parentNode.lastChild.nextSibling == null)\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n return newChild;\n }", "title": "" }, { "docid": "3c7309e3529f5293c3a4e97ba2eed9f6", "score": "0.4781368", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\t\tvar cp = newChild.parentNode;\n\t\tif(cp){\n\t\t\tcp.removeChild(newChild);//remove and update\n\t\t}\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar newFirst = newChild.firstChild;\n\t\t\tif (newFirst == null) {\n\t\t\t\treturn newChild;\n\t\t\t}\n\t\t\tvar newLast = newChild.lastChild;\n\t\t}else{\n\t\t\tnewFirst = newLast = newChild;\n\t\t}\n\t\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\t\tnewFirst.previousSibling = pre;\n\t\tnewLast.nextSibling = nextChild;\n\t\t\n\t\t\n\t\tif(pre){\n\t\t\tpre.nextSibling = newFirst;\n\t\t}else{\n\t\t\tparentNode.firstChild = newFirst;\n\t\t}\n\t\tif(nextChild == null){\n\t\t\tparentNode.lastChild = newLast;\n\t\t}else{\n\t\t\tnextChild.previousSibling = newLast;\n\t\t}\n\t\tdo{\n\t\t\tnewFirst.parentNode = parentNode;\n\t\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t\t//console.log(parentNode.lastChild.nextSibling == null)\n\t\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\t\tnewChild.firstChild = newChild.lastChild = null;\n\t\t}\n\t\treturn newChild;\n\t}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "f89fe0f0696359f9948d67fd7850d583", "score": "0.4781074", "text": "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "title": "" }, { "docid": "7e7ce60fc26d7ebc7b1d46c1af07b971", "score": "0.47806895", "text": "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "title": "" }, { "docid": "7e7ce60fc26d7ebc7b1d46c1af07b971", "score": "0.47806895", "text": "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "title": "" }, { "docid": "9e3c1937af7c3b6898ed671a42aa3d74", "score": "0.4775206", "text": "function isPreviousLineEmpty(text, node) {\n let idx = locStart$1(node) - 1;\n idx = skipSpaces(text, idx, { backwards: true });\n idx = skipNewline(text, idx, { backwards: true });\n idx = skipSpaces(text, idx, { backwards: true });\n const idx2 = skipNewline(text, idx, { backwards: true });\n return idx !== idx2;\n}", "title": "" }, { "docid": "ad4b0c0a41af8c8d476fb1b69c788cbd", "score": "0.4756103", "text": "insertBefore(node) {\n node._prevNode = this._prevNode;\n node._nextNode = this;\n node._nextNode._prevNode = node;\n if (node._prevNode) {\n node._prevNode._nextNode = node;\n }\n }", "title": "" }, { "docid": "213946a1599535f6c80ac89b703ccad0", "score": "0.474218", "text": "function previousElement(root, node) {\n\tnode = previousNode(root, node, true);\n\twhile (node && node.nodeType !== 1) {\n\t\tnode = previousNode(root, node);\n\t}\n\treturn node;\n}", "title": "" }, { "docid": "5252d4fc5e71add18c18d1f8be52875d", "score": "0.47403008", "text": "function prevTree(loc) {\n if (Full.hasInstance(loc.content)) {\n throw new Error('prevTree should be called when content is empty');\n }\n\n if (loc.before.length === 0) {\n return (0, _maybe.Nothing)();\n }\n var item = loc.before[0];\n return (0, _maybe.Just)(TreeZiper(Full(item), loc.before.slice(1), loc.after, loc.parents));\n}", "title": "" }, { "docid": "c8c657741873f7c9c801b62d5f5fcc3f", "score": "0.473974", "text": "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "title": "" }, { "docid": "c8c657741873f7c9c801b62d5f5fcc3f", "score": "0.473974", "text": "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "title": "" }, { "docid": "c8c657741873f7c9c801b62d5f5fcc3f", "score": "0.473974", "text": "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "title": "" }, { "docid": "c8c657741873f7c9c801b62d5f5fcc3f", "score": "0.473974", "text": "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "title": "" }, { "docid": "e68c9265a54d02a09687ba3d92eddf93", "score": "0.47395337", "text": "function getPrevSibling(n)\n{\n\tvar x = n.previousSibling;\n\twhile (x && x.nodeType!=1)\n\t {\n\t\tx = x.previousSibling;\n\t }\n\treturn x;\n}", "title": "" }, { "docid": "c0a56333f97e3a7ce2f67ccba92421ca", "score": "0.4737717", "text": "function _insertBefore(parentNode,newChild,nextChild){\n \tvar cp = newChild.parentNode;\n \tif(cp){\n \t\tcp.removeChild(newChild);//remove and update\n \t}\n \tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n \t\tvar newFirst = newChild.firstChild;\n \t\tif (newFirst == null) {\n \t\t\treturn newChild;\n \t\t}\n \t\tvar newLast = newChild.lastChild;\n \t}else {\n \t\tnewFirst = newLast = newChild;\n \t}\n \tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n \tnewFirst.previousSibling = pre;\n \tnewLast.nextSibling = nextChild;\n \t\n \t\n \tif(pre){\n \t\tpre.nextSibling = newFirst;\n \t}else {\n \t\tparentNode.firstChild = newFirst;\n \t}\n \tif(nextChild == null){\n \t\tparentNode.lastChild = newLast;\n \t}else {\n \t\tnextChild.previousSibling = newLast;\n \t}\n \tdo{\n \t\tnewFirst.parentNode = parentNode;\n \t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n \t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n \t//console.log(parentNode.lastChild.nextSibling == null)\n \tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n \t\tnewChild.firstChild = newChild.lastChild = null;\n \t}\n \treturn newChild;\n }", "title": "" }, { "docid": "31b626ae8d352e02669b23e3193deb09", "score": "0.47374386", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\r\n var previousSibling = node.previousSibling;\r\n while (previousSibling && _isBlankTextNode(previousSibling)) {\r\n previousSibling = previousSibling.previousSibling;\r\n }\r\n return previousSibling;\r\n }", "title": "" }, { "docid": "1134a4439b84a7b14fa0b2835459bb74", "score": "0.47315142", "text": "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "title": "" }, { "docid": "1134a4439b84a7b14fa0b2835459bb74", "score": "0.47315142", "text": "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "title": "" }, { "docid": "1134a4439b84a7b14fa0b2835459bb74", "score": "0.47315142", "text": "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "title": "" }, { "docid": "a6c56cc2207a41423b9bc001e5ff5b7f", "score": "0.47252703", "text": "function toggleBlockquote(editor) {\n _toggleLine(editor.codemirror, 'quote');\n}", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "fc9a17d1df94c4c8a3a44cbea807e2cd", "score": "0.47069806", "text": "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "title": "" }, { "docid": "4c405ad49a81c37e7883f054c46fc372", "score": "0.4704623", "text": "tokenBefore(types2) {\n let token = syntaxTree(this.state).resolveInner(this.pos, -1);\n while (token && types2.indexOf(token.name) < 0)\n token = token.parent;\n return token ? {\n from: token.from,\n to: this.pos,\n text: this.state.sliceDoc(token.from, this.pos),\n type: token.type\n } : null;\n }", "title": "" }, { "docid": "5a53e24f09d6bd8199b8773b86c25a24", "score": "0.46988043", "text": "function mergePre( preBlock ) {\n\t\tvar previousBlock;\n\t\tif ( !( ( previousBlock = preBlock.getPrevious( nonWhitespaces ) ) && previousBlock.is && previousBlock.is( 'pre' ) ) )\n\t\t\treturn;\n\n\t\t// Merge the previous <pre> block contents into the current <pre>\n\t\t// block.\n\t\t//\n\t\t// Another thing to be careful here is that currentBlock might contain\n\t\t// a '\\n' at the beginning, and previousBlock might contain a '\\n'\n\t\t// towards the end. These new lines are not normally displayed but they\n\t\t// become visible after merging.\n\t\tvar mergedHtml = replace( previousBlock.getHtml(), /\\n$/, '' ) + '\\n\\n' +\n\t\t\treplace( preBlock.getHtml(), /^\\n/, '' );\n\n\t\t// Krugle: IE normalizes innerHTML from <pre>, breaking whitespaces.\n\t\tif ( CKEDITOR.env.ie )\n\t\t\tpreBlock.$.outerHTML = '<pre>' + mergedHtml + '</pre>';\n\t\telse\n\t\t\tpreBlock.setHtml( mergedHtml );\n\n\t\tpreviousBlock.remove();\n\t}", "title": "" }, { "docid": "8764a149c09de3d122b20b459577b36a", "score": "0.46891573", "text": "function prepend(elem, prev) {\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.lastIndexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "title": "" }, { "docid": "3bfb0f8907d53988e452454cdecd0b01", "score": "0.4688052", "text": "function onEnter(event, data, change, opts) {\n var state = change.state;\n var startBlock = state.startBlock;\n\n\n if (!getCurrentBlockquote(opts, state)) {\n return null;\n }\n\n // Block is empty, we exit the blockquote\n if (startBlock.text.length === 0) {\n event.preventDefault();\n\n return unwrapBlockquote(opts, change);\n }\n}", "title": "" }, { "docid": "4c2b604e5ffb2efb684d4a97ee9d88e8", "score": "0.46864787", "text": "function toggleBlockquote(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleLine(cm, \"quote\");\n}", "title": "" }, { "docid": "4c2b604e5ffb2efb684d4a97ee9d88e8", "score": "0.46864787", "text": "function toggleBlockquote(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleLine(cm, \"quote\");\n}", "title": "" }, { "docid": "4c2b604e5ffb2efb684d4a97ee9d88e8", "score": "0.46864787", "text": "function toggleBlockquote(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleLine(cm, \"quote\");\n}", "title": "" } ]
61348fe46314866daf75b84e79149684
Warn the user about overwrite before importing
[ { "docid": "b5e491cf51277d61dc17f348a74db23e", "score": "0.5548852", "text": "function importWarn( fileInput ){\n\t\n\tvar input = fileInput;\n\tDECK.dialog.show( {\n\t\ttitle:\"Import Deck List\",\n\t\tbody:\"Importing a new deck list will replace all cards currently in your deck list. Would you like to proceed?\",\n\t\tallowClose:false,\n\t\tconfirm:{ callback:function(){ importList( input ); } },\n\t\tcancel:{ callback:function(){ input.value = \"\" } }\n\t} );\n\t\n}", "title": "" } ]
[ { "docid": "3788b417e61444b93d657b002c7bcdd7", "score": "0.66005516", "text": "function forceImport() { }", "title": "" }, { "docid": "3f0038cf59e4d86fbca3ed88d98da41a", "score": "0.61282504", "text": "onFileExists() {\n this.abortImport('File named \"' + this.file.getFileName() + '\" already exists!');\n }", "title": "" }, { "docid": "d2992245122f5bf175491f724a34591f", "score": "0.56522876", "text": "function checkOverwrite(names, csv) {\n var existingNames = searchForNamesInCsv(names, csv);\n\n if (existingNames.length > 0) {\n $(\"#warnAboutOverwritingBox\").show();\n $(\"#warningsOverwriting\").text(\"\");\n for (var y in existingNames) {\n var warning = existingNames[y];\n $(\"#warningsOverwriting\").append(warning + \" \" + OpenSpeedMonitor.i18n.overwritingWarning + \"<br/>\");\n }\n }\n $(\"#defaultMappingUploadButton\").prop(\"disabled\", false);\n}", "title": "" }, { "docid": "0899649bfacf90b1c8af53e62758ac49", "score": "0.5638408", "text": "beforeImport() {\n debug('beforeImport');\n\n let self = this;\n\n this.dataToImport = _.filter(this.dataToImport, function (data) {\n return ['core', 'theme'].indexOf(data.type) === -1;\n });\n\n _.each(this.dataToImport, function (obj) {\n obj.key = self.legacyKeys[obj.key] || obj.key;\n });\n\n return super.beforeImport();\n }", "title": "" }, { "docid": "2d16ffb3516025b88cb256fdc9936116", "score": "0.55495995", "text": "function resolveWriteConflict(filePath, data, callback) {\n if (overwrite) {\n overwriteFile(filePath, data);\n callback();\n } else {\n\n choicePrompt('There is already a file at ' + filePath.red + '!\\n How do you want to handle it?', [\n {'Overwrite it': overwriteFile},\n {'Perserve it': perserveFile},\n {'Overwrite all': overwriteAll},\n {'Abort generation': abortGeneration}\n ], function (action) {\n action(filePath, data);\n callback();\n });\n }\n}", "title": "" }, { "docid": "f3f38504c9e1710b6ac02e5bc507e753", "score": "0.55429286", "text": "importCreationsAndSettingsIntoApp() {\n\t\tthis.mergeImportedItems(this.oldSavedItems, true).then(() => {\n\t\t\ttrackEvent('fn', 'oldItemsImported');\n\t\t\tthis.dontAskToImportAnymore();\n\t\t});\n\t}", "title": "" }, { "docid": "9ee90fc369f995945ee2dcbf97aa2286", "score": "0.55326504", "text": "async overwrite() {\n await this._initialized\n const merged = Object.assign({}, this._scrSettings, fromSbToScr(this._settings))\n if (!deepEqual(merged, this._scrSettings)) {\n this._scrSettings = merged\n await fsPromises.writeFile(this._scrFilepath, jsonify(this._scrSettings), {\n encoding: 'utf8',\n })\n }\n }", "title": "" }, { "docid": "32e40cfe76b2b3b05b790ff631647284", "score": "0.549525", "text": "function doNotRename() {\n\tif (romMode == \"upload\" && !localStorage.getItem(\"webretro_settings_pastFirstSave\")) {\n\t\talert(\"WARNING: Do not rename your ROM file after this! The save data is specific to the ROM file name!\");\n\t\tlocalStorage.setItem(\"webretro_settings_pastFirstSave\", \"true\");\n\t}\n}", "title": "" }, { "docid": "866b0d27d8e526f2f28a8fd6d31b4e42", "score": "0.5475444", "text": "function reimport() {\n clear();\n import();\n}", "title": "" }, { "docid": "34a18c9eb8d2e7274499b814704c7ac5", "score": "0.5389293", "text": "enterErrorOverwriteOpt(ctx) {\n\t}", "title": "" }, { "docid": "db9387c072c9030ff9250fa66a7594f4", "score": "0.53687406", "text": "conflicts() {\n }", "title": "" }, { "docid": "786d8811331ec87e676a8f3c685fa592", "score": "0.53417534", "text": "function dirtyFileSaveCancelled() {\n UpdateInfoBar.showUpdateBar({\n type: \"warning\",\n title: Strings.WARNING_TYPE,\n description: Strings.UPDATE_ON_NEXT_LAUNCH\n });\n }", "title": "" }, { "docid": "ab8240853b414bc104504c873ce5e5f3", "score": "0.5254974", "text": "onUrlExists() {\n this.abortImport('File with URL \"' + this.file.getUrl() + '\" already exists!');\n }", "title": "" }, { "docid": "f1da7fd2bee55b41481ab7e166d1c916", "score": "0.51994103", "text": "async _overwrite(contents) {\n await this._clear();\n await this._merge(contents);\n }", "title": "" }, { "docid": "6fac1dc77e39df12b50ecc6393cc7ee3", "score": "0.5182922", "text": "function conflict() {\n throw new Error(\n 'This property was defined by multiple merged objects, override it with the proper implementation');\n }", "title": "" }, { "docid": "506fd9b8100cc245da15e9f25cc6b8d8", "score": "0.516245", "text": "invalidFiletype() {\n this.abortImport('Could not determine the file type for \"' + this.file.getFileName() + '\".');\n }", "title": "" }, { "docid": "ada5a50a477082ae9ee207140036c05a", "score": "0.51192176", "text": "ImportSpecifier(node) {\n const importedName = node.imported.name;\n\t if (importedName.includes('DataToolbar')) {\n const toolbarName = importedName.replace('DataToolbar', 'Toolbar');\n const localName = node.local.name;\n const isAliased = importedName !== localName;\n const aliasText = isAliased ? ` as ${localName}` : '';\n const newName = `${toolbarName}${aliasText}`;\n context.report({\n node,\n message: `${importedName} has been replaced with ${toolbarName}`,\n fix(fixer) {\n return fixer.replaceText(node, newName);\n }\n });\n }\n }", "title": "" }, { "docid": "81662eef0a7563d5065060273431fddf", "score": "0.511766", "text": "function owImportError(name) { //start overwrite error dialog handler\n\t\t$(\"#owImportDialog\").dialog('open');\n\t\t$(\"#importVariable\").text(name);\n\t} //end overwrite error dialog handler", "title": "" }, { "docid": "13326ba6bb04214cfb0a669327150589", "score": "0.51163626", "text": "function ignore() {}", "title": "" }, { "docid": "b447e2326be00accb33a6d06682e6291", "score": "0.5104026", "text": "exitErrorOverwriteOpt(ctx) {\n\t}", "title": "" }, { "docid": "3c84b3fdc7a3cc9abf9fe3c134f09486", "score": "0.51016265", "text": "checkFile(importsfile, f, append) {\n fs.readFile(importsfile, 'utf8', function(err, data) {\n if (err) console.log(err); \n const check = data.search(`@import \"${f}\";`);\n if (check === -1) append(importsfile, f);\n })\n }", "title": "" }, { "docid": "52eda321b9ae48ec7da0cd12b50061f0", "score": "0.5066644", "text": "function installImpress() {\n if (parent !== 'node_modules') {\n console.log('Running in developer mode');\n process.exit(0);\n }\n\n const checkFiles = ['package.json', 'server.js', 'config', 'applications'];\n api.metasync.each(checkFiles, check, done);\n\n function check(file, callback) {\n api.fs.access(destination + '/' + file, (err) => {\n exists = exists || !err;\n callback();\n });\n }\n}", "title": "" }, { "docid": "1d3c33a6928c73cd7f0468be086587c6", "score": "0.50596493", "text": "diagnosticDetectDuplicateAncestorScriptImports() {\n if (this.xmlFile.parentComponent) {\n //build a lookup of pkg paths -> FileReference so we can more easily look up collisions\n let parentScriptImports = this.xmlFile.getAncestorScriptTagImports();\n let lookup = {};\n for (let parentScriptImport of parentScriptImports) {\n //keep the first occurance of a pkgPath. Parent imports are first in the array\n if (!lookup[parentScriptImport.pkgPath]) {\n lookup[parentScriptImport.pkgPath] = parentScriptImport;\n }\n }\n //add warning for every script tag that this file shares with an ancestor\n for (let scriptImport of this.xmlFile.scriptTagImports) {\n let ancestorScriptImport = lookup[scriptImport.pkgPath];\n if (ancestorScriptImport) {\n let ancestorComponentName = ancestorScriptImport.sourceFile.componentName;\n this.diagnostics.push(Object.assign({ file: this.xmlFile, range: scriptImport.filePathRange }, DiagnosticMessages_1.DiagnosticMessages.unnecessaryScriptImportInChildFromParent(ancestorComponentName)));\n }\n }\n }\n }", "title": "" }, { "docid": "399d1997ee46f50e6e33b6ad4f0cf63c", "score": "0.501308", "text": "function extendPreventingOverrides (a, b) {\n Object.keys(b).forEach(addContentFromBtoA)\n return a\n\n function addContentFromBtoA (key) {\n if (a.hasOwnProperty(key)) {\n mergeIntoAnArray(a, b, key)\n } else {\n a[key] = b[key]\n }\n }\n }", "title": "" }, { "docid": "29fa75853a07a409696743e77380576b", "score": "0.500593", "text": "async handleIgnoreReload(oldIgnore) {\n const assetsToRemove = _.difference(this.siteConfig.ignore, oldIgnore);\n\n if (!_.isEqual(oldIgnore, this.siteConfig.ignore)) {\n await this._removeMultipleAssets(assetsToRemove);\n this.buildManagers();\n await this.buildAssets();\n }\n }", "title": "" }, { "docid": "68676c4c1b362d79e0411b0d99b00efa", "score": "0.5000636", "text": "function refreshExportFiles(){\r\t\tarrayDontExportPresets = getFileArray(dirUserPresets.getFiles()); // CS6\r\t\tarrayDontExportPresets = arrayDontExportPresets.concat( \r\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetFileArray(\r\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdirUserWorkspaces.getFiles())); // CS6\r\t\tarrayExportPresets = new Array();\r\t\texportFolderPresetsTotal = arrayDontExportPresets.length;\r\t}", "title": "" }, { "docid": "78fbe75cb818b01e975c1381cb212a86", "score": "0.4976761", "text": "function uploadFileOverride(widget, file) {\n var options = {\n title: 'Overwrite File?',\n host: widget.parent.node,\n body: \"\\\"\" + file.name + \"\\\" already exists, overwrite?\"\n };\n return dialog_1.showDialog(options).then(function (button) {\n if (button.text !== 'Ok') {\n return;\n }\n return widget.model.upload(file, true);\n });\n }", "title": "" }, { "docid": "aa839f4cc29449c7437ab61c3b91de6d", "score": "0.496262", "text": "function abortOverride(){\r\n\t\t$('#dialogAbortSaveName').on(\"click\",function(){\r\n\t\t\t$('#saveDialogNameDouble').css({\"display\":\"none\"});\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "7a6016be434c96713c7911b9c754a034", "score": "0.49380517", "text": "emptyFile(importsfile) {\n fs.writeFile(importsfile, '', (err) => { if (err) console.log(err) });\n }", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.49340704", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "251a8982c5a717e33a045cffe140473a", "score": "0.49289885", "text": "function test_upgrade_multi_ext_inplace() {}", "title": "" }, { "docid": "6eb8399913bc1709f505d0eb810ec80d", "score": "0.4928818", "text": "function addIndirectUsers(sourceFileLike){if(!addIndirectUser(sourceFileLike)){return;}var moduleSymbol=checker.getMergedSymbol(sourceFileLike.symbol);ts.Debug.assert(!!(moduleSymbol.flags&1536/* Module */));var directImports=getDirectImports(moduleSymbol);if(directImports)for(var _i=0,directImports_1=directImports;_i<directImports_1.length;_i++){var directImport=directImports_1[_i];addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport));}}", "title": "" }, { "docid": "5f2db31b8ea818ddbcdf529e844e69ae", "score": "0.492413", "text": "function warn() {\n var dialog = Dialogs.showModalDialog(\n DefaultDialogs.DIALOG_ID_INFO,\n Strings.INDEX_HTML_FILE_MISSING_DIALOG_TITLE,\n Strings.INDEX_HTML_FILE_MISSING_DIALOG_MESSAGE\n );\n }", "title": "" }, { "docid": "8a89cb27645cd95a7a3eafbcb64f7b9d", "score": "0.49028206", "text": "function imp() {\r\n\tlog('console', \"Importing legacy configuration file...\");\r\n\tlet c = require('./config.json').servers;\r\n\tfor(let id in c) {\r\n\t\tif(c.hasOwnProperty(id)) {\r\n\t\t\tlet o = c[id];\r\n\t\t\tpg.query({\r\n\t\t\t\ttext: \"INSERT INTO server_config VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) ON CONFLICT (id) DO NOTHING\",\r\n\t\t\t\tvalues: [id, o.announce, o.modlog, o.verbose, o.literal, o.name, o.admin, o.mod, o.exempt, o.verboseIgnore, JSON.stringify(o.verboseSettings), JSON.stringify(o.filterSettings), o.mute, o.blacklist]\r\n\t\t\t}, (err, res) => {\r\n\t\t\t\tif(err) {\r\n\t\t\t\t\tconsole.log(err);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "1727ad49c491affe86f31c22a2b819ba", "score": "0.4870134", "text": "async fix(ctx) {\n var _a;\n const fileInspector = await GitignoreCorrectlySetPracticeBase.checkFileInspector(ctx);\n if (!fileInspector) {\n return;\n }\n if (this.fixes && this.fixes.length > 0) {\n let fixesString = this.fixes.join('\\n');\n if (fixesString.length > 0) {\n fixesString = '\\n# added by `dx-scanner --fix`\\n' + fixesString + '\\n';\n }\n // TODO: Fix the race condition when two or more components are at the same path\n await fileInspector.writeFile('.gitignore', `${((_a = this.gitignore) === null || _a === void 0 ? void 0 : _a.raw) || ''}${fixesString}`);\n }\n }", "title": "" }, { "docid": "1efcb2954ed4e58b915f83b36521a256", "score": "0.48486823", "text": "function handleNamespaceImportLike(importName){// Don't rename an import that already has a different name than the export.\nif(exportKind===2/* ExportEquals */&&(!isForRename||importName.text===exportName)){addSearch(importName,checker.getSymbolAtLocation(importName));}}", "title": "" }, { "docid": "6981dc4488b80e80c461dee7c879bd79", "score": "0.48479265", "text": "pruneTypeOnlyImports() {\n const nonTypeIdentifiers = getNonTypeIdentifiers(this.tokens, this.options);\n for (const [path, importInfo] of this.importInfoByPath.entries()) {\n if (\n importInfo.hasBareImport ||\n importInfo.hasStarExport ||\n importInfo.exportStarNames.length > 0 ||\n importInfo.namedExports.length > 0\n ) {\n continue;\n }\n const names = [\n ...importInfo.defaultNames,\n ...importInfo.wildcardNames,\n ...importInfo.namedImports.map(({localName}) => localName),\n ];\n if (names.every((name) => !nonTypeIdentifiers.has(name))) {\n this.importsToReplace.set(path, \"\");\n }\n }\n }", "title": "" }, { "docid": "d1a776dac62d0f0baf38090905806c20", "score": "0.4819105", "text": "function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }", "title": "" }, { "docid": "e699ec74b2b5b686ab45a7ea1da7950f", "score": "0.48184893", "text": "dontAskToImportAnymore(e) {\n\t\tthis.setState({ isAskToImportModalOpen: false });\n\t\twindow.localStorage[LocalStorageKeys.ASKED_TO_IMPORT_CREATIONS] = true;\n\t\tif (e) {\n\t\t\ttrackEvent('ui', 'dontAskToImportBtnClick');\n\t\t}\n\t}", "title": "" }, { "docid": "9d076c781a92cfcc3763cb50ffa7c426", "score": "0.4810837", "text": "function warning(change_message = false) {\n\n}", "title": "" }, { "docid": "f2a42debc63a951e5dffe871e62b3d18", "score": "0.48106685", "text": "_ignoreChangeRejections () {\n return {};\n }", "title": "" }, { "docid": "be1c1d09b19d0a900de43ffbe4b14f92", "score": "0.47746038", "text": "function impLoad () {\n let myImportedData = JSON.parse(this.result)\n // Un-comment this line if we want to replace the storage\n // chrome.storage.sync.clear();\n // Here the chrome storage is imported, it aggregates the reading list and replaces setting\n chrome.storage.sync.set(myImportedData, () => {\n restoreOptions()\n if (isFirefox) {\n chrome.runtime.reload()\n }\n if (chrome.runtime.lastError) {\n console.error(chrome.runtime.lastError)\n }\n })\n importOrig.value = '' // make sure to clear input value after every import\n }", "title": "" }, { "docid": "4d0daf8bec065b5f226fe13c12dbbd65", "score": "0.47745582", "text": "function sourceFileIgnored(builder, info)\n{\n if (!application.args.silent)\n {\n console.log('Ignored source file:');\n console.log(' Package: '+info.packageName);\n console.log(' Source: '+info.sourcePath);\n console.log(' Target: '+info.targetPath);\n console.log(' Reason: '+info.reason);\n console.log();\n }\n}", "title": "" }, { "docid": "c5877dd76d9c82a8d412eecfce6197a1", "score": "0.4770017", "text": "function completeImports(e)\r\n {\r\n var modules = pendingImports.modules;\r\n\r\n for(var qualifiedName in modules)\r\n {\r\n alert( 'ImportAs (\"'+modules[qualifiedName]+'\", \"'+qualifiedName+'\")'\r\n + \"...CHECKING.\", arguments);\r\n\r\n if(!pendingImports.get(qualifiedName)) continue;\r\n ImportAs(modules[qualifiedName], qualifiedName, null, null, this);\r\n pendingImports.remove(qualifiedName);\r\n }\r\n }", "title": "" }, { "docid": "1ae29d616e24cd38a63b74a051532c07", "score": "0.47680706", "text": "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "title": "" }, { "docid": "1ae29d616e24cd38a63b74a051532c07", "score": "0.47680706", "text": "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "title": "" }, { "docid": "1ae29d616e24cd38a63b74a051532c07", "score": "0.47680706", "text": "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "title": "" }, { "docid": "1ae29d616e24cd38a63b74a051532c07", "score": "0.47680706", "text": "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "title": "" }, { "docid": "1ae29d616e24cd38a63b74a051532c07", "score": "0.47680706", "text": "function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }", "title": "" }, { "docid": "8a1b7e6b64c55cd33e3c2fff15987537", "score": "0.4767495", "text": "function fixReportWriter() {\n const fileToFix = path.join(extensionRoot, 'node_modules', 'jest-standard-reporter', 'src', 'stdlib.js');\n if (!fs.existsSync(fileToFix)) {\n throw new Error(`File not found, ${fileToFix}`);\n }\n\n const oldContents = fs.readFileSync(fileToFix).toString();\n const newContents = oldContents.replace(/this.err\\(/g, 'console.error(').replace(/this.out\\(/g, 'console.log(');\n\n if (newContents === oldContents && oldContents.includes('console.error(') && oldContents.includes('console.log(')) {\n return;\n }\n if (newContents === oldContents) {\n throw new Error(\n `Contents of the file have changed, please update this code to fix the jest reporter, ${fileToFix}`,\n );\n }\n\n fs.writeFileSync(fileToFix, newContents);\n console.info(`File ${path.relative(__dirname, fileToFix)} updated in ./build/postInstall.js.`);\n}", "title": "" }, { "docid": "71cf0b8dd9a8b9b418bb65ba0559e275", "score": "0.47536793", "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 // options: {\n // fix: true\n // }\n // })\n // }\n }", "title": "" }, { "docid": "c487da02ec1aec3179460f095a496f70", "score": "0.47515488", "text": "function overwriteDialogue()\n {\n swal({\n title: \"Overwrite?\",\n text: \"You have already created an image with this name!\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, overwrite it!\",\n closeOnConfirm: false\n }, () => contentService.saveCanvasImage(true, getSaveState())\n .then((res) => {\n var response = angular.fromJson(res).data;\n if (response.success)\n successSwal(\"overwritten\");\n else\n errSwal(response);\n }));\n }", "title": "" }, { "docid": "7811b365567ae6e973c1a22b43ad46fe", "score": "0.47450677", "text": "addDeletionOverride(path) {\n this.addOverride(path, undefined);\n }", "title": "" }, { "docid": "388e6f05c22a5e6b77bf7979aacf4c06", "score": "0.47219104", "text": "function saveComponent() {\r\n parent.dirtyOptionPane = true;\r\n let state = getImportComponentState();\r\n parent.saveData('Import', state);\r\n}", "title": "" }, { "docid": "e1c0b7e819866733a697e79a4752e75c", "score": "0.4706827", "text": "function beforeSavingGame(args, data) {\n 'use strict';\n}", "title": "" }, { "docid": "06e177720dab5ad325eae55f2642566f", "score": "0.47041574", "text": "enterImportDefault(ctx) {\n\t}", "title": "" }, { "docid": "64a0cc22f37d91d6e3d8f80a7aebce6f", "score": "0.47011933", "text": "function ignore() {\n return false;\n}", "title": "" }, { "docid": "0c6d10470d612fc16f51415d415c2347", "score": "0.46927333", "text": "function importedUsedFunction () {\n\t\tconsole.log( 'unnamed' );\n\t}", "title": "" }, { "docid": "cbe4ae2e06b03a6dd67fbffda9a355e7", "score": "0.46892846", "text": "exitImportDefault(ctx) {\n\t}", "title": "" }, { "docid": "8006d5e4c7fb9482d33f012357b99bac", "score": "0.46882018", "text": "function disregard_intervention(chosen)\n{\n\tchosen.is_implemented = false;\n\tconsole.log(\"Intervention: \" + chosen.name + \" is no longer in use by the player\");\n}", "title": "" }, { "docid": "69fc37615cd2a6ba1ca5b8cbf2338db1", "score": "0.46841967", "text": "function all_warnings_off () {\n warning_username (false);\n warning_password (false);\n warning_cracklib (false);\n }", "title": "" }, { "docid": "85475535d2aa5a1bbd5fbb30bf485500", "score": "0.46783286", "text": "function warnUnlessForced (message) {\n if (options && options.force) {\n grunt.log.error(message);\n } else {\n grunt.warn(message);\n }\n }", "title": "" }, { "docid": "8db4f9d7ef510a7865de53c00c4bd2af", "score": "0.46495572", "text": "function uploadBackupScriptConfirmation() {\n\tmessage = \"Are you sure you want to apply this script? \\n\" + \n\t\t\t\t\t\"It will overwrite the exisiting database tables. \\n\" +\n\t\t\t\t\t\"Press OK to apply the script and\\n\" + \n\t\t\t\t\t\"Cancel to stay on the current page\";\n\tif (window.confirm(message)) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "854ba3647f6e76e30a824cc565fefcd0", "score": "0.46487918", "text": "claimImportCode(importPath) {\n const result = this.importsToReplace.get(importPath);\n this.importsToReplace.set(importPath, \"\");\n return result || \"\";\n }", "title": "" }, { "docid": "854ba3647f6e76e30a824cc565fefcd0", "score": "0.46487918", "text": "claimImportCode(importPath) {\n const result = this.importsToReplace.get(importPath);\n this.importsToReplace.set(importPath, \"\");\n return result || \"\";\n }", "title": "" }, { "docid": "256b4eac90fced6c4b65f8b1312b03a5", "score": "0.46406007", "text": "function createWarningMsg(targetImportItem, outOfOrderItem, order) {\n const outOfOrderImportName =\n outOfOrderItem.node.importKind === 'type'\n ? `'${outOfOrderItem.name}' import type`\n : `'${outOfOrderItem.name}' import`;\n const targetImportName =\n targetImportItem.node.importKind === 'type'\n ? `'${targetImportItem.name}' import type`\n : `'${targetImportItem.name}' import`;\n\n return `${outOfOrderImportName} should occur ${order} ${targetImportName}`;\n}", "title": "" }, { "docid": "e1d822eeabcb13b84c383c91625c4f47", "score": "0.46282774", "text": "function warnAboutPluginsConflict() {\n (0, _console.warn)((0, _templateLiteralTag.toSingleLine)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)([\"Plugins `columnSorting` and `multiColumnSorting` should not be enabled simultaneously. \\n Only `multiColumnSorting` will work.\"], [\"Plugins \\\\`columnSorting\\\\` and \\\\`multiColumnSorting\\\\` should not be enabled simultaneously. \\n Only \\\\`multiColumnSorting\\\\` will work.\"]))));\n}", "title": "" }, { "docid": "aa23aaddd5f6a6e116ffef5b762bef74", "score": "0.46248496", "text": "extend(config, ctx) {\n config.node = {\n fs: 'empty'\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": "172668b14577683165bdaaa08aca67fe", "score": "0.46117786", "text": "pruneTypeOnlyImports() {\n this.nonTypeIdentifiers = getNonTypeIdentifiers(this.tokens, this.options);\n for (const [path, importInfo] of this.importInfoByPath.entries()) {\n if (\n importInfo.hasBareImport ||\n importInfo.hasStarExport ||\n importInfo.exportStarNames.length > 0 ||\n importInfo.namedExports.length > 0\n ) {\n continue;\n }\n const names = [\n ...importInfo.defaultNames,\n ...importInfo.wildcardNames,\n ...importInfo.namedImports.map(({localName}) => localName),\n ];\n if (names.every((name) => this.isTypeName(name))) {\n this.importsToReplace.set(path, \"\");\n }\n }\n }", "title": "" }, { "docid": "ed321e7761049eed891fb9889489b46b", "score": "0.46061316", "text": "_writing() {\n return {\n ...writeFiles(),\n ...super._missingPostWriting(),\n };\n }", "title": "" }, { "docid": "9e4150bb418e3ff2c748c3a17f031553", "score": "0.45884082", "text": "function handle_overwrite_Rules (pOverwriteLine) {\n\tvar vLine = pOverwriteLine.substring(1, pOverwriteLine.length);\n\tvar vReturnLine = pOverwriteLine;\n\t// alert(\"rules.js:51 - m_handle_overwrite_Rules()\\n\"+pOverwriteLine);\n\tvar vReturnArray = this.parse_rule(pOverwriteLine);\n\t// vReturnArray = (\">\",\"NON_TERM\",\"term definition\",\"+\",3,\"OVERWRITE\");\n\t//alert(\"rules.js:57\\nhandle_overwrite('\"+pOverwriteLine+\"')\");\n\tvar vKeywords = vReturnArray[2];\n\t//var vKeywords = this.assGrammar.replace_nonterms(vReturnArray[2]);\n\tvar vCitationCount = vReturnArray[4];\n\tif (vReturnArray[1] == \"SYS_KEYWORDS\") {\n\t\t//alert(\"rules.js:178 - m_handle_overwrite()\\n Search in Citations for Keywords and\"+\n\t\t//\t \"\\n create \"+ vCitationCount +\" citations for the keywords\\n \"+ vKeywords);\n\t\t//vReturnLine = \">SYS_CITATION [[[3]]] [[[7]]] [[[2]]]\"; \n\t\tvar vCiteTerm = \"\";\n\t\twith (this.assCitations) {\n\t\t\t//aTolerance = 10;\n\t\t\tsearch(vKeywords,10);\n\t\t\tvCiteTerm = create_citeID(vCitationCount);\n\t\t\tvReturnLine = \">SYS_CITATION\"+ vCiteTerm;\n\t\t};\n\t\tthis.update_rule(\"SYS_CITATION\",vCiteTerm,\"\",\"1\",\"SYSTEM\");\n\t} \n\t//if (vReturnArray[1].indexOf(\"LOOP_\")>=0) {alert(\"rules.js:58\\nupdate_rule('\"+vReturnArray[1]+\"','\"+vReturnArray[2]+\"','\"+vReturnArray[3]+\"','\"+vReturnArray[4]+\"','\"+vReturnArray[5]+\")\")};\n\tthis.update_rule(vReturnArray[1],vReturnArray[2],vReturnArray[3],vReturnArray[4],vReturnArray[5]);\n\treturn vReturnLine;\n}", "title": "" }, { "docid": "8af033e9a01f6309c6210eee0e32884e", "score": "0.45813927", "text": "IMP() {\r\n //do nothing\r\n }", "title": "" }, { "docid": "6f362f04ccd32c27d5e831885201313d", "score": "0.45785794", "text": "function ChangeSetOnFailure(pageProxy) {\n _CommonLibrary2.default.setOnCreateUpdateFlag(pageProxy, '');\n _CommonLibrary2.default.setOnChangesetFlag(pageProxy, false);\n _CommonLibrary2.default.setOnWOChangesetFlag(pageProxy, false);\n _AssignmentType2.default.removeWorkOrderDefaultOverride();\n}", "title": "" }, { "docid": "57376bd24d87bd77d99002592d435378", "score": "0.45721263", "text": "writing() {\n const metaFile = this.destinationPath('package.json');\n const meta = this.fs.readJSON(metaFile);\n const extension = {\n husky: {\n hooks: {\n 'pre-commit': 'pretty-quick --staged',\n },\n },\n };\n const override = merge(meta, extension);\n\n this.fs.extendJSON(metaFile, override, null, 2);\n this.fs.copy(\n this.templatePath('.prettierrc'),\n this.destinationPath('.prettierrc')\n );\n }", "title": "" }, { "docid": "21338068578d24b1bd65781b89a500b5", "score": "0.4571678", "text": "function warn(){\n alert('This feature avail @ VERSION-2.0');\n}", "title": "" }, { "docid": "0533686013e3715ae597013fb2aa61f3", "score": "0.45708382", "text": "function _checkAppDefaultConfigFile() {\n if (!fs.existsSync(defaultAppConfigFile)) {\n var self = this;\n this.utils.copyFile(fwkConfigFile, defaultAppConfigFile, function(err) {\n if (err) {\n throw new Error(err);\n } else {\n _checkAppConfigFile.call(self);\n }\n });\n } else{\n _checkAppConfigFile.call(this);\n }\n }", "title": "" }, { "docid": "1834c40a788812b61df44e76d21649af", "score": "0.4570576", "text": "function pidginImporter() { }", "title": "" }, { "docid": "76f2de452d20fb438dbb148563b18fcf", "score": "0.45704183", "text": "function throwConflictPropertyError (name) {\n\t\tthrow new Error('Remaining conflicting property: ' + name);\n\t}", "title": "" }, { "docid": "6a69ad58bdc9c1f0a709b86f0739ae59", "score": "0.4569486", "text": "_enableBeforeUnload() {\n\t\twindow.onbeforeunload = () => {\n\t\t\treturn I18n.t(\"Did you save all your changes ? If not, your changes will be lost.\")\n\t\t};\n\t}", "title": "" }, { "docid": "25868fae9eff5dc73b04dc50679e2725", "score": "0.45690006", "text": "function cannotOverrideUndeclaredRule(ruleName, grammarName, body) {\n return createError(\n 'Cannot override rule ' + ruleName + ' because it is not declared in ' + grammarName,\n body.definitionInterval);\n}", "title": "" }, { "docid": "378a98702aa75a9c417a57eb3198f082", "score": "0.4562534", "text": "function checkForManualOverride() {\n if (opt.manualOverride && !curSize) {\n var kw = keyword();\n var url = opt.manualOverride(kw);\n if (url && url.length) {\n updateWholeForm(url);\n disable('');\n }\n }\n }", "title": "" }, { "docid": "32ab3daa0281fe864112005c8df026e6", "score": "0.45624405", "text": "_checkMixedRepr() {\n if (!this._isTypeSet) return;\n\n this._warn(\n 'Script source(`inline`/`source`/`stored`/`id`/`file`) was already specified!'\n );\n this._warn('Overwriting.');\n\n delete this._body.inline;\n delete this._body.source;\n delete this._body.stored;\n delete this._body.id;\n delete this._body.file;\n }", "title": "" }, { "docid": "428429c9d77f059b1e25c7c4252d3c85", "score": "0.4557956", "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 options : {\n fix : true,\n },\n })\n }\n }", "title": "" }, { "docid": "187bdc881a0eac29bc6c5ea884bd062f", "score": "0.4549087", "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 options: {\n fix: true,\n },\n });\n }\n }", "title": "" }, { "docid": "2e048c141872727ba39d5897d7dfb207", "score": "0.45471883", "text": "skipStampingPendingFile() {\n if (this.pending) {\n this.pending.onload = null;\n }\n }", "title": "" }, { "docid": "0761d2da7572370a60ba98f69c3d4937", "score": "0.4536993", "text": "function ignoreFileHandler(disposables) {\n const ignorers = new Map();\n disposables.push({ dispose: () => ignorers.clear() });\n return {\n fileIsIgnored(filePath) {\n const { ignorer, ignoreFilePath } = getIgnorerForFile(filePath);\n return ignorer.ignores(path.relative(path.dirname(ignoreFilePath), filePath));\n },\n };\n function getIgnorerForFile(fsPath) {\n const absolutePath = getIgnorePathForFile(fsPath, utils_1.getConfig(coc_nvim_1.Uri.file(fsPath)).ignorePath);\n if (!absolutePath) {\n return { ignoreFilePath: '', ignorer: nullIgnorer };\n }\n if (!ignorers.has(absolutePath)) {\n loadIgnorer(coc_nvim_1.Uri.file(absolutePath));\n }\n if (!fs_1.existsSync(absolutePath)) {\n // Don't log default value.\n const ignorePath = utils_1.getConfig(coc_nvim_1.Uri.file(fsPath)).ignorePath;\n if (ignorePath !== '.prettierignore') {\n errorHandler_1.addToOutput(`Wrong prettier.ignorePath provided in your settings. The path (${ignorePath}) does not exist.`, 'Warning');\n }\n return { ignoreFilePath: '', ignorer: nullIgnorer };\n }\n return {\n ignoreFilePath: absolutePath,\n ignorer: ignorers.get(absolutePath),\n };\n }\n function loadIgnorer(ignoreUri) {\n let ignorer = nullIgnorer;\n if (!ignorers.has(ignoreUri.fsPath)) {\n const fileWatcher = coc_nvim_1.workspace.createFileSystemWatcher(ignoreUri.fsPath);\n disposables.push(fileWatcher);\n fileWatcher.onDidCreate(loadIgnorer, null, disposables);\n fileWatcher.onDidChange(loadIgnorer, null, disposables);\n fileWatcher.onDidDelete(unloadIgnorer, null, disposables);\n }\n if (fs_1.existsSync(ignoreUri.fsPath)) {\n const ignoreFileContents = fs_1.readFileSync(ignoreUri.fsPath, 'utf8');\n ignorer = ignore().add(ignoreFileContents);\n }\n ignorers.set(ignoreUri.fsPath, ignorer);\n }\n function unloadIgnorer(ignoreUri) {\n ignorers.set(ignoreUri.fsPath, nullIgnorer);\n }\n}", "title": "" }, { "docid": "5fc72099afcb1b9689eeda323f58cc0e", "score": "0.45351443", "text": "function loadedImport() {\n loaded++;\n checkDone();\n }", "title": "" }, { "docid": "9f8c4d2750a10449960801ac3e47a9ee", "score": "0.45347008", "text": "function reportAndFixOutOfOrder(context, importedItems) {\n const sourceCode = context.getSourceCode();\n const outOfOrder = findOutOfOrder(importedItems);\n\n if (!outOfOrder.length) {\n return;\n }\n\n // Reverse the importedItems to see if it has fewer unordered imports.\n const reversedImportedItems = reverse(importedItems);\n const reversedOutOfOrder = findOutOfOrder(reversedImportedItems);\n\n if (reversedOutOfOrder.length < outOfOrder.length) {\n reversedOutOfOrder.forEach((outOfOrderItem) => {\n const order = 'after';\n const targetImportItem = findTargetImportItem(reversedImportedItems, outOfOrderItem);\n const message = createWarningMsg(targetImportItem, outOfOrderItem, order);\n\n context.report({\n node: outOfOrderItem.node,\n message,\n fix: fixOutOfOrder(sourceCode, targetImportItem.node, outOfOrderItem.node, order),\n });\n });\n } else {\n outOfOrder.forEach((outOfOrderItem) => {\n const order = 'before';\n const targetImportItem = findTargetImportItem(importedItems, outOfOrderItem);\n const message = createWarningMsg(targetImportItem, outOfOrderItem, order);\n\n context.report({\n node: outOfOrderItem.node,\n message,\n fix: fixOutOfOrder(sourceCode, targetImportItem.node, outOfOrderItem.node, order),\n });\n });\n }\n}", "title": "" }, { "docid": "69e9a7ba210bcf459a09524d2f3b0c62", "score": "0.45309424", "text": "function cleanupDuplicateLiteralPaths() {\n const uniqueImports = {};\n\n root.find(j.ImportDeclaration).forEach((nodePath) => {\n let node = nodePath.node;\n let value = node.source && node.source.value;\n\n if (!(value in uniqueImports)) {\n // add to found uniqueImports and we wont modify\n uniqueImports[value] = nodePath;\n } else {\n // get all specifiers and add to existing import\n // then delete this nodePath\n let specifiers = node.specifiers;\n let existingNodePath = uniqueImports[value];\n\n specifiers.forEach((spec) => {\n let { imported, local } = spec;\n\n if (spec.type === 'ImportDefaultSpecifier') {\n let specifier = j.importDefaultSpecifier(j.identifier(local.name));\n // default imports go at front\n existingNodePath.get('specifiers').unshift(specifier);\n } else if (spec.type === 'ImportSpecifier') {\n let specifier;\n\n if (imported && local) {\n specifier = j.importSpecifier(\n j.identifier(imported.name),\n j.identifier(local.name)\n );\n } else {\n specifier = j.importSpecifier(j.identifier(imported.name));\n }\n\n existingNodePath.get('specifiers').push(specifier);\n }\n });\n\n nodePath.prune();\n }\n });\n }", "title": "" }, { "docid": "5feca50a9caaeb47a74194819e03b3ea", "score": "0.45203838", "text": "afterImport() {\n return Promise.resolve();\n }", "title": "" }, { "docid": "d86b4229fe955aea31d7f6e1a8ce8a14", "score": "0.45144123", "text": "function LICENSE_WARNING$static_(){LabelableSkin.LICENSE_WARNING=( new LabelableSkin(\"license-warning\"));}", "title": "" }, { "docid": "f3062a62345830278b7df040dae5e04c", "score": "0.45096597", "text": "addOrReplaceScript(scriptName, content) {\r\n const scriptsSection = 'scripts';\r\n if (!this.packageJson[scriptsSection]) {\r\n this.packageJson[scriptsSection] = {};\r\n }\r\n const isOverride = !!this.packageJson[scriptsSection][scriptName];\r\n this.packageJson[scriptsSection][scriptName] = content;\r\n if (this.context) {\r\n if (isOverride) {\r\n this.context.logger.info(`changed script ${scriptName} in ${this._path}/package.json`);\r\n }\r\n else {\r\n this.context.logger.info(`added script ${scriptName} to ${this._path}/package.json`);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a939ca14e048bf1bee940ccc593ffb59", "score": "0.4508769", "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 options: {\n fix: true\n }\n })\n }\n }", "title": "" }, { "docid": "96b1da4cc7173c5140fdf066a3bace55", "score": "0.45039696", "text": "warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }", "title": "" }, { "docid": "96b1da4cc7173c5140fdf066a3bace55", "score": "0.45039696", "text": "warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }", "title": "" }, { "docid": "96b1da4cc7173c5140fdf066a3bace55", "score": "0.45039696", "text": "warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }", "title": "" }, { "docid": "eec4a471740938775571a9f2b33cc181", "score": "0.4500823", "text": "function extendObj( obj ){\n\t\tvar exclude = ['extend'];\n\t\tfor ( var k in exports ){\n\t\t\tif ( exports.hasOwnProperty( k ) && exclude.indexOf( k ) < 0 && !obj.hasOwnProperty(k)){\n\t\t\t\tobj[ k ] = exports[ k ];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1f3427cc6b6b53125b466ceb6a9006ed", "score": "0.4485266", "text": "function updateVersionFile (done) {\n const version = getVersion()\n\n fs.writeFileSync(VERSION, `export const version = '${version}'${AUTOGENERATED_WARNING}`)\n\n done()\n}", "title": "" }, { "docid": "b0bb37928fec66748a3bb046be0e3085", "score": "0.44836187", "text": "function IgnorePhishingWarning() {\n // This property should really be called skipPhishingWarning or something\n // like that, but it's too late to change that now.\n // This property is used to suppress the phishing bar for the message.\n setMsgHdrPropertyAndReload(\"notAPhishMessage\", 1);\n}", "title": "" }, { "docid": "571ae6c9f65b1c1e4df2044b95715ed7", "score": "0.44832712", "text": "extend(config, ctx) {\n // This line prevents dotenv from failing when requiring fs\n config.node = {\n fs: 'empty',\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 })\n }\n }", "title": "" } ]
916c48951ce155afbd8c5f0244e5a7f5
Toggle full screen of the editor.
[ { "docid": "7570d49a6286e48c21973340971600d2", "score": "0.8254641", "text": "function toggleFullScreen(editor) {\n\t// Set fullscreen\n\tvar cm = editor.codemirror;\n\tcm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n\n\n\t// Prevent scrolling on body during fullscreen active\n\tif(cm.getOption(\"fullScreen\")) {\n\t\tsaved_overflow = document.body.style.overflow;\n\t\tdocument.body.style.overflow = \"hidden\";\n\t} else {\n\t\tdocument.body.style.overflow = saved_overflow;\n\t}\n\n\n\t// Update toolbar class\n\tvar wrap = cm.getWrapperElement();\n\n\tif(!/fullscreen/.test(wrap.previousSibling.className)) {\n\t\twrap.previousSibling.className += \" fullscreen\";\n\t} else {\n\t\twrap.previousSibling.className = wrap.previousSibling.className.replace(/\\s*fullscreen\\b/, \"\");\n\t}\n\n\n\t// Update toolbar button\n\tvar toolbarButton = editor.toolbarElements.fullscreen;\n\n\tif(!/active/.test(toolbarButton.className)) {\n\t\ttoolbarButton.className += \" active\";\n\t} else {\n\t\ttoolbarButton.className = toolbarButton.className.replace(/\\s*active\\s*/g, \"\");\n\t}\n\n\n\t// Hide side by side if needed\n\tvar sidebyside = cm.getWrapperElement().nextSibling;\n\tif(/editor-preview-active-side/.test(sidebyside.className))\n\t\ttoggleSideBySide(editor);\n}", "title": "" } ]
[ { "docid": "0875567e63521a911c2f42c288932015", "score": "0.8180682", "text": "function toggleFullScreen(editor) {\n // Set fullscreen\n var cm = editor.codemirror;\n cm.setOption('fullScreen', !cm.getOption('fullScreen'));\n\n\n // Prevent scrolling on body during fullscreen active\n if (cm.getOption('fullScreen')) {\n saved_overflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = saved_overflow;\n }\n\n\n // Hide side by side if needed\n var sidebyside = cm.getWrapperElement().nextSibling;\n if (/editor-preview-active-side/.test(sidebyside.className))\n toggleSideBySide(editor);\n\n if (editor.options.onToggleFullScreen) {\n editor.options.onToggleFullScreen(cm.getOption('fullScreen') || false);\n }\n\n // Remove or set maxHeight\n if (typeof editor.options.maxHeight !== 'undefined') {\n if (cm.getOption('fullScreen')) {\n cm.getScrollerElement().style.removeProperty('height');\n sidebyside.style.removeProperty('height');\n } else {\n cm.getScrollerElement().style.height = editor.options.maxHeight;\n editor.setPreviewMaxHeight();\n }\n }\n\n\n // Update toolbar class\n if (!/fullscreen/.test(editor.toolbar_div.className)) {\n editor.toolbar_div.className += ' fullscreen';\n } else {\n editor.toolbar_div.className = editor.toolbar_div.className.replace(/\\s*fullscreen\\b/, '');\n }\n\n\n // Update toolbar button\n if (editor.toolbarElements && editor.toolbarElements.fullscreen) {\n var toolbarButton = editor.toolbarElements.fullscreen;\n\n if (!/active/.test(toolbarButton.className)) {\n toolbarButton.className += ' active';\n } else {\n toolbarButton.className = toolbarButton.className.replace(/\\s*active\\s*/g, '');\n }\n }\n}", "title": "" }, { "docid": "b66cf939e7aa0f17b8034789c1f57dde", "score": "0.81682247", "text": "static toggleFullScreen(editor) {\n // Set fullscreen\n let self = MDEActions;\n let cm = editor.codemirror;\n cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n\n // Prevent scrolling on body during fullscreen active\n if (cm.getOption(\"fullScreen\")) {\n window.mdeSavedOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n } else {\n document.body.style.overflow = window.mdeSavedOverflow;\n }\n\n // Update toolbar class\n let wrap = cm.getWrapperElement();\n\n if (!/fullscreen/.test(wrap.previousSibling.className)) {\n wrap.previousSibling.className += \" fullscreen\";\n } else {\n wrap.previousSibling.className = wrap.previousSibling.className.replace(/\\s*fullscreen\\b/, \"\");\n }\n\n // Update toolbar button\n let toolbarButton = editor.toolbarElements.fullscreen;\n\n if (!/active/.test(toolbarButton.className)) {\n toolbarButton.className += \" active\";\n } else {\n toolbarButton.className = toolbarButton.className.replace(/\\s*active\\s*/g, \"\");\n }\n\n // Hide side by side if needed\n let sidebyside = cm.getWrapperElement().nextSibling;\n if (/editor-preview-active-side/.test(sidebyside.className)) {\n self.toggleSideBySide(editor);\n }\n }", "title": "" }, { "docid": "d870b96697526e2ae7e9e8927d8f4d90", "score": "0.8002238", "text": "function toggleFullscreenMode() {\n}", "title": "" }, { "docid": "fcd9810897d68015fdd8f95e2b766d89", "score": "0.79134417", "text": "function toggleScreenFull() {\n\tscreenfull.toggle();\n}", "title": "" }, { "docid": "63f8adf5c45fb25fdb7e2c3b7def8679", "score": "0.7788033", "text": "function fullScreen() {\n GAME.state.states[GAME.state.current].toggleFullScreen()\n}", "title": "" }, { "docid": "9f5023d69e44846524222ba492843133", "score": "0.77771014", "text": "function toggleFullScreen(){\n\tif(inFullScreen()){\n\t\tconsole.log(\"exit fullscreen\");\n\t\texitFullscreen();\n\t} else {\n\t\tconsole.log(\"enter fullscreen\");\n\t\tlaunchIntoFullscreen($(\"body\")[0]);\n\t}\n}", "title": "" }, { "docid": "d24c6af93156bfd0f67624cb1aa47207", "score": "0.77107346", "text": "function toggleFullScreen(editor) {\n var cm = editor.codemirror;\n var el = $('.editor')[0];\n // https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode\n var doc = document;\n var _sw = screen.width;\n var _sh = screen.height;\n var isFull = doc.isfullScreen || doc.mozFullScreen || doc.webkitIsFullScreen;\n var goBig = function() {\n $('.editor__menu--zen').addClass('editor__menu--two')\n .removeClass('editor__menu--zen');\n $('.editor').css({\n position: 'fixed',\n width: '100%',\n top: 0,\n left: 0,\n 'z-index': 999,\n 'margin-top': 0\n });\n $('.CodeMirror').css('height', $('html').height());\n $('.CodeMirror-gutters').css('height', '100%');\n $('.editor__resize').hide();\n };\n var request = function() {\n $('.editor').css('overflow', 'auto');\n $('.editor__resize').hide();\n $('.editor__menu--two').addClass('editor__menu--unzen')\n .removeClass('editor__menu--two');\n $('.editor__menu li.pull-right').hide();\n if (el.requestFullScreen) {\n el.requestFullScreen();\n } else if (el.mozRequestFullScreen) {\n el.mozRequestFullScreen();\n } else if (el.webkitRequestFullScreen) {\n el.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n $('.CodeMirror').after('<div id=\"editorLive\" class=\"editor-live fmt\"></div>')\n\n $('.editor').css('margin', 0);\n if(_sh > _sw) { // 针对竖屏做了优化\n $('.CodeMirror').css('height', '45%');\n $('#editorLive').css('height', '50%');\n } else {\n $('.editor__menu, .editor-help').css('width', '49%');\n $('.CodeMirror').css({height: _sh - 80, width: '49%', float: 'left'});\n $('#editorLive').css({height: _sh - 10, width: '49%', float: 'right', 'margin-top': '-70px'});\n }\n cm.focus();\n var text = cm.getValue();\n $('#editorLive').html(marker(text));\n highLight($('#editorLive'));\n\n $(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function() {\n var _isFull = document.isfullScreen || document.mozFullScreen || document.webkitIsFullScreen;\n if(!_isFull) {\n cancel();\n }\n });\n\n };\n var cancel = function() {\n $('.editor__resize').show();\n $('.editor__menu--unzen').addClass('editor__menu--zen')\n .removeClass('editor__menu--unzen');\n $('.editor__menu li.pull-right').show();\n $('#editorLive').remove();\n $('.CodeMirror, .editor__menu, .editor-help').css('width', '100%');\n $('.CodeMirror').css('float', 'none');\n $('.editor').css({\n position: 'static',\n width: '100%',\n 'margin-top': '20px'\n });\n if (doc.cancelFullScreen) {\n doc.cancelFullScreen();\n } else if (doc.mozCancelFullScreen) {\n doc.mozCancelFullScreen();\n } else if (doc.webkitCancelFullScreen) {\n doc.webkitCancelFullScreen();\n }\n };\n if (!isFull && $('.editor__menu--zen').length) {\n goBig();\n } else if($('.editor__menu--two').length) {\n request();\n } else {\n cancel();\n }\n}", "title": "" }, { "docid": "7816f034fc8f8780123b10709719d6e0", "score": "0.7641877", "text": "function fullScreenToggle()\n{\n\tCB_console(\"Toggling full screen mode...\");\n\t//If it is using full screen mode already, disables it:\n\tif (CB_Screen.isFullScreen())\n\t{\n\t\tCB_console(\"Full screen mode detected. Trying to restore normal mode...\");\n\t\tCB_Screen.setFullScreen(false); //Uses the Fullscreen API and fallbacks to other methods internally, including NW.js, Electron ones, when not available.\n\t}\n\t//...otherwise, requests full screen mode:\n\telse\n\t{\n\t\tCB_console(\"Normal mode detected. Trying to enable full screen mode...\");\n\t\tCB_Screen.setFullScreen(true, undefined, true); //Allows reloading into another (bigger) window (for legacy clients).\n\t}\n}", "title": "" }, { "docid": "f285588bdb6cf0758b54a32e0a18d67b", "score": "0.7622074", "text": "onFullScreen() {\n ViewPresActions.fullscreen(true);\n }", "title": "" }, { "docid": "55f6330b7a03bde2932cbc8c5676696b", "score": "0.7583307", "text": "function ViewerFullscreenToggle() {\n\t\tif(g_viewerIsFullscreen) {\n\t\t\tif(document.exitFullscreen) {\n\t\t\t\tdocument.exitFullscreen();\n\t\t\t} else if(document.webkitExitFullscreen) {\n\t\t\t\tdocument.webkitExitFullscreen();\n\t\t\t} else if(document.msExitFullscreen) {\n\t\t\t\tdocument.msExitFullscreen();\n\t\t\t} else if(document.mozCancelFullScreen) {\n\t\t\t\tdocument.mozCancelFullScreen();\n\t\t\t}\n\n\t\t\tg_viewerIsFullscreen = false;\n\t\t\t$gE.conVwTb.find('.fullscreenButton').removeClass('removeFullscreenButton').addClass('setFullscreenButton');\n\t\t} else {\n\t\t\tif($gE.conVwCon[0].requestFullscreen) {\n\t\t\t\t$gE.conVwCon[0].requestFullscreen();\n\t\t\t} else if($gE.conVwCon[0].webkitRequestFullscreen) {\n\t\t\t\t$gE.conVwCon[0].webkitRequestFullscreen();\n\t\t\t} else if($gE.conVwCon[0].msRequestFullscreen) {\n\t\t\t\t$gE.conVwCon[0].msRequestFullscreen();\n\t\t\t} else if($gE.conVwCon[0].mozRequestFullScreen) {\n\t\t\t\t$gE.conVwCon[0].mozRequestFullScreen();\n\t\t\t}\n\t\t\tg_viewerIsFullscreen = true;\n\t\t\t$gE.conVwTb.find('.fullscreenButton').removeClass('setFullscreenButton').addClass('removeFullscreenButton');\n\t\t}\n\t}", "title": "" }, { "docid": "39dd4608317ab579e2291ce3e04167ba", "score": "0.75490695", "text": "toggleFullScreen() {\n const d = document.fullscreenElement;\n\n if (!this.container.is(':visible'))\n if (d) document.exitFullscreen();\n else this.v[0].requestFullscreen();\n\n this.buttons.screen[d ? 'addClass' : 'removeClass']('fa-expand');\n if (d) document.exitFullscreen();\n else this.container[0].requestFullscreen();\n\n }", "title": "" }, { "docid": "263d62e1407070cbd1908c73b1160c5b", "score": "0.7536332", "text": "function toggleFullscreen() {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {\n enableFullScreen();\n } else {\n disableFullScreen();\n }\n hideGameButtons();\n}", "title": "" }, { "docid": "30c49801722cf4f4d0f461eac42d497a", "score": "0.74996626", "text": "function toggleFullScreen()\n\t{\n\t\tvar elem = document.documentElement;\n\t\t\n\t\tif(fullScreen)\n\t\t{\n\t\t\tif (document.exitFullscreen) \n\t\t\t{\n\t\t\t\tdocument.exitFullscreen();\n\t\t\t} \n\t\t\telse if (document.mozCancelFullScreen) \n\t\t\t{\n\t\t\t\tdocument.mozCancelFullScreen();\n\t\t\t} \n\t\t\telse if (document.webkitExitFullscreen)\n\t\t\t{\n\t\t\t\tdocument.webkitExitFullscreen();\n\t\t\t} \n\t\t\telse if (document.msExitFullscreen) \n\t\t\t{\n\t\t\t\tdocument.msExitFullscreen();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (elem.requestFullscreen) \n\t\t\t{\n\t\t\t\telem.requestFullscreen();\n\t\t\t} \n\t\t\telse if (elem.mozRequestFullScreen) \n\t\t\t{\n\t\t\t\telem.mozRequestFullScreen();\n\t\t\t} \n\t\t\telse if (elem.webkitRequestFullscreen) \n\t\t\t{\n\t\t\t\telem.webkitRequestFullscreen();\n\t\t\t} \n\t\t\telse if (elem.msRequestFullscreen) \n\t\t\t{\n\t\t\t\telem.msRequestFullscreen();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfullScreen = !fullScreen;\n\t}", "title": "" }, { "docid": "d3f289e999ad73ff22d2c7325326b157", "score": "0.7490645", "text": "function toggleFullScreen() {\n var fsElement = document.documentElement;\n\n if (!document.mozFullScreen && !document.webkitIsFullScreen) {\n //Enter Full Screen\n if (fsElement.mozRequestFullScreen) {\n fsElement.mozRequestFullScreen();\n }\n else {\n fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n } else {\n //Exit Full Screen\n if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else {\n document.webkitCancelFullScreen();\n }\n }\n}", "title": "" }, { "docid": "1080bd2d5b6ac975dcf3078d8b8da01e", "score": "0.747904", "text": "function ViewerFullscreenToggle(){\n if( ngscreenfull.enabled ) {\n // ngscreenfull.toggle($gE.conVwCon[0]); // --> issue on scrollbar visibility\n ngscreenfull.toggle();\n if( g_viewerIsFullscreen ) {\n g_viewerIsFullscreen=false;\n $gE.conVwTb.find('.fullscreenButton').removeClass('removeFullscreenButton').addClass('setFullscreenButton');\n }\n else {\n g_viewerIsFullscreen=true;\n $gE.conVwTb.find('.fullscreenButton').removeClass('setFullscreenButton').addClass('removeFullscreenButton');\n }\n }\n }", "title": "" }, { "docid": "405d2afc712f3c151f3efa4378c76d96", "score": "0.7416275", "text": "function toggleFullScreen() {\n if (!document.fullscreenElement && // alternative standard method\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\n if (document.documentElement.requestFullscreen) {\n document.documentElement.requestFullscreen();\n } else if (document.documentElement.mozRequestFullScreen) {\n document.documentElement.mozRequestFullScreen();\n } else if (document.documentElement.webkitRequestFullscreen) {\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n }", "title": "" }, { "docid": "405d2afc712f3c151f3efa4378c76d96", "score": "0.7416275", "text": "function toggleFullScreen() {\n if (!document.fullscreenElement && // alternative standard method\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\n if (document.documentElement.requestFullscreen) {\n document.documentElement.requestFullscreen();\n } else if (document.documentElement.mozRequestFullScreen) {\n document.documentElement.mozRequestFullScreen();\n } else if (document.documentElement.webkitRequestFullscreen) {\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n }", "title": "" }, { "docid": "da8d6f6c18299c380c710a8f4261c456", "score": "0.7339368", "text": "function toggleFullScreen() {\n if (!document.fullscreenElement && // alternative standard method\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\n if (document.documentElement.requestFullscreen) {\n document.documentElement.requestFullscreen();\n } else if (document.documentElement.mozRequestFullScreen) {\n document.documentElement.mozRequestFullScreen();\n } else if (document.documentElement.webkitRequestFullscreen) {\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n}", "title": "" }, { "docid": "da8d6f6c18299c380c710a8f4261c456", "score": "0.7339368", "text": "function toggleFullScreen() {\n if (!document.fullscreenElement && // alternative standard method\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\n if (document.documentElement.requestFullscreen) {\n document.documentElement.requestFullscreen();\n } else if (document.documentElement.mozRequestFullScreen) {\n document.documentElement.mozRequestFullScreen();\n } else if (document.documentElement.webkitRequestFullscreen) {\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n}", "title": "" }, { "docid": "1afe5b0138b5003da2a54fbad7f8b72d", "score": "0.7330801", "text": "function toggleFullScreen() {\n var doc = window.document;\n var docEl = doc.documentElement;\n\n var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;\n var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen;\n if (!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) {\n requestFullScreen.call(docEl);\n } else {\n cancelFullScreen.call(doc);\n }\n}", "title": "" }, { "docid": "a70c9828b824904848a0b57c9845c3c5", "score": "0.732952", "text": "function toggleFullScreen() {\r\n if (!document.fullscreenElement && // alternative standard method\r\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\r\n if (document.documentElement.requestFullscreen) {\r\n document.documentElement.requestFullscreen();\r\n } else if (document.documentElement.mozRequestFullScreen) {\r\n document.documentElement.mozRequestFullScreen();\r\n } else if (document.documentElement.webkitRequestFullscreen) {\r\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\r\n }\r\n } else {\r\n if (document.cancelFullScreen) {\r\n document.cancelFullScreen();\r\n } else if (document.mozCancelFullScreen) {\r\n document.mozCancelFullScreen();\r\n } else if (document.webkitCancelFullScreen) {\r\n document.webkitCancelFullScreen();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a70c9828b824904848a0b57c9845c3c5", "score": "0.732952", "text": "function toggleFullScreen() {\r\n if (!document.fullscreenElement && // alternative standard method\r\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\r\n if (document.documentElement.requestFullscreen) {\r\n document.documentElement.requestFullscreen();\r\n } else if (document.documentElement.mozRequestFullScreen) {\r\n document.documentElement.mozRequestFullScreen();\r\n } else if (document.documentElement.webkitRequestFullscreen) {\r\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\r\n }\r\n } else {\r\n if (document.cancelFullScreen) {\r\n document.cancelFullScreen();\r\n } else if (document.mozCancelFullScreen) {\r\n document.mozCancelFullScreen();\r\n } else if (document.webkitCancelFullScreen) {\r\n document.webkitCancelFullScreen();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "f963074680171ef69c6af0e0f99ac7ac", "score": "0.73197144", "text": "function toggleFullscreen() {\n if (!document.fullscreenElement &&\n !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods\n if (document.documentElement.requestFullscreen) {\n document.documentElement.requestFullscreen();\n } else if (document.documentElement.msRequestFullscreen) {\n document.documentElement.msRequestFullscreen();\n } else if (document.documentElement.mozRequestFullScreen) {\n document.documentElement.mozRequestFullScreen();\n } else if (document.documentElement.webkitRequestFullscreen) {\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n else {\n noty({ text: \"Cannot enter fullscreen mode automatically. Try manually pressing F11!\", type: \"error\" });\n }\n } else {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n else {\n noty({ text: \"Cannot exit fullscreen mode automatically. Try manually pressing F11!\", type: \"error\" });\n }\n }\n}", "title": "" }, { "docid": "530594cb02f2226573f1adfd1dc6e43f", "score": "0.7316629", "text": "function toggleFullScreen() {\n\t\t\t\t\telement = $this[0];\n\t\t\t\t\tvar requestMethod;\n\t\t\t\t\tif (!camera.isFullScreen) {\n\t\t\t\t\t\t// Supports most browsers and their versions.\n\t\t\t\t\t\trequestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;\n\t\t\t\t\t\tif (requestMethod) { // Native full screen.\n\t\t\t\t\t\t\trequestMethod.call(element);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\trequestMethod = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.msCancelFullScreen;\n\t\t\t\t\t\tif (requestMethod) { // Native full screen.\n\t\t\t\t\t\t\tdocument.webkitIsFullScreen ? document.webkitCancelFullScreen() : document.mozFullScreen ? document.mozCancelFullScreen() : document.fullScreen && (document.cancelFullScreen ? document.cancelFullScreen() : document.exitFullscreen && document.exitFullscreen());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Older IE.\n\t\t\t\t\tif (!requestMethod) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (typeof window.ActiveXObject !== \"undefined\") { \n\t\t\t\t\t\t\t\tvar wscript = new ActiveXObject(\"WScript.Shell\");\n\t\t\t\t\t\t\t\tif (wscript !== null) {\n\t\t\t\t\t\t\t\t\tif ((!camera.isFullScreen && window.screenTop) || (camera.isFullScreen && !window.screenTop)) {\n\t\t\t\t\t\t\t\t\t\t$(document).off('keydown.fullScreen');\n\t\t\t\t\t\t\t\t\t\twscript.SendKeys(\"{F11}\");\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\tcatch (e) {\n\t\t\t\t\t\t\t$(document).off('keydown.fullScreen');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfullScreenSize();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "title": "" }, { "docid": "b96e3cd5e221ac220df7d34394daf15c", "score": "0.7300832", "text": "function toggleFullScreen() {\n if (!document.fullscreenElement && // alternative standard method\n !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods\n if (document.documentElement.requestFullscreen) {\n document.documentElement.requestFullscreen();\n } else if (document.documentElement.mozRequestFullScreen) {\n document.documentElement.mozRequestFullScreen();\n } else if (document.documentElement.webkitRequestFullscreen) {\n document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n $.cookie('fullscreen','1',{ expires: 365 });\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n $.cookie('fullscreen','0',{ expires: 365 });\n }\n }", "title": "" }, { "docid": "9d6818c4b0900aeb8c2c1a0c40484472", "score": "0.72978354", "text": "function toggleFullScreen(value) {\n if (!getfullscreenelement()) {\n GoInFullscreen(document.documentElement);\n } else {\n GoOutFullscreen();\n }\n}", "title": "" }, { "docid": "843253f5ccf3462d758bde872b4ea118", "score": "0.72445035", "text": "function toggleFullscreen(e){e=e||document.documentElement,document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}", "title": "" }, { "docid": "783226862d8e6dd8da63b1db4a119aca", "score": "0.72003007", "text": "function toggleFullScreen() {\n\t if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods\n\t if (document.documentElement.requestFullscreen) {\n\t document.documentElement.requestFullscreen();\n\t } else if (document.documentElement.msRequestFullscreen) {\n\t document.documentElement.msRequestFullscreen();\n\t } else if (document.documentElement.mozRequestFullScreen) {\n\t document.documentElement.mozRequestFullScreen();\n\t } else if (document.documentElement.webkitRequestFullscreen) {\n\t document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n\t }\n\t } else {\n\t if (document.exitFullscreen) {\n\t document.exitFullscreen();\n\t } else if (document.msExitFullscreen) {\n\t document.msExitFullscreen();\n\t } else if (document.mozCancelFullScreen) {\n\t document.mozCancelFullScreen();\n\t } else if (document.webkitExitFullscreen) {\n\t document.webkitExitFullscreen();\n\t }\n\t }\n\t}", "title": "" }, { "docid": "4aff5e570f477d921562e5a462099198", "score": "0.70953447", "text": "show() {\n $('body').addClass('editor-full');\n window.scrollTo(0, 0);\n this.container.show();\n this.active = true;\n }", "title": "" }, { "docid": "c9ba968a78967814a9ef77dabf0c5cf4", "score": "0.7088472", "text": "function onFullscreenChange(){\n s.$fsToggleBtn.toggleClass('active');\n }", "title": "" }, { "docid": "da9246f33e947ff5aca75ebba494b762", "score": "0.7069738", "text": "enterFullMode() {\n this._setMode('full');\n }", "title": "" }, { "docid": "da9246f33e947ff5aca75ebba494b762", "score": "0.7069738", "text": "enterFullMode() {\n this._setMode('full');\n }", "title": "" }, { "docid": "86ee9d17472fb2ba71c3deaf22516ded", "score": "0.7066271", "text": "function toggleFullscreen() {\n if (video.requestFullscreen) {\n video.requestFullscreen();\n } else if (video.msRequestFullscreen) {\n video.msRequestFullscreen();\n } else if (video.mozRequestFullScreen) {\n video.mozRequestFullScreen();\n } else if (video.webkitRequestFullscreen) {\n video.webkitRequestFullscreen();\n }\n}", "title": "" }, { "docid": "e8af9dfa75bc30fa8064b666e7589444", "score": "0.70362264", "text": "function toggleFullscreen(elem) {\n elem = elem || document.documentElement;\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {\n if (elem.requestFullscreen) {\n elem.requestFullscreen();\n } else if (elem.msRequestFullscreen) {\n elem.msRequestFullscreen();\n } else if (elem.mozRequestFullScreen) {\n elem.mozRequestFullScreen();\n } else if (elem.webkitRequestFullscreen) {\n elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n } else {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n }\n }", "title": "" }, { "docid": "34587b465762769f681fae57a53d120b", "score": "0.7028857", "text": "fullScreen() {\n this.props.allowFullScreen && this._iframeNode.requestFullScreen && this._iframeNode.requestFullScreen();\n }", "title": "" }, { "docid": "1c2b03d8e497d9ab594b6291b99b3cc7", "score": "0.7022202", "text": "static set allowFullscreenSwitch(value) {}", "title": "" }, { "docid": "da83a6ecb80d58227107f18ace447e23", "score": "0.70072365", "text": "function makeFullscreen() {\n if (document.fullscreenEnabled) {\n document.documentElement.requestFullscreen();\n }\n}", "title": "" }, { "docid": "ace62cc171e72a1c0b5d38aef5020aa5", "score": "0.70018256", "text": "updateFullScreenButtonVisibility() {\n // If already in full screen, do nothing\n if (this.fullscreen) {\n return;\n }\n\n let forceFullscreen = false;\n if (this.options.layout.fullScreen.fullScreenMode === 'always') {\n forceFullscreen = true;\n }\n else if (this.options.layout.fullScreen.fullScreenMode === 'dynamic') {\n forceFullscreen = (this.$container.width() < this.options.layout.fullScreen.forceFullScreenWidthThreshold);\n }\n\n this.$container.toggleClass('h5p-mini-course-force-fullscreen', forceFullscreen);\n }", "title": "" }, { "docid": "28282d659437aa12f3809045095955b2", "score": "0.696746", "text": "function openFullScreen(elem) {\n if (elem.requestFullscreen) {\n elem.requestFullscreen();\n } else if (elem.mozRequestFullScreen) { // Firefox\n elem.mozRequestFullScreen();\n } else if (elem.webkitRequestFullscreen) { // Chrome, Safari & Opera\n elem.webkitRequestFullscreen();\n } else if (elem.msRequestFullscreen) { // IE/Edge\n elem.msRequestFullscreen();\n }\n\n body.classList.add('full-screen');\n}", "title": "" }, { "docid": "bbaf4cbc3936b0362377a1dd543fb72d", "score": "0.6954755", "text": "GoFullscreen() {\n\t\t\t//let container = document.getElementById(\"container\");\n\t\t\tlet container = document.getElementsByTagName(\"BODY\")[0];\n\t\t\tif (container.requestFullScreen) {\n\t\t\t\tcontainer.requestFullScreen();\n\t\t\t} else if (container.webkitRequestFullScreen) {\n\t\t\t\tcontainer.webkitRequestFullScreen();\n\t\t\t} else if (container.mozRequestFullScreen) {\n\t\t\t\tcontainer.mozRequestFullScreen();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "994d7ad17ccc278aa890104a38ac75f9", "score": "0.69434524", "text": "enterFullScreen() {\n this.dmPlayer.setFullscreen(true);\n }", "title": "" }, { "docid": "a1455023352140d5c8431c131852771b", "score": "0.6930691", "text": "function toggleFullscreen() {\n if (!isFullscreen) {\n try {\n webapis.avplay.setDisplayRect(0, 0, resolutionWidth, resolutionHeight);\n webapis.avplay.setDisplayMethod('PLAYER_DISPLAY_MODE_FULL_SCREEN');\n } catch (error) {\n logger.log(error.message);\n }\n\n logger.log('Fullscreen on');\n\n playerEl.classList.add(FULLSCREEN_CLASS);\n controlsEl.classList.add(FULLSCREEN_CLASS);\n\n if (timerEl) {\n timerEl.classList.add(FULLSCREEN_CLASS);\n }\n\n if (subtitlesEl) {\n subtitlesEl.classList.add(FULLSCREEN_CLASS);\n }\n\n isFullscreen = true;\n } else {\n try {\n webapis.avplay.setDisplayRect(\n playerCoords.x,\n playerCoords.y,\n playerCoords.width,\n playerCoords.height\n );\n webapis.avplay.setDisplayMethod('PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO');\n } catch (error) {\n logger.log(error.message);\n }\n\n logger.log('Fullscreen off');\n playerEl.classList.remove(FULLSCREEN_CLASS);\n controlsEl.classList.remove(FULLSCREEN_CLASS);\n\n if (subtitlesEl) {\n subtitlesEl.classList.remove(FULLSCREEN_CLASS);\n }\n\n if (timerEl) {\n timerEl.classList.remove(FULLSCREEN_CLASS);\n }\n\n isFullscreen = false;\n }\n }", "title": "" }, { "docid": "7e6909a30093c405317f7efbd9ed7b33", "score": "0.69057953", "text": "function toggleFullscreen() {\n let elem = document.querySelector(\"video\");\n if (!document.fullscreenElement) {\n elem.requestFullscreen().catch(err => {\n alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);\n });\n } else {\n document.exitFullscreen();\n }\n}", "title": "" }, { "docid": "589c900896f0b7d276e3b3c6a93b5a12", "score": "0.6905454", "text": "function switchToFullscreen() {\n if (container.requestFullscreen) {\n container.requestFullscreen();\n }\n else if (container.msRequestFullscreen) {\n container.msRequestFullscreen();\n }\n else if (container.mozRequestFullScreen) {\n container.mozRequestFullScreen();\n }\n else if (container.webkitRequestFullscreen) {\n container.webkitRequestFullscreen();\n }\n }", "title": "" }, { "docid": "ba7158389af85330bf2643419cc25025", "score": "0.6897238", "text": "function openFullscreen() {\n if (elem.requestFullscreen) {\n elem.requestFullscreen();\n } else if (elem.webkitRequestFullscreen) { /* Safari */\n elem.webkitRequestFullscreen();\n } else if (elem.msRequestFullscreen) { /* IE11 */\n elem.msRequestFullscreen();\n }\n }", "title": "" }, { "docid": "fa75ad8a36a1c76e85aa87a09c54f3b1", "score": "0.6894836", "text": "function fullscreen(){\n if (document.fullscreenElement) {\n // fullscreen is activated\n document.exitFullscreen();\n } else {\n // fullscreen is cancelled\n document.documentElement.requestFullscreen();\n }\n}", "title": "" }, { "docid": "66badfbb9ad1f7c5bcd673c6938c7784", "score": "0.6851899", "text": "_onFullscreenChanged() {\n this._updateDockVisibility();\n }", "title": "" }, { "docid": "ca04aaf7bde56c32274c80849b21b882", "score": "0.68506134", "text": "function toggleFull() {\n\tvar frame = document.getElementById(\"gameContainer\");\n\tif (!document.isFullScreen && !document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement) {\n\t\tconsole.log (\"Attempting to enter fullscreen\");\n\t\tif(frame.requestFullScreen) {\n\t\t\tconsole.log(\"standardFull\");\n\t\t\tframe.requestFullScreen();\n\t\t\t//addExit();\n\t\t} else if (frame.mozRequestFullscreen) {\n\t\t\tconsole.log(\"mozFull\");\n\t\t\tframe.mozRequestFullscreen();\n\t\t\t//addExit();\n\t\t} else if (frame.webkitRequestFullscreen) {\n\t\t\tconsole.log(\"webkitFull\");\n\t\t\tframe.webkitRequestFullscreen();\n\t\t\t//addExit();\n\t\t} else if (frame.msRequestFullscreen) {\n\t\t\tconsole.log(\"msFull\");\n\t\t\tframe.msRequestFullscreen();\n\t\t\t//addExit();\n\t\t} \n\t} else {\n\t\tconsole.log(\"Attempting to exit fullscreen\");\n\t\tif(document.exitFullScreen) {\n\t\t\tconsole.log(\"standardExit\");\n\t\t\tdocument.exitFullScreen();\n\t\t} else if (document.mozCancelFullscreen) {\n\t\t\tconsole.log(\"moxExit\");\n\t\t\tdocument.mozCancelFullscreen();\n\t\t} else if (document.webkitExitFullscreen) {\n\t\t\tconsole.log(\"webkitExit\");\n\t\t\tdocument.webkitExitFullscreen();\n\t\t} else if (document.msExitFullscreen) {\n\t\t\tconsole.log(\"msExit\");\n\t\t\tdocument.msExitFullscreen();\n\t\t}\n\tdocument.getElementById(\"exitFullButton\").style.visibility = 'hidden';\n\tdocument.getElementById(\"fullButton\").style.visibility = 'initial';\n\t}\n}", "title": "" }, { "docid": "16801736e2d542fbf3c826ebab3787a7", "score": "0.68478227", "text": "function boardToggleFullScreen(button) {\n CONTAINER_MAIN_BODY.toggleClass('mindalay--border-full-screen');\n boardToggleButton(button, CONTAINER_MAIN_BODY.hasClass('mindalay--border-full-screen'), minimize_bord_icon, full_screen_icon, TR_MINIMIZE_BOARD, TR_FULL_SCREEN)\n}", "title": "" }, { "docid": "98d68aa220f2a61b2307b6d574c343cc", "score": "0.6843287", "text": "toggleFullscreen() {\n let vid = document.querySelector('iframe')\n if (!document.vid) {\n vid.requestFullscreen();\n } else {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n }\n }\n }", "title": "" }, { "docid": "2d8eeda712ac72f31165c5bcfabfc26f", "score": "0.68133724", "text": "function toggle_fullscreen()\n{\n if (!fullscreen_mode)\n {\n var screen_width=screen.availWidth;\n var screen_height=screen.availHeight;\n var features='width='+screen_width;\n features += ',height='+screen_height;\n var url = add_arg_to_url(location.href, 'fullscreen', '1');\n url += '#image';\n window.open(url,'',features);\n }\n else\n {\n window.close();\n }\n}", "title": "" }, { "docid": "c46a0d9d8f5352d6a89cbb908b88c7e1", "score": "0.68122274", "text": "function toggleFullscreen(e) {\n\t'use strict';\n\t// Get fullscreen element\n\tdocument.fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;\n\t\n\tif ((typeof(document.fullscreenElement) === 'undefined' || document.fullscreenElement === null) && typeof(e) !== 'undefined') {\n\t\t// Request fullscreen \n\t\te.requestFullscreen = e.requestFullscreen || e.mozRequestFullScreen || e.webkitRequestFullscreen || e.msRequestFullscreen; \n\t\te.requestFullscreen();\n\t} else {\n\t\t// Switch back to windowed mode and set fullscreen element to null. Otherwise it will break toggling back and forth.\n\t\tdocument.fullscreenElement = null;\n\t\tdocument.exitFullscreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen;\n\t\tdocument.exitFullscreen();\n\t}\n\t\n\treturn false;\n}", "title": "" }, { "docid": "ebe79639c8c0c224c9f57fd90307efa7", "score": "0.6795135", "text": "function FullDisplay() {\n\tif (!FlagFullDisplay){\n\t\tif(document.documentElement.requestFullScreen) {\n\t\t\t\tdocument.documentElement.requestFullScreen();\n\t\t\t\t\t} \n\t\telse if(document.documentElement.mozRequestFullScreen) {\n\t\t\t\tdocument.documentElement.mozRequestFullScreen();\n\t\t\t\t\t}\n\t\telse if(document.documentElement.webkitRequestFullScreen) {\n\t\t\tdocument.documentElement.webkitRequestFullScreen();\n\t\t\t\t}\n\t\t}\n\telse{\n\t\tif (document.cancelFullScreen) {\n\t\t\tdocument.cancelFullScreen();\n\t\t\t} \n\t\telse if (document.mozCancelFullScreen) {\n\t\t\tdocument.mozCancelFullScreen();\n\t\t\t} \n\t\telse if (document.webkitCancelFullScreen) {\n\t\t\tdocument.webkitCancelFullScreen();\n\t\t\t}\n\t\t}\n\t\tFlagFullDisplay = !FlagFullDisplay;\n}", "title": "" }, { "docid": "a6539b67d01c516246938ff74e91be1b", "score": "0.6745866", "text": "function fullscreen(renderer) {\n renderer.view.style.position = \"absolute\";\n renderer.view.style.display = \"block\";\n renderer.autoResize = true;\n renderer.resize(window.innerWidth, window.innerHeight);\n}", "title": "" }, { "docid": "a987b4496f1d5e01154a1cdc288ca9ef", "score": "0.6742984", "text": "function _toggleFullScreen() \r\n {\r\n\t if (!document.fullscreenElement && // alternative standard method\r\n\t !document.mozFullScreenElement && !document.webkitFullscreenElement) \r\n\t { // current working methods\r\n\t if (document.documentElement.requestFullscreen) \r\n\t {\r\n\t document.documentElement.requestFullscreen();\r\n\t } \r\n\t else if (document.documentElement.mozRequestFullScreen) \r\n\t {\r\n\t document.documentElement.mozRequestFullScreen();\r\n\t } \r\n\t else if (document.documentElement.webkitRequestFullscreen) \r\n\t {\r\n\t document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\r\n\t }\r\n\t else if ($.browser.msie) \r\n\t { // Older IE.\r\n\t _IE_fullScreenMode()\r\n\t }\r\n\t else\r\n\t\t {\r\n\t\t \t_showErrorMsg(\"Not Supported Feature\");\r\n\t\t }\r\n\t \r\n\t } \r\n\t else \r\n\t {\r\n\t if (document.cancelFullScreen) \r\n\t {\r\n\t document.cancelFullScreen();\r\n\t } \r\n\t else if (document.mozCancelFullScreen) \r\n\t {\r\n\t document.mozCancelFullScreen();\r\n\t } \r\n\t else if (document.webkitCancelFullScreen) \r\n\t {\r\n\t document.webkitCancelFullScreen();\r\n\t }\r\n\t else if ($.browser.msie)\r\n\t {\r\n\t \t_IE_fullScreenMode()\r\n\t }\r\n\t else\r\n\t {\r\n\t \t_showErrorMsg(\"Not Supported Feature\");\r\n\t\t}\r\n \t}\r\n}", "title": "" }, { "docid": "32955a0fde7bfbfec01fd86a4919997b", "score": "0.6735556", "text": "function toggleFullScreen() {\n\t$(document).keyup(function(e) {\n\t\tisFullScreenEnabled = false;\n\t\tbuttonBar.style.bottom = \"15px\";\n\t\tif (e.keyCode === 27) { // escape key maps to keycode `27`\n\t\tif(document.cancelFullScreen) { document.cancelFullScreen(); }\n\t\telse if(document.mozCancelFullScreen) { document.mozCancelFullScreen(); }\n\t\telse if(document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); }\n\t\t}\n\t});\n\t\n\tif(isFullScreenEnabled === false){\n\t\tisFullScreenEnabled = true;\n\t\tbuttonBar.style.right = \"5px\";\n\t\tif(video.requestFullScreen) { video.requestFullScreen(); }\n\t\telse if(video.msRequestFullscreen) { video.msRequestFullscreen(); }\n\t\telse if(video.mozRequestFullScreen) { video.mozRequestFullScreen(); }\n\t\telse if(video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); }\n\t}\n\t\n\telse{\n\t\tisFullScreenEnabled = false;\n\t\tbuttonBar.style.bottom = \"15px\";\n\t\tif(document.cancelFullScreen) { document.cancelFullScreen(); }\n\t\telse if(document.msExitFullscreen) { document.msExitFullscreen(); }\n\t\telse if(document.mozCancelFullScreen) { document.mozCancelFullScreen(); }\n\t\telse if(document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); }\n\t\t}\n}", "title": "" }, { "docid": "cf05f06b9b21a736277ba41c912d2fd6", "score": "0.6731733", "text": "static set defaultIsFullScreen(value) {}", "title": "" }, { "docid": "56b02ab46e67744104e26902f73d901f", "score": "0.67245597", "text": "function openFullscreen(xtar='#fullscreen') {\nconst target = $(xtar)[0];\nif (screenfull.enabled) {\nscreenfull.request(target);\ngal_init_fullscreen = true;\njQuery('.gal-fullscreen').addClass('gal-restore');\n} else {\njQuery('.gal-fullscreen').hide();\n}\n}", "title": "" }, { "docid": "949996e2826433205e204671cb190a9f", "score": "0.6688968", "text": "function openFullscreen() {\n if (canvas.requestFullscreen) {\n canvas.requestFullscreen();\n } else if (canvas.mozRequestFullScreen) { /* Firefox */\n canvas.mozRequestFullScreen();\n } else if (canvas.webkitRequestFullscreen) { /* Chrome, Safari and Opera */\n canvas.webkitRequestFullscreen();\n } else if (canvas.msRequestFullscreen) { /* IE/Edge */\n canvas.msRequestFullscreen();\n }\n}", "title": "" }, { "docid": "c30d944631e24e3040b517a435814b7d", "score": "0.66764915", "text": "function openFullscreen() {\n /* If fullscreen mode is available, show the element in fullscreen */\n if (\n document.fullscreenEnabled || /* Standard syntax */\n document.webkitFullscreenEnabled || /* Chrome, Safari & Opera */\n document.mozFullScreenEnabled || /* Firefox */\n document.msFullscreenEnabled /* IE/Edge */\n ) {\n \n /* Show the element in fullscreen */\n elem.webkitRequestFullscreen();\n if (elem.requestFullscreen) {\n elem.requestFullscreen(); /* Standard syntax */\n } else if (elem.mozRequestFullScreen) { /* Firefox */\n elem.mozRequestFullScreen();\n } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari & Opera */\n elem.webkitRequestFullscreen();\n } else if (elem.msRequestFullscreen) { /* IE/Edge */\n elem.msRequestFullscreen();\n }\n \n }\n }", "title": "" }, { "docid": "99440b0c11f7363c5962ce9817ab8f2c", "score": "0.6670116", "text": "requestFullscreen() {\n\t\tif (!this.contentPlayer.isFullscreen()) {\n\t\t\tthis.contentPlayer.requestFullscreen();\n\t\t}\n\t}", "title": "" }, { "docid": "a38501118a37d55fb31d910a1a5b6c94", "score": "0.665581", "text": "function fullscr(elemId) {\n var elem = document.getElementById(elemId);\n if (elem.requestFullscreen) {\n elem.requestFullscreen();\n } else if (elem.mozRequestFullScreen) {\n elem.mozRequestFullScreen();\n } else if (elem.webkitRequestFullScreen) {\n elem.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);\n }\n}", "title": "" }, { "docid": "19a85d41f0a08ec972f7183b394dbf8b", "score": "0.66384256", "text": "function fullScreen() {\n canvas.requestFullscreen();\n}", "title": "" }, { "docid": "dccf1229f0dc52d7027c4eca09ed8843", "score": "0.6635008", "text": "exitFullScreen() {\n this.dmPlayer.setFullscreen(false);\n }", "title": "" }, { "docid": "f229114d4f69d8c08ddc3db34d681470", "score": "0.66243136", "text": "fullscreen() {\n // TODO: find out\n const rfs =\n this.refs.iframe.requestFullScreen ||\n this.refs.iframe.webkitRequestFullScreen ||\n this.refs.iframe.mozRequestFullScreen ||\n this.refs.iframe.msRequestFullScreen\n\n rfs && rfs.call(this.refs.iframe)\n }", "title": "" }, { "docid": "8e991f745b7d10faf4f23a1160ffde6b", "score": "0.66225225", "text": "function fullscreen() {\n jQuery('#hero').css({\n width: jQuery(window).width(),\n height: jQuery(window).height()\n });\n }", "title": "" }, { "docid": "517f0d5d7ed813046a8cd23afc9e8526", "score": "0.6582315", "text": "function pn_fullscreen() {\n document.querySelector(\"#pn_noteContainer\").classList.add(\"fullscreen\");\n document.querySelector(\"#pn_fullscreen\").classList.add(\"off\");\n document.querySelector(\"#pn_exitFullscreen\").classList.remove(\"off\");\n}", "title": "" }, { "docid": "bc2107e48111f1cee68feb774ebb52f9", "score": "0.65725845", "text": "hide() {\n $('body').removeClass('editor-full');\n this.container.hide();\n this.active = false;\n }", "title": "" }, { "docid": "b29241dd652310511ef1642bee4c72e2", "score": "0.65458566", "text": "function toggleSideBySide(editor) {\n var cm = editor.codemirror;\n var wrapper = cm.getWrapperElement();\n var preview = wrapper.nextSibling;\n var toolbarButton = editor.toolbarElements && editor.toolbarElements['side-by-side'];\n var useSideBySideListener = false;\n\n var noFullscreenItems = [\n wrapper.parentNode, // easyMDEContainer\n editor.gui.toolbar,\n wrapper,\n preview,\n editor.gui.statusbar,\n ];\n\n function addNoFullscreenClass(el) {\n el.className += ' sided--no-fullscreen';\n }\n\n function removeNoFullscreenClass(el) {\n el.className = el.className.replace(\n /\\s*sided--no-fullscreen\\s*/g, ''\n );\n }\n\n if (/editor-preview-active-side/.test(preview.className)) {\n if (cm.getOption('sideBySideNoFullscreen')) {\n cm.setOption('sideBySideNoFullscreen', false);\n noFullscreenItems.forEach(function (el) {\n removeNoFullscreenClass(el);\n });\n }\n preview.className = preview.className.replace(\n /\\s*editor-preview-active-side\\s*/g, ''\n );\n if (toolbarButton) toolbarButton.className = toolbarButton.className.replace(/\\s*active\\s*/g, '');\n wrapper.className = wrapper.className.replace(/\\s*CodeMirror-sided\\s*/g, ' ');\n } else {\n // When the preview button is clicked for the first time,\n // give some time for the transition from editor.css to fire and the view to slide from right to left,\n // instead of just appearing.\n setTimeout(function () {\n if (!cm.getOption('fullScreen')) {\n if (editor.options.sideBySideFullscreen === false) {\n cm.setOption('sideBySideNoFullscreen', true);\n noFullscreenItems.forEach(function(el) {\n addNoFullscreenClass(el);\n });\n } else {\n toggleFullScreen(editor);\n }\n }\n preview.className += ' editor-preview-active-side';\n }, 1);\n if (toolbarButton) toolbarButton.className += ' active';\n wrapper.className += ' CodeMirror-sided';\n useSideBySideListener = true;\n }\n\n // Hide normal preview if active\n var previewNormal = wrapper.lastChild;\n if (/editor-preview-active/.test(previewNormal.className)) {\n previewNormal.className = previewNormal.className.replace(\n /\\s*editor-preview-active\\s*/g, ''\n );\n var toolbar = editor.toolbarElements.preview;\n var toolbar_div = editor.toolbar_div;\n toolbar.className = toolbar.className.replace(/\\s*active\\s*/g, '');\n toolbar_div.className = toolbar_div.className.replace(/\\s*disabled-for-preview*/g, '');\n }\n\n var sideBySideRenderingFunction = function () {\n var newValue = editor.options.previewRender(editor.value(), preview);\n if (newValue != null) {\n preview.innerHTML = newValue;\n }\n };\n\n if (!cm.sideBySideRenderingFunction) {\n cm.sideBySideRenderingFunction = sideBySideRenderingFunction;\n }\n\n if (useSideBySideListener) {\n var newValue = editor.options.previewRender(editor.value(), preview);\n if (newValue != null) {\n preview.innerHTML = newValue;\n }\n cm.on('update', cm.sideBySideRenderingFunction);\n } else {\n cm.off('update', cm.sideBySideRenderingFunction);\n }\n\n // Refresh to fix selection being off (#309)\n cm.refresh();\n}", "title": "" }, { "docid": "e2ffce133fb0ef1ecc26a3a067069dd8", "score": "0.6544762", "text": "function fullscreen() {\n // NOTE: the Element.requestFullscreen() method issues an asynchronous request to make the element be displayed in full-screen mode.\n video.requestFullscreen();\n}", "title": "" }, { "docid": "875c7a5384b39ed551954fecda674221", "score": "0.6521703", "text": "static set macFullscreenMode(value) {}", "title": "" }, { "docid": "17515014865753dc707cdae55ace9767", "score": "0.6512496", "text": "function fullscreen(){\n jQuery('#hero').css({\n height: jQuery(window).height()\n });\n }", "title": "" }, { "docid": "2dc7f282e576ffd0a08b6f01b6ee64a6", "score": "0.65001994", "text": "function toggleFullScreen() { // > CustomCode.fullscreen:4\n if (!document.fullscreenElement && // alternative standard method // > CustomCode.fullscreen:5\n !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods // > CustomCode.fullscreen:6\n if (document.documentElement.requestFullscreen) { // > CustomCode.fullscreen:7\n document.documentElement.requestFullscreen(); // > CustomCode.fullscreen:8\n } else if (document.documentElement.msRequestFullscreen) { // > CustomCode.fullscreen:9\n document.documentElement.msRequestFullscreen(); // > CustomCode.fullscreen:10\n } else if (document.documentElement.mozRequestFullScreen) { // > CustomCode.fullscreen:11\n document.documentElement.mozRequestFullScreen(); // > CustomCode.fullscreen:12\n } else if (document.documentElement.webkitRequestFullscreen) { // > CustomCode.fullscreen:13\n document.documentElement.webkitRequestFullscreen(); // > CustomCode.fullscreen:14\n } // > CustomCode.fullscreen:15\n } else { // > CustomCode.fullscreen:16\n if (document.exitFullscreen) { // > CustomCode.fullscreen:17\n document.exitFullscreen(); // > CustomCode.fullscreen:18\n } else if (document.msExitFullscreen) { // > CustomCode.fullscreen:19\n document.msExitFullscreen(); // > CustomCode.fullscreen:20\n } else if (document.mozCancelFullScreen) { // > CustomCode.fullscreen:21\n document.mozCancelFullScreen(); // > CustomCode.fullscreen:22\n } else if (document.webkitExitFullscreen) { // > CustomCode.fullscreen:23\n document.webkitExitFullscreen(); // > CustomCode.fullscreen:24\n } // > CustomCode.fullscreen:25\n } // > CustomCode.fullscreen:26\n } // > CustomCode.fullscreen:27", "title": "" }, { "docid": "659c0ecf218fc93225e2eba090a79844", "score": "0.64964217", "text": "function closeFullScreen() {\n document.exitFullscreen();\n body.classList.remove('full-screen');\n}", "title": "" }, { "docid": "20c656115f78f5d0938e64bd09bc034b", "score": "0.64913327", "text": "function toggleEditorVisibility() {\n // If the editor is visible\n // Hide the editor\n if (isEditorVisible === true) {\n hideEditor();\n }\n\n // If the editor is not visible\n // Show the editor\n else if (isEditorVisible === false) {\n showEditor();\n }\n}", "title": "" }, { "docid": "d20031656c305f526f1a42819e9fb7ac", "score": "0.6490955", "text": "function goFullScreen( te){\n if(te.requestFullScreen)\n te.requestFullScreen();\n else if(te.webkitRequestFullScreen)\n te.webkitRequestFullScreen();\n else if(te.mozRequestFullScreen)\n te.mozRequestFullScreen();\n}", "title": "" }, { "docid": "36fc554092cf15d49bdc4c64eaa0f418", "score": "0.6478062", "text": "emitFullscreen() {\n this.emit(STORES_PRES_VIEW.FULL_SCREEN);\n }", "title": "" }, { "docid": "53b7e43fa34ddd0e45f636d2e1cc0605", "score": "0.6466877", "text": "function fullScreen(ele) {\r\n\t ele.style.top = 0;\r\n\t ele.style.left = 0;\r\n\t ele.style.width = '100%';\r\n\t ele.style.height = '100%';\r\n\t }", "title": "" }, { "docid": "dcbfc8a37a8560368d2cd7b39f1b4b86", "score": "0.64593434", "text": "function toggleContainerFullscreen(){\n\t\t\t\t\t\n\t\t\t\t\tif(document.fullscreenElement || // alternative standard method\n \t\t\t\t\tdocument.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement /*utils.hasClass(container, fullscreenModeClazz)*/){\n\t\t\t\t\t\t// exit fullscreen\n\t\t\t\t\t\tif (document.exitFullscreen) {\n\t\t\t\t\t\t\tdocument.exitFullscreen();\n\t\t\t\t\t\t} else if (document.msExitFullscreen) {\n\t\t\t\t\t\t\tdocument.msExitFullscreen();\n\t\t\t\t\t\t} else if (document.mozCancelFullScreen) {\n\t\t\t\t\t\t\tdocument.mozCancelFullScreen();\n\t\t\t\t\t\t} else if (document.webkitExitFullscreen) {\n\t\t\t\t\t\t\tdocument.webkitExitFullscreen();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log(\"The bowser doesn't support fullscreen mode\"); //// Don't support fullscreen\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// enter fullscreen\n\t\t\t\t\t\tif (document.documentElement.requestFullscreen) {\n\t\t\t\t\t\t\tcontainer.requestFullscreen();\n\t\t\t\t\t\t} else if (document.documentElement.msRequestFullscreen) {\n\t\t\t\t\t\t\tcontainer.msRequestFullscreen();\n\t\t\t\t\t\t} else if (document.documentElement.mozRequestFullScreen) {\n\t\t\t\t\t\t\tcontainer.mozRequestFullScreen();\n\t\t\t\t\t\t} else if (document.documentElement.webkitRequestFullscreen) {\n\t\t\t\t\t\t\tcontainer.webkitRequestFullscreen();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log(\"The bowser doesn't support fullscreen mode\"); //// Don't support fullscreen\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "58ce5510a00794520376cd77a5006c7e", "score": "0.6451238", "text": "function onFullscreenChange() {\n if(!document.webkitFullscreenElement && !document.mozFullScreenElement) {\n vrMode = false;\n }\n resize();\n}", "title": "" }, { "docid": "054ff9dcfa7be8f594586af5036ba226", "score": "0.6450678", "text": "static set d3d9FullscreenMode(value) {}", "title": "" }, { "docid": "ab7d5fbb9cdc51585ff35c09e230d92f", "score": "0.6446233", "text": "function closeFullScreen(){\n if(!screenfull.isFullscreen){\n $('html').removeClass('blackout');\n $(\".enlargement\").remove();\n DOM.$targetImages.removeClass('screenfull-target-link').find('img').show();\n restoreLinks();\n }\n }", "title": "" }, { "docid": "0f34a82cf0a9dd3b664091b251dbdee2", "score": "0.64413035", "text": "function btnFullScClk() {\n if (viewer) {\n if (!viewer.isFullPage()) {\n viewer.setFullPage(true);\n } else {\n viewer.setFullPage(false);\n }\n }\n }", "title": "" }, { "docid": "8ad7a7cabeef3160893afbef2b8bbc36", "score": "0.6436655", "text": "function toFakeFullScreen(){\n\t\t\n\t\tjQuery(\"body\").addClass(\"ug-body-fullscreen\");\n\t\tg_objWrapper.addClass(\"ug-fake-fullscreen\");\n\t\t\n\t\tg_temp.isFakeFullscreen = true;\n\t\t\n\t\tg_objGallery.trigger(t.events.ENTER_FULLSCREEN);\n\t\tg_objGallery.trigger(t.events.SIZE_CHANGE);\n\t}", "title": "" }, { "docid": "4bde976b29333e4b681f443e9b80d4da", "score": "0.64103955", "text": "function goFullscreen(id) {\n var element = document.getElementById(id); \n if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.webkitRequestFullScreen) {\n element.webkitRequestFullScreen();\n } \n}", "title": "" }, { "docid": "4bde976b29333e4b681f443e9b80d4da", "score": "0.64103955", "text": "function goFullscreen(id) {\n var element = document.getElementById(id); \n if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.webkitRequestFullScreen) {\n element.webkitRequestFullScreen();\n } \n}", "title": "" }, { "docid": "25d8d37f28332cda7cb7b7e91e219078", "score": "0.6403777", "text": "function maximize() {\n\t\tvar element = document.getElementById('canvas-outer');\n\t\tif (element.requestFullscreen) {\n\t\t\telement.requestFullscreen();\n\t\t} else if (element.msRequestFullscreen) {\n\t\t\telement.msRequestFullscreen();\n\t\t} else if (element.mozRequestFullScreen) {\n\t\t\telement.mozRequestFullScreen();\n\t\t} else if (element.webkitRequestFullscreen) {\n\t\t\telement.webkitRequestFullscreen();\n\t\t}\n\t}", "title": "" }, { "docid": "42f6f78f8a9cd2c33b004b2e79cb03af", "score": "0.6390869", "text": "static set d3d11FullscreenMode(value) {}", "title": "" }, { "docid": "e4981699bf7539f42200a857f2769b26", "score": "0.63872814", "text": "function enterFullscreen() {\n console.log(\"enterFullscreen()\");\n $('body').addClass('full-screen');\n elem.onwebkitfullscreenchange = onFullScreenEnter;\n elem.onmozfullscreenchange = onFullScreenEnter;\n elem.onfullscreenchange = onFullScreenEnter;\n if (elem.webkitRequestFullscreen) {\n elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n } else {\n if (elem.mozRequestFullScreen) {\n elem.mozRequestFullScreen();\n } else {\n elem.requestFullscreen();\n }\n }\n// document.getElementById('enter-exit-fs').onclick = exitFullscreen;\n}", "title": "" }, { "docid": "464ac9985017111e3719be35e91f234d", "score": "0.63248813", "text": "function goFullscreen() {\n\t// is full-screen enabled?\n\tif ( document.fullscreenEnabled || document.webkitFullscreenEnabled ||\n\t\t\tdocument.mozFullScreenEnabled || document.msFullscreenEnabled ) {\n\t\t// then go full-screen\n\t\tvar html = document.documentElement;\n\t\tif (html.requestFullscreen) { html.requestFullscreen(); }\n\t\telse if (html.webkitRequestFullscreen) { html.webkitRequestFullscreen(); }\n\t\telse if (html.mozRequestFullScreen) { html.mozRequestFullScreen(); }\n\t\telse if (html.msRequestFullscreen) { html.msRequestFullscreen(); }\n }\n}", "title": "" }, { "docid": "d767ed7f3b2098d065e95237203494a8", "score": "0.6323289", "text": "function changeScreenSize() {\n if(document.fullscreenElement) { \n document.exitFullscreen();\n fullScreen.style.display = \"block\";\n minimizedScreen.style.display = \"none\"; \n } else { \n document.documentElement.requestFullscreen();\n fullScreen.style.display = \"none\";\n minimizedScreen.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "3cefb909e3113ac342a243c084ed1f77", "score": "0.63224435", "text": "enableFullEditMode() {\n this._fullEditMode = true;\n }", "title": "" }, { "docid": "6d38e20de09c004db5b1732687c85a0e", "score": "0.63183075", "text": "static get allowFullscreenSwitch() {}", "title": "" }, { "docid": "5d93bf81c067e7618602b0bd902e255f", "score": "0.6310807", "text": "function launchFullScreen(element) {\n if(element.requestFullScreen) {\n element.requestFullScreen();\n } else if(element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if(element.webkitRequestFullScreen) {\n element.webkitRequestFullScreen();\n }\n }", "title": "" }, { "docid": "31b7181da4c01b18bfc40f7a404b4a34", "score": "0.629768", "text": "function openFullscreen() {\r\n\r\n var elem = document.getElementById(\"table\");\r\n if (elem.requestFullscreen) {\r\n elem.requestFullscreen();\r\n } else if (elem.mozRequestFullScreen) {\r\n /* Firefox */\r\n elem.mozRequestFullScreen();\r\n } else if (elem.webkitRequestFullscreen) {\r\n /* Chrome, Safari and Opera */\r\n elem.webkitRequestFullscreen();\r\n } else if (elem.msRequestFullscreen) {\r\n /* IE/Edge */\r\n elem.msRequestFullscreen();\r\n }\r\n}", "title": "" }, { "docid": "4da2e9d4415ec11fe78d9decac039012", "score": "0.62771696", "text": "bindFullScreen() {\n this.fullScreenButton.addEventListener('click', () => {\n this.map.toggleFullscreen();\n document.querySelector('#mapid').click();\n keyboard.close();\n });\n }", "title": "" }, { "docid": "48a476bbda998692f313be79369d80c5", "score": "0.6269145", "text": "function go_full_screen() {\n\tvar isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||\n\t\t(document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||\n\t\t(document.mozFullScreenElement && document.mozFullScreenElement !== null) ||\n\t\t(document.msFullscreenElement && document.msFullscreenElement !== null);\n\n\tvar docElm = document.documentElement;\n\tif (!isInFullScreen) {\n\t\tif (docElm.requestFullscreen) {\n\t\t\tdocElm.requestFullscreen();\n\t\t} else if (docElm.mozRequestFullScreen) {\n\t\t\tdocElm.mozRequestFullScreen();\n\t\t} else if (docElm.webkitRequestFullScreen) {\n\t\t\tdocElm.webkitRequestFullScreen();\n\t\t} else if (docElm.msRequestFullscreen) {\n\t\t\tdocElm.msRequestFullscreen();\n\t\t}\n\t} else {\n\t\tif (document.exitFullscreen) {\n\t\t\tdocument.exitFullscreen();\n\t\t} else if (document.webkitExitFullscreen) {\n\t\t\tdocument.webkitExitFullscreen();\n\t\t} else if (document.mozCancelFullScreen) {\n\t\t\tdocument.mozCancelFullScreen();\n\t\t} else if (document.msExitFullscreen) {\n\t\t\tdocument.msExitFullscreen();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "474997dec87b56b421ec116cf7304608", "score": "0.62654376", "text": "function fullScreenTrigger(){\n fullscreen_open.play();\n\t//$('.detail-side-text p' ).fadeIn();\n}", "title": "" } ]
3671b6e7832b6dee7352b6b84df01f3b
Truncate the document to a given length, placing the top matching term at the center, or as close to it as possible if the match is near the beginning or end of the string.
[ { "docid": "f99ac73769383751bf795ddca33d35fa", "score": "0.52381223", "text": "createExcerpt(str, rawMatches) {\n // rawMatches is ordered by score so the first match is the best. The first\n // value is the start position in the string and the second is the length\n\n // Create some brain friendly variables\n const termStart = rawMatches[0][0];\n const termLength = rawMatches[0][1];\n const termEnd = termStart + termLength;\n\n // Exact text of the matched item\n const term = str.substr(termStart, termLength);\n\n // Distance from the term from the beginning or end of the string\n const margin = Math.round(this.maxLength - termLength / 2);\n\n // First we determine where the start and end point is exactly\n const excerptStart = margin < termStart ? termStart - margin : 0;\n const excerptEnd =\n str.length > termEnd + margin ? termEnd + margin : str.length;\n\n const prefix = excerptStart > 0 ? '…' : '';\n const suffix = excerptEnd < str.length ? '…' : '';\n\n const highlighted = rawMatches\n // Copy the array\n .slice(0)\n // Sort it by start location, in reverse so we can safely iterate\n .sort((a, b) => b[0] - a[0])\n // Filter out the terms that don't fall within the excerpt\n .filter(([i, length]) => excerptStart < i && i + length < excerptEnd)\n // Make replacements\n .reduce((excerpt, [i, length]) => {\n // Account for the offset caused by trimming\n const start = i - excerptStart;\n const end = start + length;\n const before = excerpt.substring(0, start);\n const term = excerpt.substring(start, end);\n const after = excerpt.substring(end);\n\n return `${before}<strong>${term}</strong>${after}`;\n }, str.substring(excerptStart, excerptEnd));\n\n return `${prefix}${highlighted}${suffix}`;\n }", "title": "" } ]
[ { "docid": "510e9099ab20b47dc9d4a23559664125", "score": "0.5920064", "text": "function truncate(inputString, targetLength){\n return inputString.substr(0, targetLength); \n}", "title": "" }, { "docid": "0775465beeccdf48bf7b5db41df363c0", "score": "0.5705149", "text": "function shortenText(text, startingPoint, maxLength) {\r\n return text.length > maxLength\r\n ? text.slice(startingPoint, maxLength)\r\n : text;\r\n }", "title": "" }, { "docid": "8ec86a04e4ca2aa397b1078c6dad64ed", "score": "0.5639688", "text": "function truncate(str, length) {\n if (str.length > length) {\n return str.substring(0, length);\n } else {\n return str;\n }\n}", "title": "" }, { "docid": "51ab742ab9f8ed7a434ad15f457172f6", "score": "0.56191075", "text": "truncate(string, length = 70) {\n return _.truncate(string, {\n 'length': length,\n 'separator': /,? +/\n });\n }", "title": "" }, { "docid": "51ab742ab9f8ed7a434ad15f457172f6", "score": "0.56191075", "text": "truncate(string, length = 70) {\n return _.truncate(string, {\n 'length': length,\n 'separator': /,? +/\n });\n }", "title": "" }, { "docid": "65530d945726b085876d081f791ce77e", "score": "0.55815", "text": "function truncate(str, len){\n // handle long string with no spaces\n if (str.lastIndexOf(' ') == -1) {return str.substr(0, len-9) + '...';}\n\n // set up the substring\n const subString = str.substr(0, len-1);\n // add elipse after last complete word & trim trailing comma\n return (subString.substr(0, subString.lastIndexOf(' ')).replace(/(^[,\\s]+)|([,\\s]+$)/g, '') + '...');\n}", "title": "" }, { "docid": "75fec2758324ccde531467b7c688f5c6", "score": "0.55496866", "text": "function truncate(str, maxChars, append, onlyFullWords){\n str = toString(str);\n append = append || '...';\n maxChars = onlyFullWords? maxChars + 1 : maxChars;\n\n str = trim(str);\n if(str.length <= maxChars){\n return str;\n }\n str = str.substr(0, maxChars - append.length);\n //crop at last space or remove trailing whitespace\n str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str);\n return str + append;\n }", "title": "" }, { "docid": "ff73228e5f806f58996341abea87956a", "score": "0.55390847", "text": "function truncateWords(originalText, wordLimit) { // function that truncates string of words at inputed index value number and outputs remaining words with ellipses to signal truncation. Also ouputs orginial text inputed and the word count used for truncation.\n \"use strict\";\n if (wordLimit == undefined)\n wordLimit = 2; // sets truncation to an index value of 2 if no number is inputted for numWords parameter.\n originalText = String(originalText); // Turns first parameter input into a string just in case they input some other value type.\n wordLimit = Number(wordLimit); // Turns second parameter input into a number just in case they input some other value type.\n var textArray = originalText.split(\" \"); // Separates text after each individual character and has no limit on splits.\n var originalLength = originalText.split(\" \").length; //outputs word count of original string\n textArray.splice(wordLimit, textArray.length); // splice starts at index value of number type value entered for the numWords parameter and omits everything at and after it.\n return { // object containing original inputed text, the word count used for truncation, and the newly trucated text by the function.\n originalText: originalText,\n wordCount: originalLength, // word count of originial string\n numWords: wordLimit,\n shortText: textArray.join(\" \") + \"...\" // output of function\n}\n}", "title": "" }, { "docid": "b6b596eb392bc32007aec0a0b91fd43d", "score": "0.54896563", "text": "function truncate(str, maxChars, append, onlyFullWords) {\n append = append || '...';\n maxChars = onlyFullWords ? maxChars + 1 : maxChars;\n\n str = trim(str);\n if (str.length <= maxChars) {\n return str;\n }\n str = str.substr(0, maxChars - append.length);\n //crop at last space or remove trailing whitespace\n str = onlyFullWords ? str.substr(0, str.lastIndexOf(' ')) : trim(str);\n return str + append;\n}", "title": "" }, { "docid": "cbe92adcc0274f91d5467aaf0cd51f04", "score": "0.5424063", "text": "function truncate(s, n, useWordBoundary){\n var isTooLong = s.length > n;\n s = isTooLong ? s.substr(0,n-1) : s;\n s = (useWordBoundary && isTooLong) ? s.substr(0,s.lastIndexOf(' ')) : s;\n return isTooLong ? s + '&hellip;' : s;\n}", "title": "" }, { "docid": "4b6fc148f38819e20cb44a865a7b3cda", "score": "0.53850913", "text": "function Truncate(stringToTruncate, maxLength)\r\n{\r\n var rv = stringToTruncate;\r\n if(stringToTruncate.length > maxLength)\r\n {\r\n rv = stringToTruncate.substring(stringToTruncate, maxLength) + \"... \";\r\n }\r\n return rv;\r\n}", "title": "" }, { "docid": "5f0c6c369fb39ff529b06b7cbc6cc4ec", "score": "0.53802127", "text": "function truncate(txt, txt_length, txt_suffix = null){\n\tif (txt_suffix === null) {\n\t\t\ttxt_suffix = '';\n\t}\n\tcharRemoveCount = txt_length - txt_suffix.length;\n\tpart1 = txt.slice(0, charRemoveCount);\n\tpart2 = txt_suffix;\n\tfinalString = part1 + part2;\n\treturn finalString;\n}", "title": "" }, { "docid": "5747f1a71cc65464f1df7468103aee4f", "score": "0.5350394", "text": "function truncate(n, useWordBoundary) {\n\tif (this.length <= n) { return this; }\n\tvar subString = this.substr(0, n - 1);\n\treturn (useWordBoundary\n\t\t? subString.substr(0, subString.lastIndexOf(' '))\n\t\t: subString) + \"...\";\n}", "title": "" }, { "docid": "d55098a6e68fae673c2d6a6159910d6d", "score": "0.53085154", "text": "measureSubstring(ctxt, length) {\n if (length === 0) return 0;\n if (!length) length = Infinity;\n if (length < 0) {\n var lines = -length;\n length = Infinity;\n }\n var canvasCtxt = ctxt.canvasCtxt;\n var width = 0;\n var widths = [];\n var newLineSpans = [this.spans[0]];\n var subStringLength = 0;\n for (var i = 0; i < this.spans.length; i++) {\n var span = this.spans[i],\n myText = span.text.slice(0, length - subStringLength);\n if (span.properties.newLine) {\n if (!lines && this.rightAligned === true && length === Infinity) {\n newLineSpans[newLineSpans.length - 1].properties.xOffset = this.firstLineMaxWidth - width;\n newLineSpans.push(span);\n } else if ((--lines === 0))\n break;\n widths.push(width);\n width = 0;\n }\n canvasCtxt.font = this.getCanvasFontForProperties(span.properties);\n var metrics = canvasCtxt.measureText(myText, this.bounds.x, this.bounds.y);\n width += metrics.width;\n subStringLength += myText.length;\n if (subStringLength === length) break;\n }\n if (!lines && width && newLineSpans.length && this.rightAligned === true && length === Infinity) {\n newLineSpans[newLineSpans.length - 1].properties.xOffset = this.firstLineMaxWidth - width;\n }\n return Math.max(width, ...widths);\n }", "title": "" }, { "docid": "0f7718f6e0dbc827a34650b1f7d7ca1d", "score": "0.52492636", "text": "function truncate(string, position) {\n var newString = string.split(\" \");\n var newString2=[]\n for (var i = 0; i < newString.length; i++) {\n if(i<position){\n newString2.push(newString[i])\n }\n\n }\n return newString2.join(\" \")\n}", "title": "" }, { "docid": "d2ecaaf541554c1af83f3e215ca7fc91", "score": "0.52361363", "text": "partial(cloze, fullText) {\n for (var i = 0; i < fullText.length; ++i) {\n if (fullText.substring(i, i + cloze.length) == cloze) {\n fullText = fullText.substring(0, i) + \"...\" + fullText.substring(i + cloze.length, fullText.length);\n }\n }\n return fullText;\n }", "title": "" }, { "docid": "01687d23400aef66100ade0e8c50b911", "score": "0.52343786", "text": "function truncate(str, size){\n if(str.length > 20) {\n str = str.substring(0,size) + \"...\";\n }\n return str;\n}", "title": "" }, { "docid": "cde26972bb557e145675923da613a7e7", "score": "0.51963747", "text": "function _fixTo(to, length) {\n if (to < 0) {\n to = 0;\n } else if (to >= length){\n to = length;\n }\n return to;\n }", "title": "" }, { "docid": "8ab1047badca9150afd3d25eacdb96ac", "score": "0.51706916", "text": "function truncate(original_text, limit) {\n var truncated_text = original_text;\n if (original_text.length > limit) {\n truncated_text = original_text.substring(0, limit);\n truncated_text = truncated_text + \" ...\";\n }\n return truncated_text;\n }", "title": "" }, { "docid": "64c46a68e7963c5b6fb6b800e72ca24e", "score": "0.5160282", "text": "function truncateTextStart($element, $rootNode, $clipNode, options) {\n\t var element = $element[0];\n\t var original = $element.text();\n\n\t var maxChunk = '';\n\t var mid, chunk;\n\t var low = 0;\n\t var high = original.length;\n\n\t while (low <= high) {\n\t mid = low + (high - low >> 1); // Integer division\n\n\t chunk = options.ellipsis + $.trim(original.substr(mid - 1, original.length));\n\t setText(element, chunk);\n\n\t if ($rootNode.height() > options.maxHeight) {\n\t // too big, reduce the chunk\n\t low = mid + 1;\n\t } else {\n\t // chunk valid, try to get a bigger chunk\n\t high = mid - 1;\n\t maxChunk = maxChunk.length > chunk.length ? maxChunk : chunk;\n\t }\n\t }\n\n\t if (maxChunk.length > 0) {\n\t setText(element, maxChunk);\n\t return true;\n\t } else {\n\t return truncateNearestSibling($element, $rootNode, $clipNode, options);\n\t }\n\t}", "title": "" }, { "docid": "9c917003e7e4415e21a242000b2cecef", "score": "0.5151678", "text": "function resolveTextSize(input : String, lineLength : int) : String\n{\n // Split string by char \" \" \n var words : String[] = input.Split(\" \"[0]);\n \n // Prepare result\n var result : String;\n \n // Temp line string\n var line : String;\n \n // for each all words \n for(var s : String in words)\n {\n //See if any part of the string is just too long\n if(s.length > lineLength)\n return null;\n\n // Append current word into line\n var temp : String = line + \" \" + s;\n \n // If line length is bigger than lineLength\n if(temp.Length > lineLength)\n { \n // Append current line into result\n result += line + \"\\n\";\n // Remain word append into new line\n line = s;\n }\n // Append current word into current line\n else \n {\n line = temp;\n }\n }\n // Append last line into result \n result += line;\n \n // Remove first \" \" char\n return result.Substring(1,result.Length-1);\n}", "title": "" }, { "docid": "b08246d61c7c4df242f42cd4213b2ff0", "score": "0.51491827", "text": "function truncateWords(longText, numWords) { // function that truncates string of words at inputed index value number and outputs remaining words with ellipses to signal truncation.\n longText = String(longText); // Turns first parameter input into a string just in case they input some other value type.\n numWords = Number(numWords); // Turn second parameter input into a number just in case they input some other value type.\n var textArray = longText.split(\" \"); // Separates text at each whitespace and has no limit on splits.\n textArray.splice(numWords, textArray.length); // splice starts at index value of number type value entered for the numWords parameter and omits everything at and after it. \n return textArray.join(\" \") + \"...\"; // returns the spliced text with a whitespace at each splice point and \"...\" added to the last set of characters.\n}", "title": "" }, { "docid": "ec6602ffcdcc185ed4b06f4d81f44fca", "score": "0.5147206", "text": "function r(start, length, text) {\n return ot.TextReplace(start, length, text);\n}", "title": "" }, { "docid": "32958efe4123667fc5c0579fe93bcd4c", "score": "0.51414484", "text": "function truncate(str, length) {\n if (Buffer.byteLength(str, 'utf8') <= length) {\n return str;\n }\n str = str.substr(0, length - 3);\n while (Buffer.byteLength(str, 'utf8') > length - 3) {\n str = str.substr(0, str.length - 1);\n }\n return str + '...';\n}", "title": "" }, { "docid": "7266733ecfb45ff0141187b4674b4685", "score": "0.5137756", "text": "truncate(string, cut) {\r\n cut = cut || 30\r\n if (string !== undefined && string.length > cut) {\r\n let newString = string.slice(0, cut) + '...';\r\n return newString;\r\n } else {\r\n return string;\r\n }\r\n }", "title": "" }, { "docid": "b947324257a324a0c9171b761aaa5c0c", "score": "0.5108526", "text": "function truncateTextMiddle($element, $rootNode, $clipNode, options) {\n\t var element = $element[0];\n\t var original = $element.text();\n\n\t var maxChunk = '';\n\t var low = 0;\n\t var len = original.length;\n\t var high = len >> 1;\n\t var mid, chunk;\n\n\t while (low <= high) {\n\t mid = low + (high - low >> 1); // Integer division\n\n\t chunk = $.trim(original.substr(0, mid)) + options.ellipsis + original.substr(len - mid, len - mid);\n\t setText(element, chunk);\n\n\t if ($rootNode.height() > options.maxHeight) {\n\t // too big, reduce the chunk\n\t high = mid - 1;\n\t } else {\n\t // chunk valid, try to get a bigger chunk\n\t low = mid + 1;\n\n\t maxChunk = maxChunk.length > chunk.length ? maxChunk : chunk;\n\t }\n\t }\n\n\t if (maxChunk.length > 0) {\n\t setText(element, maxChunk);\n\t return true;\n\t } else {\n\t return truncateNearestSibling($element, $rootNode, $clipNode, options);\n\t }\n\t}", "title": "" }, { "docid": "da2e01aa4e9a5d9baa7ff6ab5764b3a4", "score": "0.50982887", "text": "function truncate(str, numChars) {\n if (str.length < numChars) {\n return str;\n }\n\n var index = str.lastIndexOf(\" \", numChars);\n if (index === -1) {\n index = numChars;\n }\n return str.substr(0, index) + \" …\";\n }", "title": "" }, { "docid": "c22978ef6ae19a815a8af78367f49209", "score": "0.509644", "text": "function prune(str, length, end) {\n if (length == null || length >= str.length) {\n return str;\n }\n if (end == null) {\n end = '...';\n }\n var remnantPlusOne = str.slice(0, Math.max(0, length - end.length) + 1);\n var lastSpace = Math.max(0, remnantPlusOne.lastIndexOf(' '));\n return remnantPlusOne.slice(0, lastSpace) + end;\n}", "title": "" }, { "docid": "e5dc180508092d08a7c42d78245311f9", "score": "0.5080222", "text": "function truncateTextNode(textNode, rootNode, options) {\n var originalHTML = textNode.nodeValue,\n mid,\n low = 0,\n high = originalHTML.length,\n chunk,\n maxChunk = '';\n\n // Binary Search\n while (low <= high) {\n mid = low + ((high - low) >> 1); // Integer division\n\n chunk = trim(originalHTML.substr(0, mid + 1)) + options.showMore;\n textNode.nodeValue = chunk;\n\n if (height(rootNode) > options.maxHeight) {\n high = mid - 1;\n } else {\n low = mid + 1;\n maxChunk = maxChunk.length > chunk.length ? maxChunk : chunk;\n }\n }\n\n textNode.nodeValue = maxChunk;\n }", "title": "" }, { "docid": "e4962d75469b41bd26753eabe1ef736f", "score": "0.5059164", "text": "function wordWrap(input, length) {\n // LOOK! Over there! Is it an airplane?\n var wrapper = new RegExp('.{0,' + (length - 1) + '}([ $|\\\\s$]|$)', 'g');\n return input.match(wrapper).slice(0, -1).map(function(s) {\n return s.replace(/ $/, '');\n });\n}", "title": "" }, { "docid": "74791cdbea2665d4ae7d2af7f434fc43", "score": "0.50553304", "text": "function truncate(string, maxLength, options) {\n var content = '', // traced text\n total = 0, // record how many characters we traced so far\n matches = true,\n result, index, tag, tail;\n\n while(matches) {\n matches = /<\\/?\\w+(\\s+\\w+=\"[^\"]*\")*>/g.exec(string);\n if ( ! matches) { break; }\n result = matches[0];\n index = matches.index;\n\n // overceed, dump everything to clear stack\n if (total + index > maxLength) {\n content += string.substring(0, maxLength - total);\n content += stack.dumpCloseTag();\n\n break;\n } else {\n total += index;\n content += string.substring(0, index);\n }\n\n if (-1 === result.indexOf('</')) {\n tail = result.indexOf(' ');\n tail = (-1 === tail) ? result.indexOf('>') : tail;\n stack.push({\n tag: result.substring(1, tail),\n html: result\n });\n } else {\n stack.pop();\n }\n\n content += result;\n\n string = string.substring(index + result.length);\n }\n\n return content;\n}", "title": "" }, { "docid": "85db2aef51c22dfd97e4b3aa5f83e776", "score": "0.50550634", "text": "function truncateString(str, num) {\n // Clear out that junk in your trunk\n \n //find out if string is longer than number\n if(str.length > num){\n //slice string from beginning to index number and then add '...'\n return str.slice(0,num) + '...'\n }\n \n //else return string\n return str;\n }", "title": "" }, { "docid": "7b9c52d3fb4449e725d60d750793fdb1", "score": "0.504827", "text": "function truncateText(element,startIdx,endIdx) {\n var truncated = element.substring(startIdx,endIdx);\n truncated += '...';\n return truncated;\n }", "title": "" }, { "docid": "91a0ecb63408d451de970f5934f4c8b7", "score": "0.50411075", "text": "function truncate (value, length) {\n length = length || 15\n if( !value || typeof value !== 'string' ) return ''\n if( value.length <= length) return value\n return value.substring(0, length) + '...'\n}", "title": "" }, { "docid": "91a0ecb63408d451de970f5934f4c8b7", "score": "0.50411075", "text": "function truncate (value, length) {\n length = length || 15\n if( !value || typeof value !== 'string' ) return ''\n if( value.length <= length) return value\n return value.substring(0, length) + '...'\n}", "title": "" }, { "docid": "91a0ecb63408d451de970f5934f4c8b7", "score": "0.50411075", "text": "function truncate (value, length) {\n length = length || 15\n if( !value || typeof value !== 'string' ) return ''\n if( value.length <= length) return value\n return value.substring(0, length) + '...'\n}", "title": "" }, { "docid": "91a0ecb63408d451de970f5934f4c8b7", "score": "0.50411075", "text": "function truncate (value, length) {\n length = length || 15\n if( !value || typeof value !== 'string' ) return ''\n if( value.length <= length) return value\n return value.substring(0, length) + '...'\n}", "title": "" }, { "docid": "b8d9d628a391bb21733dfce50587e49c", "score": "0.50230795", "text": "function truncate(str, len, suffix) {\n if (suffix === undefined) {\n suffix = '...';\n }\n len -= suffix.length;\n var trunc = str;\n if (trunc.length > len) {\n trunc = trunc.substr(0, len);\n var r = /[^\\s]/;\n if (r.test(str.charAt(len))) {\n trunc = trimRight(trunc.replace(/\\w+$|\\s+$/, ''));\n }\n trunc += suffix;\n }\n return trunc;\n}", "title": "" }, { "docid": "e147da2357d4de2ccfcd1383e5595383", "score": "0.4998234", "text": "function update() {\n var _splitString = splitString(string, el.width() - 10),\n _splitString2 = _slicedToArray(_splitString, 2),\n left = _splitString2[0],\n right = _splitString2[1]; // 10 accounts for letter spacing\n\n el.empty().append('\\n <span class=\"rv-truncate-title-left\">' + left + '</span>\\n <span calss=\"rv-truncate-title-right\">' + right + '</span>\\n ');\n }", "title": "" }, { "docid": "9bcc72933b92c16404032bcbbd5cf7c7", "score": "0.49961817", "text": "function truncate(target, maxHeight) {\n\t if (!maxHeight) {\n\t return;\n\t }\n\n\t /**\n\t * Resets global variables.\n\t */\n\t function reset() {\n\t splitOnChars = opt.splitOnChars.slice(0);\n\t splitChar = splitOnChars[0];\n\t chunks = null;\n\t lastChunk = null;\n\t }\n\n\t var nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n\n\t //Grab the next chunks\n\t if (!chunks) {\n\t //If there are more characters to try, grab the next one\n\t if (splitOnChars.length > 0) {\n\t splitChar = splitOnChars.shift();\n\t }\n\t //No characters to chunk by. Go character-by-character\n\t else {\n\t splitChar = '';\n\t }\n\n\t chunks = nodeValue.split(splitChar);\n\t }\n\n\t //If there are chunks left to remove, remove the last one and see if\n\t // the nodeValue fits.\n\t if (chunks.length > 1) {\n\t // console.log('chunks', chunks);\n\t lastChunk = chunks.pop();\n\t // console.log('lastChunk', lastChunk);\n\t applyEllipsis(target, chunks.join(splitChar));\n\t }\n\t //No more chunks can be removed using this character\n\t else {\n\t chunks = null;\n\t }\n\n\t //Insert the custom HTML before the truncation character\n\t if (truncationHTMLContainer) {\n\t target.nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n\t element.innerHTML = target.nodeValue + ' ' + truncationHTMLContainer.innerHTML + opt.truncationChar;\n\t }\n\n\t //Search produced valid chunks\n\t if (chunks) {\n\t //It fits\n\t if (element.clientHeight <= maxHeight) {\n\t //There's still more characters to try splitting on, not quite done yet\n\t if (splitOnChars.length >= 0 && splitChar !== '') {\n\t applyEllipsis(target, chunks.join(splitChar) + splitChar + lastChunk);\n\t chunks = null;\n\t }\n\t //Finished!\n\t else {\n\t return element.innerHTML;\n\t }\n\t }\n\t }\n\t //No valid chunks produced\n\t else {\n\t //No valid chunks even when splitting by letter, time to move\n\t //on to the next node\n\t if (splitChar === '') {\n\t applyEllipsis(target, '');\n\t target = getLastChild(element);\n\n\t reset();\n\t }\n\t }\n\n\t //If you get here it means still too big, let's keep truncating\n\t if (opt.animate) {\n\t setTimeout(function() {\n\t truncate(target, maxHeight);\n\t }, opt.animate === true ? 10 : opt.animate);\n\t } else {\n\t return truncate(target, maxHeight);\n\t }\n\t }", "title": "" }, { "docid": "b675889d0b5036f6f3d55b8c6082bfcc", "score": "0.49932277", "text": "function truncate(target, maxHeight) {\n if (!maxHeight) {return;}\n \n /**\n * Resets global variables.\n */\n function reset() {\n splitOnChars = opt.splitOnChars.slice(0);\n splitChar = splitOnChars[0];\n chunks = null;\n lastChunk = null;\n }\n \n var nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n \n //Grab the next chunks\n if (!chunks) {\n //If there are more characters to try, grab the next one\n if (splitOnChars.length > 0) {\n splitChar = splitOnChars.shift();\n }\n //No characters to chunk by. Go character-by-character\n else {\n splitChar = '';\n }\n \n chunks = nodeValue.split(splitChar);\n }\n \n //If there are chunks left to remove, remove the last one and see if\n // the nodeValue fits.\n if (chunks.length > 1) {\n // console.log('chunks', chunks);\n lastChunk = chunks.pop();\n // console.log('lastChunk', lastChunk);\n applyEllipsis(target, chunks.join(splitChar));\n }\n //No more chunks can be removed using this character\n else {\n chunks = null;\n }\n \n //Insert the custom HTML before the truncation character\n if (truncationHTMLContainer) {\n target.nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n element.innerHTML = target.nodeValue + ' ' + truncationHTMLContainer.innerHTML + opt.truncationChar;\n }\n\n //Search produced valid chunks\n if (chunks) {\n //It fits\n if (element.clientHeight <= maxHeight) {\n //There's still more characters to try splitting on, not quite done yet\n if (splitOnChars.length >= 0 && splitChar != '') {\n applyEllipsis(target, chunks.join(splitChar) + splitChar + lastChunk);\n chunks = null;\n }\n //Finished!\n else {\n return element.innerHTML;\n }\n }\n }\n //No valid chunks produced\n else {\n //No valid chunks even when splitting by letter, time to move\n //on to the next node\n if (splitChar == '') {\n applyEllipsis(target, '');\n target = getLastChild(element);\n \n reset();\n }\n }\n \n //If you get here it means still too big, let's keep truncating\n if (opt.animate) {\n setTimeout(function() {\n truncate(target, maxHeight);\n }, opt.animate === true ? 10 : opt.animate);\n }\n else {\n return truncate(target, maxHeight);\n }\n }", "title": "" }, { "docid": "108643e17132bf79e5bf3b6f63587123", "score": "0.49741116", "text": "function padRight(str, substr, length) {\n while (str.length < length) {\n str += substr;\n }\n return str;\n}", "title": "" }, { "docid": "49b4fad90da56ec8d4742a794939be05", "score": "0.49717912", "text": "function truncateStrBeyondLen(str, maxLen) {\n if (str.length > maxLen) {\n return str.substring(0, maxLen) + '...';\n } else {\n return str;\n }\n }", "title": "" }, { "docid": "4b7237c7b8db0ea85202ebc14c4d126e", "score": "0.49680337", "text": "function crop(str, maxChars, append) {\n return truncate(str, maxChars, append, true);\n}", "title": "" }, { "docid": "f9138e9e9bcf8ebcc5400d6ed061accd", "score": "0.4966966", "text": "function crop(str, maxChars, append) {\n str = toString(str);\n return truncate(str, maxChars, append, true);\n }", "title": "" }, { "docid": "c5fec794c6ca3efcf49d809aa7e04601", "score": "0.4964064", "text": "function truncateText(text, width) {\n return function(d, i) {\n var t = this.textContent = text(d, i),\n w = width(d, i);\n if (this.getComputedTextLength() < w) return t;\n this.textContent = \"…\" + t;\n var lo = 0,\n hi = t.length + 1,\n x;\n while (lo < hi) {\n var mid = lo + hi >> 1;\n if ((x = this.getSubStringLength(0, mid)) < w) lo = mid + 1;\n else hi = mid;\n }\n return lo > 1 ? t.substr(0, lo - 2) + \"…\" : \"\";\n };\n }", "title": "" }, { "docid": "46fce9ed1394b0abf29a782aa658192c", "score": "0.49585158", "text": "function truncate(value, length) {\n length = length || 15;\n if (!value || typeof value !== 'string') return '';\n if (value.length <= length) return value;\n return value.substring(0, length) + '...';\n}", "title": "" }, { "docid": "456ae723667ae26e84a9408836ef7bc6", "score": "0.49549755", "text": "function shortenQuote(quote, maxLength) {\n var length = quote.length;\n if (length <= maxLength) {\n // Text to quote is short enough. Quote in full.\n return quote;\n }\n else {\n // Text to quote is too long. Shorten it.\n var ellipsis = '...';\n // Quote the first and last pieces of the text.\n var pieceMaxLength = Math.floor((maxLength - ellipsis.length)/2);\n\n // First, try to nicely break the quote at whitespace.\n {\n // Do not allow the pieces to be too short either. Half the maximum seems reasonable.\n var pieceMinLength = Math.ceil(pieceMaxLength/2);\n // Get the start and end pieces\n var startAndEndRegExp = '^(.{' + (pieceMinLength-1) + ',' + (pieceMaxLength-1) + '}\\\\s)' // Starting piece (ends with space)\n + '.*?' // Anything in between, non-greedy\n + '(\\\\s.{' + (pieceMinLength-1) + ',' + (pieceMaxLength-1) + '})$'; // Ending piece (starts with space)\n var startAndEnd = quote.match(new RegExp(startAndEndRegExp));\n }\n var start, end;\n if (startAndEnd !== null) {\n // We found nice whitespace points at which to break the quote.\n start = startAndEnd[1];\n end = startAndEnd[2];\n }\n else {\n // No nice place to break it; just break it.\n start = quote.substring(0, pieceMaxLength);\n end = quote.substring(length-pieceMaxLength, length);\n }\n return start + ellipsis + end;\n }\n}", "title": "" }, { "docid": "b686cb499918d9f4d246841c3fa1e3d4", "score": "0.49536568", "text": "static truncateWithEllipsis(s, maximumLength) {\n if (maximumLength < 0) {\n throw new Error('The maximumLength cannot be a negative number');\n }\n if (s.length <= maximumLength) {\n return s;\n }\n if (s.length <= 3) {\n return s.substring(0, maximumLength);\n }\n return s.substring(0, maximumLength - 3) + '...';\n }", "title": "" }, { "docid": "b686cb499918d9f4d246841c3fa1e3d4", "score": "0.49536568", "text": "static truncateWithEllipsis(s, maximumLength) {\n if (maximumLength < 0) {\n throw new Error('The maximumLength cannot be a negative number');\n }\n if (s.length <= maximumLength) {\n return s;\n }\n if (s.length <= 3) {\n return s.substring(0, maximumLength);\n }\n return s.substring(0, maximumLength - 3) + '...';\n }", "title": "" }, { "docid": "b23c9ab4bf53c6a45273d726fdd87976", "score": "0.49509758", "text": "function substringFromCloserCharacter(str, character, maxLength) {\n var separatorDistance = 15;\n var ndxAfter = str.indexOf(character, maxLength);\n var ndxBefore = str.lastIndexOf(character, maxLength);\n if (ndxBefore >= 0 && (maxLength - ndxBefore) < separatorDistance) {\n return str.substr(0, ndxBefore);\n } else if (ndxAfter >= 0 && (ndxAfter - maxLength) < separatorDistance) {\n return str.substr(0, ndxAfter);\n }\n\n return null;\n }", "title": "" }, { "docid": "936b7fca98ec827b5d8bb71c1ddedb44", "score": "0.49403188", "text": "function truncateString( string, len ) {\n return ( string.length > len ) ? string.substr( 0, len-1 ) + '...' : string;\n}", "title": "" }, { "docid": "c418f045c416b28758ceaee7517ea60e", "score": "0.4923501", "text": "function truncName(name, maxLength, truncAmount) {\n if (maxLength && truncAmount) {\n if (name.length >= maxLength) {\n return name.substring(0, truncAmount);\n }\n }\n return name;\n }", "title": "" }, { "docid": "19776cff4b46eb44543bb9bd9569efe2", "score": "0.49201906", "text": "function truncateTextEnd($element, $rootNode, $clipNode, options) {\n\t var element = $element[0];\n\t var original = $element.text();\n\n\t var maxChunk = '';\n\t var mid, chunk;\n\t var low = 0;\n\t var high = original.length;\n\n\t // Binary Search\n\t while (low <= high) {\n\t mid = low + (high - low >> 1); // Integer division\n\n\t chunk = $.trim(original.substr(0, mid + 1)) + options.ellipsis;\n\t setText(element, chunk);\n\n\t if ($rootNode.height() > options.maxHeight) {\n\t // too big, reduce the chunk\n\t high = mid - 1;\n\t } else {\n\t // chunk valid, try to get a bigger chunk\n\t low = mid + 1;\n\t maxChunk = maxChunk.length > chunk.length ? maxChunk : chunk;\n\t }\n\t }\n\n\t if (maxChunk.length > 0) {\n\t setText(element, maxChunk);\n\t return true;\n\t } else {\n\t return truncateNearestSibling($element, $rootNode, $clipNode, options);\n\t }\n\t}", "title": "" }, { "docid": "f40c3a5f57de7ad7fca4256cf0d4de4a", "score": "0.49139094", "text": "function truncate(el, maxHeight, ellipsis) {\n\tvar str \t= el.innerHTML,\n\t\thi \t\t= str.length - 1,\n\t\tmid \t= 0,\n\t\tlo \t\t= 0,\n\t\theight \t= 0,\n\t\tnewStr \t= \"\",\n\t\tprevStr = \"\",\n\t\tlast\t= false;\n\t\n\twhile (lo <= hi || height > maxHeight) {\n\t\tmid \t= Math.floor((lo + hi) / 2); \t\t\t// calc a new truncation point\n\t\tprevStr\t= newStr;\t\t\t\t\t\t\t\t// to test length change\n\t\tnewStr \t= truncStr(str, mid, ellipsis);\t\t\t// apply truncation\n\t\tlast\t= !(newStr.length - prevStr.length); \t// finished when no change to length\n\t\tel.innerHTML = newStr;\t\t\t\t\t\t\t// update the dom w/ truncated str\n\t\theight = el.offsetHeight;\t\t\t\t\t\t// get new height\n\t\t\n\t\tif (height > maxHeight) { \t// text wraps past max height\n\t\t\thi = mid - 1;\t\t\t// so move upper bound down\n\t\t\t\n\t\t} else if (!last) {\t\t\t// not the last character before next wrap\n\t\t\tlo = mid + 1;\t\t\t// so move the lower bound up\n\t\t\t\n\t\t} else {\n\t\t\treturn;\t\t\t\t\t// quit loop we done\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2dd3e1d22e65652eaaa22681b1650de4", "score": "0.4912161", "text": "function truncate(str, no_words) {\n return str.split(\" \").splice(0, no_words).join(\" \");\n}", "title": "" }, { "docid": "3d17da89cbf40c42cb1a737ddf702d39", "score": "0.49012834", "text": "function crop(str, maxChars, append) {\n str = toString_1[\"default\"](str);\n return truncate_1[\"default\"](str, maxChars, append, true);\n}", "title": "" }, { "docid": "f15a235256ce5c3ab46a55d7b9b57774", "score": "0.48915324", "text": "function longTextFilter() {\n var postfix = \"...\";\n\n return function (input, maxLength) {\n var ret;\n\n if (input.length > (maxLength + postfix.length)) {\n ret = input.substr(0, maxLength) + postfix;\n } else {\n ret = input;\n }\n return ret;\n };\n }", "title": "" }, { "docid": "ee9b1daee052d8b00075cbd652b4ee87", "score": "0.48900524", "text": "function truncate(str,max){if(max===void 0){max=0;}if(typeof str!=='string'||max===0){return str;}return str.length<=max?str:str.substr(0,max)+\"...\";}", "title": "" }, { "docid": "4079bd8f57e82f25cf9eaaf7d9a0472a", "score": "0.48604003", "text": "substr(startPos /*: Column | Int */, len /*: Column | Int*/) /*: Column */ {\n return new Column(this.jvm_obj.substr(startPos, len));\n }", "title": "" }, { "docid": "b775f2b1c669bfff56b76e6a3e6cc853", "score": "0.48602167", "text": "truncate_() {\n const container = dev().assertElement(\n this.useShadow_ ? this.element : this.content_\n );\n const overflowElement = this.useShadow_\n ? this.element.querySelector('[slot=\"expand\"]')\n : this.element.querySelector('.i-amphtml-truncate-expand-slot');\n\n truncateText({\n container,\n overflowElement,\n });\n // Take the records to clear them out. This prevents mutations from\n // the truncation from invoking the observer's callback.\n this.mutationObserver_.takeRecords();\n }", "title": "" }, { "docid": "05ec98abb1a08f5fd00cf8f6f1ae80e5", "score": "0.48544148", "text": "function shorten(term, match, opts) {\n var matchOpts = {pre: opts.pre, post: opts.post};\n var shared = util.getUnion(term, match.dir);\n var cutoff = shared.lastIndexOf(path.sep) + 1;\n match.dir = match.dir.slice(cutoff);\n match.shared = shared.slice(0, cutoff);\n\n var filepath = path.join(match.dir, match.file);\n term = getRelativeTerm(term, match.shared);\n\n var relativeMatch = fuzzy.match(term, filepath, matchOpts);\n if(relativeMatch) {\n match.rendered = relativeMatch.rendered;\n }\n}", "title": "" }, { "docid": "d9e0fd791e5f5ae9b47810f222cc67f6", "score": "0.48508373", "text": "function truncate($target, maxHeight) {\n if (!maxHeight) {return;}\n \n /**\n * Resets global variables.\n */\n function reset() {\n splitOnChars = settings.splitOnChars.slice(0);\n splitChar = splitOnChars[0];\n chunks = null;\n lastChunk = null;\n }\n \n var nodeValue = $target.html().replace(settings.truncationChar, '');\n \n //Grab the next chunks\n if (!chunks) {\n //If there are more characters to try, grab the next one\n if (splitOnChars.length > 0) {\n splitChar = splitOnChars.shift();\n }\n //No characters to chunk by. Go character-by-character\n else {\n splitChar = '';\n }\n \n chunks = nodeValue.split(splitChar);\n }\n \n //If there are chunks left to remove, remove the last one and see if\n // the nodeValue fits.\n if (chunks.length > 1) {\n // console.log('chunks', chunks);\n lastChunk = chunks.pop();\n // console.log('lastChunk', lastChunk);\n applyEllipsis($target, chunks.join(splitChar));\n }\n //No more chunks can be removed using this character\n else {\n chunks = null;\n }\n \n //Insert the custom HTML before the truncation character\n if (truncationHTMLContainer) {\n $target.html($target.html().replace(settings.truncationChar, ''));\n $this.html($target.html() + ' ' + truncationHTMLContainer.innerHTML + settings.truncationChar);\n }\n\n //Search produced valid chunks\n if (chunks) {\n //It fits\n if ($this.height() <= maxHeight) {\n //There's still more characters to try splitting on, not quite done yet\n if (splitOnChars.length >= 0 && splitChar != '') {\n applyEllipsis($target, chunks.join(splitChar) + splitChar + lastChunk);\n chunks = null;\n }\n //Finished!\n else {\n return $this.html();\n }\n }\n }\n //No valid chunks produced\n else {\n //No valid chunks even when splitting by letter, time to move\n //on to the next node\n if (splitChar == '') {\n applyEllipsis($target, '');\n reset();\n }\n }\n \n //If you get here it means still too big, let's keep truncating\n if (settings.animate) {\n setTimeout(function() {\n truncate($target, maxHeight);\n }, settings.animate === true ? 10 : settings.animate);\n }\n else {\n return truncate($target, maxHeight);\n }\n }", "title": "" }, { "docid": "a2166f3c90ace8a7e944e761fa692668", "score": "0.48459253", "text": "trimText (str = '', length = 260) {\n if (str === null) {\n str = '';\n }\n\n if (str.length <= length) {\n return str;\n }\n else {\n str = str.substring(0, length) + '...';\n return str;\n }\n }", "title": "" }, { "docid": "6562b2d87098f4f0b9f19e24762e05c1", "score": "0.48435554", "text": "function clampStartIndexFromRight(startIndex, len) {\n return min(len, max(-1, startIndex));\n }", "title": "" }, { "docid": "6562b2d87098f4f0b9f19e24762e05c1", "score": "0.48435554", "text": "function clampStartIndexFromRight(startIndex, len) {\n return min(len, max(-1, startIndex));\n }", "title": "" }, { "docid": "e26f81cca2de1b454a8659aa68b57a49", "score": "0.4830108", "text": "function trimText(selector, maxLength) {\n\n\t$(selector).each(function(){\n\t\tif($(this).text().length > maxLength){\n\t\t\tvar trimmedText = $(this).text().substr(0, maxLength);\n\t\t\t$(this).text(trimmedText + '...');\n\t\t}\n\t});\n\t}", "title": "" }, { "docid": "f07ba424564dba71e12112eea86ebc52", "score": "0.48283803", "text": "function truncateWithEllipsis(text, maxChars, ellipsis, fullWords, rtl) {\n if (text.length <= maxChars) {\n return text;\n }\n // Calc max chars\n maxChars -= ellipsis.length;\n if (maxChars < 1) {\n maxChars = 1;\n //ellipsis = \"\";\n }\n // Get lines\n var lines = splitTextByCharCount(text, maxChars, fullWords, rtl);\n // Use first line\n return (lines[0] || \"\") + ellipsis;\n}", "title": "" }, { "docid": "6b7fa23a20a77c7bbbf03c68ba4b299f", "score": "0.48272955", "text": "function shortenString(message, messageLengthThreshold) {\n if (message.length < messageLengthThreshold)\n {\n return message;\n }\n else\n {\n \n var half = (messageLengthThreshold / 2) - 1;\n \n //cut out middle of string and replace with \"...\"\n var newMessage = message.substring(0, half) + \"...\" + message.substring(message.length - half, message.length);\n return newMessage;\n }\n}", "title": "" }, { "docid": "870deb054400f50361b5455c142e4610", "score": "0.4814522", "text": "function TextAbstract(text, length) {\n if (text == null) {\n return \"\";\n }\n if (text.length <= length) {\n return text;\n }\n text = text.substring(0, length);\n last = text.lastIndexOf(\" \");\n text = text.substring(0, last);\n return text + \"...\";\n }", "title": "" }, { "docid": "3b395fc88f72c9fba920be4f4e474bfb", "score": "0.4813668", "text": "function normalizeLength(token, length) {\n\tlength = length || 6;\n\tif (token.length < length) {\n\t\ttoken += (new Array(length - token.length + 1)).join('0');\n\t}\n return token.slice(0, length);\n}", "title": "" }, { "docid": "b392299120e509e7ede035509803c50a", "score": "0.47988713", "text": "function subStringTitle(title, length) {\n if(title.length > length) { title = title.substring(0, length)+\"...\"; return title;}\n return title;\n}", "title": "" }, { "docid": "89a07a55a37db112e314d249ab2ebb72", "score": "0.4797651", "text": "function truncateTextContent($element, $rootNode, $clipNode, options) {\n\t // jshint ignore:line\n\t if (options.position === \"end\") {\n\t return truncateTextEnd($element, $rootNode, $clipNode, options);\n\t } else if (options.position === \"start\") {\n\t return truncateTextStart($element, $rootNode, $clipNode, options);\n\t } else {\n\t return truncateTextMiddle($element, $rootNode, $clipNode, options);\n\t }\n\t}", "title": "" }, { "docid": "2aa7b8680fd68322cf3a6b72e458de20", "score": "0.47898638", "text": "constrainLength(minLength, maxLength) {\n let dir = p5.Vector.sub(this.bob.location, this.anchor);\n let d = dir.mag();\n // Is it too short?\n if (d < minLength) {\n dir.normalize();\n dir.mult(minLength);\n // Reset location and stop from moving (not realistic physics)\n this.bob.location = p5.Vector.add(this.anchor, dir);\n this.bob.velocity.mult(0);\n // Is it too long?\n } else if (d > maxLength) {\n dir.normalize();\n dir.mult(maxLength);\n // Reset location and stop from moving (not realistic physics)\n this.bob.location = p5.Vector.add(this.anchor, dir);\n this.bob.velocity.mult(0);\n }\n }", "title": "" }, { "docid": "9f7845ede3668e6f0175d20f4a95200b", "score": "0.47837403", "text": "function longestWord(sen) {}", "title": "" }, { "docid": "d5e9873666132661f1b5cd568ecbcd84", "score": "0.47826576", "text": "function trimToMaxWidth (width, text) {\n\tvar truncated = text.split('\\n').map(function (line) {\n\t\treturn line.substring(0, width);\n\t});\n\treturn truncated.join('\\n');\n}", "title": "" }, { "docid": "61cab5f32b69699a41a9cc8b323a5d78", "score": "0.47805238", "text": "function truncate(string){\n var MAX_STRING = 20\n if (string.length > MAX_STRING)\n return string.substring(0,MAX_STRING - 3)+'...';\n else\n return string;\n}", "title": "" }, { "docid": "4da82ae2cc742e0ac17086c3fa15d161", "score": "0.47751385", "text": "function _cut(s, tag, forward, match) {\n\tvar i = _find(s, tag, forward, true, match); // Search s for tag\n\tif (i == -1) {\n\t\treturn {\n\t\t\tfound: false, // Not found, make before s and after blank\n\t\t\tbefore: s,\n\t\t\ttag: \"\", // No tag because it's not a part of s\n\t\t\tafter: \"\"\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tfound: true, // We found the tag at i, clip out the text before and after it\n\t\t\tbefore: start(s, i),\n\t\t\ttag: clip(s, i, tag.length), // Include tag to have all parts of s\n\t\t\tafter: beyond(s, i + tag.length)\n\t\t};\n\t}\n}", "title": "" }, { "docid": "445bff67ab7e5a7cdd0554f3299cfeb8", "score": "0.47679377", "text": "after(subject,search,config={}){\n if(!search) return subject\n let position = subject.search(search)\n if(position >= 0) return subject.substr(position)\n return subject\n }", "title": "" }, { "docid": "955f97d47719793d36c5ebdb565ead82", "score": "0.4734917", "text": "function shortenedTitle(title, length) {\n if (title.length === length || title.length < length) {\n return `${title}`;\n } else if (title.match(/^The/)) {\n return `${title.slice(4, length + 3)}`;\n } else {\n return `${title.slice(0, length)}`;\n }\n }", "title": "" }, { "docid": "d23b93c9d3ed5decbd6cc1275fbd3526", "score": "0.47328314", "text": "function truncateString(str, num) {\n const cutStr = str.slice(0, num) \n if(str.length > num){\n \n return cutStr + \"...\"\n }else{\n return cutStr\n }\n\n }", "title": "" }, { "docid": "2f0fc3c67c9d480113ce16a1df1a2b84", "score": "0.47260654", "text": "str_limit(str, length) {\n if (typeof str == typeof null) {\n return null;\n }\n\n if (str.length > length) return (str = str.substring(0, length) + '...');\n\n return str;\n }", "title": "" }, { "docid": "c2b3b81ea50d33c3e4e7639cef20cd02", "score": "0.47196603", "text": "function truncate( text, minWords ) {\n let match;\n let result = \"\";\n let wordCount = 0;\n let regexp = /(\\S+)(\\s*)/g;\n while ( match = regexp.exec( text ) ) {\n wordCount++;\n if ( wordCount <= minWords )\n result += match[0];\n else {\n let char1 = match[1][match[1].length - 1];\n let char2 = match[2][0];\n if ( /[.?!\"]/.test( char1 ) || char2 == \"\\n\" ) {\n result += match[1];\n break;\n }\n else\n result += match[0];\n }\n }\n return result;\n }", "title": "" }, { "docid": "309922c357057963bc1d12a09daf7fb2", "score": "0.4717559", "text": "function truncateCharacters(characters, numCharacters) { // function that truncates string of characters at inputed index value number and outputs remaining words with ellipses to signal truncation.\n characters = String(characters); // Turns first parameter input into a string just in case they input some other value type.\n numCharacters = Number(numCharacters); // Turn second parameter input into a number just in case they input some other value type.\n var textArray = characters.split(\"\"); // Separates text after each individual character and has no limit on splits.\n textArray.splice(numCharacters, textArray.length); // splice starts at index value of number type value entered for the numWords parameter and omits everything at and after it. \n return textArray.join(\"\") + \"...\"; // returns the spliced text with a whitespace at each splice point and \"...\" added to the last set of characters.\n}", "title": "" }, { "docid": "d370718cc0e6c47da3e517e3b2737413", "score": "0.47168255", "text": "function RemoveNInsert(field, value, len) \r\n{\r\n\tif (document.selection) \r\n\t{\r\n\t\tfield.focus();\r\n\t\tsel = document.selection.createRange();\r\n\t\tif (field.value.length >= len)\r\n\t\t\t{ \t\t\t\r\n\t\t\tsel.moveStart('character', -1*(len)); \r\n\t\t\t}\r\n\t\tsel.text = value;\r\n\t\tsel.collapse(true);\r\n\t\tsel.select();\r\n\t\t}\r\n\r\n\telse if (field.selectionStart || field.selectionStart == 0) {\r\n\t\tfield.focus();\r\n\t\tvar startPos = field.selectionStart-len;\r\n\t\tvar endPos = field.selectionEnd;\r\n\t\tvar scrollTop = field.scrollTop;\r\n\t\tstartPos = (startPos == -1 ? field.value.length : startPos );\r\n\t\tfield.value = field.value.substring(0, startPos)\r\n\t\t+ value\r\n\t\t+ field.value.substring(endPos, field.value.length);\r\n\t\tfield.focus();\r\n\t\tfield.selectionStart = startPos + value.length;\r\n\t\tfield.selectionEnd = startPos + value.length;\r\n\t\tfield.scrollTop = scrollTop;\r\n\t} else {\r\n\t\tvar scrollTop = field.scrollTop;\r\n\t\tfield.value += value;\r\n\t\tfield.focus();\r\n\t\tfield.scrollTop = scrollTop;\r\n\t}\r\n\r\n\tAvro_BanglaWord = Avro_BanglaWord.substring(0,Avro_BanglaWord.length-len) + value;\r\n\r\n}", "title": "" }, { "docid": "083f13994c03083f29cb94545a9a3230", "score": "0.47086456", "text": "function changeLength(val, length) {\n if (val.length > length)\n return trim(val, length);\n else if (val.length < length)\n return extend(val, length);\n else\n return val;\n}", "title": "" }, { "docid": "7b8f3560c0382b6be2d1b162ad138290", "score": "0.47022885", "text": "function wrap(text, width) {\n text.each(function () {\n var text = d3.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1,\n x = text.attr(\"x\"),\n y = text.attr(\"y\"),\n dy = 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", dy + \"em\");\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\")\n .text(word);\n }\n }\n });\n }", "title": "" }, { "docid": "1bbeb112fc32165e06e4db59c1145659", "score": "0.46969345", "text": "function truncateString(str, num) {\n // Clear out that junk in your trunk\n if(num === str.length){\n return str;\n }else{\n return str.slice(0,num) + '...';\n }\n\n}", "title": "" }, { "docid": "b8e7e607eaca91cd1d3d89a6b4c80aa6", "score": "0.46960348", "text": "function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;\n else if (len1 > pos) --pos1;\n else return pos1;\n }\n }", "title": "" }, { "docid": "b8e7e607eaca91cd1d3d89a6b4c80aa6", "score": "0.46960348", "text": "function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;\n else if (len1 > pos) --pos1;\n else return pos1;\n }\n }", "title": "" }, { "docid": "0705f8567b806a8229ddfb9c641ae8ba", "score": "0.468374", "text": "function wrap(text, width) {\n var text = d3.select(this)[0][0],\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.4, \n y = text.attr(\"y\"),\n\t\tx = text.attr(\"x\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n\t\t\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n };\n }; \n}", "title": "" }, { "docid": "0705f8567b806a8229ddfb9c641ae8ba", "score": "0.468374", "text": "function wrap(text, width) {\n var text = d3.select(this)[0][0],\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.4, \n y = text.attr(\"y\"),\n\t\tx = text.attr(\"x\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n\t\t\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n };\n }; \n}", "title": "" }, { "docid": "71d0822fb8e39b087348a233d115d533", "score": "0.46817324", "text": "function limitTextTo140(string, text) {\n if (text.length < 70) {\n return text;\n } else {\n return text.substring(0, 67) + '...';\n }\n }", "title": "" }, { "docid": "39d2d40f561222a3b9b03a7dbd62870e", "score": "0.4676559", "text": "function truncateString(str, num) {\n var newStr = str.substr(0,num);\n var otherStr = str.substr(0,num-3);\n\n if (num < 3) {\n return newStr + '...';\n } else if (str.length > num + 3) {\n return otherStr + '...';\n }else {\n return str;\n }\n}", "title": "" }, { "docid": "d5ef1743b139176a2d4a2cab5daf92e5", "score": "0.46685576", "text": "function wrap(text, width) {\n text.each(function () {\n var text = d3.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n }\n }\n });\n }", "title": "" }, { "docid": "83295c6dbf03464dd67362046c8107ad", "score": "0.46683332", "text": "function wrap(text, width) {\n\n text.each(function () {\n var text = d3.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1, // ems\n x = text.attr('x'),\n y = text.attr('y'),\n dy = 0, //parseFloat(text.attr(\"dy\")),\n tspan = text.text(null)\n .append('tspan')\n .attr('x', x)\n .attr('y', y)\n .attr('dy', dy + 'em')\n .attr('dominant-baseline', 'text-before-edge');\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(' '));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(' '));\n line = [word];\n tspan = text.append('tspan')\n .attr('x', x)\n .attr('y', y)\n .attr('dy', ++lineNumber * lineHeight + dy + 'em')\n .attr('dominant-baseline', 'text-before-edge')\n .text(word);\n }\n }\n });\n}", "title": "" }, { "docid": "473dddf8f0ba66aa6a2725003fe29f9e", "score": "0.4667331", "text": "function wrap(text, width) {\n text.each(function () {\n var text = d3.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.4, // ems\n y = text.attr(\"y\"),\n x = text.attr(\"x\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text\n .text(null)\n .append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", dy + \"em\");\n\n while ((word = words.pop())) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text\n .append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\")\n .text(word);\n }\n }\n });\n }", "title": "" }, { "docid": "473dddf8f0ba66aa6a2725003fe29f9e", "score": "0.4667331", "text": "function wrap(text, width) {\n text.each(function () {\n var text = d3.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.4, // ems\n y = text.attr(\"y\"),\n x = text.attr(\"x\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text\n .text(null)\n .append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", dy + \"em\");\n\n while ((word = words.pop())) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text\n .append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\")\n .text(word);\n }\n }\n });\n }", "title": "" }, { "docid": "25d59b3c54a554df8d560c6f3e4f0c3e", "score": "0.46648368", "text": "async ignore(length) {\n if (this.fileInfo.size !== undefined) {\n const bytesLeft = this.fileInfo.size - this.position;\n if (length > bytesLeft) {\n this.position += bytesLeft;\n return bytesLeft;\n }\n }\n this.position += length;\n return length;\n }", "title": "" }, { "docid": "25d59b3c54a554df8d560c6f3e4f0c3e", "score": "0.46648368", "text": "async ignore(length) {\n if (this.fileInfo.size !== undefined) {\n const bytesLeft = this.fileInfo.size - this.position;\n if (length > bytesLeft) {\n this.position += bytesLeft;\n return bytesLeft;\n }\n }\n this.position += length;\n return length;\n }", "title": "" } ]
f25dd55727fcd20843e23f34785a633c
We can do this relatively easily by leveraging the code used for 32bit unsigned code.
[ { "docid": "bee8c84ac6d1ab38bb0bf9d0c5584261", "score": "0.0", "text": "function wsint32(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 3 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fffffff, -0x80000000);\n\tif (val >= 0)\n\t\twgint32(val, endian, buffer, offset);\n\telse\n\t\twgint32(0xffffffff + val + 1, endian, buffer, offset);\n}", "title": "" } ]
[ { "docid": "2d7afbe8da7b696318bc7a400bc64727", "score": "0.7124602", "text": "function unsigned32(n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n {\n return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n }", "title": "" }, { "docid": "d7e2867f1ae606661447ea64e3e0fc51", "score": "0.70848525", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n {\n return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n }", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.6864342", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.6864342", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "47fc7c4bb0c8430bc0a9b60edfb26824", "score": "0.6778664", "text": "function ToUint32(v) { return v >>> 0; }", "title": "" }, { "docid": "92491e5565462af2a2664639de0f7eb4", "score": "0.6749495", "text": "function u32(d,i)\n {\n return (d[i] << 24) | (d[i+1] << 16) | (d[i+2] << 8) | d[i+3];\n }", "title": "" }, { "docid": "58b87c34975f68f102c9121d4d791e22", "score": "0.6725096", "text": "function fixu32(upper, lower)\n{\n\treturn ((upper * (1 << 24)) + lower);\n}", "title": "" }, { "docid": "06206445f30107bf380ffe2f32996e62", "score": "0.6692521", "text": "function ToUint32(x) {\n\tx = Number(x);\n\ta = x < 0 ? Math.ceil(x) : Math.floor(x);\n\tb = Math.pow(2, 32);\n\treturn a - Math.floor(a / b) * b;\n}", "title": "" }, { "docid": "27c0948b81fa71a48063d9d54ff1c159", "score": "0.658488", "text": "function smi(i32){return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;}", "title": "" }, { "docid": "bcc3b734bed0817ecef7da533adeb7f2", "score": "0.6501976", "text": "function ToUint32(input) {\n return input >>> 0;\n }", "title": "" }, { "docid": "949cd3a4e14f291fe0fb4a2e3e4d96fa", "score": "0.647606", "text": "function add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "41c5459baf5d438286d021130f24b12f", "score": "0.6461411", "text": "get uint32() { return this.view.getUint32(0, this.isLE); }", "title": "" }, { "docid": "ac44b140e28dceb7e373be73d58fce8a", "score": "0.63297355", "text": "function readU32() {\n var bytes = readBytes(_webassemblyjs_leb128__WEBPACK_IMPORTED_MODULE_4__[\"MAX_NUMBER_OF_BYTE_U32\"]);\n var buffer = Buffer.from(bytes);\n return Object(_webassemblyjs_leb128__WEBPACK_IMPORTED_MODULE_4__[\"decodeUInt32\"])(buffer);\n }", "title": "" }, { "docid": "d03719e563f7afebf023066b59ceab47", "score": "0.6317929", "text": "function setBitCount32(value)\n{\n value = value - ((value >> 1) & 0x55555555);\n value = (value & 0x33333333) + ((value >> 2) & 0x33333333);\n return ((value + (value >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;\n}", "title": "" }, { "docid": "71096b5cc9df6bf624c29c39fce6b632", "score": "0.63123244", "text": "randomUInt32() {\n let y;\n if (this.mti >= 624) {\n for (let i = 0; i < 227; i++) {\n y = ((this.mt[i] & 0x80000000) | (this.mt[i + 1] & 0x7fffffff)) >>> 0;\n this.mt[i] = (this.mt[i + 397] ^ (y >>> 1) ^ (y & 1 ? 0x9908b0df : 0)) >>> 0;\n }\n for (let i = 227; i < 623; i++) {\n y = ((this.mt[i] & 0x80000000) | (this.mt[i + 1] & 0x7fffffff)) >>> 0;\n this.mt[i] = (this.mt[i - 227] ^ (y >>> 1) ^ (y & 1 ? 0x9908b0df : 0)) >>> 0;\n }\n y = ((this.mt[623] & 0x80000000) | (this.mt[0] & 0x7fffffff)) >>> 0;\n this.mt[623] = (this.mt[396] ^ (y >>> 1) ^ (y & 1 ? 0x9908b0df : 0)) >>> 0;\n this.mti = 0;\n }\n y = this.mt[this.mti++];\n y = (y ^ (y >>> 11)) >>> 0;\n y = (y ^ ((y << 7) & 0x9d2c5680)) >>> 0;\n y = (y ^ ((y << 15) & 0xefc60000)) >>> 0;\n y = (y ^ (y >>> 18)) >>> 0;\n return y;\n }", "title": "" }, { "docid": "4456e60e68e1ba884dcf83e01e7ab49d", "score": "0.6311848", "text": "function addEntropy32(w) {\r\n \tvar i;\r\n\t\r\n\tfor (i = 0; i < 4; i++) {\r\n\t addEntropyByte(w & 0xFF);\r\n\t w >>= 8;\r\n \t}\r\n }", "title": "" }, { "docid": "6e28e36d2c1a72e7ab2728868527832b", "score": "0.6305811", "text": "function add32(a, b) {\n\t return a + b & 0xFFFFFFFF;\n\t}", "title": "" }, { "docid": "083f806dd83b72bd55798cf76781f938", "score": "0.6288117", "text": "function addEntropy32(w) {\n \tvar i;\n\t\n\tfor (i = 0; i < 4; i++) {\n\t addEntropyByte(w & 0xFF);\n\t w >>= 8;\n \t}\n }", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.62646556", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.62646556", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.62646556", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.62646556", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "c668706d160a5413ec5da15788679bf9", "score": "0.625487", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "f058cef129e4fc82e38d74a6c86fce70", "score": "0.62480175", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "f0369c7068b9e60972df769722026863", "score": "0.6227433", "text": "static _mulberry32(a) {\n\t return function() {\n\t let t = a += 0x6D2B79F5;\n\t /* jshint bitwise: false */\n\t t = Math.imul(t ^ t >>> 15, t | 1);\n\t t ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\t return ((t ^ t >>> 14) >>> 0) / 4294967296;\n\t /* jshint bitwise: true */\n\t };\n\t}", "title": "" }, { "docid": "79c8115219f5d19c12624d71b381e278", "score": "0.62067175", "text": "function add32(a, b) {\n\t return a + b & 0xFFFFFFFF;\n\t }", "title": "" }, { "docid": "cb809fa3bd86dfae99d2910ae6f67f54", "score": "0.61908996", "text": "function smi(i32){return i32>>>1&1073741824|3221225471&i32}", "title": "" }, { "docid": "5d8b3c4c4d9f82cb7e7f39ae9c08773b", "score": "0.6189047", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "49007295cc87eccdf203eec8b148bfab", "score": "0.6187516", "text": "function test32()\n{\n\tvar data = new Buffer(8);\n\tdata[0] = 0x32;\n\tdata[1] = 0x65;\n\tdata[2] = 0x42;\n\tdata[3] = 0x56;\n\tdata[4] = 0x23;\n\tdata[5] = 0xff;\n\n\tASSERT.equal(0x32654256, mod_ctype.ruint32(data, 'big', 0));\n\tASSERT.equal(0x65425623, mod_ctype.ruint32(data, 'big', 1));\n\tASSERT.equal(0x425623ff, mod_ctype.ruint32(data, 'big', 2));\n\n\tASSERT.equal(0x56426532, mod_ctype.ruint32(data, 'little', 0));\n\tASSERT.equal(0x23564265, mod_ctype.ruint32(data, 'little', 1));\n\tASSERT.equal(0xff235642, mod_ctype.ruint32(data, 'little', 2));\n}", "title": "" }, { "docid": "c152be65d3c4a09dac1213271e0ac722", "score": "0.6162266", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "d07050cff63bb2addff20f65437066b2", "score": "0.6141354", "text": "function B2S_GET32 (v, i) {\n\t return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n\t}", "title": "" }, { "docid": "99b707d3409e54bc475a6e608a1179a4", "score": "0.6124518", "text": "function add32(a, b) {\r\n return (a + b) & 0xFFFFFFFF;\r\n }", "title": "" }, { "docid": "abd24990df39ad4b658f7b184817b58d", "score": "0.60898554", "text": "function $rt_toUint32(x)\n{\n x = $rt_toNumber(x);\n\n if ($ir_is_int32(x))\n return x;\n\n // NaN or infinity\n if ($ir_ne_f64(x, x) ||\n $ir_eq_f64(x, Infinity) ||\n $ir_eq_f64(x, -Infinity))\n return 0;\n\n if ($ir_ge_i32(x, 0.0))\n return $ir_f64_to_i32(x);\n else\n return $ir_f64_to_i32($ir_sub_f64(0.0, x));\n}", "title": "" }, { "docid": "62d461bbdd00431c5e3bf39662e44f64", "score": "0.60881186", "text": "function Low32Bits(n) {\n var result = n & 0x7fffffff;\n\n if (n & 0x80000000) {\n result += 0x80000000;\n }\n\n return result;\n}", "title": "" }, { "docid": "8f56d799095ccf8808f19ebdc0971285", "score": "0.608694", "text": "function adler32(data){var a=1;var b=0;for(var i=0;i<data.length;i++){a=(a+data.charCodeAt(i))%MOD;b=(b+a)%MOD;}return a|b<<16;}", "title": "" }, { "docid": "ea20c0c0fe989ac23ad5cb9082b44b98", "score": "0.60216784", "text": "function add32(a, b) {\n\t\t\t\treturn (a + b) & 0xFFFFFFFF;\n\t\t\t}", "title": "" }, { "docid": "28d1b1e3a65753529b6014d5193b6328", "score": "0.60132813", "text": "function v0() {\n for (let i= 0; i < 4004; i++) {\n const v7 = 1 >>> i;\n const v9 = 32 - i;\n const v10 = 1<< v9;\n const v11 = v7 & v10;\n }\n}", "title": "" }, { "docid": "e31b305a5ec7883db1f0afcfa5f368f1", "score": "0.60117996", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "e1d6585f4f43b27f3c6d8f4ca5243160", "score": "0.60066944", "text": "function B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}", "title": "" }, { "docid": "d29a5c1e851cc9d5619eb2b5b2a3715d", "score": "0.60021234", "text": "function adler32(data){for(var a=1,b=0,i=0,l=data.length,m=l&-4;i<m;){for(var n=Math.min(i+4096,m);i<n;i+=4)b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));a%=MOD,b%=MOD}for(;i<l;i++)b+=a+=data.charCodeAt(i);return a%=MOD,b%=MOD,a|b<<16}", "title": "" }, { "docid": "7a90fe90880b92f3805a978702f31756", "score": "0.5986338", "text": "function RAND_32() {\n\t\treturn (Math.floor((Math.random()*255)+1) << 23) | (Math.floor((Math.random()*255)+1) << 16)\n\t\t | (Math.floor((Math.random()*255)+1) << 8) | Math.floor((Math.random()*255)+1);\n\t}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.59845024", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "4c508fa57d45d2e4ca6e116e50db591c", "score": "0.5974721", "text": "function as_signed(value,bits){var s=32-bits;return value<<s>>s}", "title": "" }, { "docid": "1e0f52289f2e7b68b5e0a6327cb5725b", "score": "0.593849", "text": "function popcnt32(n) {\n\tn -= ((n >> 1) & 0x55555555);\n\tn = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n\treturn (((n + (n >> 4))& 0xF0F0F0F)* 0x1010101) >> 24;\n}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.59236294", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.59236294", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.59236294", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.59236294", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.59236294", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "8f9919ae9fb8e5474d9ad229f7a4cf16", "score": "0.59203595", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xbfffffff;\n}", "title": "" }, { "docid": "8f9919ae9fb8e5474d9ad229f7a4cf16", "score": "0.59203595", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xbfffffff;\n}", "title": "" }, { "docid": "8f9919ae9fb8e5474d9ad229f7a4cf16", "score": "0.59203595", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xbfffffff;\n}", "title": "" }, { "docid": "8f9919ae9fb8e5474d9ad229f7a4cf16", "score": "0.59203595", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xbfffffff;\n}", "title": "" }, { "docid": "9f8379f892ee873ef6e9fe49dbaeefef", "score": "0.5896739", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "title": "" }, { "docid": "9f8379f892ee873ef6e9fe49dbaeefef", "score": "0.5896739", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "title": "" }, { "docid": "9f8379f892ee873ef6e9fe49dbaeefef", "score": "0.5896739", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "title": "" }, { "docid": "9f8379f892ee873ef6e9fe49dbaeefef", "score": "0.5896739", "text": "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "title": "" }, { "docid": "dac53341407feafa43730d1a7edf6f4b", "score": "0.5894012", "text": "function h$hashable_wang_32(a) {\n a = (a ^ 61) ^ (a >> 16);\n a = a + (a << 3);\n a = a ^ (a >> 4);\n a = a * 0x27d4eb2d;\n a = a ^ (a >> 15);\n return a;\n}", "title": "" }, { "docid": "aacf0498bc66d2dd0e09956e3b40c0a0", "score": "0.58779657", "text": "function ToInt32(v) { return v >> 0; }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "dbd18b611be78b56a280383baa369194", "score": "0.586275", "text": "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "title": "" }, { "docid": "ff31fec89d6eb88ab7ce42656ab89b9d", "score": "0.58607113", "text": "get() { return this.getUint32() / 4294967296.0; }", "title": "" } ]
0a46d3e0eced76e1cf70e85fddabf5a7
Parse URL hash tag
[ { "docid": "d9b3df31e6d9dfe2c1aa6004479fa805", "score": "0.0", "text": "function readHashTag()\n{\n\tvar tags = location.hash.split('&');\n\tfor ( var i=0; i<tags.length; ++i ) {\n\t\tvar tag = tags[i].split('=');\n\t\tvar key = tag[0];\n\t\tvar val = tag[1];\n\n\t\tswitch ( key ) {\n\t\t\tcase '#zoom': {\n\t\t\t\tzoom = parseFloat(val);\n\t\t\t\tconsole.log(\"readHashTag() zoom : \" + zoom);\n\t\t\t\tbreak;\n\t\t\t} \n\t\t\tcase 'xcen': {\n\t\t\t\txcen = parseFloat(val);\n\t\t\t\tconsole.log(\"readHashTag() xcen : \" + xcen);\n\t\t\t\tbreak;\n\t\t\t} \n\t\t\tcase 'ycen': {\n\t\t\t\tycen = parseFloat(val);\n\t\t\t\tconsole.log(\"readHashTag() ycen : \" + ycen);\n\t\t\t\tredraw = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t\tcase 'power': {\n\t\t\t\tpower = parseFloat(val);\n\t\t\t\t$(\"power\").value = power;\n\t\t\t\tconsole.log(\"readHashTag() power : \" + power);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'fog': {\n\t\t\t\tfog_factor = parseFloat(val);\n\t\t\t\t$(\"fog\").value = fog_factor;\n\t\t\t\tconsole.log(\"readHashTag() fog : \" + fog_factor);\n\t\t\t\tbreak;\n\t\t\t} \n\t\t\tcase 'primary_light': {\n\t\t\t\tprimary_light = parseFloat(val);\n\t\t\t\t$(\"primary_light\").value = primary_light;\n\t\t\t\tconsole.log(\"readHashTag() primary_light : \" + primary_light);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'dof': {\n\t\t\t\tcameraDOF = parseFloat(val);\n\t\t\t\tfactorDOF = cameraDOF * (ximlen/3);\n\t\t\t\t$(\"DOF\").value = cameraDOF;\n\t\t\t\tconsole.log(\"readHashTag() dof : \" + cameraDOF);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'focus': {\n\t\t\t\tfocus = parseFloat(val);\n\t\t\t\t$(\"focus\").value = focus;\n\t\t\t\tconsole.log(\"readHashTag() focus : \" + focus);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "b4d51a177c18d2a063c569cac04e0e0c", "score": "0.73131025", "text": "function parseHash(){\n return this.parseQuery( this.hash() );\n }", "title": "" }, { "docid": "30c9a2bd5a9982a702783e18495a4b9b", "score": "0.72896147", "text": "function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n }", "title": "" }, { "docid": "0788d384da1dd36a6e2d1fa36a8c5629", "score": "0.7269114", "text": "function parseURL() {\n var parts = window.location.hash.replace('#', '').split('/');\n\n return parts[1] ? parts[1] : false;\n }", "title": "" }, { "docid": "9ff4303f487cdf5c75c2dee8c8604113", "score": "0.7250949", "text": "function getHash( url ) {\n var hashPos = url.lastIndexOf ( '#' );\n return url.substring( hashPos + 1 );\n}", "title": "" }, { "docid": "0496def9bfa0cb8166cee3fbf9c1b06f", "score": "0.7221153", "text": "function parseLocationHash() {\n var hash = (location.hash && location.hash != \"\" ? location.hash: \"#home\");\n return hash.match(/#([a-zA-Z0-9_-]+)(\\/.*)?/);\n}", "title": "" }, { "docid": "942b6bb51dbc85eefd418c6c78f8243f", "score": "0.71995544", "text": "function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n}", "title": "" }, { "docid": "942b6bb51dbc85eefd418c6c78f8243f", "score": "0.71995544", "text": "function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n}", "title": "" }, { "docid": "d8dac3b0ef1e2ae4078e8f0a1da2fcd6", "score": "0.7187037", "text": "function stripHash(url) {\r\n return /^[^#]*/.exec(url)[0];\r\n}", "title": "" }, { "docid": "ec72459484481ed5e6baad6cdf155d62", "score": "0.71708506", "text": "function parseUrlHash_(hash) {\n const parameters = hash.split('&');\n\n let tabHash = parameters[0];\n if (tabHash === '' || tabHash === '#') {\n tabHash = undefined;\n }\n\n // Split each string except the first around the '='.\n let paramDict = null;\n for (let i = 1; i < parameters.length; i++) {\n const paramStrings = parameters[i].split('=');\n if (paramStrings.length !== 2) {\n continue;\n }\n if (paramDict === null) {\n paramDict = {};\n }\n const key = decodeURIComponent(paramStrings[0]);\n const value = decodeURIComponent(paramStrings[1]);\n paramDict[key] = value;\n }\n\n return {tabHash, parameters: paramDict};\n }", "title": "" }, { "docid": "9bfdc7ba68e1c1d127f0bc5ffd1307e9", "score": "0.71619993", "text": "get hash() {\n return this.parsedUrl.hash;\n }", "title": "" }, { "docid": "692dabe958d8eac23480cd8f31ebf84e", "score": "0.6911467", "text": "function getHash(url) {\n\t\tif (typeof url == 'string') {\n\t\t\tvar hashPos = url.indexOf('#');\n\t\t\tif (hashPos > -1)\n\t\t\t\treturn url.substring(hashPos);\n\t\t}\n\t\treturn '';\n\t}", "title": "" }, { "docid": "4f07f583e6c598a20f64366c567d42f9", "score": "0.690219", "text": "function getUrlHash() {\r\n // var hash = window.location.search.substring(3);\r\n var hash = window.location.hash;\r\n \r\n if(hash) {\r\n var userData = hash.split('~');\r\n if (userData.length > 8) {\r\n return userData;\r\n } \r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "31163f8df05f8cbb09564374b3421f59", "score": "0.6863171", "text": "function getHash(uri) {\n var hash = parse(uri).hash\n return hash ? hash.slice(1) : null\n}", "title": "" }, { "docid": "69adf91d6356401a9d934fae988d4e5f", "score": "0.68219197", "text": "function parseHash() {\n let [_, language, page] = location.hash.replace(/^#/, '').split('/');\n if (language != 'en') {\n language = 'lv';\n }\n page = +page;\n if (!Number.isInteger(page) || page < 0 || page > 7) {\n page = 0;\n }\n return { language, page };\n}", "title": "" }, { "docid": "08af22f0fff250c428951b49312e7a15", "score": "0.67989767", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1), rez = hash.split(\"-\"), index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1, gallery = rez.join(\"-\");\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "08af22f0fff250c428951b49312e7a15", "score": "0.67989767", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1), rez = hash.split(\"-\"), index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1, gallery = rez.join(\"-\");\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "99785bf7de9c3222c80637d82176096c", "score": "0.67810863", "text": "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "title": "" }, { "docid": "c2ff2f57cf905a833601383573858c74", "score": "0.67556185", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "326b68b3f9b5b53b77ffc175a3e31086", "score": "0.6753743", "text": "function getHashFromHref(href) {\n // If href contains #, then return everything after the last #\n return (href.indexOf('#') !== -1)? href.split('#').pop() : false;\n }", "title": "" }, { "docid": "1b7d5c77d1eb62f744f76f0f2b2496ef", "score": "0.67431146", "text": "function takeHashPath(){\n \n var path = document.URL;\n var split = path.split('#');\n \n return split[1];\n}", "title": "" }, { "docid": "9c4b7195f963fe59dea2abb3f44f01a0", "score": "0.67415553", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.67204875", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.67204875", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.67204875", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.67204875", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.67204875", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.67204875", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "572a750fc21b69efbb7a667f48a23469", "score": "0.67066425", "text": "function parseHash() {\n let page, search, query;\n\n if (typeof window !== `undefined`) {\n let url = new URL(window.location.href);\n let hash = url.hash || '';\n\n const i = hash.indexOf('?');\n if (i === -1) {\n page = hash;\n search = new URLSearchParams(); // empty query\n } else {\n page = hash.substring(0, i);\n search = new URLSearchParams(hash.substring(i));\n }\n\n query = new Map();\n for (const p of allowedSearchParams) {\n query[p] = search.get(p);\n }\n }\n return { page, query };\n}", "title": "" }, { "docid": "c50ec541f7c019ec645a779f581f3f5e", "score": "0.6698888", "text": "function parseHash() {\n\tif (location.hash === \"\") location.hash = \"#general\";\n\tif (location.hash === \"#general\") selectTab(\"tab-general\");\n\tif (location.hash === \"#storage\") selectTab(\"tab-storage\");\n\tif (location.hash === \"#notifs\") selectTab(\"tab-notifs\");\n\tif (location.hash === \"#community\") selectTab(\"tab-community\");\n\tif (location.hash === \"#tracks\") selectTab(\"tab-tracks\");\n\tif (location.hash === \"#about\") selectTab(\"tab-about\");\n}", "title": "" }, { "docid": "c46bd685fa16b34e0eac8ced0dfa6bcf", "score": "0.6686722", "text": "function photoswipeParseHash() {\n var hash = window.location.hash.substring(1),\n params = {};\n\n if (hash.length < 5) {\n return params;\n }\n\n var vars = hash.split('&');\n for (var i = 0; i < vars.length; i++) {\n if (!vars[i]) {\n continue;\n }\n var pair = vars[i].split('=');\n if (pair.length < 2) {\n continue;\n }\n params[pair[0]] = parseInt(pair[1], 10);\n }\n\n return params;\n }", "title": "" }, { "docid": "14688fa4678ccd985113bcc2b5963294", "score": "0.66513467", "text": "function get(){\n var hash = unescape(window.location.hash)\n var re = new RegExp(\"[#|&]\" + id + \"=(.*?)(&|$)\", \"i\");\n separator = hash.indexOf('#') !== -1 ? \"&\" : \"#\";\n var match = hash.match(re),\n value = match ? match[1] : null;\n if (codec) value = codec.parse(value);\n return value;\n }", "title": "" }, { "docid": "7c19c21263dc532bcdf76c27f013cc38", "score": "0.6643997", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1);\n var rez = hash.split('-');\n var index = rez.length > 1 && /^\\+?\\d+$/.test(rez[ rez.length - 1 ]) ? parseInt(rez.pop(-1), 10) || 1 : 1;\n var gallery = rez.join('-');\n\n // Index is starting from 1\n if (index < 1) {\n index = 1;\n }\n\n return {\n hash: hash,\n index: index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "0a5c818f863a22593bde0f59e130bfba", "score": "0.6633271", "text": "function getHashValue() {\n return location.hash.substr(1);\n}", "title": "" }, { "docid": "614c03d522851dcdc87c0deb574b5a44", "score": "0.66273963", "text": "function parseHashURL(url) {\n return !url.indexOf(SOLVE_URL) ? url.slice(SOLVE_URL.length) : url;\n}", "title": "" }, { "docid": "673e80724b8fef4288eb963257d8b707", "score": "0.6610097", "text": "function getHashValue(key) {\n return location.hash.split('=')[1];\n}", "title": "" }, { "docid": "3f21b7731b5b2a71fc52c0cbdfc662ed", "score": "0.6597684", "text": "function extractFromHash(name, hash) {\n var match = hash.match(new RegExp(name + \"=([^&]+)\"));\n return !!match && match[1];\n }", "title": "" }, { "docid": "3f21b7731b5b2a71fc52c0cbdfc662ed", "score": "0.6597684", "text": "function extractFromHash(name, hash) {\n var match = hash.match(new RegExp(name + \"=([^&]+)\"));\n return !!match && match[1];\n }", "title": "" }, { "docid": "52f0d87710e9cc8e60996f8e93692efc", "score": "0.6594105", "text": "function getHash () {\n return window.location.hash.replace(/^\\#/, '');\n}", "title": "" }, { "docid": "550878849654971fb17f41a773b70d6f", "score": "0.65508384", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n return {\n hash: hash,\n\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n } // Trigger click evnt on links to open new fancyBox instance", "title": "" }, { "docid": "cbdc3578e23272d3a3fa6e33af557536", "score": "0.65477204", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "cbdc3578e23272d3a3fa6e33af557536", "score": "0.65477204", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "cbdc3578e23272d3a3fa6e33af557536", "score": "0.65477204", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "cbdc3578e23272d3a3fa6e33af557536", "score": "0.65477204", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "d5465993f1512db916b1a8e21acb9edd", "score": "0.6506464", "text": "function parse_hash(s) {\n if (s == null) { s = window.location.hash; }\n if (!s) { return; }\n //IE gives you a # at the start. sonova\n s = s.replace('#','');\n parts = s.split(\",\");\n lat = parseFloat(parts[0]);\n lng = parseFloat(parts[1]);\n zoom = parseInt(parts[2]);\n resource = parseInt(parts[3]);\n if (parts.length == 6) {\n var markerLat = parts[4];\n var markerLng = parts[5];\n return [lat, lng, zoom, resource, markerLat, markerLng];\n } else {\n return [lat, lng, zoom, resource];\n }\n return null;\n}", "title": "" }, { "docid": "84663811831040c74aca5211753a4a0b", "score": "0.649704", "text": "function getHash() {\n const hash = window.location.hash || \"\"\n window.location.hash = '' // Get rid of hash\n\n return hash.substring(1)\n .split(\"&\")\n .reduce((initial, item) => {\n if (item) {\n const parts = item.split(\"=\");\n initial[parts[0]] = decodeURIComponent(parts[1]);\n }\n\n return initial;\n }, {});\n}", "title": "" }, { "docid": "9216fefbd94b5f199b8df9c528b73fbd", "score": "0.6484987", "text": "function parseURL() {\n\tvar page_title = location.href; // location.pathname; //.match(/\\/page\\/(.*)/)[1];\n\tvar chunks = page_title.split(\"#\");\n\t\n\t// Parse # from URL\n\tif (chunks.length > 1) {\n\t\tvar schemeLetter = chunks[1];\n\t\treturn schemeLetter;\n\t}// End if hashtag exists in URL\n\t// Load A by default\n\telse {\n\t\treturn \"A\";\t\n\t}\n}", "title": "" }, { "docid": "a49d27787b87e3f36d39aa2702b9b17f", "score": "0.6438432", "text": "parseHash(hash){\n let urlObj={\n api: null,\n action: null,\n id:null,\n query: {\n   sort_col: null,\n   sort_dir:null,\n   limit: null,\n   offset:null,\n filter_col: null,\n filter_str: null,\n \n }\n }\n if (!hash.includes(\"#\")){\n return urlObj;\n }\n let parts = hash.split('/');\n let querysplit=parts[1].split(\"?\")\n if (querysplit.length>1){\n let items = querysplit[1].split(\"&\");\n for(let item of items){\n let arr=item.split(\"=\");\n urlObj.query[arr[0]]=arr[1];\n }\n parts[1]=querysplit[0];\n }\n \n urlObj.api=parts[1];\n urlObj.action=parts.length>2?parts[2]:null;\n urlObj.id=parts.length>3?parts[3]:null;\n return urlObj;\n }", "title": "" }, { "docid": "9d09658ee46644517360830b1ed2719a", "score": "0.6435966", "text": "function getLocationHash() {\n var href = location.href;\n var index = href.indexOf('#');\n return index > 0 ? href.substring(index) : \"\";\n }", "title": "" }, { "docid": "050cbf15282b466868f266a47693d113", "score": "0.6364571", "text": "getHashURLCode() {\n var q = window.location.hash.substring(1); \n return q;\n }", "title": "" }, { "docid": "df5227df297284d6a5ee768d89eda368", "score": "0.63577783", "text": "function readHashTag()\n{\n\tvar redraw = false;\n\tvar tags = location.hash.split('&');\n\n\tfor ( var i=0; i<tags.length; ++i ) {\n\t\tvar tag = tags[i].split('=');\n\t\tvar key = tag[0];\n\t\tvar val = tag[1];\n\n\t\tswitch ( key ) {\n\t\t\tcase '#zoom': {\n\t\t\t\tvar z = val.split(',');\n\t\t\t\tzoom = [parseFloat(z[0]), parseFloat(z[1])];\n\t\t\t\tredraw = true;\n\t\t\t} break;\n\n\t\t\tcase 'lookAt': {\n\t\t\t\tvar l = val.split(',');\n\t\t\t\tlookAt = [parseFloat(l[0]), parseFloat(l[1])];\n\t\t\t\tredraw = true;\n\t\t\t} break;\n\n\t\t\tcase 'iterations': {\n\t\t\t\t$('txtSteps').value = val;\n\t\t\t\tconsole.log(\"readHashTag() \" + $('txtSteps').value);\n\t\t\t\tredraw = true;\n\t\t\t} break;\n\n\t\t\tcase 'superSamples': {\n\t\t\t\t$('superSamples').value = String(parseInt(val, 10));\n\t\t\t\tredraw = true;\n\t\t\t} break;\n\n\t\t\tcase 'mode': {\n\t\t\t\t$('mode').value = String(val);\n\t\t\t\tredraw = true;\n\t\t\t} break;\n\t\t}\n\t}\n\n\tif ( redraw )\n\t\treInitCanvas = true;\n\n\treturn redraw;\n}", "title": "" }, { "docid": "8ffdf4061f54f0bd942e0205c4534319", "score": "0.6345962", "text": "function getUrlHash(sHash) {\r\n var sPageURL = location.hash.replace('#', '');\r\n var sURLHash = sPageURL.split('&');\r\n for (var i = 0; i < sURLHash.length; i++) {\r\n var sHashName = sURLHash[i].split('=');\r\n if (sHashName[0] == sHash) {\r\n return sHashName[1];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "24fe7c184db9bdca6fe540f1db209088", "score": "0.63223016", "text": "function getHash() {\n\tvar h = window.location.hash;\n\treturn h.length > 1 && h[0] === '#' ? (Math.max(0, 1*h.substring(1))) : 0;\n}", "title": "" }, { "docid": "5642f8f712c0d260b0ff7a2810d96860", "score": "0.63014084", "text": "function _getHash() {\n var match = windowLocation.href.match(/#(.*)$/);\n\n if (match) {\n return match[1];\n } else {\n return \"\";\n }\n }", "title": "" }, { "docid": "82a16ab154deaa7e050fa853206255b0", "score": "0.624185", "text": "function cleanURL(url) {\n\tvar url_hash = window.location.hash;\n\tvar hash_regexp = new RegExp(\"STS=\", \"i\");\n\tvar match_results = url_hash.match(hash_regexp); // elements 1,3\n\tif( match_results != null ) {\n\t\tvar url_arr = url.split('#');\n\t\treturn url_arr[0];\n\t} else {\n\t\treturn url;\n\t}\n}", "title": "" }, { "docid": "bc630bebb35f913c29547e478468c2be", "score": "0.62412184", "text": "function parseHash(hash, regex) {\n\n var matches;\n\n if (hash && regex) {\n matches = hash.match(regex);\n if (matches && matches.length >= 1) {\n return matches;\n }\n }\n return null;\n\n}", "title": "" }, { "docid": "16f32593e9c3b3bb6c63087ef49304f8", "score": "0.6218122", "text": "function getHashFromAddress(){\n\t\t\t\n\t\t\tvar hashValue;\n\t\t\t\n\t\t\tif(window.location.hash){\n\t\t\t\thashValue=window.location.hash;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thashValue=location.hash;\n\t\t\t}\n\t\t\t\n\t\t\treturn String(hashValue).replace(/#/,\"\");\n\t\t}", "title": "" }, { "docid": "7b49fdbcc3bb47f272fc5cee29e83c78", "score": "0.61874855", "text": "function readURL() {\n\t\t// Break the hash down to separate components\n\t\tvar bits = window.location.hash.slice(2).split('/');\n\n\t\t// Read the index components of the hash\n\t\tindexh = bits[0] ? parseInt(bits[0]) : 0;\n\t\tindexv = bits[1] ? parseInt(bits[1]) : 0;\n\n\t\tnavigateTo(indexh, indexv);\n\t}", "title": "" }, { "docid": "b8d270dde27192ac9909c924d36271af", "score": "0.6185331", "text": "function parseUrl(){var hash=window.location.hash.substr(1),rez=hash.split(\"-\"),index=rez.length>1&&/^\\+?\\d+$/.test(rez[rez.length-1])?parseInt(rez.pop(-1),10)||1:1,gallery=rez.join(\"-\");return{hash:hash,/* Index is starting from 1 */index:index<1?1:index,gallery:gallery};}// Trigger click evnt on links to open new fancyBox instance", "title": "" }, { "docid": "36f6f16ce227688e20d2419677cfc710", "score": "0.6096778", "text": "getHashParam(type){\n let pattern = this.campaign_map[type].format;\n let matches = pattern.exec(window.location.hash);\n\n if(matches){\n return matches[0]\n } else {\n return false\n }\n }", "title": "" }, { "docid": "7f3bc760fd1cac167052eaf7b68f7d5f", "score": "0.60927236", "text": "getHashParams() {\n let hashParams = {};\n let e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n console.log(e);\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n }", "title": "" }, { "docid": "250150b6a60fe5773ac8c27cda6ed1e9", "score": "0.60827875", "text": "function get_hash_args() {\n hashsplit = window.location.hash.substr(1).split(',');\n if (hashsplit[0]=='') return false;\n return hashsplit;\n}", "title": "" }, { "docid": "f20045d2a660ef69b0c29b7f9a35fde7", "score": "0.60756177", "text": "function locationParse(){\n\tvar getLocation = location.hash.substr(1);\n if(getLocation){\n \treturn getLocation\n }\n}", "title": "" }, { "docid": "be9cd2092cfc94fefc31b1e5e96ed393", "score": "0.6061655", "text": "function parseSelectionHash( hash ) {\n var parts,\n isValid = /^[0-9:]+$/,\n selection = null;\n\n if ( hash.charAt( 0) === \"#\" ) {\n hash = hash.substring( 1 );\n }\n if ( isValid.test( hash ) ) {\n parts = hash.split( \":\" );\n if ( parts.length === 2 ) {\n selection = {\n typeId: parts[0],\n componentId: parts[1]\n };\n }\n }\n return selection;\n }", "title": "" }, { "docid": "8909ad8edf68f58e87f85c30638688ad", "score": "0.6038259", "text": "function getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n }", "title": "" }, { "docid": "7e3953a5d46f659067808e0ca77749a7", "score": "0.603697", "text": "function getHashInfo(urlHash) {\n\tif (urlHash.length > 0) {\n\t\tvar pageLink = urlHash[0] == '#' ? urlHash.substring(1) : urlHash,\n\t\t\tthisPage,\n\t\t\tthisSection,\n\t\t\tthisContent;\n\n\t\tvar tempStartIndex = [];\n\n\t\tif (pageLink.substring(0,4) == \"page\") {\n\t\t\ttempStartIndex.push(4);\n\n\t\t\tif (pageLink.substring(tempStartIndex[0]).indexOf('section') > -1) {\n\t\t\t\ttempStartIndex.push(pageLink.indexOf('section'));\n\t\t\t\tthisPage = parseInt(pageLink.substring(tempStartIndex[0], tempStartIndex[1]), 10) - 1;\n\n\t\t\t\tif (pageLink.substring(tempStartIndex[1] + 7).indexOf('content') > -1) {\n\t\t\t\t\ttempStartIndex.push(pageLink.indexOf('content'));\n\t\t\t\t\tthisSection = parseInt(pageLink.substring(tempStartIndex[1] + 7, tempStartIndex[2]), 10);\n\t\t\t\t\tthisContent = parseInt(pageLink.substring(tempStartIndex[2] + 7), 10);\n\t\t\t\t} else {\n\t\t\t\t\tthisSection = parseInt(pageLink.substring(tempStartIndex[1] + 7), 10);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthisPage = parseInt(pageLink.substring(tempStartIndex[0]), 10) - 1;\n\t\t\t}\n\n\t\t\tthisPage = thisPage < 0 ? 0 : thisPage;\n\n\t\t} else {\n\t\t\tif (pageLink.indexOf('section') > -1) {\n\t\t\t\ttempStartIndex.push(0);\n\t\t\t\ttempStartIndex.push(pageLink.indexOf('section'));\n\t\t\t\tthisPage = pageLink.substring(tempStartIndex[0], tempStartIndex[1]);\n\n\t\t\t\tif (pageLink.substring(tempStartIndex[1] + 7).indexOf('content') > -1) {\n\t\t\t\t\ttempStartIndex.push(pageLink.indexOf('content'));\n\t\t\t\t\tthisSection = parseInt(pageLink.substring(tempStartIndex[1] + 7, tempStartIndex[2]), 10);\n\t\t\t\t\tthisContent = parseInt(pageLink.substring(tempStartIndex[2] + 7), 10);\n\t\t\t\t} else {\n\t\t\t\t\tthisSection = parseInt(pageLink.substring(tempStartIndex[1] + 7), 10);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthisPage = pageLink;\n\t\t\t}\n\t\t}\n\n\t\treturn [thisPage, thisSection, thisContent];\n\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "7b5dbb68e4216be7e9e7172b741f47ec", "score": "0.60341656", "text": "function checkHash(){\n hash = document.location.hash;\n //console.log(\"IN CHECKHASH\");\n if(hash){\n \t var index;\n \t if((index = hash.indexOf(\"_\"))> -1){\n \t\t //hash = hash.substr(4, index-4);\n \t\t hash = hash.substr(4);\n \t }else{\n \t\t hash = hash.substr(4);\n \t }\n \n if(hash === prevHash){\n return;\n }\n console.log(\"HASH:\"+ hash);\n console.log(\"PREVHASH:\"+ prevHash);\n getHtml();\n clickedId = hash;\n prevHash = hash;\n\n }\n }", "title": "" }, { "docid": "641ac74471e68bdf02dc1da6bce864cd", "score": "0.60225195", "text": "function removeHashtags(params) {\n return params.startsWith('#')? params.slice(1) : params;\n}", "title": "" }, { "docid": "d38912c002ebebd9d1e499a88a53c377", "score": "0.6000415", "text": "function setStateFromHash(hash) {\n var hash = hash;\n hash = hash.replace('#', '');\n hash = hash.split(\"-\");\n // console.log(\"got v, h from hash: \", hash);\n if (hash !== \"\") {\n Reveal.slide(parseInt(hash[0]));\n console.log('did set state', hash);\n }\n}", "title": "" }, { "docid": "a5e1c72325d8d90828a0d25d3e080c41", "score": "0.5978456", "text": "function hashtag(linkify) {\n\t\tvar TT = linkify.scanner.TOKENS; // Text tokens\n\t\tvar MultiToken = linkify.parser.TOKENS.Base; // Base Multi token class\n\t\tvar S_START = linkify.parser.start;\n\n\t\tfunction HASHTAG(value) {\n\t\t\tthis.v = value;\n\t\t}\n\n\t\tlinkify.inherits(MultiToken, HASHTAG, {\n\t\t\ttype: 'hashtag',\n\t\t\tisLink: true\n\t\t});\n\n\t\tvar S_HASH = S_START.jump(TT.POUND);\n\t\tvar S_HASHTAG = new linkify.parser.State(HASHTAG);\n\n\t\tS_HASH.on(TT.DOMAIN, S_HASHTAG);\n\t\tS_HASH.on(TT.TLD, S_HASHTAG);\n\t\tS_HASH.on(TT.LOCALHOST, S_HASHTAG);\n\t}", "title": "" }, { "docid": "6ef6a2f0f35913600abb459f75119bc8", "score": "0.59631056", "text": "function getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n }", "title": "" }, { "docid": "6e46833b30df529206c4ff242b1e8b94", "score": "0.5956925", "text": "function stripHash(location) {\n return location.href.replace(/#.*/, '')\n}", "title": "" }, { "docid": "6e46833b30df529206c4ff242b1e8b94", "score": "0.5956925", "text": "function stripHash(location) {\n return location.href.replace(/#.*/, '')\n}", "title": "" }, { "docid": "70f4204563cb2854b31ddc8ae348cdc1", "score": "0.5951617", "text": "function getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n}", "title": "" }, { "docid": "4d39fc16d2d1cb871eb986d9a905c324", "score": "0.5948757", "text": "function appUrlHash() \n{\n\tvar hashParts = window.location.hash.replace(/\\//g, '.').substring(1).split(\".\");\n\t\n\treturn {\n\t\t\"func\": hashParts[0], \n\t\t\"arg\": hashParts[1]\n\t};\n}", "title": "" }, { "docid": "dd14fc4394f46d03b8a1fdae4bab03ac", "score": "0.59380794", "text": "function getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while (e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n }", "title": "" }, { "docid": "dfffc0b100ab1d48ea27a79a535e6969", "score": "0.59087694", "text": "getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n }", "title": "" }, { "docid": "dfffc0b100ab1d48ea27a79a535e6969", "score": "0.59087694", "text": "getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n }", "title": "" }, { "docid": "27d7399e47f3bea1d9eefcf5d9dc97f0", "score": "0.58754456", "text": "function getHashTagInfo(hashTag){ \n return twitter.config.get('search/tweets', { q: `#${hashTag}`, tweet_mode : \"extended\" }) \n}", "title": "" }, { "docid": "ab52c1a3d103c8f9073959f5cc8890f0", "score": "0.58744043", "text": "function getHashtag(){\n\t var hashTag = secretKeyField.value;\n\t hashTag = arrayze(hashTag);\n\t return hashTag;\n\t}", "title": "" }, { "docid": "ce4c18f16b86a6b63dc647f851eb317c", "score": "0.58689684", "text": "function readURL() {\n\n\t\tvar hash = window.location.hash;\n\n\t\t// Attempt to parse the hash as either an index or name\n\t\tvar bits = hash.slice( 2 ).split( '/' ),\n\t\t\tname = hash.replace( /#|\\//gi, '' );\n\n\t\t// If the first bit is invalid and there is a name we can\n\t\t// assume that this is a named link\n\t\tif( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {\n\t\t\t// Find the slide with the specified name\n\t\t\tvar element = document.querySelector( '#' + name );\n\n\t\t\tif( element ) {\n\t\t\t\t// Find the position of the named slide and navigate to it\n\t\t\t\tvar indices = Reveal.getIndices( element );\n\t\t\t\tslide( indices.h, indices.v );\n\t\t\t}\n\t\t\t// If the slide doesn't exist, navigate to the current slide\n\t\t\telse {\n\t\t\t\tslide( indexh || 0, indexv || 0 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Read the index components of the hash\n\t\t\tvar h = parseInt( bits[0], 10 ) || 0,\n\t\t\t\tv = parseInt( bits[1], 10 ) || 0;\n\n\t\t\tif( h !== indexh || v !== indexv ) {\n\t\t\t\tslide( h, v );\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "ce4c18f16b86a6b63dc647f851eb317c", "score": "0.58689684", "text": "function readURL() {\n\n\t\tvar hash = window.location.hash;\n\n\t\t// Attempt to parse the hash as either an index or name\n\t\tvar bits = hash.slice( 2 ).split( '/' ),\n\t\t\tname = hash.replace( /#|\\//gi, '' );\n\n\t\t// If the first bit is invalid and there is a name we can\n\t\t// assume that this is a named link\n\t\tif( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {\n\t\t\t// Find the slide with the specified name\n\t\t\tvar element = document.querySelector( '#' + name );\n\n\t\t\tif( element ) {\n\t\t\t\t// Find the position of the named slide and navigate to it\n\t\t\t\tvar indices = Reveal.getIndices( element );\n\t\t\t\tslide( indices.h, indices.v );\n\t\t\t}\n\t\t\t// If the slide doesn't exist, navigate to the current slide\n\t\t\telse {\n\t\t\t\tslide( indexh || 0, indexv || 0 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Read the index components of the hash\n\t\t\tvar h = parseInt( bits[0], 10 ) || 0,\n\t\t\t\tv = parseInt( bits[1], 10 ) || 0;\n\n\t\t\tif( h !== indexh || v !== indexv ) {\n\t\t\t\tslide( h, v );\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "0fa6f796b76f4bbe18d897318c18ccd6", "score": "0.58663845", "text": "function formatHash(hash, bRemoveId){\n\t\t\tvar sRes = hash, iSharpIndex = hash ? hash.indexOf(\"#\") : -1;\n\n\t\t\tif (iSharpIndex === 0) {\n\t\t\t\tsRes = sRes.slice(iSharpIndex + 1);\n\t\t\t}\n\n\t\t\tif (bRemoveId) {\n\t\t\t\tsRes = sRes.replace(rIdRegex, \"\");\n\t\t\t}\n\n\t\t\treturn sRes;\n\t\t}", "title": "" }, { "docid": "1eb440c12f5064a1d1ffe0e7e4d48d86", "score": "0.5852814", "text": "getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n e = r.exec(q)\n while (e) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n e = r.exec(q);\n }\n return hashParams;\n }", "title": "" }, { "docid": "b0b8f7a2e596541024da9942a324d5ae", "score": "0.58521116", "text": "function readURL() {\n\n\t\tvar hash = window.location.hash;\n\n\t\t// Attempt to parse the hash as either an index or name\n\t\tvar bits = hash.slice( 2 ).split( '/' ),\n\t\t\tname = hash.replace( /#|\\//gi, '' );\n\n\t\t// If the first bit is invalid and there is a name we can\n\t\t// assume that this is a named link\n\t\tif( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {\n\t\t\tvar element;\n\n\t\t\t// Ensure the named link is a valid HTML ID attribute\n\t\t\tif( /^[a-zA-Z][\\w:.-]*$/.test( name ) ) {\n\t\t\t\t// Find the slide with the specified ID\n\t\t\t\telement = document.getElementById( name );\n\t\t\t}\n\n\t\t\tif( element ) {\n\t\t\t\t// Find the position of the named slide and navigate to it\n\t\t\t\tvar indices = Reveal.getIndices( element );\n\t\t\t\tslide( indices.h, indices.v );\n\t\t\t}\n\t\t\t// If the slide doesn't exist, navigate to the current slide\n\t\t\telse {\n\t\t\t\tslide( indexh || 0, indexv || 0 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Read the index components of the hash\n\t\t\tvar h = parseInt( bits[0], 10 ) || 0,\n\t\t\t\tv = parseInt( bits[1], 10 ) || 0;\n\n\t\t\tif( h !== indexh || v !== indexv ) {\n\t\t\t\tslide( h, v );\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "b0b8f7a2e596541024da9942a324d5ae", "score": "0.58521116", "text": "function readURL() {\n\n\t\tvar hash = window.location.hash;\n\n\t\t// Attempt to parse the hash as either an index or name\n\t\tvar bits = hash.slice( 2 ).split( '/' ),\n\t\t\tname = hash.replace( /#|\\//gi, '' );\n\n\t\t// If the first bit is invalid and there is a name we can\n\t\t// assume that this is a named link\n\t\tif( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {\n\t\t\tvar element;\n\n\t\t\t// Ensure the named link is a valid HTML ID attribute\n\t\t\tif( /^[a-zA-Z][\\w:.-]*$/.test( name ) ) {\n\t\t\t\t// Find the slide with the specified ID\n\t\t\t\telement = document.getElementById( name );\n\t\t\t}\n\n\t\t\tif( element ) {\n\t\t\t\t// Find the position of the named slide and navigate to it\n\t\t\t\tvar indices = Reveal.getIndices( element );\n\t\t\t\tslide( indices.h, indices.v );\n\t\t\t}\n\t\t\t// If the slide doesn't exist, navigate to the current slide\n\t\t\telse {\n\t\t\t\tslide( indexh || 0, indexv || 0 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Read the index components of the hash\n\t\t\tvar h = parseInt( bits[0], 10 ) || 0,\n\t\t\t\tv = parseInt( bits[1], 10 ) || 0;\n\n\t\t\tif( h !== indexh || v !== indexv ) {\n\t\t\t\tslide( h, v );\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "13cdf51909b26a7397aeaac00c7b8040", "score": "0.58519834", "text": "function getHashParams(param) {\r\n var url_string = window.location.href;\r\n var url = new URL(url_string);\r\n var c = url.searchParams.get(param);\r\n return c;\r\n }", "title": "" }, { "docid": "9780b68d306abbec65f997fd2aff10cc", "score": "0.5848685", "text": "getHashParams() {\n var hashParams = {};\n var e,\n r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n e = r.exec(q);\n while (e) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n e = r.exec(q);\n }\n return hashParams;\n }", "title": "" }, { "docid": "b61cb625aec6f96ed81b0f4a42b6c722", "score": "0.5847419", "text": "function getName( url ) {\n var hashPos = url.lastIndexOf ( '#' );\n return url.substring( hashPos + 1 );\n }", "title": "" }, { "docid": "04f669c82404d2ab88b35452a537315e", "score": "0.58465564", "text": "function get_fragment( url ) {\n return url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "title": "" }, { "docid": "04f669c82404d2ab88b35452a537315e", "score": "0.58465564", "text": "function get_fragment( url ) {\n return url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "title": "" }, { "docid": "04f669c82404d2ab88b35452a537315e", "score": "0.58465564", "text": "function get_fragment( url ) {\n return url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "title": "" }, { "docid": "499b40edf227efdff619a73e8fa0d923", "score": "0.58368266", "text": "function getHash(elem){\n return $(elem).find('a').attr('href');\n}", "title": "" }, { "docid": "e5ceff5e12df9e8d69155c1e2dfade1d", "score": "0.5799168", "text": "function hashString(name, notDecoded){\n return anyString(name, notDecoded, window.location.hash, '#');\n }", "title": "" }, { "docid": "d5ee15a7dcc4cf15b37070434d7b3b49", "score": "0.5797833", "text": "function processHash(hash) {\n if (!hash || typeof hash !== 'string') {\n return {\n data: '',\n entity: '',\n view: ''\n };\n }\n\n var hashSplit = hash.split('(');\n var hashSplitLength = hashSplit.length;\n var routeStart;\n var data = undefined;\n var entity = '';\n var view = '';\n\n // No split\n if (hashSplitLength === 1) {\n return {\n data: data,\n entity: entity,\n view: hash.split('/')[1]\n };\n }\n\n var hasView = function (hash) {\n var i = 2; // skip initial /\n while (i < hash.length) {\n if (hash[i] === '/') {\n return true;\n }\n else if (hash[i] === '(') {\n return false;\n }\n i = i + 1;\n }\n return false;\n }(hash);\n\n // pull out a view if necessary\n if (hasView) {\n view = hash.split('/')[1];\n }\n\n // now deal with entities if any\n if (hashSplitLength > 1) {\n // (1234)/whatever(1235)\n var startOfRoute = hashSplit[hashSplitLength - 2].split(')');\n if (startOfRoute.length > 1) {\n // we only take the last entity\n routeStart = startOfRoute[1]; // /whatever(1235)\n entity = routeStart.split('/')[1];\n }\n else {\n // has at least an enity and possible view\n routeStart = startOfRoute[0];\n entity = hasView ? routeStart.split('/')[2] : routeStart.split('/')[1];\n }\n\n // pattern to parse on\n var routePattern = '/:ignore*:' + routeStart + '({id})';\n\n // create a new crossroads router\n var crossroadsRouter = crossroads.create();\n // register the url being passed in as a route\n crossroadsRouter.addRoute(routePattern, function (urlStart, id) {\n // set the data object to be the object within the brackets (also removing the surrounding quotes)\n data = id.replace(/'/g, '');\n });\n // parse the route with the hash\n crossroadsRouter.parse(hash);\n }\n\n return {\n data: data,\n entity: entity,\n view: view\n };\n}", "title": "" }, { "docid": "e9ca9e8d1e42fae7ce1bf286ce0bf308", "score": "0.5792214", "text": "function get_hash_param(key, default_value) {\n if(is_empty(default_value)) {\n default_value = \"\";\n }\n var hash_key = key + \"=\"\n var url = window.location.toString();\n // find start index of hash\n var hash_start_index = url.indexOf(hash_key);\n if(hash_start_index == -1) {\n if(!is_empty(default_value)) {\n set_hash_param(key, default_value);\n }\n return default_value;\n }\n\n var value_start_index = hash_start_index + hash_key.length;\n\n // find the next index of next '#' symbol, use url length if there is no next symbol\n var value_end_index = url.indexOf(\"#\", value_start_index);\n if(value_end_index == -1) {\n value_end_index = url.length;\n }\n var param = url.substring(value_start_index, value_end_index);\n return decodeURIComponent(param);\n}", "title": "" }, { "docid": "1e3c58d6cb62a4990a72579b18efaf5b", "score": "0.57870775", "text": "function addHashToUrl($url)\n{\n if ('' == $url || undefined == $url) {\n $url = '_'; // it is empty hash because if put empty string here then browser will scroll to top of page\n }\n $hash = $url.replace(/^.*#/, '');\n var $fx, $node = jQuery('#' + $hash);\n if ($node.length) {\n $fx = jQuery('<div></div>')\n .css({\n position:'absolute',\n visibility:'hidden',\n top: jQuery(window).scrollTop() + 'px'\n })\n .attr('id', $hash)\n .appendTo(document.body);\n $node.attr('id', '');\n }\n document.location.hash = $hash;\n if ($node.length) {\n $fx.remove();\n $node.attr('id', $hash);\n }\n}", "title": "" }, { "docid": "6f67301c16346a4a790610e470d3eeda", "score": "0.578535", "text": "function get_url_var(){\n\t\tvar hash = location.slice(is_query + 1);\n\t\treturn decodeURIComponent( hash );\n\t}", "title": "" }, { "docid": "9aac96897f26626d8b639095a721d37e", "score": "0.578209", "text": "function findHashTag (s){\n if (s.indexOf(\"hashtag\") != -1){\n var res = s.replace(\"hashtag\", \"#\");\n var chunks = res.split(/#/);\n var arr = [chunks.shift(), chunks.join('')];\n var myHashtag = arr[1];\n var split = myHashtag.split(' ');\n //iterate through each of the \"words\" and capitalize them\n for (var i = 0, len = split.length; i < len; i++) {\n split[i] = split[i].charAt(0).toUpperCase() + split[i].slice(1);\n }\n myLabel= split.join(' ');\n var saying = arr[0]+ \"#\"+myLabel.replace(/\\s/g, '');\n\n T.post('statuses/update', { status:saying}, function(err, data, response) {\n console.log(data)\n })\n\n \n } else { \n T.post('statuses/update', { status:s}, function(err, data, response) {\n console.log(data) })\n }\n}", "title": "" }, { "docid": "a030cefd8ffe84756e9ba8cc24f9f38a", "score": "0.5780373", "text": "function checkHash() {\n\n\t hash = window.location.hash.substr(1); \n\t console.log(hash);\n\t if (hash !== '' && hash !== '#' ) {\n\t \tvar valid = validateHash();\n\t \t// validate hash\n\t \tif ( valid ) {\n\t \t\tconsole.log('valid hash');\n\t \t\t$('#message').html('Generating export options and content...');\n\t\t \t// generate page\n\t \t\tsetTimeout(readHash, 200);\n\n\t \t} else {\n\t \t\tconsole.log('not a valid hash');\n\t \t\t$('#message').html('Not a valid link.');\n\t \t\treturn;\n\t \t}\n\n \t} else {\n \t\t$('#message').html('Not a valid link.');\n \t}\n \t}", "title": "" }, { "docid": "14a0993c425452dd29aa264cd572fb11", "score": "0.5692519", "text": "function sacarHash()\n{\n //console.log(\"remove hash\");\n //hash HTML\n var hashA = listHash();\n var hashFinal;\n\tif (hashA.length > 1)\n\t{\n\t\thashA = hashA.splice(0, hashA.length-1);\n\t\tvar i = hashA.length-1;\n\t\tvar hashF = '';\n\t\thashA.forEach(function(hash)\n\t\t{\n\t\t\thashF += hash;\n\t\t\tif (i != 0)\n\t\t\t{\n\t\t\t\thashF += '/';\n\t\t\t}\n\t\t\ti--;\n\t\t});\n hashFinal = hashF;\n\t}\n\telse\n\t{\n hashFinal = 'home';\n\t}\n setHashPost(hashFinal);\n}", "title": "" }, { "docid": "a997369b14768499139f1ac65fe29778", "score": "0.5684847", "text": "function filterUrlHash(t)\r\n\t\t\t{\r\n\t\t\t\tvar te = 0;\r\n\t\t\t\tfor (var i=0;i<=s;i=i+1) if (option[15]/*numericText*/[i] == t) te = i;\r\n\t\t\t\treturn te;\r\n\t\t\t}", "title": "" } ]
bfe456aefc5118abfc53e31b0f6c11bc
Picks a random key from the db TODO: maybe create a cache table
[ { "docid": "ccf8d518d5c7ef1a6791c28588f3ed62", "score": "0.0", "text": "pickRandomWord(opts, cb) {\n if (typeof opts == 'function') {\n cb = opts;\n opts = {\n order: 1\n };\n }\n else if (typeof opts == 'number') {\n opts = {\n order: opts\n };\n }\n\n var queryParams = [ opts.order, this.getRandomDecimal() ],\n hasTokens = opts.tokens && opts.tokens.length;\n\n if (hasTokens) {\n queryParams.push(opts.tokens)\n }\n\n if (opts.match) {\n queryParams.push(opts.match)\n }\n\n this.queryRow(\n `\n SELECT\n key\n FROM (\n SELECT\n key,\n (\n sum(weight) OVER (ORDER BY key)::decimal /\n sum(weight) OVER ()\n ) AS cumm_weight\n FROM\n (\n SELECT key, sum(weight) AS weight\n FROM markov\n WHERE\n namespace = '${this.namespace}' AND\n markov_order = $1\n ${hasTokens ? \" AND key = ANY ( $3 ) \" : ''}\n ${opts.match ? \" AND to_tsvector('english', key) @@ to_tsquery('english', $3) \" : ''}\n GROUP BY\n key\n ) a\n ) result\n WHERE\n $2 <= cumm_weight\n LIMIT 1;\n `,\n queryParams,\n function(err, result) {\n cb(err, result ? result.key : undefined);\n }\n );\n }", "title": "" } ]
[ { "docid": "910954c4f82676ead8451e9c7b55db09", "score": "0.7553286", "text": "function getRandomKey() {\n return Math.floor(Math.random() * 4);\n}", "title": "" }, { "docid": "ff0e56bb625986bb35a5ea3b0f139ccd", "score": "0.75284845", "text": "function generateKey() {\n var i = Math.floor(Math.random() * 4);\n return KEYS[i];\n}", "title": "" }, { "docid": "c565bb2ba3ca19c1d30891e663d192e1", "score": "0.7360589", "text": "randomKey(){\n return Math.random();\n }", "title": "" }, { "docid": "1361f82099cfaa789014e5bf443f2af1", "score": "0.7246739", "text": "function randomKey() {\n\n return `randomKey_${Math.random().toString(32).slice(2)}`;\n}", "title": "" }, { "docid": "388393e8120126ccfe1727683b0e68d3", "score": "0.7131036", "text": "function generateRandKey() {\n // body...\n}", "title": "" }, { "docid": "9d08d262f5307797bc11357bb8aa3718", "score": "0.6966004", "text": "function getRandomKey(memory) {\n 'use strict';\n\n var keys = Object.keys(memory);\n return keys[Math.floor(Math.random() * keys.length)];\n}", "title": "" }, { "docid": "0f413275626b3d50f892570a24047328", "score": "0.6944858", "text": "randomkey() {\n return this.redisClientProxy('randomkey', arguments);\n }", "title": "" }, { "docid": "1301e9f239ebbc23f2346cda8ab41430", "score": "0.6944203", "text": "function getRandomKey(collection) {\n let keys = Array.from(collection.keys());\n return keys[Math.floor(Math.random() * keys.length)];\n}", "title": "" }, { "docid": "01d90a1430ac1155ef3ab84639428c7f", "score": "0.6927405", "text": "chooseKey(callback) {\n let key = crypto.randomBytes(8).toString('hex');\n let _this = this;\n this.store.get(key, (ret) => {\n if (ret) _this.chooseKey(callback);\n else callback(key);\n }, true); // Don't bump expirations when key searching\n }", "title": "" }, { "docid": "5cfc24284f7f93e3ad4d8d91a1dd0f3f", "score": "0.67947614", "text": "function generateKey() {\n var number = Math.floor(Math.random() * 100000); // Make sure it starts with a varter - j is first varter of my name :)\n\n return 'j' + number.toString(36);\n }", "title": "" }, { "docid": "aac2e77bd8666233c4a66f6cd9927504", "score": "0.66808534", "text": "function generateRandomString() {\n let result = Math.random().toString(36).slice(6);\n return Object.keys(urlDatabase).includes(result) ? generateRandomString : result;\n}", "title": "" }, { "docid": "16b8983574e4bd0bd34d39c22326ba40", "score": "0.6627978", "text": "function getSearchKey() {\n let searchKeys = require('./data.js').searchKeys;\n return searchKeys[Math.floor(Math.random() * searchKeys.length)].toLowerCase();\n }", "title": "" }, { "docid": "724172f17ea24d2da99d95f5684d1a30", "score": "0.65757877", "text": "function getRandomValueFromKey(key, dict) {\n if (dict[key] == undefined) {\n return null;\n }\n return dict[key][getRandomInt(dict[key].length)]\n}", "title": "" }, { "docid": "16f4160c53d0029a307e51c648ece368", "score": "0.65694416", "text": "function randomKey(dict) {\n return Object.keys(dict)[Math.floor(Math.random() * Object.keys(dict).length)];\n}", "title": "" }, { "docid": "cd784383d4ffc90e00cfc956b86981e8", "score": "0.6508408", "text": "datasetKeyProvider(){\n return Math.floor(Math.random()*100);\n }", "title": "" }, { "docid": "82b0bb2d0b3e8e596bfbe72cebb44dcd", "score": "0.6480494", "text": "function generateKey()\n{\n\tvar index = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\tvar key = '';\n\tfor( var i = 1; i < 25; i++ ) { key += index[Math.floor( Math.random() * index.length )] };\n\treturn key;\n}", "title": "" }, { "docid": "2d44d8a2ecd4888ea01687a37b26dd93", "score": "0.64568824", "text": "function GetRandomKey() {\n var result = \"\";\n for (var i = 0; i < 7; i++) {\n result += String.fromCharCode(65 + Math.round(Math.random() * 25));\n }\n return result;\n}", "title": "" }, { "docid": "3d21611d32b08fb6a59f45a8fd6162f5", "score": "0.6455815", "text": "function random_id() {\n var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26));\n return randLetter + Date.now();\n}", "title": "" }, { "docid": "fd68ac9c039af36c5431b84644731a06", "score": "0.6431702", "text": "function getRandId() {\n return Math.random().toString( 36 ).slice( 2 );\n }", "title": "" }, { "docid": "192026e98a8d19469b9bb93d3fb6e6ca", "score": "0.64298797", "text": "function rand_gen(){\n rand_key = keys[Math.floor(keys.length * Math.random())];\n rand_value = cards_value[rand_key];\n return {rand_key, rand_value};\n}", "title": "" }, { "docid": "c84909a1971eb31ea15fe6f0a790b167", "score": "0.63692755", "text": "function keyGen() {\n let number = Math.floor(100000 + Math.random() * 900000 + user);\n user++;\n return number;\n}", "title": "" }, { "docid": "a2da7bc2adf7afb42e8155ad4fae7394", "score": "0.6306232", "text": "getRandom() {\n let completeKeys = getCompleteKeys(this.records);\n let allowedKeys = getAllowedKeys(completeKeys);\n let key = randomMember(allowedKeys);\n console.log(\"emogi in text: \" + key);\n return getImage(this.records, key);\n }", "title": "" }, { "docid": "f5eb540a019229cfc29b4e226fc69627", "score": "0.6261459", "text": "function pickRandomGame() {\n return db(\"games\").orderByRaw(\"RANDOM()\").limit(1);\n}", "title": "" }, { "docid": "aff1bcdcad1f9c77fa456aaad4b348fa", "score": "0.62421215", "text": "generateKey(){\n\t\tlet key1 = Math.random().toString(36).slice(2);\n\t\tlet key2 = Math.random().toString(36).slice(2);\n\n\t\treturn key1 + key2;\n\t}", "title": "" }, { "docid": "e98148c5c5badb261579ee2184c5dee3", "score": "0.6216176", "text": "function key() {\n const chars = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n let key = [];\n for (let i = 0; i < 32; i++) {\n key.push(chars.charAt(Math.floor(Math.random() * chars.length)));\n };\n return key.join(\"\");\n}", "title": "" }, { "docid": "a05596cb025c82bfd2f0078b9910f4ef", "score": "0.61916476", "text": "function random(){\n return random.get();\n }", "title": "" }, { "docid": "666b5f0ceebc74d4d77ec48ddc6cb01a", "score": "0.61893916", "text": "function getRandomColourKey(oldKey) {\n // Taken from StackOverflow: https://stackoverflow.com/questions/2532218/pick-random-property-from-a-javascript-object\n let keys = Object.keys(colours);\n let randKey;\n do {\n randKey = keys[keys.length * Math.random() << 0];\n } while (randKey === oldKey);\n return randKey;\n}", "title": "" }, { "docid": "8d99bcb15cb13837114d4b9a25913781", "score": "0.61666757", "text": "static getNewId() {\n const randomId = [...Array(100).keys()]\n .sort(() => Math.random() * 3 - 1)\n .slice(0, 3)\n .join(\"\");\n return Number(randomId);\n }", "title": "" }, { "docid": "a68f5f7bc82d0e269738da313de15c64", "score": "0.6157184", "text": "function RandomUserIndex() {\n\tvar keyArr = Object.keys(users);\n\treturn keyArr[Math.floor(Math.random() * (keyArr.length))];\n}", "title": "" }, { "docid": "85afd0b731870d90cf95c50aed1d770f", "score": "0.6154594", "text": "function createKey()\n{\n var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');\n var key = ''; \n for(var i = 0; i < 32; i ++)\n { \n key += chars[Math.floor(Math.random() * chars.length)];\n } \n $('#key').val(key);\n return false;\n}", "title": "" }, { "docid": "52fc95d04b35f5eb589e31999a74b139", "score": "0.61433625", "text": "randomId() {\n return Date.now().toString(36).substr(2) + Math.random().toString(36).substr(2);\n }", "title": "" }, { "docid": "2c2db2be55acf94ab5289bcb9dbdaa68", "score": "0.61267245", "text": "function generate_id() {\n\treturn Math.floor(Math.random(Date.now()) * 1000000000000);\n}", "title": "" }, { "docid": "d7293cf49e42bbac7ec6f618a81d1aa1", "score": "0.6120044", "text": "function getRandomId() {\n return Math.random().toString(36).substring(2, 7);\n}", "title": "" }, { "docid": "3407f5342683b8942fcb5c3f270ec9a5", "score": "0.6091161", "text": "function getRandomId(){\n\t// ids cannot start with a number\n\treturn 'id' + Math.random().toString(36).split('.')[1]\n}", "title": "" }, { "docid": "a690b45afb931ca034c7e46f3e962ce5", "score": "0.6077664", "text": "function generateKey() {\n return key = crypto.randomBytes(32);\n}", "title": "" }, { "docid": "0191c31eca2ad8273c17bdfe3e5f2bbb", "score": "0.6074422", "text": "function generateRandomKeys() {\r\n const MIN = 65;\r\n const MAX = 90;\r\n return Math.round(Math.random() * (MAX - MIN) + MIN);\r\n}", "title": "" }, { "docid": "c90e56ec0ead94f3c05e1ab3a86ab42e", "score": "0.6074319", "text": "function getRandomQuote () {\n\n return quotes[getRandomNumber()];\n\n}", "title": "" }, { "docid": "8d52148e5c2c7f60cd13e3f46e43d87f", "score": "0.6058792", "text": "generateRoomKey(){\n\n let key;\n\n do {\n // Generate a new room code\n key = Util.generateKeyString(5);\n\n // If the room code contains any banned words or is\n // already in use, regenerate a new code\n } while (this.checkIsInDictionary(key) || this.checkIsExistingKey(key));\n\n return key;\n }", "title": "" }, { "docid": "0ea152d1a647fe8c5330186b1aca1b1c", "score": "0.6046881", "text": "function getRandomIdx(){\n\treturn Math.floor(Math.random() * quotes.length);\n}", "title": "" }, { "docid": "3ff81f235d61309903f6846f93427c4d", "score": "0.60458404", "text": "function key(n,callback){var self=this;var promise=new Promise(function(resolve,reject){self.ready().then(function(){var dbInfo=self._dbInfo;dbInfo.db.transaction(function(t){t.executeSql('SELECT key FROM '+dbInfo.storeName+' WHERE id = ? LIMIT 1',[n+1],function(t,results){var result=results.rows.length?results.rows.item(0).key:null;resolve(result);},function(t,error){reject(error);});});})['catch'](reject);});executeCallback(promise,callback);return promise;}", "title": "" }, { "docid": "c403e200a54867f9e4fdea603a6b9878", "score": "0.60434073", "text": "function generateKey (){\n var key = keygen._({\n length: 16\n });\n\n return key;\n}", "title": "" }, { "docid": "7bb6561e4acf70861258adfc6194cad4", "score": "0.60414714", "text": "function generateKey(seed) {\n var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxy'.split('');\n var length = 12;\n if (seed) {\n \tlength = seed.length;\n }\n var str = '';\n for (var i = 0; i < length; i++) {\n \tvar random = Math.random();\n \tif (seed) {\n \t\tvar c = seed.charCodeAt(i);\n \t\tif (c == 0) random = 0;\n \t\telse random = 1 / c;\n \t}\n str += chars[Math.floor(97*random * chars.length) % chars.length];\n }\n return str;\n}", "title": "" }, { "docid": "b00b78a56c21a0c6074fccbd74a88abf", "score": "0.6027154", "text": "function randNumber() { return Math.random() }", "title": "" }, { "docid": "2d13204ffe647aa08bc2ae933df6f804", "score": "0.6022164", "text": "function generatePlayerKey(playerId) {\n //TO DO: Fill in code here\n}", "title": "" }, { "docid": "b3937a8917c841e859e52f241308be6a", "score": "0.60067314", "text": "function generate(length, include_special) {\n\tlet key = \"\";\n\tconst date = new Date().getTime();\n\tlet char_list =\n\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\tif (include_special) {\n\t\tchar_list =\n\t\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%\";\n\t}\n\n\tfor (var i = 0; i < length; i++) {\n\t\tkey += char_list.charAt(Math.floor(Math.random() * char_list.length));\n\t}\n\tglobal_key = key + date;\n}", "title": "" }, { "docid": "a91452051c8d9af70b2da795d35b594d", "score": "0.5985045", "text": "function getRandomThikr(){\r\n return athkar[Math.floor(Math.random() * athkar.length)];\r\n }", "title": "" }, { "docid": "60e7b75014fe1ed3c7f9ebe21799f020", "score": "0.5968328", "text": "getRandomID() {\n\t\treturn `uid${ Math.random().toString(36).substr(2, 9) }`;\n\t}", "title": "" }, { "docid": "4c0862b6d9b04b4f2545da2ab3d16aa9", "score": "0.5946838", "text": "function getRandom() { return Math.random(); }", "title": "" }, { "docid": "c3d0bbc4c46a184cc08175635a33a993", "score": "0.591516", "text": "function randomGameCode() {\n return Math.floor(10000 + Math.random() * 90000);\n }", "title": "" }, { "docid": "a8a0d4a342c6d7c855637e61a710c473", "score": "0.5912241", "text": "function getRandomString() { return Math.random().toString(36).substring(2); }", "title": "" }, { "docid": "66fbf8dd020b3a010d4fbfb18e105338", "score": "0.5911895", "text": "function generateID (){\n return Math.floor(Math.random() * 1000000);\n\n}", "title": "" }, { "docid": "e41db0e8bbb8f5ede7c0457602f512de", "score": "0.5911181", "text": "function generateRandomId() {\n return '_' + Math.random().toString(36).substr(2, 12);\n}", "title": "" }, { "docid": "615e7683a566958f133b99ff72418d15", "score": "0.591086", "text": "function rand()\n{\n return Math.floor(Math.random() * 26) + 1;\n}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "cb08a976c1171b4321969044c8fa9751", "score": "0.5910751", "text": "function getKeyFromID(id){return'.'+id;}", "title": "" }, { "docid": "15d08637210511d2e4dfb9b2db1bc0cd", "score": "0.59105295", "text": "function random_id() {\n var result = '';\n chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n for (var i = 26; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n}", "title": "" }, { "docid": "6f457d0a192b836c7c65efcc44d63dea", "score": "0.59103256", "text": "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4); // append a 'a' because neo gets mad\n\n newId = \"a\".concat(newId); // ensure not already used\n\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n\n return id();\n }", "title": "" }, { "docid": "d411cb0055cd86ada0660fd8a54bc445", "score": "0.59084153", "text": "function genID() { \n return (+new Date() + Math.floor(Math.random() * 999999)).toString(36); \n}", "title": "" }, { "docid": "7d55aaf4927ab5a5519e0f3181312e2a", "score": "0.59028214", "text": "static getGuestKey(generateNew = true) {\n let key = window.localStorage.getItem(GUEST_KEY);\n if (key) return key;\n\n if (generateNew) {\n key =\n \"devdao_guest_user_\" +\n Date.now() +\n \"_\" +\n Math.floor(Math.random() * 100);\n window.localStorage.setItem(GUEST_KEY, key);\n return key;\n } else return \"\";\n }", "title": "" }, { "docid": "87b6d9374c75325bdea09bf80e29924d", "score": "0.589758", "text": "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "title": "" }, { "docid": "6888cc41939ae7525363fa8a6932ceb7", "score": "0.58760196", "text": "async function randomID(counter = 0) {\n if (counter > MAX_TRIES) {\n return null;\n }\n await bluebird.delay(10);\n const id = haiku();\n return id in users ? randomID(counter + 1) : id;\n}", "title": "" }, { "docid": "8570c224822dab49f7d96e877ae25876", "score": "0.5866421", "text": "function getRandomNumber() {\n return String.fromCharCode(Math.floor(Math.random()*10) + 48);\n }", "title": "" }, { "docid": "ca24f2b7760bb37680a3e4678b94aa55", "score": "0.5865168", "text": "function createKey()\n{\n var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');\n var key = ''; \n for(var i = 0; i < 32; i ++)\n { \n key += chars[Math.floor(Math.random() * chars.length)];\n } \n $('#key').val(key);\n\n $('#key').css({'margin-bottom' : 0, 'border-color' : ''});\n $('#keyLabel').remove();\n\n return false;\n}", "title": "" }, { "docid": "307ae190d5003031100f62945b485c81", "score": "0.58644265", "text": "chooseRandomVerb() {\n const verbList = this.props.getVerbList();\n\n // Choose a random verb from the whole database if the verb list is empty\n if (verbList.length <= 0) {\n let randomKey = Lefff[verbs[verbs.length * Math.random() << 0]];\n\n // Prevent selecting verbs with incomplete data\n while (verbs.some(key => verbs[key] === null))\n randomKey = Lefff[verbs[verbs.length * Math.random() << 0]];\n \n return randomKey.W[0];\n } else {\n // Choose a random verb from the user inputted verb list\n let randomKey = verbList[Math.floor(Math.random() * verbList.length)];\n return randomKey;\n }\n }", "title": "" }, { "docid": "d7dfbdea544c4d3176ef0c7eb24a8916", "score": "0.5861702", "text": "function getRandomQuote(){\n var randomNumber = Math.floor( Math.random() * 9 );\n return quotes[randomNumber];\n}", "title": "" }, { "docid": "337b9ab186cbf1d7ee1079276dfbdc3d", "score": "0.58508503", "text": "function id() {\r\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\r\n newId = `a${newId}`;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "title": "" }, { "docid": "3d4f8e58f412acc18465a00fb16336d7", "score": "0.58479387", "text": "function generateKey() {\r\n var key = [];\r\n for (var i = 0; i < 16; i++) {\r\n key.push(Math.floor(Math.random() * 256));\r\n }\r\n chrome.storage.local.get('password_storage', function(storage) {\r\n storage[\"password_storage\"] = {};\r\n storage[\"password_storage\"][\"account_database\"] = {};\r\n storage[\"password_storage\"][\"password_key\"] = key;\r\n chrome.storage.local.set(storage);\r\n })\r\n}", "title": "" }, { "docid": "5c67c08d3ef82982ad8d387badda6fc5", "score": "0.5845056", "text": "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "title": "" }, { "docid": "5c67c08d3ef82982ad8d387badda6fc5", "score": "0.5845056", "text": "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "title": "" }, { "docid": "5c67c08d3ef82982ad8d387badda6fc5", "score": "0.5845056", "text": "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "title": "" }, { "docid": "5c67c08d3ef82982ad8d387badda6fc5", "score": "0.5845056", "text": "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "title": "" }, { "docid": "ed0f7d0c20020010efa37fccb4f3392e", "score": "0.5844927", "text": "function selectRandomChuckMeme() {\n let x = Math.floor(\n Math.random() * Object.keys(chuckTemplateIDs).length\n );\n return chuckTemplateIDs[x];\n}", "title": "" }, { "docid": "3359f51bbb2d261a2bf1f0bb5ea8460f", "score": "0.5838857", "text": "function id() {\r\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = `a${newId}`;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "title": "" }, { "docid": "3359f51bbb2d261a2bf1f0bb5ea8460f", "score": "0.5838857", "text": "function id() {\r\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = `a${newId}`;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "title": "" }, { "docid": "43f203f9b5edce93826a06a2420afd2b", "score": "0.5838133", "text": "generateJobKey() {\n let key;\n // N.B. not universally unique if queue is in-memory.\n // assumes rare mishaps are ok.\n do {\n key = this.keyPrefix + idGen.randomish(0, 9999999999)\n } while (this.queue.has(key));\n\n return key;\n }", "title": "" }, { "docid": "4a0e64e992fb46c86487f6fe11a6196a", "score": "0.5835916", "text": "genId() {\n return \"id\" + (Math.random()+\"\").substring(2);\n }", "title": "" }, { "docid": "11ff078339ba5afd3f6fec1b3b5489bd", "score": "0.5835063", "text": "function urlKeyGen(bidID, playerID) {\n var length = 7;\n var charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n var urlkey = (\"00000\" + bidID).slice(-4) + playerID;\n for (var i = 0, n = charset.length; i < length; ++i) {\n urlkey += charset.charAt(Math.floor(Math.random() * n));\n }\n return urlkey;\n}", "title": "" }, { "docid": "2aa8638f04d4ec90d4d6f39b787911c3", "score": "0.58324254", "text": "function newId() {\n return Math.floor((Math.random() * 900000) + 100000);\n }", "title": "" }, { "docid": "fef1e7f4ce72a6ff30d8d4ef106408d5", "score": "0.5831753", "text": "function genKey(length){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < length; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "title": "" }, { "docid": "d902993c9c095a718a08197f8cfb66ee", "score": "0.5828692", "text": "function getRandomNumber() {\n\treturn String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n}", "title": "" }, { "docid": "d902993c9c095a718a08197f8cfb66ee", "score": "0.5828692", "text": "function getRandomNumber() {\n\treturn String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n}", "title": "" }, { "docid": "d902993c9c095a718a08197f8cfb66ee", "score": "0.5828692", "text": "function getRandomNumber() {\n\treturn String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n}", "title": "" }, { "docid": "84f8cf5726902311d3ceb7a3d89703fb", "score": "0.58276254", "text": "function InitHashKeys(){\n\n var index = 0;\n\n for(index = 0; index < 14 * 120; ++index) {\n PieceKeys[index] = RAND_32();\n }\n\n SideKey = RAND_32();\n\n for(index = 0; index < 16; ++index) {\n CastleKeys[index] = RAND_32();\n }\n}", "title": "" }, { "docid": "e485def056525913aa18da7ea9fcd160", "score": "0.58248687", "text": "function randomCard(){\n \n return BlackJack['Card'][Math.floor(Math.random()*13)];\n\n}", "title": "" }, { "docid": "841ae876606aa6e82252842bf1932adf", "score": "0.58218175", "text": "function getRandomQuote(){\nlet random_number = Math.floor(Math.random() * 6);\nreturn quotes[random_number];\n}", "title": "" }, { "docid": "d99148d3000c7e4b25cca43071905ea7", "score": "0.58208835", "text": "function id () {\n return '_' + Math.random().toString(36).substr(2, 9);\n }", "title": "" }, { "docid": "046ccb160de6b9f829bd544faf8835d3", "score": "0.58176017", "text": "function getRand() {\n return Math.ceil(Math.random() * 100000) + new Date().getTime();\n}", "title": "" }, { "docid": "6bdb1fb2e1e33a75b552012902a2034c", "score": "0.58125687", "text": "function getRandomNumber() {\n return String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n}", "title": "" }, { "docid": "84622277a64b43d425fb051f47c11466", "score": "0.5788458", "text": "function randomNumber() {\n return String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n}", "title": "" }, { "docid": "2df5d4febc5dd9156e0d5e1a1b417a83", "score": "0.5786518", "text": "generateId() {\n return Math.round(Math.random() * 100000000);\n }", "title": "" }, { "docid": "180947f15e52bfbc8d3b1376321ac647", "score": "0.57778406", "text": "function getRandomQuote (){\n// Aqui genero un numero aleatorio entre 0 y 5\n var ramdomNumber = Math.floor( Math.random() * 5 );\n return quotes[ramdomNumber];\n}", "title": "" }, { "docid": "21008a725fd159692d7d1a542ba50926", "score": "0.57769674", "text": "function getRandomIdeaNmumber() {\n\treturn Math.floor(Math.random() * 10 + 1);\n}", "title": "" }, { "docid": "c316b76e88fd6de57664c47d29499c97", "score": "0.57741654", "text": "function getId(){\n\t\tvar x = 2147483648;\n\t\treturn Math.floor(Math.random() * x).toString(36) + Math.abs(Math.floor(Math.random() * x) ^ Date.now()).toString(36);\n\t}", "title": "" }, { "docid": "e304ae4e5b9f25bb652690ac6ca455ce", "score": "0.577157", "text": "function maakGetal(){\r\n\treturn Math.floor(Math.random()*9) + 1;\r\n}", "title": "" }, { "docid": "1c7350437a9883c460c30cf03c812f43", "score": "0.5770299", "text": "function getRandomNum() {\n return String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n }", "title": "" }, { "docid": "e36d95add32784744137cc268061cd6d", "score": "0.5770177", "text": "function selRandom()\r\n{\r\n var random=Math.floor(Math.random() * clrs.length);\r\n return clrs[random];\r\n}", "title": "" } ]
20e0c194b15c927e6dddc6a00d6f65cd
TXT SHOULD LINK TO JSON FILE FOR DISPLAYING
[ { "docid": "3cac92e6e6775a4ef972347257f9c82a", "score": "0.0", "text": "constructor(txt, font = 'Georgia') {\n\n super();\n\n this.text = txt;\n this.color = 0;\n this.textSize = 30;\n this.font = font;\n }", "title": "" } ]
[ { "docid": "44764762feaab6742231771bd67a8d7c", "score": "0.613222", "text": "function download(filename, text) {\n\t var element = document.createElement('a');\n\t element.setAttribute('href', 'data:text/json;charset=utf-8,' + encodeURIComponent(text));\n\t element.setAttribute('download', filename);\n\t\telement.style.display = 'none';\n\t document.body.appendChild(element);\n\t\telement.click();\n\t\tdocument.body.removeChild(element);\n\t}", "title": "" }, { "docid": "47116fce34af9fc41f1dd39fb81f1f7a", "score": "0.6105768", "text": "function saveJsonString(file) {\n let uc = encodeURIComponent(file.content);\n let hr = `data:application/json;charset=utf-8,${uc}`;\n let n = (file.name) ? file.name : \"saveJsonString.json\";\n let a = document.createElement(\"a\");\n a.setAttribute(\"download\", n);\n a.setAttribute(\"href\", hr);\n a.click();\n a.remove();\n return;\n}", "title": "" }, { "docid": "1e3992f68312299ad4c3ef522560c8b7", "score": "0.60463756", "text": "function print_new_json(){\n var fin = {\n \"nodes\" : nodes_,\n \"links\" : links_\n };\n $(\".texta\").text(JSON.stringify(fin));\n $(\".print_text\").css(\"display\",\"initial\");\n}", "title": "" }, { "docid": "1e3992f68312299ad4c3ef522560c8b7", "score": "0.60463756", "text": "function print_new_json(){\n var fin = {\n \"nodes\" : nodes_,\n \"links\" : links_\n };\n $(\".texta\").text(JSON.stringify(fin));\n $(\".print_text\").css(\"display\",\"initial\");\n}", "title": "" }, { "docid": "b42a03cd5ed9196fa0b9f4ad710b3fa9", "score": "0.6040294", "text": "function makeJSONfile(){\n\tvar jsonFileName = fl.getDocumentDOM().pathURI\n\tvar jsonFileNameSplit = jsonFileName.split(\".\")[0]\n\tvar jsonFileName = jsonFileNameSplit + \"_data.json\"\n\tvar jsonFileName = jsonFileName.replace(\"_v2\",\"\")\n\tfl.outputPanel.trace(JsonInfo)\n\tfl.outputPanel.save(jsonFileName)\n\tfl.outputPanel.clear();\n}", "title": "" }, { "docid": "3bbbfdd2db85974a769a9770900af436", "score": "0.6000811", "text": "function generateExport(json) {\n\tlet dataStr = \"data:text/json;charset=utf-8,let config = `\" + encodeURIComponent(JSON.stringify(json, null, '\\t') + \"`;\");\n\tlet dlAnchorElem = document.querySelector('#downloadAnchorElem');\n\tdlAnchorElem.setAttribute(\"href\", dataStr );\n\tdlAnchorElem.setAttribute(\"download\", \"linklist.js\");\n}", "title": "" }, { "docid": "17a06f0e4a88ad6266f754d843f431ce", "score": "0.59794337", "text": "saveJSON() {\n const _data = this.state.editedLiveset;\n const _saveName = this.state.fileName + '.edited.tsl';\n const _output = \"data:text/json;charset=utf-8,\" + encodeURIComponent( JSON.stringify( _data ) );\n const _downloadAnchorNode = document.createElement('a');\n _downloadAnchorNode.setAttribute(\"href\", _output);\n _downloadAnchorNode.setAttribute(\"download\", _saveName);\n _downloadAnchorNode.click();\n _downloadAnchorNode.remove();\n }", "title": "" }, { "docid": "faf5b863bddc2defa2fae4e1f5bc3b1d", "score": "0.5971717", "text": "function loadTceLinkJSON(url, file){\n var path = url + file;\n var jqxhr = $.getJSON(path, function(jsonData) {\n //console.log(\"orgId--\",jsonData.orgId)\n getLinkAssetXML(jsonData.orgId)\n })\n .done(function(jsonData) {})\n .fail(function() {\n console.log('An error occurred while loading JSON file. ' + path);\n });\n}", "title": "" }, { "docid": "66726d265b6a7002ca3fbe5d501c5989", "score": "0.5938842", "text": "function grabTextFile() {\n\n $.getJSON( \"/text\", function(textdata) {\n console.log( \"success loading text data\" );\n $(\"#text1\").html(textdata);\n });\n\n\n}", "title": "" }, { "docid": "073de2bf531517fa2f24536fcebd511b", "score": "0.5912217", "text": "function processFileContents(data, options) {\n\tvar object = JSON.parse(data);\n\tvar ATON = new aton;\n\tvar atonstring = ATON.stringify(object);\n\tconsole.log(atonstring);\n}", "title": "" }, { "docid": "b3c8cc370c0ee6275e8a6fbd080a949c", "score": "0.58759075", "text": "function writeToDocument(type) {\n //this ensures that the previous data is cleared each time the function is called again\n var el = document.getElementById(\"data\");\n el.innerHTML = \"\";\n \n //We now call our getData function and pass in our type, along with another function which gets the element by ID and passes it our data\n getData(type, function(data) {\n //console.dir(data); Allows us to see the directories in the console.log\n //the data is stored in the results directory, so we want our data parameter to display data.results\n data = data.results;\n \n //then we run a forEach loop to unpack the data\n //for each element in the data, it's going to take the item\n data.forEach(function(item) {\n //we now write the .name string from the json file to the innerHTML item - the += sign ensures the the loop doesn't overwrite the data each time\n //<p> puts it into paragraphs\n el.innerHTML += \"<p>\" + item.name + \"</p>\";\n });\n });\n}", "title": "" }, { "docid": "e9e67615b8264c69994e1c0ee324de86", "score": "0.58550966", "text": "function LoadFile (selectedFile) {\n //Convert from JSON object to JS object\n var contents = fs.readFileSync(selectedFile);\n jsonObject = JSON.parse(contents)\n\n output = \"\";\n\n //Get all of the properties of the JSON object\n for (var property in jsonObject) {\n if (!jsonObject.hasOwnProperty(property))\n continue;\n\n objectType = typeof property\n objectValue = jsonObject[property]\n\n output += `${objectType} : ${objectValue} (${objectType})\\n`\n }\n\n return output;\n}", "title": "" }, { "docid": "43e8ddef87fb6941904da9c6ba4e1e4a", "score": "0.57887876", "text": "function lJson(file, callback) {\r\n var rawFile = new XMLHttpRequest();\r\n rawFile.overrideMimeType(\"application/json\");\r\n rawFile.open(\"GET\", file, true);\r\n rawFile.onreadystatechange = function() {\r\n if (rawFile.readyState === 4 && rawFile.status == \"200\") {\r\n callback(JSON.parse(rawFile.responseText));\r\n }\r\n }\r\n rawFile.send(null);\r\n }", "title": "" }, { "docid": "941369bbee9d6057434608802757374f", "score": "0.5785574", "text": "function loadDoc() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n \n obj = JSON.parse(this.responseText); // This obj is now your object from your JSON file.\n\n fetchJSONdata();\n }\n };\n // Reference our JSON file full of quotes, provided by www.officequotes.net\n // TODO: add this credit to github README \n xhttp.open(\"GET\", \"theoffice_lines.json\", true);\n xhttp.send();\n}", "title": "" }, { "docid": "8a8d9a29386cd5716231d205f5f930b9", "score": "0.57822734", "text": "function loadJsonInTextArea()\n{\n\t// var obj = JSON.parse(testItinerary);\n var pretty = JSON.stringify(testItinerary, undefined, 4);\n\tdocument.getElementById(\"jsonTextArea\").innerHTML = pretty;\n\t//generateItineraryObj();\n\t\n\t//testCreateObject();\n\n}", "title": "" }, { "docid": "5e7dbe7124da8c956778acf85564abc1", "score": "0.57136345", "text": "function onPressSave() {\n var a = document.createElement('a');\n var notesJson = JSON.stringify(globals.notes);\n var notesBlob = new Blob([notesJson], {type: 'application/json'});\n a.href = window.URL.createObjectURL(notesBlob);\n a.download = 'notes.json';\n a.click();\n }", "title": "" }, { "docid": "9c7bf0cb456b99cfc211a0f42ba8f155", "score": "0.57097834", "text": "function downloadJSON(content, fileName, contentType){\n var a = document.createElement(\"a\");\n var file = new Blob([content], {type: contentType});\n a.href = URL.createObjectURL(file);\n a.download = fileName;\n a.click();\n}", "title": "" }, { "docid": "61ea3d25859df0c1c06dbacc3bcf53b1", "score": "0.5683326", "text": "function linkFile(linkText){\n fs.appendFile('link.txt', \"\\n - \" + linkText + \"\\n\", (err)=>{\n if(err) throw(err);\n });\n}", "title": "" }, { "docid": "110c438c67b9bed5fc334918a435e5de", "score": "0.5668251", "text": "function getText() {\r\n\t//console.log('text file will be here')\r\n\tfetch('text.txt')\r\n\t\t.then(function(res){\r\n\t\t\treturn res.text()\r\n\t\t})\r\n\t\t.then(function(data){\r\n\t\t\tconsole.log(data);\r\n\t\t\tdocument.getElementById('output').innerHTML = data;\r\n\t\t})\r\n\t\t.catch(function(err){\r\n\t\t\tconsole.log(err);\r\n\t\t});\r\n}", "title": "" }, { "docid": "8481bf43d74c4d7faf4ada44c1d0ed7e", "score": "0.566372", "text": "function getText() {\n fetch('data.txt')\n .then(function(response) {\n return response.text()\n })\n .then(function(data) {\n // console.log(data)\n document.getElementById('output').innerHTML = `<ul class = \"z-depth-4\">\n <li >${data}</li></ul>`\n })\n .catch(function(error) {\n console.log(error);\n })\n \n}", "title": "" }, { "docid": "f68f58dcf74f37ccd624abeb7788b438", "score": "0.56494325", "text": "function writeJsonFile(jsonString, callback) {\n console.log(\"---> writeJSON <---\");\n // let jsonString = createHeadlineArray(tweets);\n\n //auskommentiert zur Probe\n fs.writeFile(\"headlines.json\", jsonString, function (error) {\n if (error) {\n console.log(error);\n return;\n }\n callback(\"Successfully saved headlines.json\");\n });\n}", "title": "" }, { "docid": "a23da25318b5e2c931ddbaafeb3047c1", "score": "0.5648448", "text": "function getText() {\r\n fetch('test.txt')\r\n .then(function(res){\r\n // You can console.log 'res' to see all the associated data fetched\r\n // If you console.log 'res.text' you get a promise\r\n // If we were dealing with JSON, we would use res.JSON\r\n return res.text();\r\n })\r\n .then(function(data) {\r\n // This console.log will show you the text inside test.txt\r\n console.log(data);\r\n document.getElementById('output').innerHTML = data;\r\n })\r\n // If there is an error we use .catch.\r\n // Try renaming the text file to something incorrect to see the err in console.log\r\n .catch(function(err){\r\n console.log(err);\r\n });\r\n}", "title": "" }, { "docid": "0479537ad6f055d4ddf21a9201fb5924", "score": "0.561825", "text": "async function getfilasjson(path){\r\n //path = path + \".txt\"\r\n console.log(path)\r\n if (!path || path == undefined){\r\n throw \"Need to provide a file name getfilasjson\";\r\n }\r\n \r\n try{\r\n const fileContent = await fs.readFileAsync(path , \"utf-8\")\r\n //fileContent = '{\"text\" : \"this is awesome\"}'\r\n if (typeof (fileContent) != 'string')\r\n fileContent = JSON.stringify(fileContent)\r\n //console.log(JSON.parse(fileContent)) \r\n return fileContent \r\n }\r\n catch(e){\r\n throw \"create file\"\r\n }\r\n return null\r\n \r\n}", "title": "" }, { "docid": "5a9f2d872f829b9f263029a0145c5d18", "score": "0.5594297", "text": "function DownloadLights() {\n var data = \"text/json; charset=utf-8,\" + encodeURIComponent(JSON.stringify(lights));\n var a = document.createElement('a');\n a.href = 'data:' + data;\n a.download = 'lights.json';\n a.innerHTML = ': download JSON';\n\n document.body.appendChild(a);\n a.click()\n document.body.removeChild(a);\n}", "title": "" }, { "docid": "b8366a0722404934ded56873e90e43a3", "score": "0.5574744", "text": "function loadFromJsonText(fileContents) {\n\tvar updates = {};\n\ttry {\n\t\tupdates[newDataBaseKey] = JSON.parse(fileContents);\n\t\tfirebase.database().ref().update(updates);\n\t} catch (err) {\n\t\talert(err);\n\t}\n}", "title": "" }, { "docid": "bdcc078ead43a87b8ce1b88e8443eb93", "score": "0.55654097", "text": "function writeJsonToFile(jsonData)\n{\n var fileStr=\"Id\\t|firstName\\t|LastName\\t|Score \\n\";\n for(var i=0;i<jsonData.students.length;i++) \n {\n fileStr=fileStr+jsonData.students[i].id+\"\\t|\"+jsonData.students[i].fName+\"\\t\\t|\"+jsonData.students[i].lName+\"\\t\\t|\"+jsonData.students[i].score+\"\\n\";\n }\n fs.writeFile(constants.DESTINATION_TEXT_FILE,fileStr,function txtFileError(error){\n if(error) {\n console.log(error);\n }\n console.log(\"JsonObject successfully written to specified txt file\");\n });\n}", "title": "" }, { "docid": "8482b1947aa0ad66a8d0e00537ec1c98", "score": "0.5556728", "text": "function writeJSONFile(content) {\nfs.writeFileSync(\n \"formular.json\",\n JSON.stringify({ people: content }),\n \"utf8\",\n err => {\n if (err) {\n console.log(err);\n }\n }\n);\n}", "title": "" }, { "docid": "03f8b2e29d52417edede68ca6ace14b6", "score": "0.55409485", "text": "function getText(e){\r\n fetch('test.txt')\r\n .then((res)=>{\r\n return res.text();\r\n })\r\n .then((data)=>{\r\n document.getElementById('output').innerHTML = data;\r\n })\r\n .catch((err)=>{\r\n });\r\n}", "title": "" }, { "docid": "07830cd011f3ffff6edc6d44e2e28600", "score": "0.5519997", "text": "function printJSONFile( config, toPrint )\n{\n config = config || defaultConfig;\n toPrint = toPrint || { hello : 'world' };\n\n console.log( JSON.stringify( toPrint ) );\n console.log( 'OutPut File : ', config.file );\n\n return fs.writeFileSync( config.file, JSON.stringify( toPrint) );\n}", "title": "" }, { "docid": "d5988bb2edc863894320422d8cee2817", "score": "0.55024743", "text": "exportTargets() {\n const targetsArray = [];\n this.props.targets.map((target) => {\n targetsArray.push(target.target_url+'\\n');\n });\n const element = document.createElement(\"a\");\n const file = new Blob(targetsArray, {type: 'text/plain;charset=utf-8'});\n element.href = URL.createObjectURL(file);\n element.download = \"targets.txt\";\n element.click();\n }", "title": "" }, { "docid": "0303d993c3d209b9ae3ed6c872b429a3", "score": "0.54894173", "text": "function update(text) {\n\tvar textNode = document.createTextNode(text);\n document.getElementById('json').appendChild(textNode);\n }", "title": "" }, { "docid": "38ca894b391b1093b32724aaae30c8ae", "score": "0.5484577", "text": "function getText() {\n fetch(\"data.txt\")\n .then((response) => response.text())\n .then((data) => {\n document.getElementById(\"output\").innerHTML = data;\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "853ba4beaef3c48417f48fdd360fa221", "score": "0.5481681", "text": "function getText() {\n\tfetch('test.txt')\n\t\t.then(res => res.text())\n\t\t.then(data => {\n\t\t\tconsole.log(data);\n\t\t\tdocument.querySelector('#outptu').innerHTML = data;\n\t\t})\n\t\t.catch(err => console.log(err));\n}", "title": "" }, { "docid": "594aa70badd5ffc6d4afc164290797a8", "score": "0.5479575", "text": "function save_text(file_name,info_text) {var ds; if (flow_path.indexOf('/') !== -1) ds = '/'; else ds = '\\\\';\nif (!file_name) {save_text_count++; file_name = flow_path + ds + 'text' + save_text_count.toString() + '.txt';}\nvar fs = require('fs'); fs.write(file_name, info_text, 'w');}", "title": "" }, { "docid": "9e4cba150c06259bb64103c81cf4df2e", "score": "0.5473854", "text": "function getText() {\n fetch('data.txt')\n .then(response => response.text())\n .then(data => {\n document.getElementById('output').innerHTML = data;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "a3d943f0cbd82ada37df6a9a14c26ad7", "score": "0.5467718", "text": "function downloadJSON() {\n var inputs = getCacheKey()\n if (localStorage[inputs]) {\n const jsonData = localStorage[inputs]\n var data = \"text/json;charset=utf-8,\" + encodeURIComponent(jsonData);\n var a = document.createElement('a')\n a.href = \"data:\" + data;\n a.download = \"schedule.sch\"\n var container = document.getElementById(\"app\")\n container.appendChild(a)\n a.click()\n container.removeChild(a)\n }\n}", "title": "" }, { "docid": "c32dd126ed86470724395ff95f8d8553", "score": "0.54652166", "text": "function downloadJSON() {\n var inputs = getCacheKey()\n if (localStorage[inputs]) {\n jsonData = localStorage[inputs]\n var data = \"text/json;charset=utf-8,\" + encodeURIComponent(jsonData);\n var a = document.createElement('a')\n a.href = \"data:\" + data;\n a.download = \"schedule.sch\"\n var container = document.getElementById(\"app\")\n container.appendChild(a)\n a.click()\n container.removeChild(a)\n }\n}", "title": "" }, { "docid": "9bebc14e18e591d427d026d77ce68a2a", "score": "0.54636216", "text": "function loadInstrumentsfile(callback) {\n //console.log(\"load Instr File\");\n var request = new XMLHttpRequest();\n //request.overrideMimeType(\"application/json\");\n request.open('GET', '/json/instruments.json', true); // Replace 'my_data' with the path to your file\n request.onreadystatechange = function () {\n if (request.readyState == 4 && request.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(request.responseText);\n }\n };\n request.send(null);\n}", "title": "" }, { "docid": "0b671eb76b46b467977cef3895090b11", "score": "0.54613674", "text": "function fetchJSONFile(path, callback) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n var data = JSON.parse(httpRequest.responseText);\n if (callback) callback(data);\n }\n }\n };\n httpRequest.open('GET', path);\n httpRequest.send(); \n}", "title": "" }, { "docid": "48deb5f38cf7d91fb74379c2430eabb8", "score": "0.5448183", "text": "function getJsonFile(textYear){\n var requestURL = \"https://raw.githubusercontent.com/CCCOG/gh-pages/master/\" + textYear + \".json\"\n // var requestURL = \"https://raw.githubusercontent.com/thecodinghyrax/Bible_page_update_v3/major-change-for-index/\" + textYear + \".json\"\n var request = new XMLHttpRequest();\n request.open('GET', requestURL)\n request.responseType = 'json';\n request.send();\n return request\n}", "title": "" }, { "docid": "977b0b9cdda023b1b6ffc780ea33a1ee", "score": "0.5444617", "text": "function getJson (fileName) {\n\treturn jsonfile.readFileSync(`${__dirname}/templates/${fileName}.json`);\n}", "title": "" }, { "docid": "624b398c823eee96775a512a1ebe9917", "score": "0.5437896", "text": "function getJSON() {\n fetch(\"data.json\")\n .then((response) => response.json())\n .then((data) => {\n let output = \"\";\n data.forEach((post) => {\n output += `<li>${post.title}</li>`;\n });\n document.getElementById(\"output\").innerHTML = output;\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "e133eb2af3c0491ff7ebb0286c2dca58", "score": "0.54214674", "text": "function downloadJSON(){\n if(d3.select(\"#json_download\").attr(\"class\")==\"pButton\") {//=active\n var content = JSON.stringify(proteins);\n //download file to user\n var a = window.document.createElement('a');\n a.href = window.URL.createObjectURL(new Blob([ content ], {\n type : 'text/txt'\n }));\n var date = new Date();\n a.download = 'proteator_'+date.getDate()+'_'+date.getMonth()+'_'+date.getFullYear()+'.json';\n\n // Append anchor to body.\n document.body.appendChild(a);\n a.click();\n // Remove anchor from body\n document.body.removeChild(a);\n }\n}", "title": "" }, { "docid": "c157991900e7813cd59cc581d3bb121c", "score": "0.5420659", "text": "function getTitles(res) {\n fs.readFile(\"./src/titles.json\", (err, data) => {\n if (err) return hadError(err, res);\n getTemplate(JSON.parse(data.toString()), res);\n });\n}", "title": "" }, { "docid": "f876cec1b3da97ba079b9ffd60999ffd", "score": "0.54181814", "text": "function getText () {\n window.fetch('test.txt')\n .then(res => res.text())\n .then(data => {\n console.log(data);\n document.getElementById('output').innerHTML = data;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "e498e8cb5ee845f600791b1ef729bc46", "score": "0.5414585", "text": "function getText(){\n fetch('test.txt').then(res => res.text())\n .then(data => {\n console.log(data);\n document.getElementById('output').innerHTML = data;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "43657ee8d8a54b3cb43f975e5ce34135", "score": "0.54110336", "text": "function loadJSON(callback) {\n\tvar xobj = new XMLHttpRequest();\n\txobj.overrideMimeType(\"application/json\");\n\txobj.open('GET', 'js/terms.json', false); // Replace 'my_data' with the path to your file\n\txobj.onreadystatechange = function () {\n\t\tif (xobj.readyState == 4 && xobj.status == \"200\") {\n\t\t\t// Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n\t\t\tcallback(xobj.responseText);\n\t\t}\n\t};\n\txobj.send(null);\n}", "title": "" }, { "docid": "e5497f8cbf1595f5311b369e3748d7a3", "score": "0.53979635", "text": "function readTextFile(file, callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function() {\n if (rawFile.readyState === 4 && rawFile.status == \"200\") {\n callback(rawFile.responseText);\n }\n };\n rawFile.send(null);\n}", "title": "" }, { "docid": "29d5ef5b046c9d919ce00251201b83b5", "score": "0.5394914", "text": "static read_json_file()\n{\n\tvar file = './data/contacts.json';\t\n\treturn fs.readFileSync(file);\n}", "title": "" }, { "docid": "da7b85e3e28189f435a6afbfedee51b8", "score": "0.53907233", "text": "function readTextFile(file, callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function() {\n if (rawFile.readyState === 4 && rawFile.status == \"200\") {\n callback(rawFile.responseText);\n }\n }\n rawFile.send(null);\n}", "title": "" }, { "docid": "da7b85e3e28189f435a6afbfedee51b8", "score": "0.53907233", "text": "function readTextFile(file, callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function() {\n if (rawFile.readyState === 4 && rawFile.status == \"200\") {\n callback(rawFile.responseText);\n }\n }\n rawFile.send(null);\n}", "title": "" }, { "docid": "4c9b0fd17f035c08d927b474b188195c", "score": "0.538208", "text": "function readTextFile(file, callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function() {\n if (rawFile.readyState === 4 && rawFile.status == \"200\") {\n callback(rawFile.responseText);\n }\n }\n rawFile.send(null);\n}", "title": "" }, { "docid": "0f27d0e19f33c6b8eb4c9751e847349c", "score": "0.53753823", "text": "function readTextFile(file, callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function () {\n if (rawFile.readyState === 4 && rawFile.status === \"200\") {\n callback(rawFile.responseText);\n }\n }\n rawFile.send(null);\n}", "title": "" }, { "docid": "3b5847e1380a82b701fd3217ffe82614", "score": "0.5369858", "text": "function SaveGeoJSON() {\n // creates a String from the geojson object.\n var jsonString = JSON.stringify(json);\n var filename = document.getElementById(\"geojsonName\").value + \".txt\";\n\n SaveAsFile(jsonString, filename, \"text/plain;charset=utf-8\");\n}", "title": "" }, { "docid": "775cee05d50ea5a7be43403e4d61fb94", "score": "0.53672326", "text": "function handleFile(err, data) {\n if (err) throw err\n obj = JSON.parse(data)\n\tconsole.log(obj)\n // You can now play with your datas\n}", "title": "" }, { "docid": "5d50db0d5bb533e1f5a4f2db6f2b9cd0", "score": "0.536539", "text": "function forTextToJson(eventForId)\n\t{\n\t\t var saveData = $.ajax({\n \t\ttype: 'GET',\n \t\turl: \"http://kh9331.kitspl.com:3005\",\n\t\t\t//url: \"http://konycse.konylabs.net:3005\",\n \t\tdataType: \"json\",\n \t\tcors: true,\n \t\theaders: {\n\n \t\t}\n\n\n \t})\n .done(function (resultData)\n {\n console.log(resultData);\n jsfunction(eventForId,resultData);\n });\n // .error(function (){\n //\n // alert(\"Oops!!\\nSomething went wrong!!\");\n // console.log('hell');\n // });\n\n\t}", "title": "" }, { "docid": "6fbe62417bb3e0e543c0318f925192f5", "score": "0.5364236", "text": "function getText() {\n fetch('test.txt')\n .then(response => {\n return response.text();\n })\n .then(data => {\n document.getElementById('output').innerHTML = data;\n })\n .catch(err => {\n console.log(err);\n });\n}", "title": "" }, { "docid": "9d90c8aef93c2de20cc19313d890dee0", "score": "0.53625035", "text": "function getText() {\n fetch('text.txt')\n .then(response => response.text())\n .then(data => {\n document.querySelector('#output').innerHTML = data;\n })\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "502f267f7ff4e4bad2907eb8d3f9165b", "score": "0.53575075", "text": "function meyshan_search_king_attachJSON(jsonUrl){\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = jsonUrl;\r\n document.body.appendChild(script);\r\n}", "title": "" }, { "docid": "47522ce03540dcb28514387d050381e4", "score": "0.53568494", "text": "async openJSON (url) {\n return JSON.parse(await this.openText(url))\n }", "title": "" }, { "docid": "4b894f0613f5b346dd2cb7efe14c2276", "score": "0.5353992", "text": "function downloadJSON() {\r\n\r\n var filename = \"json-export.json\";\r\n var element = document.createElement(\"a\");\r\n\r\n element.setAttribute(\"href\", \"data:application/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(users_list)));\r\n element.setAttribute(\"download\", filename);\r\n\r\n element.style.display = \"none\";\r\n document.body.appendChild(element);\r\n\r\n element.click();\r\n\r\n document.body.removeChild(element);\r\n}", "title": "" }, { "docid": "047b5fd768cd3764c52fffc37ff1b726", "score": "0.5353932", "text": "function getJson(e){\n fetch(\"customer.json\")\n .then(function(response){\n return response.json(); //stream json\n })\n .then(function(data){\n console.log(data);\n data.forEach(function(person){\n output += `<li>${person.name} works for ${person.company}<li>`;\n });\n document.getElementById(\"output\").innerHTML = output;\n })\n .catch(function(error){console.log('something went wrong')})\n}", "title": "" }, { "docid": "9735c67b29425b2c6f400fbe9a02d7b2", "score": "0.53494006", "text": "function displayToddlers(url, req, res) {\n // Configure the response to return a status code of 200 (meaning everything went OK), and to be an HTML document\n res.writeHead(200, { \"Content-Type\": \"text/json\" });\n res.end(JSON.stringify(depts[2]));\n }", "title": "" }, { "docid": "f81889284b0e67a064185ac6be14aee9", "score": "0.53491175", "text": "function requestFile( url ) {\r\n\t\tconst xhr = new XMLHttpRequest();\r\n\t\txhr.open( 'GET', url, true );\r\n\t\txhr.onerror = function( xhr ) { console.log( 'error:', xhr ); };\r\n\t\txhr.onprogress = function( xhr ) { console.log( 'bytes loaded:', xhr.loaded ); }; \r\n\t\txhr.onload = callback;\r\n\t\txhr.send( null );\r\n\t\tfunction callback( xhr ) {\r\n\t\t\tconst response = xhr.target.response;\r\n\t\t\tdivContents.innerText = response;\r\n\t\t\tif (response.slice( 0, 1) !== '{' ) { return; } // not a json file\r\n\t\t\tconst json = JSON.parse( response );\r\nconsole.log( 'json', json );\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8795c74b17cc1e80485b0560d2d0eed8", "score": "0.53463066", "text": "function download(text){\n\tconsole.log(text);\n\tvar down = document.createElement('a');\n down.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\n down.setAttribute('download', \"yourMelody.txt\");\n\n down.style.display = 'none';\n document.body.appendChild(down);\n\n down.click();\n\n document.body.removeChild(down);\n}", "title": "" }, { "docid": "73f39813df43443843e0db1f1b3eef43", "score": "0.5346033", "text": "function retrieveJsonFile() { \n var request = new XMLHttpRequest(); \n var file = document.getElementById(\"fileJSON\").value;\n\n if (request !== null) {\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n var data = JSON.parse(request.responseText);\n var parsedData=\"<tr><th>First Name</th><th>Last Name</th><th>City</th><th>State</th><th>Zip</th><th>Major</th><th>GPA</th></tr>\";\n for (var i = 0; i < data.students.length; i++) {\n parsedData += \"<tr><td>\" + data.students[i].first + \"</td>\" +\n \"<td>\" + data.students[i].last + \"</td>\" +\n \"<td>\" + data.students[i].address.city + \"</td>\" +\n \"<td>\" + data.students[i].address.state + \"</td>\" +\n \"<td>\" + data.students[i].address.zip + \"</td>\" +\n \"<td>\" + data.students[i].major + \"</td>\" +\n \"<td>\" + data.students[i].gpa + \"</td></tr>\";\n }\n document.getElementById(\"studentInfo\").innerHTML = parsedData;\n }\n };\n }\n request.open(\"GET\", \"../\" + file, true);\n request.send();\n}", "title": "" }, { "docid": "1d3bd3594b6106d7b162b37617037c68", "score": "0.5341813", "text": "function downloadData(){\r\n const filename = \"highscores.json\";\r\n const jsonStr = JSON.stringify(highscores);\r\n\r\n var element = document.createElement(\"a\");\r\n element.setAttribute(\"href\", \"data:text/plain;charset=utf-8,\" + encodeURIComponent(jsonStr));\r\n element.setAttribute(\"download\", filename);\r\n\r\n element.style.display = \"none\";\r\n document.body.appendChild(element);\r\n\r\n element.click();\r\n\r\n document.body.removeChild(element);\r\n}", "title": "" }, { "docid": "39820bd4e8216de39c72437cf9acd770", "score": "0.53409946", "text": "function loadJSONfile(callback) { \n let request = new XMLHttpRequest();\n request.overrideMimeType(\"application/json\");\n request.open('GET', 'Restaurants.json', true);\n request.onreadystatechange = function () {\n if (request.readyState == 4 && request.status == \"200\") {\n callback(request.responseText);\n }\n };\n request.send(null); \n }", "title": "" }, { "docid": "b8407f385aa913dc6e11814dd9375b81", "score": "0.534059", "text": "function getText() { \n fetch(\"test.txt\")\n .then(res => res.text())\n .then(data => document.getElementById(\"output\").innerHTML = data)\n .catch(err =>console.log(err));\n}", "title": "" }, { "docid": "2b335157b1564040f946b9d9a822599c", "score": "0.5329383", "text": "function getText(e){\n fetch('textData.txt')\n .then(function(response){\n return response.text() //stream .then .catch\n }).then(function(text){\n// console.log(text);\ndocument.getElementById('output').innerHTML = `\n<b>Fetch Text</b>: [${text}]\n`;\n })\n .catch(function(error){\n console.log(new Error(\"Something went wrong\"));\n });\n \n}", "title": "" }, { "docid": "07e7855df0b80e0f9200c986b4fa6ef3", "score": "0.53286827", "text": "function getJson(url, videoName){\n fetch(url)\n .then(res => res.json())\n .then((out) => {\n console.log(out.results.transcripts[0].transcript);\n fs.appendFile(destination, videoName + \"\\n\"+out.results.transcripts[0].transcript+\"\\n\", (err) => {\n if (err) throw err;\n});\n}).catch(err => {\n console.error(err);\n setTimeout(() => {\n getJson(url, videoName);\n }, 1000);\n});\n}", "title": "" }, { "docid": "947846c7757052000eda61e8b015bd7d", "score": "0.53266656", "text": "function jsonToText (resp, searchTerm) {\n var jsonResp = JSON.parse(resp).data[0].attributes;\n var name = jsonResp.name[0].value;\n var description = jsonResp.description[0].value;\n var location = jsonResp.locations[0].value.replace(\"Science Museum, \", \"\");\n\n var pause = '-';\n var msg = \"Dave I've found you a match for \" + searchTerm + pause + \". Your match is a \" + name + pause + \"it is a \" + description + \" \" + pause + \"you can find this item in the \" + location;\n\n sciMuSay(msg);\n // console.log(msg);\n}", "title": "" }, { "docid": "1d629bef685761511018fbb627f7d7d1", "score": "0.5321863", "text": "function fetchJSONFile(path, callback) {\n let httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n let data = JSON.parse(httpRequest.responseText);\n if (callback) callback(data);\n }\n }\n };\n httpRequest.open('GET', path);\n httpRequest.send(); \n}", "title": "" }, { "docid": "be0cc64c5ce8f275b6ba8e0a6239630a", "score": "0.53183854", "text": "function getJSON () {\n window.fetch('posts.json')\n .then(res => res.json())\n .then(data => {\n console.log(data);\n let output = '';\n data.forEach(function (datum) {\n output += `<li>${datum.title}</li>`;\n });\n document.getElementById('output').innerHTML = output;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "6014a3cb444e2a648157f83117511cdc", "score": "0.531275", "text": "function note_json_html(in_json){\n\tlet output=\"\";\n\toutput += \"<div class='palitext'>\"+in_json.palitext+\"</div>\";\n\toutput += \"<div class='tran'>\"+term_std_str_to_tran(in_json.tran)+\"</div>\";\n\toutput += \"<div class='ref'>\"+in_json.ref+\"</div>\";\n\treturn(output);\n}", "title": "" }, { "docid": "f4a02c2e2e21568579d763be990b6a35", "score": "0.53117156", "text": "function readTextFile(file)\r\n{\r\n var rawFile = new XMLHttpRequest();\r\n\tvar allText;\r\n rawFile.open(\"GET\", file, false);\r\n rawFile.onreadystatechange = function () {\r\n if(rawFile.readyState === 4) {\r\n if(rawFile.status === 200 || rawFile.status == 0) {\r\n allText = rawFile.responseText;\r\n }\r\n }\r\n }\r\n rawFile.send(null);\r\n\treturn JSON.parse(allText);\r\n}", "title": "" }, { "docid": "f3b8491e359bb91f463c9642001b56a1", "score": "0.5311217", "text": "function getJson() {\n fetch('posts.json')\n .then(res => res.json())\n .then(data => {\n let html = ''\n data.forEach(function (post) {\n html += `<ul>\n <li>${post.title}</li>\n <li>${post.body}</li>\n </ul>`\n })\n output.innerHTML = html\n })\n .catch(err => output.innerHTML = err)\n}", "title": "" }, { "docid": "110da9d5d84f7bcc468d470882a7d232", "score": "0.53110176", "text": "function json(options, callback){\n console.log(\"json\")\n var path = options.path;\n //Read the file using filepath\n fs.readFile(path, 'utf8', function(err, d){\n if(err){\n console.log(\"Error: \"+ err);\n return;\n }\n data = JSON.parse(d);\n \n //Send data back to app.js\n exports.data = data;\n callback();\n });\n}", "title": "" }, { "docid": "d753b7b585745502f577a261ba4125c2", "score": "0.53076965", "text": "function fuse_IconographyEngine_generateJSONDataObjectExternalFile_Location(fuse_IconographyControlObj) {\n\n\t// This is a helper function that provides the relative path to the JSON.\n\t// NOTE: \tThis is included as a helper function, so if the need arises to provide an alternative path\n\t//\t\t\tto another JSON file is needed, over-riding this single function can be done with ease.\n\t\n\tvar jsonPath = _spPageContextInfo.siteAbsoluteUrl + '/catdsgsp/jslinks/sitecolumns/catdsgspjslinkiconography/catdsgsp-jslink-sitecolumn-iconography-json.js';\n\t\n\treturn jsonPath;\n\n}", "title": "" }, { "docid": "01d18c94da8ece5c04221f26c6eb61b5", "score": "0.5305062", "text": "generateExperienceURL(text){\n var textFile = null;\n var data = new Blob([text], {type: 'text/plain'});\n // If we are replacing a previously generated file we need to\n // manually revoke the object URL to avoid memory leaks.\n if (textFile !== null) {\n window.URL.revokeObjectURL(textFile);\n }\n textFile = window.URL.createObjectURL(data);\n\n // returns a URL you can use as a href\n return textFile;\n }", "title": "" }, { "docid": "925032a538667332d6d6e53dad2b88b1", "score": "0.5302569", "text": "function getJSON() { \n fetch(\"posts.json\")\n .then(res => res.json())\n .then(data => {\n let resultData = \"\";\n data.forEach(element => {\n resultData += `<li>${element.title}</li>`;\n })\n document.getElementById(\"output\").innerHTML = resultData;\n })\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "2f9f8cae430dec166456b54ef3d9dedd", "score": "0.52927834", "text": "function getText() {\n\n\t// Fetch returns promises, so we need to use .then to handle that\n\tfetch('test.txt')\n\t\t.then(function(res){\n\t\t\t//res is a prototype that has many properties, including status, json, text, etc. It also returns a promise, so we return out of our current function and use . t hen\n\t\t\treturn res.text();\n\t\t})\n\t\t.then(function(data) {\n\t\t\t//at this point, we've got the data itself so we can start working with it\n\t\t\tdocument.querySelector('#output').innerHTML = `<p>${data}</p>`;\n\t\t})\n\t\t.catch(function(err){\n\t\t\tconsole.log(err);\n\t\t});\n}", "title": "" }, { "docid": "a5891c798b11b01de28f169e384c8fc8", "score": "0.5290914", "text": "function updateJsonFile(savedNotes) {\n jsonfile.writeFile(file, savedNotes, err => {\n if (err) throw err; \n }); \n}", "title": "" }, { "docid": "44ab82d6b06294c61e9b79365a5f7e52", "score": "0.52908826", "text": "function download_save() {\n\n\tvar modroot = cloneForJSON(root.children[0]); // clone the elements of root & its children that we need for json string\n\tvar jsonstring = JSON.stringify(modroot);\n\n\tvar element = document.createElement('a');\n\telement.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(jsonstring));\n\telement.setAttribute('download', \"tree.json\");\n\telement.style.display = 'none';\n\tdocument.body.appendChild(element);\n\n\telement.click();\n\tdocument.body.removeChild(element);\n\n}", "title": "" }, { "docid": "96ee72b96f1556785d0005370c7f3a9c", "score": "0.528864", "text": "function getText() {\n fetch('text.txt')\n .then(res => res.text())\n .then(data => output.innerHTML = data)\n .catch(err => output.innerHTML = err)\n}", "title": "" }, { "docid": "285e887cf623d773dcf18927e4bfadf0", "score": "0.5279543", "text": "function downloadJSON( blob, filename ) {\n\n\tlink.href = URL.createObjectURL( blob );\n\tlink.download = filename;\n\tlink.click();\n\t// URL.revokeObjectURL( url ); breaks Firefox...\n\n}", "title": "" }, { "docid": "89d3f3b2fc9a94c1f5fbcea610fe01bb", "score": "0.5277634", "text": "function downloadObject(text, name, type) {\n var a = document.createElement('a');\n var file = new Blob([text], { type: type });\n a.href = URL.createObjectURL(file);\n a.download = name;\n a.click();\n}", "title": "" }, { "docid": "98ddd91a93008b0027f427dcdc5ea355", "score": "0.52770716", "text": "function readTextFile(file, callback)\n{\n let rawFile = new XMLHttpRequest();\n rawFile.overrideMimeType(\"application/json\");\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function ()\n {\n if (rawFile.readyState === 4 && rawFile.status == \"200\")\n {\n callback(rawFile.responseText);\n }\n else\n {\n //console.log(\"An error has occurred:\");\n //console.log(\"Ready state: \" + rawFile.readyState + \". Status: \" + rawFile.status);\n }\n };\n rawFile.send(null);\n}", "title": "" }, { "docid": "8839bd64ccb7e40bc27ebc678c5ea34f", "score": "0.52766085", "text": "function getText() {\n fetch('text.txt')\n .then(function (response) {\n return response.text();\n })\n .then(function (text) {\n console.log(text);\n document.getElementById(\"output\").innerHTML = text;\n })\n .catch(function (err) {\n console.log(err);\n })\n}", "title": "" }, { "docid": "a94e14bcdf45abef9235636e026c5235", "score": "0.52764267", "text": "function fetchJSONFile(path, callback) {\n let httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n let data = JSON.parse(httpRequest.responseText);\n if (callback) callback(data);\n }\n }\n };\n httpRequest.open('GET', path);\n httpRequest.send();\n}", "title": "" }, { "docid": "a7f2ac37fbc4f85b66f7693e9fdc0a09", "score": "0.52725685", "text": "function createFileJson(name) {\n var filePath = `./../storage/${d}/url-html/${name}.json`;\n chalk.red(console.log('nuovo file: ' + name));\n return fs.writeFileAsync(filePath, '').return(name);\n}", "title": "" }, { "docid": "6cffbc11969b47921b8eb05976246714", "score": "0.52722937", "text": "function getJson() {\n fetch('posts.json')\n .then(res => res.json())\n .then(data => {\n console.log(data);\n let output = '';\n data.forEach(post => {\n output += `<li>${post.title}</li>`;\n });\n document.getElementById('output').innerHTML = output;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "7d85267e69502193874c28667291b2de", "score": "0.52713376", "text": "function getJSON(){\n fetch('posts.json').then(res => res.json())\n .then(data => {\n console.log(data);\n let output = '';\n data.forEach((post) => {\n output += `<li>${post.title} : ${post.body}</li>`\n })\n document.getElementById('output').innerHTML = output;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "9733b7115c6d81949124d5e395ef66fc", "score": "0.5268865", "text": "function getJson(){\r\n fetch('posts.json')\r\n .then((res)=>{\r\n return res.json();\r\n })\r\n .then((data)=>{\r\n let postOutput ='';\r\n data.forEach((post)=>{\r\n postOutput = postOutput + `\r\n <li>${post.title} : ${post.body}</li>`\r\n });\r\n document.getElementById('output').innerHTML = postOutput;\r\n })\r\n}", "title": "" }, { "docid": "7084423cb69e90b96835540e0b0d25ce", "score": "0.52685714", "text": "function fetchText() {\n fetch('examples/words.txt')\n .then(validateResponse)\n .then(readResponseAsText)\n .then(showText)\n .catch(logError);\n}", "title": "" }, { "docid": "9d5a67087903b251836bce01cb3fb375", "score": "0.5260412", "text": "function loadJSON(callback, jsonFileURL) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', jsonFileURL, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null); \n }", "title": "" }, { "docid": "c395fc71bda32612645332e58dc09682", "score": "0.52599853", "text": "read_abi_from_json_file() { }", "title": "" }, { "docid": "edbee82c23bcf0811da7d6de5b5641a7", "score": "0.5255854", "text": "downloadAsFile() {\n const fileName = this.keyFileName;\n const text = JSON.stringify(this.toJSON());\n \n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\n element.setAttribute('download', fileName);\n \n element.style.display = 'none';\n document.body.appendChild(element);\n \n element.click();\n \n document.body.removeChild(element);\n }", "title": "" }, { "docid": "3b3cd890891404e7b3b8f1291c930954", "score": "0.5250323", "text": "function preload(){\n savedText = loadJSON(\"files/test.json\");\n}", "title": "" }, { "docid": "e06987fb3be3ab01d6615303d94287d5", "score": "0.5243222", "text": "function dataDemo() {\n fileName='dataDemo.json';\n updateAll(fileName);\n document.getElementById(\"description\").innerHTML = \"Demonstration | The map below shows 50 states and the District of Columbia. Each state is assigned the number of electoral votes and popular votes that it had in 2016. Use the simulation to see how the larger states can appear to quickly decide a presidential election.\";\n}", "title": "" }, { "docid": "ccadad787f26f65d56d62298d6712155", "score": "0.52417946", "text": "function getJson() {\n fetch('posts.json')\n .then(response => response.json())\n .then(data => {\n let output = '';\n data.forEach(function(post) {\n output += `\n <li>${post.title}</li>\n `\n });\n document.querySelector('#output').innerHTML = output;\n })\n .catch(error => console.log(error));\n}", "title": "" } ]
e6fae1776e9180c7e61f1e8582f30ad1
must be called for forEach where this is the bubble object
[ { "docid": "ecf3868b84b38c4938fc719cd08fffdf", "score": "0.0", "text": "function drawBubble(self, index){\n if(index == 0){\n context.clearRect(0, 0, canvas.width, canvas.height);\n initCanvas();\n\n }\n self.context.save();\n self.context.beginPath();\n // console.log(this.y);\n var complete = self.floatUp()\n \n \n self.context.arc(self.x, self.y, self.radius, 0, 2 * Math.PI, false);\n \n // this.context.fillStyle =\"green\";\n // this.context.fill();\n\n\n self.context.clip();\n self.context.clearRect(self.x-self.radius,self.y-self.radius,2*self.radius,2*self.radius);\n self.context.restore();\n if(complete){\n generateRandomBubbles(self);\n } \n requestAnimFrame(function(){\n drawBubble(self, index);\n });\n \n\n}", "title": "" } ]
[ { "docid": "e1dc158da05991a06f9017dc016cd296", "score": "0.6483872", "text": "get bubbles() {\n return $(this).bubbles;\n }", "title": "" }, { "docid": "2c09494da2ded11f4eb8c3dd776c052e", "score": "0.634729", "text": "renderMessages()\n {\n let bubbles = [];\n let userOfPreviousMsg=\"\";\n\n this.state.messages.forEach((element, index) =>\n {\n let isSameUser = userOfPreviousMsg == element.id;\n userOfPreviousMsg = element.id;\n bubbles.push(<ChatBubble key={index} isSameUser={isSameUser} partner={this.state.partner} user={this.state.user} message={element}></ChatBubble>);\n });\n\n this.scrollToBottom();\n\n return bubbles;\n }", "title": "" }, { "docid": "37509087253ae4deae18d94b006a4732", "score": "0.6186762", "text": "bubbleCheck(otherBubble, myId) {\n for (let n = 0; n < otherBubble.length; n++) {\n if (n != myId) {\n let d = dist(this.posX, this.posY, otherBubble[n].posX, otherBubble[n].posY);\n let combinedR = this.rad + otherBubble[n].rad;\n if (d <= combinedR) {\n if( this.color == ('rgb(149, 242, 255)')) {\n this.color = ('rgb(255, 208, 240)');\n } else {\n this.color = ('rgb(149, 242, 255)');\n }\n }\n }\n }\n }", "title": "" }, { "docid": "604387d16fe11c30c3f615d7fd2ec94e", "score": "0.5919179", "text": "function processData(data) {\n var obj = data;\n\n var newDataSet = [];\n\n for(var prop in obj) {\n\t newDataSet.push({name: obj[prop].properties.name, className: \"bubble\", size: obj[prop].properties.weight});\n }\n return {children: newDataSet};\n }", "title": "" }, { "docid": "3686f3bc2e6a4cc79e5bba02dad8ff11", "score": "0.5761615", "text": "bubble(value) {\n value = !!value;\n this.trace('bubble', value);\n this.bubbles = value;\n }", "title": "" }, { "docid": "c97cc6d4ea339207b0e1acbaf014e69e", "score": "0.57472163", "text": "updateBubble() {\n if (!this.visible || !this.saying) {\n this.bubbleContainer.style.display = 'none';\n return;\n }\n const b = this.rotatedBounds();\n const left = 240 + b.right;\n var bottom = 180 + b.top;\n const width = this.bubbleContainer.offsetWidth / this.stage.zoom;\n const height = this.bubbleContainer.offsetHeight / this.stage.zoom;\n this.bubblePointer.style.top = ((height - 6) / 14) + 'em';\n if (left + width + 2 > 480) {\n this.bubbleContainer.style.right = ((240 - b.left) / 14) + 'em';\n this.bubbleContainer.style.left = 'auto';\n this.bubblePointer.style.right = (3 / 14) + 'em';\n this.bubblePointer.style.left = 'auto';\n this.bubblePointer.style.backgroundPositionY = (-36 / 14) + 'em';\n }\n else {\n this.bubbleContainer.style.left = (left / 14) + 'em';\n this.bubbleContainer.style.right = 'auto';\n this.bubblePointer.style.left = (3 / 14) + 'em';\n this.bubblePointer.style.right = 'auto';\n this.bubblePointer.style.backgroundPositionY = (-4 / 14) + 'em';\n }\n if (bottom + height + 2 > 360) {\n bottom = 360 - height - 2;\n }\n if (bottom < 19) {\n bottom = 19;\n }\n this.bubbleContainer.style.bottom = (bottom / 14) + 'em';\n }", "title": "" }, { "docid": "e5f86ceb2a94a65beb98dcd7ec0d68b6", "score": "0.5721092", "text": "function activateBubble(d, i) {\n // increase this bubble and decrease others\n var t = svg.transition()\n .duration(d3.event.altKey ? 7500 : 350);\n\n t.selectAll(\".topBubble\")\n .attr(\"cx\", function (d, ii) {\n if (i == ii) {\n // Nothing to change\n return oR * (3 * (1 + ii) - 1) - 0.6 * oR * (ii - 1);\n } else {\n // Push away a little bit\n if (ii < i) {\n // left side\n return oR * 0.6 * (3 * (1 + ii) - 1);\n } else {\n // right side\n return oR * (nTop * 3 + 1) - oR * 0.6 * (3 * (nTop - ii) - 1);\n }\n }\n })\n .attr(\"r\", function (d, ii) {\n if (i == ii)\n return oR * 1.8;\n else\n return oR * 0.8;\n });\n\n t.selectAll(\".topBubbleText\")\n .attr(\"x\", function (d, ii) {\n if (i == ii) {\n // Nothing to change\n return oR * (3 * (1 + ii) - 1) - 0.6 * oR * (ii - 1);\n } else {\n // Push away a little bit\n if (ii < i) {\n // left side\n return oR * 0.6 * (3 * (1 + ii) - 1);\n } else {\n // right side\n return oR * (nTop * 3 + 1) - oR * 0.6 * (3 * (nTop - ii) - 1);\n }\n }\n })\n .attr(\"font-size\", function (d, ii) {\n if (i == ii)\n return 10 * 1.5;\n else\n return 10 * 0.6;\n });\n\n var signSide = -1;\n for (var k = 0; k < nTop; k++) {\n signSide = 1;\n if (k < nTop / 2) signSide = 1;\n t.selectAll(\".childBubbleText\" + k)\n .attr(\"x\", function (d, i) {\n return (oR * (3 * (k + 1) - 1) - 0.6 * oR * (k - 1) + signSide * oR * 2.5 * Math.cos((i - 1) *\n 45 / 180 * 3.1415926));\n })\n .attr(\"y\", function (d, i) {\n return ((h + oR) / 3 + signSide * oR * 2.5 * Math.sin((i - 1) * 45 / 180 * 3.1415926));\n })\n .attr(\"font-size\", function () {\n return (k == i) ? 12 : 6;\n })\n .style(\"opacity\", function () {\n return (k == i) ? 1 : 0;\n });\n\n t.selectAll(\".childBubble\" + k)\n .attr(\"cx\", function (d, i) {\n return (oR * (3 * (k + 1) - 1) - 0.6 * oR * (k - 1) + signSide * oR * 2.5 * Math.cos((i - 1) *\n 45 / 180 * 3.1415926));\n })\n .attr(\"cy\", function (d, i) {\n return ((h + oR) / 3 + signSide * oR * 2.5 * Math.sin((i - 1) * 45 / 180 * 3.1415926));\n })\n .attr(\"r\", function () {\n return (k == i) ? (oR * 0.55) : (oR / 3.0);\n })\n .style(\"opacity\", function () {\n return (k == i) ? 1 : 0;\n });\n }\n}", "title": "" }, { "docid": "a99a824c3717a2ce549d77810c2ab2d3", "score": "0.57146835", "text": "function splitBubbles() {\n\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\n simulation.force('x', d3.forceX().strength(forceStrength).x(xPos));\n //simulation.force('y', d3.forceY().strength(forceStrength).y(yPos));\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "1cbfc8c5dba439bf86dd4bec1de02154", "score": "0.57126397", "text": "bubbleReachedTop()\r\n\t{\r\n\t\tthis.bubbles.forEach((bubble ,i)=>{\r\n\t\t\tif(bubble.y<0)\r\n\t\t\t{\r\n\t\t\t\tconsole.log('Done');\r\n\t\t\t\tthis.bubbles.splice(i ,1);\r\n\t\t\t\tthis.bubbleReached = true;\r\n\t\t\t\tpowerDown.play();\r\n\t\t\t\tsetTimeout(() =>{\r\n\t\t\t\t\tthis.bubbleReached =false;\r\n\t\t\t\t}, 1000);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "6841c7a03a0a3f549839ea8ed68b5648", "score": "0.5671759", "text": "buildGraph(bubbles) {\n this.graph = []\n for (let i = 0; i < bubbles.length; i++) this.graph.push([])\n for (let i = 0; i < bubbles.length; i++) {\n for (let j = i + 1; j < bubbles.length; j++) {\n if (bubbles[i].intersects(bubbles[j])) {\n this.graph[i].push(j)\n this.graph[j].push(i)\n }\n }\n }\n return this.graph\n }", "title": "" }, { "docid": "ed06c566d52f7f256ff1cd5005c5789b", "score": "0.5591248", "text": "function mouseClicked(){\nlet r = random(10,30);\nlet b = new Bubble(mouseX, mouseY, r);\n // add a value to the end of the array, no matter the length of the array\nbubbles.push(b);\n\n}", "title": "" }, { "docid": "1f62a170673bf90f48ce52b2cf6bef03", "score": "0.557084", "text": "function bubble(arr) {\n let len = arr.length - 1;\n while (len > 0) {\n for (let i = 0; i <= len; i++) {\n if (arr[i] > arr[i + 1]) {\n let temp = arr[i + 1];\n arr[i + 1] = arr[i];\n arr[i] = temp;\n // constructor de cartas ordenadas\n let temp2 = cardsUbication.children[i + 1].innerHTML;\n cardsUbication.children[i + 1].innerHTML =\n cardsUbication.children[i].innerHTML;\n cardsUbication.children[i].innerHTML = temp2;\n }\n }\n len--;\n }\n }", "title": "" }, { "docid": "8ecdb2d31f932eac6c93f3e6f6282d97", "score": "0.55648094", "text": "function mousePressed(){\n\n\tbubbles.push(new Bubble(mouseX,mouseY));\n\n}", "title": "" }, { "docid": "dff51c7236659652d45e16d329f62ed1", "score": "0.55459404", "text": "createBubble(parent){\n // local var bubble being saved as a new DIV element\n let bub1 = document.createElement(\"DIV\");\n // adding class so new div can take proper styling\n bub1.classList.add(\"circle\");\n //appending bubble to parent element\n parent.appendChild(bub1);\n\n // timout to make the bubble grow & pop to random location\n setTimeout(() => {\n // giving random left location using string concatenation\n bub1.style.left = `${Math.floor(Math.random()*100)}%`;\n // giving random right location using string concatenation\n bub1.style.top = `${Math.floor(Math.random()*100)}%`;\n // setting dimenstions of circle\n bub1.style.width='15rem';\n bub1.style.height='15rem';\n bub1.style.borderRadius='1rem';\n\n // assigning a background color to the div\n bub1.style.background = `${this.backgroundColors[Math.floor(Math.random()*this.backgroundColors.length)]}`;\n }, 1);\n\n // another timeout to clear the styles\n setTimeout(() => {\n bub1.style.width='0rem';\n bub1.style.height='0rem';\n bub1.style.borderRadius='50%';\n }, 3000);\n\n // another timeout to fully delete the node from the document \n setTimeout(() => {\n this.bubblecontainer.removeChild(bub1);\n }, 7000);\n\n }", "title": "" }, { "docid": "78dc1d0305936e1de21ecf9790df21b0", "score": "0.5541236", "text": "function deleteBubble() {\r\n\t\tvar divOut = document.getElementsByClassName(\"bubbleCenter\")\r\n\t\tvar divIn = document.getElementsByClassName(\"bubble\")\r\n\t\tif (divOut && divIn) {\r\n\t\t\tfor (var i = divOut.length - 1; 0 <= i; i--) {\r\n\t\t\t\tdivIn[i].remove(divIn[i])\r\n\t\t\t\tdivOut[i].remove(divOut[i])\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "28bbf1f4cd1c11d303f46c07e1f55843", "score": "0.55080885", "text": "function splitBubbles(displayName) {\n if (displayName === 'styles'){\n showStyles();\n force.on('tick', function (e) {\n\n background_image.attr(\"xlink:href\", \"images/Style.png\");\n\n bubbles.each(moveToStyles(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; })\n .attr('rx', function (d) { return d.radius; })\n .attr('ry', function (d) { return d.radius; });\n });\n }\n else if (displayName === 'gender'){\n showGen();\n force.on('tick', function (e) {\n\n background_image.attr(\"xlink:href\", \"images/Gender.png\");\n\n bubbles.each(moveToGen(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; })\n .attr('rx', function (d) { return d.radius; })\n .attr('ry', function (d) { return d.radius; });\n });\n }\n else if (displayName === 'political'){\n showPoli();\n force.on('tick', function (e) {\n\n background_image.attr(\"xlink:href\", \"images/Poli.png\");\n\n bubbles.each(moveToPoli(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; })\n .attr('rx', function (d) { return d.radius; })\n .attr('ry', function (d) { return d.radius; });\n });\n }\n force.start();\n }", "title": "" }, { "docid": "0a99ce03a503143ea6b7d6b68be9c047", "score": "0.54869646", "text": "function groupBubbles() {\n hideStyles();\n hideGen();\n hidePoli();\n hideYear();\n hideEmp();\n hidePrice();\n hideAge();\n hideWS();\n hideMS();\n hideGeo();\n hideSearch();\n\n background_image.attr(\"xlink:href\", \"images/All.png\");\n\n force.on('tick', function (e) {\n\n bubbles.each(moveToCenter(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; })\n .attr('rx', function (d) { return d.radius; })\n .attr('ry', function (d) { return d.radius; });\n });\n\n force.start();\n }", "title": "" }, { "docid": "44613d8810898fcd4eac363a7eaa34f4", "score": "0.5480128", "text": "function showbubbles() { \n for(var i=0; i<bubbles.length; i++) {\n bubbles[i].move();\n bubbles[i].display();\n }\n}", "title": "" }, { "docid": "d6f8404275033ac5e672f01a43fbd996", "score": "0.5469294", "text": "function splitBubbles() {\n showVolumeTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodeVolumePos));\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "a9c4cdfcafb8faa14442a94ba0dad1e1", "score": "0.5466224", "text": "function buildBubble() {\r\n\r\n // Get needed data\r\n var revenue = femaledata.map(d => d.revenue);\r\n var budget = femaledata.map(d => d.budget);\r\n var similarity = femaledata.map(d => d.similarity_score*200);\r\n var title = femaledata.map(d => d.title);\r\n var genres = femaledata.map(d => d.genres);\r\n var director = femaledata.map(d => d.director);\r\n var release = femaledata.map(d => d.release_date);\r\n var runtime = femaledata.map(d => d.runtime);\r\n\r\n // Build BUBBLE\r\n var Hoverinfo = []\r\n for (i=0;i<director.length;i++){\r\n p = {\"Title\":title[i], \"Genre\": genres[i], \"Director\":director[i],\r\n \"Release_Date\":release[i],\"Run_Time\":runtime[i]+\" min.\"}\r\n Hoverinfo.push(p)\r\n }\r\n var data = [{\r\n x: revenue,\r\n y: budget,\r\n text: Hoverinfo,\r\n type: 'scatter',\r\n mode: 'markers',\r\n marker: {\r\n size: similarity,\r\n color: revenue,\r\n colorscale: \"Bluered\",\r\n },\r\n hovertemplate:\r\n \"<b>Title:</b> %{text.Title}<br><b>Genre:</b> %{text.Genre}<br><b>Director:</b> %{text.Director}<br><b>Release Date:</b> %{text.Release_Date} <br> <b>Run Time:</b>%{text.Run_Time}<extra></extra>\"\r\n }];\r\n var layout = {\r\n title: `Female Lead or Directed Film Recommendations`,\r\n font: { size: 13 },\r\n xaxis: { title: \"Revenue\" },\r\n yaxis: {title: \"Budget\"}\r\n };\r\n Plotly.newPlot('bubble', data, layout); \r\n}", "title": "" }, { "docid": "ac4c9fe0c96d7ffca72f6d1fe46030a8", "score": "0.54330695", "text": "function showBubbleCaption() {\n let $bubbles = $('.bubble')\n let $captions = $('.bubble-caption')\n\n $bubbles.on('mouseover', function() {\n let $th = $(this)\n let caption = $th.find('.bubble-caption')\n\n if (caption.length !== 0) {\n caption.addClass('active')\n }\n })\n\n $bubbles.on('mouseout', function() {\n $captions.removeClass('active')\n })\n }", "title": "" }, { "docid": "682d188fd7054a268595ea1852c8fa28", "score": "0.54318595", "text": "function draw() {\n background(65, 120, 25);\n for (var i = 0; i < bubbles.length; i++) {// Goes through all the numbers from 0 through entire array to move and display bubble objects. \n bubbles[i].move();\n bubbles[i].display();//displays index value in this case it wouid start with var i then switch with the loop.\n }\n}", "title": "" }, { "docid": "d5f91d6a1a71a42a277dd7803f797dc2", "score": "0.5417255", "text": "function animateBubbles(){\n for(let i = 0; i < 5; i++) {\n images[i].transition()\n .duration(7000)\n .attr(\"height\", Math.sqrt(bubbleObjects[i].second / Math.PI)/2)\n .attr(\"width\", Math.sqrt(bubbleObjects[i].second / Math.PI)/2)\n\n bubbles[i].transition()\n .duration(7000)\n .attr(\"r\", Math.sqrt(bubbleObjects[i].second / Math.PI)/4)\n\n let format = d3.format(\",\")\n streamCounts[i].transition()\n .tween(\"text\", function(){\n let interpolator = d3.interpolateNumber(\n bubbleObjects[i].first,\n bubbleObjects[i].second\n )\n return function(t){\n d3.select(this).text(format(Math.round(interpolator(t))))\n }\n })\n .attr(\"y\", 320-(Math.sqrt(bubbleObjects[i].second / Math.PI)/4)-18)\n .duration(6350)\n\n songTitles[i].transition()\n .duration(7100)\n .attr(\"y\", 320+(Math.sqrt(bubbleObjects[i].second / Math.PI)/4)+35)\n }\n d3.selectAll(\"#bubbleannotation\")\n .transition()\n .delay(6350)\n .duration(2000)\n .style(\"opacity\", \"1\")\n}", "title": "" }, { "docid": "e8c8f8bf7ce8a99599f1207d1a240bee", "score": "0.5410205", "text": "bubble() {\n return body.querySelector(\".\" + conf.cssClass);\n }", "title": "" }, { "docid": "f0971d69b7afaaa43cea6b4a0c9d6664", "score": "0.5399147", "text": "function splitBubblesPosition() {\n showpositionTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to their position centers\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodepositionPosX));\n simulation.force('y', d3.forceY().strength(forceStrength).y(nodepositionPosY));\n simulation.force('charge', d3.forceManyBody().strength(charge));\n\n if (floorPlanShowing === true){\n document.getElementById(\"floorPlanBackground\").removeChild(floorPlanImage);\n document.getElementById(\"sliderContainer\").removeChild(floorPlanSlider);\n document.getElementById(\"mostSolitary\").innerHTML = \"\";\n document.getElementById(\"mostCollaborative\").innerHTML = \"\";\n d3.selectAll('.bubble')\n .attr(\"opacity\", 1);\n floorPlanShowing = false;\n }\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "5383caf89cece632bc3beb7f6f5c6ee9", "score": "0.5397408", "text": "function setMessageBubble() {\n //var me = $('.conv-detail-pannel').find('.content-pannel-body').find('.chat-item.me').find('.msg-bubble-area').find('.msg-bubble');\n //$('.conv-detail-pannel').find('.content-pannel-body').find('.chat-item.me').find('.msg-bubble-area').find('.msg-bubble').css('max-width', 'none');\n //$('.conv-detail-pannel').find('.content-pannel-body').find('.chat-item.not-me').find('.msg-bubble-area').find('.msg-bubble').css('max-width', 'none');\n $('.msg-bubble').css('max-width', 'none');\n}", "title": "" }, { "docid": "4301d97a0b5abafca348a9fdc8b8f3aa", "score": "0.53936255", "text": "function ws_bubbles(b,l,n){var e=jQuery;var f=e(this);var i=b.noCanvas||!document.createElement(\"canvas\").getContext;var k=b.width,p=b.height;var g=e(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_bubbles\").appendTo(n);if(!i){var a=e(\"<canvas>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\"}).appendTo(g);var o=a.get(0).getContext(\"2d\")}var j={easeOutBack:function(u,v,h,z,y,w){if(w==undefined){w=1.70158}return z*((v=v/y-1)*v*((w+1)*v+w)+1)+h},easeOutBackCubic:function(u,v,h,A,z,w){var y=(v/=z)*v;return h+A*(-1.5*y*v*y+2*y*y+4*y*v+-9*y+5.5*v)},easeOutCubic:function(u,v,h,y,w){return y*((v=v/w-1)*v*v+1)+h},easeOutExpo:function(u,v,h,y,w){return(v==w)?h+y:y*(-Math.pow(2,-10*v/w)+1)+h}};var s=[[\"#bbbbbb\",0.5,0.5],[\"#b3b3b3\",0.2,0.2],[\"#b6b6b6\",0.5,0.2],[\"#b9b9b9\",0.8,0.2],[\"#cccccc\",0.2,0.8],[\"#c3c3c3\",0.5,0.8],[\"#c6c6c6\",0.8,0.8]];var c=[[[0.5,0.5,0.7,0.15],[0.5,0.5,0.6,0.3],[0.5,0.5,0.5,0.45],[0.5,0.5,0.4,0.6],[0.5,0.5,0.3,0.75],[0.5,0.5,0.2,0.9],[0.5,0.5,0.1,1]],[[0.5,0.5,0.7,1],[0.5,0.5,0.6,0.9],[0.5,0.5,0.5,0.75],[0.5,0.5,0.4,0.6],[0.5,0.5,0.3,0.45],[0.5,0.5,0.2,0.3],[0.5,0.5,0.1,0.15]]];var m=[[[0.5,0.5,0,1],[0.5,0.5,0,0.9],[0.5,0.5,0,0.75],[0.5,0.5,0,0.6],[0.5,0.5,0,0.45],[0.5,0.5,0,0.3],[0.5,0.5,0,0.15]],[[0.5,0.5,0,0.15],[0.5,0.5,0,0.3],[0.5,0.5,0,0.45],[0.5,0.5,0,0.6],[0.5,0.5,0,0.75],[0.5,0.5,0,0.9],[0.5,0.5,0,1]],[[0.5,7.5,0.7,0.75],[0.5,7.5,0.6,0.15],[0.5,7.5,0.5,1],[0.5,7.5,0.4,0.3],[0.5,7.5,0.3,0.45],[0.5,7.5,0.2,0.6],[0.5,7.5,0.1,0.9]],[[0.5,7.5,0.7,1],[0.5,7.5,0.6,0.9],[0.5,7.5,0.5,0.75],[0.5,7.5,0.4,0.6],[0.5,7.5,0.3,0.45],[0.5,7.5,0.2,0.3],[0.5,7.5,0.1,0.15]]];function d(u){if(Object.prototype.toString.call(u)===\"[object Array]\"){return u[Math.floor(Math.random()*(u.length))]}else{var h;var t=0;for(var v in u){if(Math.random()<1/++t){h=v}}return/linear|swing/g.test(h)?d(u):h}}function q(B,A,v,z,t){B.clearRect(0,0,k,p);for(var u=0,y=v.length;u<y;u++){var h=Math.max(0,Math.min(1,A-v[u][3]*(1-A)));if(t&&j[t]){h=j[t](1,h,0,1,1,1)}var w=k;if(k/p<=1.8&&k/p>0.7){w*=2}else{if(k/p<=0.7){w=p*2}}var x=v[u][2]*h*w;if(z){x=(v[u][2]+(z[u][2]-v[u][2])*h)*w}x=Math.max(0,x);B.beginPath();B.arc((v[u][0]+((z?z[u][0]:0.5)-v[u][0])*h)*k,(v[u][1]+((z?z[u][1]:0.5)-v[u][1])*h)*p,x,0,2*Math.PI,false);B.fillStyle=s[u][0];B.fill()}}this.go=function(B,w){if(i){n.find(\".ws_list\").css(\"transform\",\"translate3d(0,0,0)\").stop(true).animate({left:(B?-B+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},b.duration,\"easeInOutExpo\",function(){f.trigger(\"effectEnd\")})}else{k=n.width();p=n.height();a.attr({width:k,height:p});var z=l.get(w);for(var x=0,A=s.length;x<A;x++){var u=Math.abs(s[x][1]),h=Math.abs(s[x][2]);s[x][0]=r(z,{x:u*k,y:h*p,w:2,h:2})||s[x][0]}var t=d(c);var v=d(m);var y=d(j);wowAnimate(function(C){q(o,C,t,0,y)},0,1,b.duration/2,function(){n.find(\".ws_list\").css({left:(B?-B+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))});y=d(j);wowAnimate(function(C){q(o,1-C,v,t,y)},0,1,b.duration/2,function(){o.clearRect(0,0,k,p);f.trigger(\"effectEnd\")})})}};function r(C,t){t=t||{};var E=1,w=t.exclude||[],B;var y=document.createElement(\"canvas\"),v=y.getContext(\"2d\"),u=y.width=C.naturalWidth,I=y.height=C.naturalHeight;v.drawImage(C,0,0,C.naturalWidth,C.naturalHeight);try{B=v.getImageData(t.x?t.x:0,t.y?t.y:0,t.w?t.w:C.width,t.h?t.h:C.height)[\"data\"]}catch(D){return false}var x=(t.w?t.w:C.width*t.h?t.h:C.height)||B.length,z={},G=\"\",F=[],h={dominant:{name:\"\",count:0}};var A=0;while(A<x){F[0]=B[A];F[1]=B[A+1];F[2]=B[A+2];G=F.join(\",\");if(G in z){z[G]=z[G]+1}else{z[G]=1}if(w.indexOf([\"rgb(\",G,\")\"].join(\"\"))===-1){var H=z[G];if(H>h.dominant.count){h.dominant.name=G;h.dominant.count=H}}A+=E*4}return[\"rgb(\",h.dominant.name,\")\"].join(\"\")}}", "title": "" }, { "docid": "d20dab3886c1a0d6085fb137c502e804", "score": "0.53886276", "text": "function draw(){\n\tsmooth();\n\t//frameRate(20);\n\tbackground(15,15,10);\n\tfor (var i = 0; i<bubbles.length; i++){\n \t\tbubbles[i].display();\n \t\tbubbles[i].bound();\n \t\tbubbles[i].move();\n \t}\n}", "title": "" }, { "docid": "b68dde7d5bd291dd127f759c38c897d0", "score": "0.5381197", "text": "function splitBubbles() {\n hideMonths();\n hideTags();\n showYears();\n\n\n\n force.on('tick', function(e) {\n bubbles.each(moveToYears(e.alpha))\n .attr('r', function(d) {\n if (resize == 1) {\n return d.radius / 2;\n } else {\n return d.radius;\n }\n })\n .attr('cx', function(d) {\n return d.x;\n })\n .attr('cy', function(d) {\n return d.y;\n });\n });\n\n force.start();\n }", "title": "" }, { "docid": "2e1c0feb5afc4c4a0bf15297a5ac8358", "score": "0.5377895", "text": "function bubbleEvent(element,type,eventObject){while(element){var handlers=lookupListeners(element,type);for(var i=0,len=handlers.length;i<len;i++){handlers[i].listener.call(element,eventObject);}element=element.parentNode;}}", "title": "" }, { "docid": "8bf5c2a521aba4ed9c3532958f6dde2e", "score": "0.53632224", "text": "update () {\n // Calculate offset between the button and the h5p frame\n const offset = this.getOffsetBetween(this.$h5pContainer, this.$reference);\n\n // Compute bubbleWidth (after changing the content);\n const bubbleWidth = Math.min(offset.outerWidth * 0.9, (this.maxWidth === 'auto') ? this.$innerBubble.outerWidth() : this.maxWidth);\n const bubblePosition = this.getBubblePosition(bubbleWidth, offset);\n const tailPosition = this.getTailPosition(this.$reference, bubblePosition);\n // Need to set font-size, since element is appended to body.\n // Using same font-size as parent. In that way it will grow accordingly\n // when resizing\n const fontSize = 16;//parseFloat($parent.css('font-size'));\n\n // Set width and position of speech bubble\n this.$bubble.css({\n width: (this.maxWidth === 'auto') ? 'auto' : this.maxWidth + 'px',\n bottom: bubblePosition.bottom + 'px',\n left: bubblePosition.left + 'px',\n fontSize: fontSize + 'px'\n });\n\n const preparedTailCSS = {\n bottom: tailPosition.bottom + 'px',\n left: tailPosition.left + 'px'\n };\n this.$tail.css(preparedTailCSS);\n this.$innerTail.css(preparedTailCSS);\n }", "title": "" }, { "docid": "2644ce0e33cf411c414f8b259b76214b", "score": "0.5352135", "text": "function updateBubbles(curLen) {\n distances.forEach(elem => {\n if (curLen >= elem.distBar) {\n $(elem.selector + \" img:nth-child(1)\").removeClass(\"active\");\n $(elem.selector + \" img:nth-child(2)\").addClass(\"active\");\n } else {\n $(elem.selector + \" img:nth-child(1)\").addClass(\"active\");\n $(elem.selector + \" img:nth-child(2)\").removeClass(\"active\");\n }\n });\n\n dots.forEach(elem => {\n if (curLen >= elem.bar) {\n $(elem.selector).removeClass(\"invis\");\n } else {\n $(elem.selector).addClass(\"invis\");\n }\n });\n}", "title": "" }, { "docid": "1799b0c6f01d9f0f472be40a814f7915", "score": "0.5350682", "text": "bubble(handle, data, upwards = true) {\n _bubble(this, handle, data, upwards);\n }", "title": "" }, { "docid": "151d91b9c2f3837ba58b5b971cd08567", "score": "0.53486013", "text": "setOriginData(el, bubble) {\n bubble.vTitleOrigin = el;\n }", "title": "" }, { "docid": "1818dedb0b06b1a8826d1c3a6154284c", "score": "0.5338064", "text": "function drawBubble(bubble) {\t\t\t\t\n\t\tctx.beginPath();\n\t\tctx.lineWidth = 1;\n\t\tctx.strokeStyle = \"blue\";\n\t\tctx.arc(bubble.x, bubble.y, bubble.r, 0, 2 * Math.PI);\n\t\tctx.stroke();\n\t}", "title": "" }, { "docid": "bd82d9c10ad74e976b4543047647cb8a", "score": "0.5326495", "text": "bubbleUp() {\n let idx = this.values.length - 1;\n const element = this.values[idx];\n while (idx > 0) {\n let parentIdx = Math.floor((idx - 1) / 2);\n let parent = this.values[parentIdx];\n if (element.priority >= parent.priority) break;\n this.values[parentIdx] = element;\n this.values[idx] = parent;\n idx = parentIdx;\n }\n }", "title": "" }, { "docid": "0196c66bd94440fb915e1a4f9705fb8c", "score": "0.53194314", "text": "function _bubble(arr) {\n for (let i = 0; i < arr.length - 1; i++) {\n for (let j = 0; j < arr.length - 1 - i; j++) {\n if (arr[j] > arr[j + 1]) {\n let temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n }\n }\n }\n\n return arr;\n}", "title": "" }, { "docid": "365669de000eb2da849db3fe8b273b18", "score": "0.5307056", "text": "function buildBubble() {\n\n const recipDisbUrl1011 = \"/annualdata/all/recipients_disbursements/1011\"\n\n d3.json(recipDisbUrl1011).then(function (data) {\n\n const BUBBLE = document.getElementById(\"bubble-graph\");\n\n var dlsbBubble = {\n x: data.map(a => a.total_dlsb_sum),\n y: data.map(a => a.avgdebt_dlsb),\n name: 'Dir Sub',\n mode: 'markers',\n marker: {\n color: '#3C1642',\n size: data.map(a => a.total_dlsb_recip) / 100000\n },\n opacity: 0.75\n };\n\n var ugdlusBubble = {\n x: data.map(a => a.total_ugdlus_sum),\n y: data.map(a => a.avgdebt_ugdlus),\n name: 'Dir Unsub',\n mode: 'markers',\n marker: {\n color: '#086375',\n size: data.map(a => a.total_ugdlus_recip) / 100000\n },\n opacity: 0.75\n };\n\n var grdlusBubble = {\n x: data.map(a => a.total_grdlus_sum),\n y: data.map(a => a.avgdebt_grdlus),\n name: 'Gr Unsub',\n mode: 'markers',\n marker: {\n color: '#1DD3B0',\n size: data.map(a => a.total_grdlus_recip) / 100000\n },\n opacity: 0.75\n };\n\n var prplusBubble = {\n x: data.map(a => a.total_prplus_sum),\n y: data.map(a => a.avgdebt_prplus),\n name: 'Pr Plus',\n mode: 'markers',\n marker: {\n color: '#AFFC41',\n size: data.map(a => a.total_prplus_recip) / 100000\n },\n opacity: 0.75\n };\n\n var grplusBubble = {\n x: data.map(a => a.total_grplus_sum),\n y: data.map(a => a.avgdebt_grplus),\n name: 'Gr Plus',\n mode: 'markers',\n marker: {\n color: '#002B2B',\n size: data.map(a => a.total_grplus_recip) / 100000\n },\n opacity: 0.75\n };\n\n var grdlsbBubble = {\n x: data.map(a => a.total_grdlsb_sum),\n y: data.map(a => a.avgdebt_grdlsb),\n name: 'Gr Unsub',\n mode: 'markers',\n marker: {\n color: '#F9FC5A',\n size: data.map(a => a.total_grdlsb_recip) / 100000\n },\n opacity: 0.75\n };\n\n const loanData = [dlsbBubble, ugdlusBubble, grdlusBubble, prplusBubble, grplusBubble, grdlsbBubble]\n\n const bubbleLayout = {\n title: { text: `Loan Recipient Data over the Years`, size: 18 },\n xaxis: {\n title: \"Dollars Disbursed<br>Note: Size of bubble denotes number of recipients.\",\n range: [5000000000, 35000000000]\n },\n yaxis: {\n title: \"Average Debt in Dollars\",\n range: [0, 25000]\n },\n font: { family: 'Quicksand, sans-serif' }\n };\n\n Plotly.newPlot(BUBBLE, loanData, bubbleLayout, { responsive: true });\n })\n\n}", "title": "" }, { "docid": "9f26c338bfe3122c0b101c87ae8f7b23", "score": "0.53054684", "text": "setPointerPositionBubble(bubbleObj) {\n if (this.pointerPos.isMoved === true) {\n if (this.pointerPos.clientX > this.container.offsetWidth - this.bubblesGlassObj.width / 2) {\n bubbleObj.XPos = this.container.offsetWidth - this.bubblesGlassObj.width / 2 - this.bubbleElObj.width / 2;\n } else if (this.pointerPos.clientX < this.bubblesGlassObj.width / 2) {\n bubbleObj.XPos = this.bubblesGlassObj.width / 2 - this.bubbleElObj.width / 2;\n } else {\n bubbleObj.XPos = this.pointerPos.clientX - this.bubbleElObj.width / 2;\n }\n\n if (this.pointerPos.clientY < 200) {\n bubbleObj.YPos = 200 - this.bubbleElObj.height;\n } else if (this.pointerPos.clientY > this.container.offsetHeight - this.bubblesGlassObj.height) {\n bubbleObj.YPos = this.container.offsetHeight - this.bubblesGlassObj.height - this.bubbleElObj.height;\n } else {\n bubbleObj.YPos = this.pointerPos.clientY - this.bubbleElObj.height;\n }\n }\n }", "title": "" }, { "docid": "7fdbfb79b9d1cc1b83833234a5f7c0fa", "score": "0.5303171", "text": "function bubble(e) {\n // stop! that! propagation!\n e.stopPropagation();\n\n console.log(this.firstChild.nodeValue.trim() + ' bubbled');\n}", "title": "" }, { "docid": "d5c2828c361d9cc151433be725c2edfa", "score": "0.53022605", "text": "function drawBubbles() {\n push();\n var bubblesAlive = bubbles.length;\n var bubbleSize = 2;\n\n for (var i=0; i<bubblesAlive; ++i) {\n if (bubbles[i].y > height * .25) {\n // draw bubble\n stroke(bubbles[i].c);\n fill(bubbles[i].c);\n ellipse(bubbles[i].x, bubbles[i].y, \n bubbleSize * bubbles[i].scale, bubbleSize * bubbles[i].scale);\n \n // modify coordinates and size\n bubbles[i].x += bubbleSize * random(-2, 2);\n bubbles[i].y -= 5;\n bubbles[i].scale += .1\n }\n else { // remove bubble if it has hit surface of water\n bubbles.shift();\n bubblesAlive--;\n }\n }\n pop();\n}", "title": "" }, { "docid": "4b615d4c74139d1bd32f0779b7519a45", "score": "0.529716", "text": "updateGasBubbles() {\n\n\t\tfor ( let i = 0; i < this.gasBubbleActualAmount; i ++ ) {\n\n\t\t\t//wandering positions\n\t\t\tlet nX = this.radius * 0.08 * sin( ( i * 5 ) + ( time * 0.5 ) * 0.3 );\n\t\t\tlet nY = this.radius * 0.08 * sin( ( i * 8 ) + ( time * 0.5 ) * 0.4 );\n\n\t\t\tnX -= this.velocity.x;\n\t\t\tnY -= this.velocity.y;\n\n\t\t\tcircle(\n\t\t\t\tthis.position.x + this.gasBubblePositions[ i ].x + nX,\n\t\t\t\tthis.position.y + this.gasBubblePositions[ i ].y + nY,\n\t\t\t\t5\n\t\t\t);\n\n\t\t}\n\n\t\tif ( this.gasBubbleAmount < this.gasBubbleActualAmount ) {\n\n\t\t\tthis.gasBubbleActualAmount --;\n\n\t\t} else if ( this.gasBubbleAmount > this.gasBubbleActualAmount ) {\n\n\t\t\tthis.gasBubbleActualAmount ++;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "7dfebd81987d7b4749d880dcc69f51c4", "score": "0.5275135", "text": "resetPointerPositionBubble(bubbleObj) {\n if (bubbleObj.YPos < -this.bubbleElObj.height) {\n if (this.pointerPos.isMoved === true) {\n if (this.pointerPos.clientX > this.container.offsetWidth - this.bubblesGlassObj.width / 2) {\n bubbleObj.XPos = this.container.offsetWidth - this.bubblesGlassObj.width / 2 - this.bubbleElObj.width / 2;\n } else if (this.pointerPos.clientX < this.bubblesGlassObj.width / 2) {\n bubbleObj.XPos = this.bubblesGlassObj.width / 2 - this.bubbleElObj.width / 2;\n } else {\n bubbleObj.XPos = this.pointerPos.clientX - this.bubbleElObj.width / 2;\n }\n \n if (this.pointerPos.clientY < 200) {\n bubbleObj.YPos = 200 - this.bubbleElObj.height;\n } else if (this.pointerPos.clientY > this.container.offsetHeight - this.bubblesGlassObj.height) {\n bubbleObj.YPos = this.container.offsetHeight - this.bubblesGlassObj.height - this.bubbleElObj.height;\n } else {\n bubbleObj.YPos = this.pointerPos.clientY - this.bubbleElObj.height;\n }\n } else {\n bubbleObj.XPos = this.container.offsetWidth / 2 - this.bubbleElObj.width / 2;\n bubbleObj.YPos = this.container.offsetHeight - this.bubblesGlassObj.height - this.bubbleElObj.height;\n }\n }\n }", "title": "" }, { "docid": "85502044cb92f3c6766333d89f81ff9e", "score": "0.5266841", "text": "function ws_bubbles(c,m,o){var f=jQuery;var g=f(this);var j=c.noCanvas||!document.createElement(\"canvas\").getContext;var l=c.width,q=c.height;var i=f(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_bubbles\").appendTo(o);if(!j){var b=f(\"<canvas>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\"}).appendTo(i);var p=b.get(0).getContext(\"2d\")}var k={easeOutBack:function(u,v,h,z,y,w){if(w==undefined){w=1.70158}return z*((v=v/y-1)*v*((w+1)*v+w)+1)+h},easeOutBackCubic:function(u,v,h,A,z,w){var y=(v/=z)*v;return h+A*(-1.5*y*v*y+2*y*y+4*y*v+-9*y+5.5*v)},easeOutCubic:function(u,v,h,y,w){return y*((v=v/w-1)*v*v+1)+h},easeOutExpo:function(u,v,h,y,w){return(v==w)?h+y:y*(-Math.pow(2,-10*v/w)+1)+h}};var t=[[\"#bbbbbb\",0.5,0.5],[\"#b3b3b3\",0.2,0.2],[\"#b6b6b6\",0.5,0.2],[\"#b9b9b9\",0.8,0.2],[\"#cccccc\",0.2,0.8],[\"#c3c3c3\",0.5,0.8],[\"#c6c6c6\",0.8,0.8]];var d=[[[0.5,0.5,0.7,0.15],[0.5,0.5,0.6,0.3],[0.5,0.5,0.5,0.45],[0.5,0.5,0.4,0.6],[0.5,0.5,0.3,0.75],[0.5,0.5,0.2,0.9],[0.5,0.5,0.1,1]],[[0.5,0.5,0.7,1],[0.5,0.5,0.6,0.9],[0.5,0.5,0.5,0.75],[0.5,0.5,0.4,0.6],[0.5,0.5,0.3,0.45],[0.5,0.5,0.2,0.3],[0.5,0.5,0.1,0.15]]];var n=[[[0.5,0.5,0,1],[0.5,0.5,0,0.9],[0.5,0.5,0,0.75],[0.5,0.5,0,0.6],[0.5,0.5,0,0.45],[0.5,0.5,0,0.3],[0.5,0.5,0,0.15]],[[0.5,0.5,0,0.15],[0.5,0.5,0,0.3],[0.5,0.5,0,0.45],[0.5,0.5,0,0.6],[0.5,0.5,0,0.75],[0.5,0.5,0,0.9],[0.5,0.5,0,1]],[[0.5,7.5,0.7,0.75],[0.5,7.5,0.6,0.15],[0.5,7.5,0.5,1],[0.5,7.5,0.4,0.3],[0.5,7.5,0.3,0.45],[0.5,7.5,0.2,0.6],[0.5,7.5,0.1,0.9]],[[0.5,7.5,0.7,1],[0.5,7.5,0.6,0.9],[0.5,7.5,0.5,0.75],[0.5,7.5,0.4,0.6],[0.5,7.5,0.3,0.45],[0.5,7.5,0.2,0.3],[0.5,7.5,0.1,0.15]]];function e(v){if(Object.prototype.toString.call(v)===\"[object Array]\"){return v[Math.floor(Math.random()*(v.length))]}else{var h;var u=0;for(var w in v){if(Math.random()<1/++u){h=w}}return/linear|swing/g.test(h)?e(v):h}}function a(w,v,y){var x=new Date().getTime();var u=function(){var A=new Date().getTime();var z=(A-x)/w;if(z<1){v(z);requestAnimationFrame(u)}else{h(1)}};u();function h(z){cancelAnimationFrame(u);if(z){v(1)}if(y){y()}}return{stop:h}}function r(C,B,w,A,u){C.clearRect(0,0,l,q);for(var v=0,z=w.length;v<z;v++){var h=Math.max(0,Math.min(1,B-w[v][3]*(1-B)));if(u&&k[u]){h=k[u](1,h,0,1,1,1)}var x=l;if(l/q<=1.8&&l/q>0.7){x*=2}else{if(l/q<=0.7){x=q*2}}var y=w[v][2]*h*x;if(A){y=(w[v][2]+(A[v][2]-w[v][2])*h)*x}y=Math.max(0,y);C.beginPath();C.arc((w[v][0]+((A?A[v][0]:0.5)-w[v][0])*h)*l,(w[v][1]+((A?A[v][1]:0.5)-w[v][1])*h)*q,y,0,2*Math.PI,false);C.fillStyle=t[v][0];C.fill()}}this.go=function(C,x){if(j){o.find(\".ws_list\").css(\"transform\",\"translate3d(0,0,0)\").stop(true).animate({left:(C?-C+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))},c.duration,\"easeInOutExpo\",function(){g.trigger(\"effectEnd\")})}else{l=o.width();q=o.height();b.attr({width:l,height:q});var A=m.get(x);for(var y=0,B=t.length;y<B;y++){var v=Math.abs(t[y][1]),h=Math.abs(t[y][2]);t[y][0]=s(A,{x:v*l,y:h*q,w:2,h:2})||t[y][0]}var u=e(d);var w=e(n);var z=e(k);a(c.duration/2,function(D){r(p,D,u,0,z)},function(){o.find(\".ws_list\").css({left:(C?-C+\"00%\":(/Safari/.test(navigator.userAgent)?\"0%\":0))});z=e(k);a(c.duration/2,function(D){r(p,1-D,w,u,z)},function(){p.clearRect(0,0,l,q);g.trigger(\"effectEnd\")})})}};function s(D,u){u=u||{};var F=1,x=u.exclude||[],C;var z=document.createElement(\"canvas\"),w=z.getContext(\"2d\"),v=z.width=D.naturalWidth,J=z.height=D.naturalHeight;w.drawImage(D,0,0,D.naturalWidth,D.naturalHeight);try{C=w.getImageData(u.x?u.x:0,u.y?u.y:0,u.w?u.w:D.width,u.h?u.h:D.height)[\"data\"]}catch(E){return false}var y=(u.w?u.w:D.width*u.h?u.h:D.height)||C.length,A={},H=\"\",G=[],h={dominant:{name:\"\",count:0}};var B=0;while(B<y){G[0]=C[B];G[1]=C[B+1];G[2]=C[B+2];H=G.join(\",\");if(H in A){A[H]=A[H]+1}else{A[H]=1}if(x.indexOf([\"rgb(\",H,\")\"].join(\"\"))===-1){var I=A[H];if(I>h.dominant.count){h.dominant.name=H;h.dominant.count=I}}B+=F*4}return[\"rgb(\",h.dominant.name,\")\"].join(\"\")}}", "title": "" }, { "docid": "2f90756438ad4fe358f88e9720651d77", "score": "0.52594775", "text": "bubbleSort() {\r\n const animation = dobubbleSort(this.state.array.slice());\r\n this.resetCounters();\r\n /* entering critical section */\r\n this.setState({\r\n animations : animation,\r\n selected_alg : 'BUBBLE'\r\n });\r\n /* existing cs */\r\n }", "title": "" }, { "docid": "749bef7db3362a0103903e64ae76915e", "score": "0.5259335", "text": "function delete_bubble(user_jid,message){\n var bubble=rainbowSDK.bubbles.getAll();\n for(i=0;i<bubble.length;i++){\n console.log(bubble[i]);\n for(j=0;j<bubble[i].users.length;j++){\n //console.log(bubble[i].users);\n if(bubble[i].users[j].jid_im==user_jid){\n console.log(bubble[i].users[j].jid_im);\n console.log(\"suppression de la bulle\");\n rainbowSDK.bubbles.deleteBubble(bubble[i]).then(function() {\n // do something once the bubble has been deleted\n console.log(\"bulle supprimée\");\n messageSent=rainbowSDK.im.sendMessageToJid(\"Bulle supprimée\",message.fromJid);\n }).catch(function(err) {\n // do something if you can't delete the bubble\n console.log(\"pb\");\n console.log(err);\n });\n\n }\n }\n }\n}", "title": "" }, { "docid": "dae7376d9bf468cb284dde33256a60ac", "score": "0.5242804", "text": "function BuildBubbleChart(testSubjectId)\n{\n // filter the sample dataset for the test subjectId\n testSubjectSample = samples.filter(d => d.id == testSubjectId)\n\n //testSubjectSample[0].reverse();\n console.log(testSubjectSample)\n \n // get the x and y values for the bubble chart\n var x = testSubjectSample[0].sample_values;\n var y = testSubjectSample[0].otu_ids;\n var text = testSubjectSample[0].otu_labels;\n\n\n // Reference : https://plotly.com/javascript/bubble-charts/\n var trace =\n {\n x: x,\n y: y,\n text: text,\n mode: \"markers\", \n marker: {\n size: x,\n color: y,\n colorscale: \"Earth\"\n }\n }\n \n // Create the data array for our plot\n var data = [trace]\n\n // Define our plot layout\n var layout = {\n xaxis :{\n \"title\" : \"OTU Ids\"\n }\n }\n\n // 8. Plot the chart to a div tag with id \"bubble-plot\"\n Plotly.plot(\"bubble\", data, layout);\n}", "title": "" }, { "docid": "2163d5b6e184751f67455034cdcf5f3c", "score": "0.5238157", "text": "function Bubble(startX,startY){\n this.x = startX;\n this.y = startY;\n this.r = 25; //r is for radius which is 1/2 the width\n this.color = color('purple');\n\n this.drawBubble = function(){\n fill(this.color);\n ellipse(this.x, this.y, this.r*2, this.r*2 );\n }\n\n this.moveBubble = function(){\n// this.x++;\n// this.y++;\n this.x += random(-2,2);\n this.y += random(-2,2);\n \n //move towrd mouse\n// var v = createVector(mouseX,mouseY);\n// this.v = createVector(this.x,this.y);\n// this.v = this.v.add(v);\n// this.x = this.v.x;\n// this.y = this.v.y;\n \n }\n}//end Bubble", "title": "" }, { "docid": "2100d26420d45996c82b14d0874c79f7", "score": "0.52324724", "text": "function generateBubble(bubbleData) {\n var chart = this,\n svg = chart.svg,\n container = chart.config.container,\n width = container.width,\n height = container.height,\n pack = d3.pack().size([width, height]).padding(1.5),\n legendData = chart.data.legendData,\n valueKey = chart.data.dataTable.value,\n labelKey = chart.data.dataTable.label,\n colors = chart._vars.color;\n\n if (!chart._vars.legendHeaders) {\n chart._vars.legendHeaders = legendData;\n }\n var dataHeaders = chart._vars.legendHeaders;\n if (!chart._vars.legendHeaders) {\n chart._vars.legendHeaders = legendData;\n }\n var bubbleDataNew = jvCharts.getToggledData(bubbleData, dataHeaders),\n legendElementToggleArray = jvCharts.getLegendElementToggleArray(dataHeaders, legendData);\n if (legendElementToggleArray) {\n for (var j = 0; j < bubbleDataNew.length; j++) {\n for (var i = 0; i < legendElementToggleArray.length; i++) {\n if (legendElementToggleArray[i].element === bubbleDataNew[j][labelKey] && legendElementToggleArray[i].toggle === false) {\n bubbleDataNew.splice(j, 1);\n }\n }\n }\n }\n svg.selectAll('.bubble').remove();\n //assigns the data to a hierarchy using parent-child relationships\n var root = d3.hierarchy({ children: bubbleDataNew }).sum(function (d) {\n return d[valueKey];\n }),\n bubble = svg.selectAll('.bubble').data(pack(root).leaves()).enter().append('g').attr('class', 'bubble').attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n\n bubble.append('circle').attr('fill', function (d, i) {\n var name = legendData.indexOf(d.data[labelKey]);\n return jvCharts.getColors(colors, name, d.data[labelKey]);\n }).attr('class', function (d, i) {\n return 'editable editable-bubble bubble-' + i + ' highlight-class-' + i;\n }).attr('r', function (d) {\n return d.r;\n }).on('mouseover', function (d, i) {\n if (chart.showToolTip) {\n //Get tip data\n var tipData = chart.setTipData(d.data, i);\n //Draw tip line\n tipData.data.color = jvCharts.getColors(colors, tipData.index, d.data[labelKey]);\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n chart.tip.d = d.data;\n chart.tip.i = i;\n }\n }).on('mousemove', function (d, i) {\n if (chart.showToolTip) {\n if (chart.tip.d === d && chart.tip.i === i) {\n chart.tip.showTip(0);\n } else {\n //Get tip data\n var tipData = chart.setTipData(d.data, i);\n //Draw tip line\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n }\n }\n }).on('mouseout', function (d) {\n if (chart.showToolTip) {\n chart.tip.hideTip();\n }\n });\n\n bubble.append('text').attr('class', 'bubble-text').text(function (d) {\n return d.data[labelKey];\n }).attr('fill', 'white')\n //hide text if its too wide\n .attr('style', function (d) {\n if (this.clientWidth > d.r * 2) {\n return 'display: none';\n }\n })\n //center the text on the bubble\n .attr('transform', function (d, i) {\n var diameter = d.r * 2,\n textWidth = this.clientWidth,\n emptySpace = diameter - textWidth;\n\n if (emptySpace < 0) {\n return '';\n } else {\n return 'translate(-' + (d.r - emptySpace / 2) + ', 0)';\n }\n }).on('mouseover', function (d, i) {\n if (chart.showToolTip) {\n //Get tip data\n var tipData = chart.setTipData(d.data, i);\n\n //Draw tip line\n tipData.data.color = jvCharts.getColors(colors, tipData.index, d.data[labelKey]);\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n chart.tip.d = d.data;\n chart.tip.i = i;\n }\n }).on('mousemove', function (d, i) {\n if (chart.showToolTip) {\n if (chart.tip.d === d && chart.tip.i === i) {\n chart.tip.showTip(0);\n } else {\n //Get tip data\n var tipData = chart.setTipData(d.data, i);\n //Draw tip line\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n }\n }\n }).on('mouseout', function (d) {\n if (chart.showToolTip) {\n chart.tip.hideTip();\n }\n });\n\n bubble.append('text').text(function (d) {\n return d.data[valueKey];\n }).attr('fill', 'white')\n //hide text if its too wide\n .attr('style', function (d) {\n if (this.clientWidth > d.r * 2) {\n return 'display: none';\n }\n\n return '';\n })\n //center the text on the bubble\n .attr('transform', function (d, i) {\n var diameter = d.r * 2,\n textWidth = this.clientWidth,\n emptySpace = diameter - textWidth;\n\n if (emptySpace < 0) {\n return '';\n }\n\n return 'translate(-' + (d.r - emptySpace / 2) + ',' + 15 + ')';\n }).on('mouseover', function (d, i) {\n if (chart.showToolTip) {\n //Get tip data\n var tipData = chart.setTipData(d.data, i);\n\n //Draw tip line\n tipData.data.color = jvCharts.getColors(colors, tipData.index, d.data[labelKey]);\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n chart.tip.d = d.data;\n chart.tip.i = i;\n }\n }).on('mousemove', function (d, i) {\n if (chart.showToolTip) {\n if (chart.tip.d === d && chart.tip.i === i) {\n chart.tip.showTip(0);\n } else {\n //Get tip data\n var tipData = chart.setTipData(d.data, i);\n //Draw tip line\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n }\n }\n }).on('mouseout', function (d) {\n if (chart.showToolTip) {\n chart.tip.hideTip();\n }\n });\n}", "title": "" }, { "docid": "21f152499c03c047896817e02811c86c", "score": "0.52235544", "text": "function _bubbles(){\n for(var i = 0; i < options.num; ++i ){\n // random color\n var color = options.colors[~~_random(0, options.colors.length)];\n // random borderColor\n var borderColor = options.borderColors[~~_random(0, options.borderColors.length)];\n // randowm opacity\n var opacity = _random(options.opacity[0], options.opacity[1]);\n\n params[i] = {\n // random scale\n scale: _random(options.scale[0], options.scale[1]),\n\n x: _random(0, size.width),\n\n y: _random(0, size.height),\n\n // init rotation\n rotation: 0,\n\n // random speed for x-direction\n speedX: _random(options.speedX[0], options.speedX[1]),\n\n // random speed for x-direction\n speedY: _random(options.speedY[0], options.speedY[1]),\n\n // random speed for totate\n speedR: _random(options.rotate[0], options.rotate[1]),\n\n // rgba color\n color: 'rgba(' + color + ',' + opacity + ')',\n \n opacity: opacity,\n \n borderColor: 'rgb(' + borderColor + ')'\n }\n }\n // run it!\n _run();\n }", "title": "" }, { "docid": "6c296baa4666791bfcf185f80085831e", "score": "0.52196026", "text": "function ticked() {\n // connections\n // .attr('x1', joinedData => joinedData.source.x)\n // .attr('y1', joinedData => joinedData.source.y)\n // .attr('x2', joinedData => joinedData.target.x)\n // .attr('y2', joinedData => joinedData.target.y);\n bubbles\n .attr('cx', joinedData => joinedData.x)\n .attr('cy', joinedData => joinedData.y);\n }", "title": "" }, { "docid": "80098528a498d73395354afc7ffe46fa", "score": "0.52101666", "text": "function make_bubble() {\n var bubble_array = ['bubble1', 'bubble2', 'bubble3', 'bubble4', 'bubble5', 'bubble6', 'bubble7', 'bubble8', 'bubble9', 'bubble10'];\n var bubble_size = ['sm_bubble', 'md_bubble', 'big_bubble', 'biggest', 'sm_bubble', 'md_bubble'];\n var new_bubble = $('<img>').attr('src', 'images/bubble.png').addClass('bubbles');\n new_bubble.addClass(bubble_array[i]);\n new_bubble.addClass(bubble_size[j]);\n $('.all_bubbles').append(new_bubble);\n i++;\n j++;\n counter++;\n if (i == bubble_array.length && (j)) {\n i = 0;\n }\n if (j == bubble_size.length) {\n j = 0;\n }\n}", "title": "" }, { "docid": "f338871943cc8b30e160832917e9533c", "score": "0.5208982", "text": "function draw() {\r\n // LOGIC\r\n \r\n // DRAW\r\n background('white');\r\n for (let i = 0; i < bubbles.length; i++) {\r\n bubbles[i].move();\r\n bubbles[i].show();\r\n }\r\n}", "title": "" }, { "docid": "d4876ea8a7bf4cc1a44771303569fcb6", "score": "0.5208384", "text": "function bubblesSize() {\n\t\tvar $bubble = $('a.bubble i');\n\t\t$bubble.css({\n\t\t\t'height': $bubble.width(),\n\t\t\t'line-height': $bubble.width() + 'px'\n\t\t});\n\t}", "title": "" }, { "docid": "d9ce1df77d0824c2da17af4023a989d9", "score": "0.5195304", "text": "_getBubblingTargets (type, array) {\n var parent = this.parent;\n while (parent) {\n if (parent.hasEventListener(type)) {\n array.push(parent);\n }\n parent = parent.parent;\n }\n }", "title": "" }, { "docid": "22c833ef637e50b8f4ada1f6cdef61cb", "score": "0.5193598", "text": "function bubbleEvent(element, type, eventObject) {\n\t while (element) {\n\t var handlers = lookupListeners(element, type);\n\t for (var i = 0, len = handlers.length; i < len; i++) {\n\t handlers[i].listener.call(element, eventObject);\n\t }\n\n\t element = element.parentNode;\n\t }\n\t }", "title": "" }, { "docid": "f4cbfeb01c5fd9b1e277145c36a6afba", "score": "0.5189428", "text": "bubbleSort() {\n const animations = BubbleSortAnimations(this.state.array);\n const visualizerArray = this.getVisualizerArrayBars();\n this.toggleResetArray('none', 'bubbleSort');\n\n for (let i=0; i < animations.length; i++) {\n\n const comparisons = animations[i][0];\n const swapped = animations[i][1];\n const finished = animations[i][2];\n const firstValue = visualizerArray[comparisons[0]];\n const secondValue = visualizerArray[comparisons[1]];\n\n if (finished) {\n setTimeout(() => {\n secondValue.style.backgroundColor = FINISHED_COLOUR;\n this.toggleResetArray('none', 'bubbleSort');\n }, i * ANIMATION_SPEED);\n }\n\n if (swapped) {\n setTimeout(() => {\n this.swapHeights(firstValue, secondValue);\n }, i * ANIMATION_SPEED);\n }\n\n if ((i+1) === animations.length) {\n setTimeout(() => {\n this.toggleResetArray('auto', 'bubbleSort');\n }, i * ANIMATION_SPEED)\n }\n \n }\n }", "title": "" }, { "docid": "f66bbafe24471a607bba47a32c09e275", "score": "0.5188457", "text": "bubbleUp(index) {\n let parent = Math.floor((index - 1) / 2);\n if (this.storage[index] > this.storage[parent]) {\n [this.storage[parent], this.storage[index]] = [\n this.storage[index],\n this.storage[parent]\n ];\n this.bubbleUp(parent);\n }\n }", "title": "" }, { "docid": "1b9116fb0bad18ce90a045f76ea0098d", "score": "0.51763654", "text": "bubble(index) {\n //Base case.\n if (index == 0) {\n return;\n }\n var p = this.parent(index);\n //Comparison will be < 0 if index < parent, > 0 if index > parent, 0 if\n //index == parent.\n var comparison = this.compare(this.heap[index], this.heap[p]);\n //To preserve min-heap property, want to swap if comparison is negative.\n if (comparison < 0) {\n this.swap(index, p);\n this.bubble(p);\n } else {\n return;\n }\n }", "title": "" }, { "docid": "c8dc4d9ce5e5378547680b0905949177", "score": "0.5175157", "text": "function mouseDragged() {\n\tbubbles.push(new Bubble(mouseX, mouseY));\n}", "title": "" }, { "docid": "b5178a3ce6e169c0725585229f580932", "score": "0.5174137", "text": "bubbleUp() {\n //*Variable that takes the value of the last index\n let idx = this.values.length - 1;\n //*variable that takes the value of the index\n const element = this.values[idx];\n //*While idx is bigger than 0\n while (idx > 0) {\n //*variables that will take the index and value of the parent\n let parentIdx = Math.floor((idx - 1) / 2);\n let parent = this.values[parentIdx];\n //*if the priority of the element is bigger than the parent priority it wont run the loop\n if (element.priority >= parent.priority) break;\n //*Otherwise we will swap the values of the parent with the elements\n this.values[parentIdx] = element;\n this.values[idx] = parent;\n //*Updating the position of idx to start at the parent index\n idx = parentIdx;\n }\n }", "title": "" }, { "docid": "c5d33b5e24ffead6cae66a7bf1117a52", "score": "0.516999", "text": "function addBubble(x, y, volume, r, g, b) {\n bubbles.push({\n x: x,\n y: y,\n c: color('rgba(' + r + ',' + g + ',' + b + ', 100)'),\n scale: 1,\n });\n}", "title": "" }, { "docid": "9e7276a99dfe3431aa3b4912319a906a", "score": "0.5158349", "text": "bubbleup() {\n //store last-value's index {recently added value} as the child\n let child = this.values.length - 1,\n //find the parent's index of the child\n parent = Math.floor((child - 1) / 2);\n\n if (this.values[parent] === undefined) return this.values;\n\n //loop only if child have greater priority then parent \n while (this.values[parent].priority > this.values[child].priority) {\n //swap the parent and child\n [this.values[child], this.values[parent]] = [this.values[parent], this.values[child]]\n //set child as the parent and find the parent\n child = parent;\n parent = Math.floor((parent - 1) / 2);\n\n if (this.values[parent] === undefined) return this.values;\n\n }\n }", "title": "" }, { "docid": "3defe8d30400482559f3987ff2df54bd", "score": "0.51522124", "text": "function gotData(data) {\n\n console.log(data); // Print the data in the console\n\n // iterate through the array of data and create an object and push it on an array called bubbles\n for (let i = 0; i < data.length; i++) {\n bubbles.push(new Bubble(data[i].show, data[i].defeat,data[i].theme)); // THESE Name and Shape need to match your column names in your spreadsheet!\n }\n\n}", "title": "" }, { "docid": "680791821efdd4458893ce9386965276", "score": "0.51519287", "text": "function splitBubbles() {\n showYearTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodeYearPos));\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "680791821efdd4458893ce9386965276", "score": "0.51519287", "text": "function splitBubbles() {\n showYearTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodeYearPos));\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "1e2647248a53a62f57b05c77ac2757d5", "score": "0.5150758", "text": "function groupBubbles() {\n hideVolumeTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to the center.\n simulation.force('x', d3.forceX().strength(forceStrength).x(center.x));\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "52a2ade42bfd8a0f8977319235516880", "score": "0.51485384", "text": "function createBubble(data) {\n var trace = {\n x: data.map(x=>x.otu_id),\n y: data.map(x=>x.otu_value),\n mode: \"markers\",\n marker: {\n size: data.map(x=>x.otu_value),\n color: data.map(x=> `${x.otu_id}`),\n colorscale: 'Jet'\n }\n }\n Plotly.newPlot(\"bubble\", [trace], {title: \"<b>OTU Bubble Chart</b>\"});\n}", "title": "" }, { "docid": "5dec5616ec45359a7620444f962cbdb0", "score": "0.5144075", "text": "function groupBubbles() {\n hideLabels();\n\n force.on('tick', function (e) {\n bubbles.each(moveToCenter(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }", "title": "" }, { "docid": "3b0ec62b0ab34e69481f636f18a5e9d5", "score": "0.5142162", "text": "function Bubble(){\n //create x and y properties (variables)\n this.x = random(width);\n this.y = random(height);\n this.r = 20; //r os fpr radius which is 1/2 the width of the circle\n this.bubbleSize = this.r*2;//width and height are twice the radius\n //draw the bubble\n\n //method: draw the bubble\n this.drawBubble = function(){\n ellipse(this.x, this.y, this.bubbleSize, this.bubbleSize);\n }\n\n this.col = fill(\"lightblue\");{\n //ellipse(this.x, this.y, this.bubbleSize, this.bubbleSize);\n }\n}//end bubble", "title": "" }, { "docid": "3cfdfa91034ab70cac22180b7ec97d2e", "score": "0.51314855", "text": "function createBubbles() {\r\n\t\tvar graphic = document.getElementById(\"graphic\")\r\n\t\t// Order all the Elements by the diameter\r\n\t\tinfo.sort(function(a, b) {\r\n\t\t\tif (a.diameter > b.diameter) {\r\n\t\t\t\treturn -1\r\n\t\t\t} else if (a.diameter < b.diameter) {\r\n\t\t\t\treturn 1\r\n\t\t\t} else {\r\n\t\t\t\treturn 0\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tinfo.forEach(function(element) {\r\n\t\t\t// Create bubbles based on diameter\r\n\r\n\t\t\tvar diameter = element.diameter * 80000\r\n\t\t\tvar velocity = element.velocity * 2.5\r\n\t\t\tvar distance = element.distance * 180\r\n\t\t\tvar name = element.name\r\n\t\t\tvar magnitude = element.magnitude\r\n\t\t\tvar divOut = document.createElement(\"div\")\r\n\t\t\tvar divIn = document.createElement(\"div\")\r\n\r\n\t\t\t// Add style and class to the div and append them\r\n\t\t\tdivOut.style.transition = \"2s\"\r\n\t\t\tdivOut.appendChild(divIn)\r\n\t\t\tgraphic.appendChild(divOut)\r\n\t\t\tdivIn.className = \"bubble\"\r\n\t\t\tdivOut.className = \"bubbleCenter\"\r\n\r\n\t\t\t//\tCreate bubbles by diameter and position them in the chart\r\n\t\t\tdivIn.style.height = diameter + \"%\"\r\n\t\t\tdivIn.style.width = diameter + \"%\"\r\n\t\t\tdivOut.style.bottom = distance + \"%\"\r\n\t\t\tdivOut.style.left = velocity + \"%\"\r\n\r\n\t\t\t// Add the \"mouseover\" action to the Bubbles and Create dynamically the Info Tooltip\r\n\t\t\tdivIn.addEventListener(\"mouseover\", function() {\r\n\t\t\t\tvar allInfo = document.createElement(\"div\")\r\n\t\t\t\tvar information = document.createElement(\"div\")\r\n\t\t\t\tvar pInfo1 = document.createElement(\"p\")\r\n\t\t\t\tvar pInfo2 = document.createElement(\"p\")\r\n\t\t\t\tvar pInfo3 = document.createElement(\"p\")\r\n\t\t\t\tvar pInfo4 = document.createElement(\"p\")\r\n\t\t\t\tvar pInfo5 = document.createElement(\"p\")\r\n\t\t\t\tallInfo.className = \"allInfo\"\r\n\t\t\t\tinformation.className = \"information\"\r\n\t\t\t\tpInfo1.innerHTML = \"Name: \" + name\r\n\t\t\t\tpInfo2.innerHTML = \"Diameter: \" + (diameter / 80000).toFixed(3) + \" Km\"\r\n\t\t\t\tpInfo3.innerHTML = \"Magnitude: \" + magnitude.toFixed(3) + \" h\"\r\n\t\t\t\tpInfo4.innerHTML = \"Distance: \" + (distance / 180).toFixed(3) + \" au\"\r\n\t\t\t\tpInfo5.innerHTML = \"Velocity: \" + (velocity / 2.5).toFixed(3) + \" Km/s\"\r\n\t\t\t\tinformation.appendChild(pInfo1)\r\n\t\t\t\tinformation.appendChild(pInfo2)\r\n\t\t\t\tinformation.appendChild(pInfo3)\r\n\t\t\t\tinformation.appendChild(pInfo4)\r\n\t\t\t\tinformation.appendChild(pInfo5)\r\n\t\t\t\tallInfo.appendChild(information)\r\n\t\t\t\tdivOut.appendChild(allInfo)\r\n\t\t\t})\r\n\r\n\t\t\t// Add the \"mouseleave\" action to the Bubbles\r\n\t\t\tdivIn.addEventListener(\"mouseleave\", function() {\r\n\t\t\t\tvar allInfo = document.getElementsByClassName(\"allInfo\")\r\n\t\t\t\tif (allInfo) {\r\n\t\t\t\t\tallInfo[0].remove(allInfo[0])\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "9e28855c54ad93f87d231c6e3876e9c6", "score": "0.5124499", "text": "function gotData(data) {\n\n console.log(data); // Print the data in the console\n\n // iterate through the array of data and create an object and push it on an array called bubbles\n for (let i = 0; i < data.length; i++) {\n bubbles.push(new Bubble(data[i].name, data[i].game, data[i].movie, data[i].music)); // THESE Name and Shape need to match your column names in your spreadsheet!\n }\n\n}", "title": "" }, { "docid": "63765ddbf34dddbf6ed8b42913f391bc", "score": "0.5113778", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n left: { backgroundColor: `${Global.colors.secondary}` },\n right: { backgroundColor: `${Global.colors.primary}` }\n }}\n />\n ); // return\n }", "title": "" }, { "docid": "ed43af84db1571ebb85f21b88f414602", "score": "0.51089036", "text": "function update_bubbles(new_party){\n d3.selectAll('circle.votePerc')\n .each(function(d, i){\n total_votes = list_votes(d, new_party);\n total_valid_votes = list_valid_votes(d);\n d.ValidVotesTotal = d3.sum(total_valid_votes);\n d.VotePerc = (d3.sum(total_votes)/ d3.sum(total_valid_votes)) * 100;\n d.VotePerc = Math.round(d.VotePerc * 10)/ 10;\n })\n .transition(\"partySwitchTrans\")\n .duration(1000)\n .attr(\"r\", function(d, i){\n return rad_scale(d.VotePerc);\n })\n .style(\"fill\", d => colorScale(new_party));\n }", "title": "" }, { "docid": "8d729a538721bb0870b48533f3ad1d50", "score": "0.51062864", "text": "function resetBubblelight() {\n d3.selectAll('bubblelayer .bubble').each(function(d) {\n delete d.light;\n })\n $.each(selected, function(i, d) {\n d.light = -1;\n })\n}", "title": "" }, { "docid": "844d335810413ae9a99eb7f0f23267b2", "score": "0.5097108", "text": "bubbleUp() {\n //get index of the last element array\n let idx = this.values.length - 1\n //get the last element of the array\n const element = this.values[idx]\n\n //loop while idx > 0\n while (idx > 0) {\n //get the index of the parent Element\n let parentIdx = Math.floor((idx - 1) / 2)\n //get the parent element of the inserted value\n let parent = this.values[parentIdx]\n //break when element is in it's right place\n if (element <= parent) break;\n //swap the value of the parentIdx with the element\n this.values[parentIdx] = element\n //swap the value of the idx with the parent\n this.values[idx] = parent\n //swap the value idx with the parentIdx\n idx = parentIdx\n }\n\n }", "title": "" }, { "docid": "a5ea104b17c37b918d1052c1d0686f5d", "score": "0.50934446", "text": "function groupBubbles() {\n hidepositionTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to the center.\n simulation.force('x', d3.forceX().strength(forceStrength).x(center.x));\n simulation.force('y', d3.forceY().strength(forceStrength).y(center.y));\n simulation.force('charge', d3.forceManyBody().strength(charge));\n\n if (floorPlanShowing === true){\n document.getElementById(\"floorPlanBackground\").removeChild(floorPlanImage);\n document.getElementById(\"sliderContainer\").removeChild(floorPlanSlider);\n document.getElementById(\"mostSolitary\").innerHTML = \"\";\n document.getElementById(\"mostCollaborative\").innerHTML = \"\";\n d3.selectAll('.bubble')\n .attr(\"opacity\", 1);\n floorPlanShowing = false;\n }\n\n // @v4 We can reset the alpha researchGroup and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "101985e7df46cbb6d3f457aced2a3348", "score": "0.5078054", "text": "function bouncer(arr) {\n\t\n}", "title": "" }, { "docid": "1a978053d0323b689ab4e4cd0be35c2f", "score": "0.50775015", "text": "bubbleSort(){\n this.disableButtons(); //Disable the buttons\n const ANIMATION_SPEED=this.state.x; //Get the animation speed from state\n var array=this.state.array.slice();\n const anims=getBubbleSortAnims(array); //Get the animation from Bubble Sort file\n var lines=document.getElementsByClassName(\"line\"); //Get all the lines from HTML(DOM)\n const PRIMARY_COLOR=this.state.PRIMARY_COLOR; //Getting the primary color from state\n const SECONDARY_COLOR=this.state.SECONDARY_COLOR; //Getting the secondary color from state\n\n //The animations are divided into triplets.\n //First element of this triplet tells which two elements are in comparision\n //Second element tells whether the two elements we are comparing must be swapped or not.\n //Third element is used to change the color of elements in comparision back to primary color \n for(let i=0;i<anims.length;i++){\n if(i%3!==1){\n const [firstBarindex,secondBarindex]=anims[i];\n const firstBarStyle=lines[firstBarindex].style;\n const secondBarStyle=lines[secondBarindex].style;\n const color= i%3===0 ? SECONDARY_COLOR : PRIMARY_COLOR; //Change the color to primary or secondary depending upon element\n setTimeout(()=>{\n firstBarStyle.background=color;\n secondBarStyle.background=color;\n },i*ANIMATION_SPEED)\n }\n else{\n setTimeout(()=>{\n const [firstBarindex,secondBarindex,flag]=anims[i];\n const firstBarStyle=lines[firstBarindex].style;\n const secondBarStyle=lines[secondBarindex].style;\n if(flag){ //Interchange the height of the lines\n [firstBarStyle.height,secondBarStyle.height]=[secondBarStyle.height,firstBarStyle.height];\n }\n },i*ANIMATION_SPEED)\n }\n }\n }", "title": "" }, { "docid": "6a1f805acecb8e734b2451986c1900de", "score": "0.5072795", "text": "bubbleUp() {\n let index = this.values.length - 1;\n let parentIdx = Math.floor((index - 1) / 2);\n while (this.values[index] > this.values[parentIdx]) {\n let hold = this.values[parentIdx];\n this.values[parentIdx] = this.values[index];\n this.values[index] = hold;\n index = parentIdx;\n }\n }", "title": "" }, { "docid": "364059483ac5a7929f433929fc9ea111", "score": "0.50718534", "text": "_createButtonsDiffers() {\n this.buttonsDiffers = {};\n this.nbpButtons.forEach((el) => {\n if (el.id) {\n this.buttonsDiffers[el.id] = this._differs.find(el).create();\n }\n else {\n console.warn('Attenzione, change detection degli nbpButtons non funzionante nel componente nbpModal. Inserire un id unico per ogni pulsante');\n }\n });\n }", "title": "" }, { "docid": "0dc2afaf5fd33515f30db2f709e94d87", "score": "0.5067967", "text": "function moveBubble(){\n bubble.x += bubble.vx;\n bubble.y += bubble.vy;\n}", "title": "" }, { "docid": "908017f27025b38623f22234258bc29a", "score": "0.5059447", "text": "checkCollusion()\r\n\t{\r\n\t\tthis.bullets.forEach((bullet)=>{\r\n\t\t\tthis.bubbles.forEach((bubble, i)=>{\r\n\t\t\t\tif(\r\n\t\t\t\t\tMath.abs(bullet.x -bubble.x)<(25+7.5) &&\r\n\t\t\t\t\tMath.abs(bullet.y -bubble.y)<(25+7.5)\r\n\r\n\t\t\t\t){\r\n\t\t\t\t\tthis.bubbles.splice(i,1);\r\n\t\t\t\t this.score++;\r\n\t\t\t\t burstSound.play();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "3d3290423a39cfbe0f4fc817c5a36239", "score": "0.5054084", "text": "function handleMouseEnterBubble(d, i) {\n // change stroke of the cicles\n d3.select(this)\n .attr(\"stroke\", \"white\")\n .attr(\"stroke-width\", 2)\n .attr(\"stroke-opacity\", 0.6);\n\n}", "title": "" }, { "docid": "308478d1aa8cb2ed3f85ff8eb4bbe6fb", "score": "0.5052542", "text": "function bounceObjects() {\r\n goodObjects.children.iterate(function(goodObject) {\r\n if (goodObject && goodObject.body.center.y > h + 100) {\r\n goodObject.setActive(false);\r\n launchObject(goodObject);\r\n goodObject.setScale(0.5);//mine\r\n }\r\n });\r\n \r\n badObjects.children.iterate(function(badObject) {\r\n if (badObject && badObject.body.center.y > h + 100) {\r\n badObject.setActive(false);\r\n launchObject(badObject);\r\n badObject.setScale(0.5);//mine\r\n }\r\n });\r\n }", "title": "" }, { "docid": "f6ec8742a64f97b145bc56ea04a125c2", "score": "0.5047619", "text": "function drawBubbles(nodes) {\n\n// Use the pack layout to initialize node positions.\n d3.layout.pack()\n .sort(null)\n .size([width, height])\n .children(function (d) {\n return d.values;\n })\n .value(function (d) {\n return d.size;\n })\n .nodes({values: d3.nest()\n .key(function (d) {\n return d.className;\n })\n .entries(nodes)});\n\n var svg = d3.select(\"body\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n \n var force = d3.layout.force()\n .nodes(nodes)\n .size([width, height])\n .gravity(.02)\n .charge(0)\n .on(\"tick\", tick)\n .start();\n\n var node = svg.selectAll(\"g\")\n .data(nodes)\n .enter()\n .append(\"g\")\n .call(force.drag);\n\n var circle = node.append(\"circle\")\n .attr('class', function (d) { //QC d corresponds to the data from your dataset (for that node)\n return d.className;\n })\n .attr(\"id\", function (d) {\n return \"circle-\" + d.uid;\n });\n\n //make a clipping path for text... don't need it though text just clutters\n// node.append(\"clipPath\")\n// .attr(\"id\", function (d) {\n// return \"clip-\" + d.uid + \"\";\n// })\n// //use the circle we just made to define the path\n// .append(\"use\")\n// .attr(\"xlink:href\", function (d) {\n// return \"#circle-\" + d.uid;\n// });\n//\n// node.append(\"text\")\n// .attr(\"dx\", function (d) {\n// return -20;\n// })\n// .attr(\"clip-path\", function (d) {\n// return \"url(#clip-\" + d.uid + \")\";\n// })\n// .text(function (d) {\n// return d.className;\n// });\n\n node.append('emoji')\n .attr('symbol', function (d) {\n return emojiHash(d.name);\n })\n .attr('width', function (d) {\n return circleSize(d.size);\n })\n .attr('height', function (d) {\n return circleSize(d.size);\n })\n .attr('opacity', 255)\n .attr(\"transform\", function (d) {\n return \"translate(\" + (-.5 * circleSize(d.size)) + \",\" + (-.5 * circleSize(d.size)) + \")\";\n });\n \n //make an alpha mask to tint the emojis the same color as their clusters\n node.append(\"use\")\n .attr(\"xlink:href\", function (d) {\n return \"#circle-\" + d.uid;\n }) .style(\"fill\", \"white\")\n .style(\"opacity\", 0.5); \n \n\n circle.transition()\n .duration(750)\n .delay(function (d, i) {\n return i * 5;\n })\n .attrTween(\"r\", function (d) {\n var i = d3.interpolate(0,circleSize(d.size));\n return function (t) {\n return d.size = i(t);\n };\n });\n\n function circleSize(d){\n return Math.min(maxRadius + Math.log10(d),Math.max(minRadius,d/2));\n }\n\n resize();\n d3.select(window).on(\"resize\", resize);\n \n function resize() {\n width = window.innerWidth, height = window.innerHeight;\n svg.attr(\"width\", width).attr(\"height\", height);\n force.size([width, height]).resume();\n }\n\n function tick(e) {\n node\n .each(cluster(10 * e.alpha * e.alpha)) //QC cluster is a method (below)\n .each(collide(.5))\n //for each object.. circles adjust cx, cy,.. text adjust ?tx?ty? et...\n .attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n }\n\n// Move d to be adjacent to the cluster node.\n function cluster(alpha) {\n return function (d) {\n var cluster = kingPin[d.className];\n if (cluster === d)\n return;\n var x = d.x - cluster.x,\n y = d.y - cluster.y,\n l = Math.sqrt(x * x + y * y),\n r = d.size + cluster.size;\n if (l != r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n cluster.x += x;\n cluster.y += y;\n }\n };\n }\n\n// Resolves collisions between d and all other circles.\n function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function (d) {\n var r = d.size + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function (quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.size + quad.point.size + (d.className === quad.point.className ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }\n\n //hash any given string to an emoji name\n function emojiHash(hashMe) {\n return Object.keys(emojiMap)[Math.abs(hashMe.hashCode()) % Object.keys(emojiMap).length];\n }\n}", "title": "" }, { "docid": "10643c066277ab18a164b13b8b618dda", "score": "0.5044237", "text": "function gotData(data) {\n\n console.log(data); // Print the data in the console\n\n // iterate through the array of data and create an object and push it on an array called bubbles\n for (let i = 0; i < data.length; i++) {\n bubbles.push(new Bubble(data[i].bandits, data[i].merchant, data[i].wizard)); // THESE Name and Shape need to match your column names in your spreadsheet!\n }\n}", "title": "" }, { "docid": "ac7e381216ff04094cd0e5fb2ae2df40", "score": "0.5043224", "text": "function makeEmptyBubbles(count)\n{\n\tvar loop;\n\tfor (loop = 0; loop < count; loop = loop + 1)\n\t{\n\t\temptyBubble = emptyGroup.create(getBubbleX(), getBubbleY(), 'bub');\n\t\tgame.physics.arcade.enable(emptyBubble)\n\t\temptyBubble.scale.x = .2;\n\t\temptyBubble.scale.y = .2;\n\t\temptyBubble.body.velocity.x = game.rnd.integerInRange(-400, 400);\n\t\temptyBubble.body.velocity.y = game.rnd.integerInRange(-400, 400);\n\t\temptyBubble.body.collideWorldBounds = true;\n\t\temptyBubble.body.bounce.setTo(1, 1);\n\t}\n\tcurrentBubbles = currentBubbles + count;\n}", "title": "" }, { "docid": "4c711d31015c82f3a4a09bb2f9399e9b", "score": "0.50409484", "text": "function updateBubble (bubble,x,y,val,c){\n var offset = Math.abs(parseInt($(bubble).find('.outerBubble').css('top')) + (parseInt($(bubble).find('.outerBubble').css('height')) - val) / 2)*-1;\n\n $(bubble).animate({\n left: x.toString(),\n top: y.toString(),\n opacity: \"1\"\n }, 1000);\n \n $(bubble).find('.outerBubble').animate({\n height: val.toString(),\n width: val.toString(),\n top: offset.toString(),\n left: offset.toString(),\n }, 1000);\n \n $(bubble).find('.innerBubble').animate({\n height: (val-10).toString(),\n width: (val-10).toString(),\n top: (offset + 5).toString(),\n left: (offset + 5).toString(),\n backgroundColor: c.toString() \n }, 1000); \n }", "title": "" }, { "docid": "d1f5436ba8e8cf529dc9b6bc6869c631", "score": "0.5032438", "text": "function updateBubble(bubble) {\n\t\tbubble.y -= yVel;\n\t\tbubble.x += (Math.random()* 16) - 8;\t\t\n\t\tbubble.r *= (Math.random() * 2 + 1)/2;\n\t\tif(bubble.r > 4) {\n\t\t\tbubble.r -= Math.random();\n\t\t}\n\t}", "title": "" }, { "docid": "3fbd8b7ac4ae2f3cdc70e9814b010ca6", "score": "0.5023962", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: '#7ac5cd',\n },\n }}\n />\n );\n }", "title": "" }, { "docid": "33a283a6efe29ab2b3039622286e2eec", "score": "0.5023835", "text": "function levelTwo(){\n c.drawImage(background, 0, 0, canvas.width, canvas.height);\n Utils.drawInfo(score, lives, c);\n bubbles = [new Bubbles(750, 200, 30, 2.5, 1), new Bubbles(500, 200, 30, -2.5, 1)]\n // console.log(bubbles)\n magazine = [];\n player = new Player();\n player.draw(c);\n bubbles.forEach(bubble => {\n bubble.draw(c)\n })\n \n \n } //end of levelTwo fucntion ", "title": "" }, { "docid": "1d8128c2691d9e3ad707a2fb212d7a2d", "score": "0.5018695", "text": "function animateBubble(self){\n var complete = self.floatUp();\n if(animateBubbles){\n if(complete){\n beginBubbleAnimation(self, null);\n } else {\n requestAnimFrame(function(){\n animateBubble(self);\n });\n }\n }\n \n\n}", "title": "" }, { "docid": "1d8128c2691d9e3ad707a2fb212d7a2d", "score": "0.5018695", "text": "function animateBubble(self){\n var complete = self.floatUp();\n if(animateBubbles){\n if(complete){\n beginBubbleAnimation(self, null);\n } else {\n requestAnimFrame(function(){\n animateBubble(self);\n });\n }\n }\n \n\n}", "title": "" }, { "docid": "fb1b8461de38f26330579d8223e15128", "score": "0.5017635", "text": "renderBubble(props) {\n return (\n <Bubble \n {...props}\n wrapperStyle={{\n right: {backgroundColor: '#807f7d'},\n left: {backgroundColor: '#edf5d3'}\n }}\n />\n )\n }", "title": "" }, { "docid": "a4e2a5ad0c6f0992e9c03c525737b1f9", "score": "0.50148034", "text": "function paintBag() {\n var auxelem;\n var el;\n bag.forEach(function (val, key) {\n repaintElement(key, val);\n });\n}", "title": "" }, { "docid": "83c7d887371af2abd22436dc1176fd89", "score": "0.50113845", "text": "onRenderBusiness() {\n if (this.state.isComplete) {\n const temp = this.state.business;\n for (let i = 0; i < temp.length; i++) {\n if (temp[i].props.children !== 'AISLES') { // to eliminate aisles\n const temp1 = temp[i].props.children;\n for (let j = 0; j < temp1.length; j++) {\n if (temp1[j].props.className === 'Unoccupied') {\n const m = (<div className=\"updatedDiv\" onClick={() => this.getMessage(this)} >\n {this.state.business[i].props.children[j].props.children} </div>);\n this.state.business[i].props.children[j] = this.updateElement(m, i, j, 'business');\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "fc810deb188fe3590abc1672083d9dee", "score": "0.500402", "text": "function displayCreateBubble (bubbleTree, node, path)\n{\n//\tconsole.log(\"DisplayCreateBubble! \" + node.id);\n//\tconsole.log(path);\n\n\tvar n = domainList_bubble.length;\n\tvar url = node.url;\n\tisTransition = true;\n\t\t\n\ttreemap.deactivate ();\t\t\t\t\t// Disable interactivity in main tree.\n\t\t\n\t// Compute polygons for the bubble\n\tmaxStroke /= 1.5;\n\tbubbleId = \"#poly\" + treemap.id + \"_\" + node.id;\n\tvar bubbleColor1 = d3.select(bubbleId).attr(\"fill\");\n\tvar bubbleColor2 = treemap.colors(path, node);\n\tvar bubbleEdge = d3.select(bubbleId).attr(\"fill\");\n\tvar bubbleWidth = d3.select(bubbleId).attr(\"stroke-width\");\n\tvar bubblePolyTemp1 = _.map(d3.select(bubbleId).attr(\"points\").split(\" \"), \n\t\tfunction(x) {var y = x.split(\",\"); return [parseFloat(y[0]), parseFloat(y[1])]})\n/*\tvar bubblePolyTemp2 = []; var m = bubblePolyTemp1.length; //console.log(m);\n\tfor (var i = 0; i < bubblePolyTemp1.length; i++)\n\t{\n\t\tvar m2 = 8;\n\t\tfor (var j = 0; j < m2; j++)\n\t\t\tbubblePolyTemp2.push([(1-j/m2)*bubblePolyTemp1[i][0] + (j/m2)*bubblePolyTemp1[(i+1)%m][0],\n\t\t\t\t(1-j/m2)*bubblePolyTemp1[i][1] + (j/m2)*bubblePolyTemp1[(i+1)%m][1]]);\n\t}\n\tvar c = centroid(bubblePolyTemp1);\n\tvar r = Math.min((n + 5) * 0.4 / 20, 0.4) * Math.min(width, height);\n\tfor (var i in bubblePolyTemp1)\n\t\tr = Math.max(r, dist(c, bubblePolyTemp1[i])*1.5);\n\tvar bubblePoly = _.map (bubblePolyTemp2, function (pt) \n\t{\n\t\tvar dx = pt[0] - c[0], dy = pt[1] - c[1], xMax = width - c[0], yMax = height - c[1], xMin = -c[0], yMin = -c[1];\n\t\tvar dr = Math.sqrt(dx*dx + dy*dy);\n\t\tdx *= r/dr; dy *= r/dr;\n\t\tdx = Math.max(Math.min(dx, xMax), xMin);\n\t\tdy = Math.max(Math.min(dy, yMax), yMin);\n\t\treturn [c[0] + dx, c[1] + dy];\n\t})\n\tvar bubblePoly2 = clone_array(bubblePoly);\n\twhile (true)\t// Get rid of redundant indices in bubblePoly.\n\t{\n\t\tvar deletePoint = false;\n\t\tfor (var i = bubblePoly2.length - 1; i >= 0; i--)\n\t\t\tif (bubblePoly2[i][0] == bubblePoly2[(i+1)%bubblePoly2.length][0] && \n\t\t\t\tbubblePoly2[i][1] == bubblePoly2[(i+1)%bubblePoly2.length][1])\n\t\t\t{\n\t\t\t\tbubblePoly2.splice(i, 1);\n\t\t\t}\n\t\tbreak;\n\t}*/\n\t\n\t// TODO -- call getBubblePolygon\n\tvar ans = getBubblePolygon (bubblePolyTemp1, width, height, n)\n//\tthrow \"Call getBubblePolygon here.\";\n\n\t// Create the main treemap and draw it.\n\tvar bubbleColors = (isSearchResults || n >= 15) ? treemap.colors : darkenColors(bubbleColor2);\n\ttreemap_bubble = new VoronoiTreemap (clusterTree_bubble, ans.polyLargeClipped, vis, {\"tooltip\": d3.select(\"#tip\"),\n\t\t\"tooltip_text\": function(d) {return (d.title.length <= 60 ? d.title : d.title.substr(0, 60) + \"...\")\n\t\t\t + \"<br>(\" + (d.url.length <= 40 ? d.url : (d.url.substr(0, 40) + \"...\")) + \")\";},\n \t\t\"text\": function (d) {return d.title},\n\t\t\"color\": bubbleColors, \"textColor\": color.text\n\t\t});\n\n\t//print_array(bubblePoly2);\n\t\t\n\t// Create and expand the bubble.\n\tpolyBubbleSmall = {\"points\": _.map(ans.polySmall, function(x) {return x.join(\",\");}).join(\" \"), \n\t\t\"fill\": bubbleColor1, \"stroke\": \"white\", \"strokewidth\": bubbleWidth};\n\tpolyBubbleLarge = {\"points\": _.map(ans.polyLarge, function(x) {return x.join(\",\");}).join(\" \"),\n\t\t\"fill\": bubbleColor2, \"stroke\": \"white\", \"strokewidth\": displayTreeStrokeWidth(0)};\n\tpolyTemp = vis.append(\"polygon\").attr(\"points\", polyBubbleSmall.points)\n\t\t.attr(\"fill\", bubbleColor1)\n\t\t.attr(\"stroke\", \"white\")\n\t\t.attr(\"stroke-width\", bubbleWidth);\n\tpolyTemp\n\t\t.transition()\n\t\t.duration(200)\n\t\t.attr(\"points\", polyBubbleLarge.points)\n\t\t.attr(\"fill\", bubbleColor2)\n\t\t.attr(\"stroke-width\", displayTreeStrokeWidth(0))\n\t\t.each(\"end\", function () \n\t\t{\n\t\t\t// Stuff to do after the transition ends.\n\t\t\tactiveTree = clusterTree_bubble;\n\t\t\tisTransition = false;\n\t\t\t\n\t\t\tif (n > 15)\t\t// Desaturate the exterior for large bubbles.\n\t\t\t{\n\t\t\t\ttreemap.colorsBackup = (treemap.colorsBackup != null ? treemap.colorsBackup : treemap.colors);\n\t\t\t\ttreemap.recolor(function (path, node)\n\t\t\t\t{\n\t\t\t\t\tvar a = d3.hsl(treemap.colorsBackup(path, node));\n\t\t\t\t\ta.s = 0; a.l = 0.625 + (a.l - 0.625)*0.4; return a.toString();\n\t\t\t\t}, 1000);\n\t\t\t\tisBubbleGrayed = true;\n\t\t\t}\n\t\t\t\n\t\t\ttreemap_bubble.draw ();\n\t\t\ttreemap_bubble.on(\"click\", visitSiteBubble);\n\t\t\tpolyTemp.remove();\n\t\t\tvis.on(\"click.bubble\", \n\t\t\t\tfunction (x) {if (!isInsidePolygon(d3.mouse(this), treemap_bubble.bbox)) {zoomOut();}})\n\t\t\t\n\t\t});\n}", "title": "" }, { "docid": "d691d466cdb15057892d79352d30bccb", "score": "0.49928194", "text": "function gotData(data) {\n\n console.log(data); // Print the data in the console\n\n // iterate through the array of data and create an object and push it on an array called bubbles\n for (let i = 0; i < data.length; i++) {\n bubbles.push(new Bubble(data[i].Name, data[i].Island, data[i].Job, data[i].Fight, data[i].Memory, data[i].Forest, data[i].Power )); // THESE Name and Shape need to match your column names in your spreadsheet!\n }\n\n}", "title": "" }, { "docid": "5ecca270fd7cffa5b181bff14bce84a4", "score": "0.49897647", "text": "renderVis(stat) {\r\n let vis = this\r\n\r\n vis.nodes = vis.createNodes(vis.data, stat)\r\n\r\n // Bind nodes data\r\n vis.bubbles = vis.svg\r\n .selectAll('.bubble')\r\n .data(vis.nodes, function (d) {\r\n return d.id\r\n })\r\n\r\n vis.bubbles.exit().remove()\r\n\r\n let bubblesE = vis.bubbles\r\n .enter()\r\n .append('circle')\r\n .attr('class', (d) => `bubble ${d.position}`)\r\n .attr('id', (d) => `bc-node-${d.id}`)\r\n .attr('r', 0)\r\n .attr('fill', function (d) {\r\n return vis.color(d.position)\r\n })\r\n .attr('stroke', function (d) {\r\n return d3.rgb(vis.color(d.position)).darker()\r\n })\r\n .attr('stroke-width', 2)\r\n .on('click', (event, d) => {\r\n // Disabled\r\n if (event.target.classList.contains('bc-gray')) {\r\n return\r\n }\r\n\r\n if (event.target.classList.contains('bc-selected')) {\r\n // Deselect node event\r\n event.target.classList.remove('bc-selected')\r\n vis.selectedNode = null\r\n vis.playerTip.innerHTML = ''\r\n vis.dispatcher.call('deselectPlayer', event)\r\n } else {\r\n if (vis.selectedNode !== null) {\r\n let oldNode = document.getElementById(\r\n `bc-node-${vis.selectedNode.id}`\r\n )\r\n oldNode.classList.remove('bc-selected')\r\n vis.playerTip.innerHTML = ''\r\n }\r\n\r\n vis.selectedNode = d\r\n event.target.classList.add('bc-selected')\r\n\r\n // Update tooltip on side\r\n vis.playerTip.innerHTML = ''\r\n vis.playerTip.appendChild(\r\n vis.createPlayerInfoDiv(vis.selectedNode.player_id)\r\n )\r\n\r\n let player = {\r\n name: vis.selectedNode.name,\r\n player_id: vis.selectedNode.player_id,\r\n position: vis.selectedNode.position,\r\n }\r\n vis.dispatcher.call('selectPlayer', event, player)\r\n }\r\n })\r\n .on('mouseover', (event, d) => {\r\n const hallOfFameText = `<li><b>Hall of Fame</b> 🏆</li>`\r\n\r\n if (event.target.classList.contains('bc-gray')) return\r\n d3.select('#tooltip').style('display', 'block').html(`\r\n <h4>${d.name} - ${d.position}</h4>\r\n <ul class=\"display\">\r\n <li><b>Age:</b> ${d.age}</li>\r\n <li><b>Height: </b> ${d.height} cm</li>\r\n <li><b>Weigth: </b> ${d.weight} kg</li>\r\n <li><b>${vis.selectedStat}: </b> ${d.value}</li>\r\n ${d.hof ? hallOfFameText : ''}\r\n </ul>\r\n `)\r\n })\r\n .on('mousemove', (event) => {\r\n if (event.target.classList.contains('bc-gray')) return\r\n d3.select('#tooltip')\r\n .style('left', event.pageX + 16 + 'px')\r\n .style('top', event.pageY + 16 + 'px')\r\n })\r\n .on('mouseleave', (event) => {\r\n if (event.target.classList.contains('bc-gray')) return\r\n d3.select('#tooltip').style('display', 'none')\r\n })\r\n\r\n vis.bubbles = vis.bubbles.merge(bubblesE)\r\n\r\n // Smooth transition\r\n vis.bubbles\r\n .transition()\r\n .duration(1000)\r\n .attr('r', function (d) {\r\n return d.radius\r\n })\r\n\r\n vis.simulation.nodes(vis.nodes)\r\n\r\n // Set initial layout to single group.\r\n vis.simulation.alpha(1).restart()\r\n }", "title": "" }, { "docid": "0ee098f73238fbedb630ee93f31c3a58", "score": "0.4987618", "text": "bubbleUp() {\n let index = this.values.length - 1;\n const element = this.values[index];\n while (index > 0) {\n let parentIndex = Math.floor((index - 1) / 2);\n let parentElem = this.values[parentIndex];\n if (element <= parentElem) break;\n this.values[parentIndex] = element;\n this.values[index] = parentElem;\n index = parentIndex;\n }\n }", "title": "" } ]
4be08a515fbf461774a2b6d0935fa914
Kraft, J. Regular Expressions in JavaScript[snippet]
[ { "docid": "4f9c26207965b6961a6599f76aca5149", "score": "0.0", "text": "function createListener(validator, spanIdToHide) {\n return e => {\n const text = e.target.value;\n const valid = validator(text);\n const showTip = text !== \"\" && !valid;\n const tooltip = e.target.nextElementSibling;\n showOrHideTip(showTip, tooltip, spanIdToHide);\n };\n }", "title": "" } ]
[ { "docid": "e9c9a3fa27f297acf64824e89a2520c3", "score": "0.71696377", "text": "function RegExpHandler() { }", "title": "" }, { "docid": "920e955ecc72cffb2944412e244f3803", "score": "0.6515879", "text": "function build_regex(search_text) {\n\n /* Remove parenthesised content */\n par_regexp = new RegExp(\"\\\\W?\\\\(.*\\\\)\\\\W?\", 'ig');\n par_result = par_regexp.exec(search_text);\n \n if(par_result) {\n search_text = RegExp.leftContext;\n if((RegExp.rightContext) && (0 < RegExp.rightContext)) {\n search_text += \" \" + RegExp.rightContext;\n }\n }\n \n first_search = \"\";\n end_search = \"\";\n \n do {\n /* Case verb start with \"to\"*/\n verb_regexp = new RegExp(\"^to \", 'ig');\n verb_result = verb_regexp.exec(search_text);\n \n if(verb_result) {\n /* Verb may be composed */\n first_search = search_text.substring(verb_result[0].length);\n\n vcomp_regexp = new RegExp(\"^(\\\\w*)\\\\W.*\", 'ig');\n vcomp_result = vcomp_regexp.exec(first_search);\n \n if (vcomp_result) {\n end_search = first_search.substring(vcomp_result[1].length+1);\n first_search = vcomp_result[1];\n search_pattern = \"(\"+first_search+\"{0,2}(s|e|ing|ed)?\\\\W\"+end_search+\")\";\n } else {\n search_pattern = \"(\"+first_search+\"{0,2}(s|e|ing|ed)?)\";\n }\n break;\n }\n \n /* Case name */\n name_regexp = new RegExp(\"^(a |an )\", 'ig');\n name_result = name_regexp.exec(search_text);\n if(name_result) {\n first_search = search_text.substring(name_result[0].length);\n search_pattern = \"(\"+first_search+\"?(s|es)?)\";\n break;\n }\n \n /* Other cases */\n first_search = search_text;\n\t\tif(first_search.length <= 0) {\n\t\t\tGM_log(\"Strange case in regexp building. Content is empty\");\n\t\t} else {\n\t\t\tsearch_pattern = \"(\"+first_search+\"?(s|es)?)\";\n\t\t}\n \n } while(0);\n\n new_regexp = new RegExp(\"\\\\W\" + search_pattern + \"\\\\W\", 'ig');\n\n return new_regexp;\n}", "title": "" }, { "docid": "bda3e615c5474737b942a35e2c48b9d0", "score": "0.6511773", "text": "function RegExpLiteralExpression() {\n}", "title": "" }, { "docid": "3a8dffc0da0f1455187dbeee259cee63", "score": "0.6435251", "text": "getScriptureRegEx() {\n var booksrearray=[];\n for( var b of ScriptureUtil.BIBLEBOOKS ) booksrearray.push(b.regex.source);\n return RegExp(ScriptureUtil.SCRIPTURE_REGEX.source.replace(\"\\\\w+\",booksrearray.join(\"|\")),ScriptureUtil.SCRIPTURE_REGEX.flags);\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.64010173", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.64010173", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.64010173", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.64010173", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.64010173", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.64010173", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "4b0af39f6e2f9a33bf7939d192a4174d", "score": "0.6229434", "text": "static get PATTERN() { return /^(.*)/; }", "title": "" }, { "docid": "d69b0fac019c697050832ce974ffab66", "score": "0.62221843", "text": "function matchAllLettersNumbersUnderscore(){\n let y = document.getElementById(\"p14a\").innerHTML\nlet myRegex = /\\w/gi \n// let myRegex = /g$/gi //if just last charater \ndocument.getElementById(\"p14b\").innerHTML = `Matched string : ${myRegex}`;\ndocument.getElementById(\"p14c\").innerHTML = y.match(myRegex); \n}", "title": "" }, { "docid": "c76475f86e85d9126cdbfe8f1e298cd5", "score": "0.6191105", "text": "match(rexp, di = 0) {\n return rexp.exec(this.rest(di));\n }", "title": "" }, { "docid": "94a69a5049a0b6c4ae4582bc8955ab9e", "score": "0.6183565", "text": "function RE(s, f) {\n\t return RegExp(s, f);\n\t}", "title": "" }, { "docid": "94a69a5049a0b6c4ae4582bc8955ab9e", "score": "0.6183565", "text": "function RE(s, f) {\n\t return RegExp(s, f);\n\t}", "title": "" }, { "docid": "28cd5b7aba057b6d7bb84011c899c65e", "score": "0.61662596", "text": "function make_a_matcher() {\n return /a/gi; \n}", "title": "" }, { "docid": "8175fd9a0198ef5185c742894188a9d6", "score": "0.6161911", "text": "function make_a_matcher(){\n\treturn /a/gi;\n}", "title": "" }, { "docid": "a18d723beedc9617c198637fd748f352", "score": "0.6147987", "text": "function buildFinalRegex(r) {\n\tr = r.trim();\n\n\tif (r === 'pecka:)') {\n\t\treturn null;\n\t}\n\n\t// turn P, O and S into non-capturing groups\n\tif (r.indexOf('(') !== -1) {\n\t\tr = r.replace('(p|P)', '(?:p|P)');\n\t\tr = r.replace('(o|O)', '(?:o|O)');\n\t\tr = r.replace('(S|s)', '(?:S|s)');\n\t\tr = r.replace(\"(_|\\\\.)\", \"(?:_|\\\\.)\");\n\t}\n\n\t// only add boundaries to word-only emotes\n\tif (r.match(/^\\w+$/)) {\n\t\tr = \"\\\\b\" + r + \"\\\\b\";\n\t}\n\t// un-HTML encode the regex\n\telse {\n\t\tr = r.replace('\\\\&lt\\\\;', '<');\n\t\tr = r.replace('\\\\&gt\\\\;', '>');\n\t}\n\n\treturn new RegExp(r, 'g');\n}", "title": "" }, { "docid": "3064d7624466ea3d0f2997a3e7ade9cc", "score": "0.61424404", "text": "getRegEx(match) {\n const explicitRegex = Filter.getRegEx(match);\n // User specified search using /regex/ format\n if (explicitRegex) {\n return explicitRegex;\n }\n // Convert text to regex format\n const convertPlainTextToRegexSearch = (text) =>\n text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n return { regex: convertPlainTextToRegexSearch(match), flags: 'g' };\n }", "title": "" }, { "docid": "b6288e0f22d0afc516cabcac563974d5", "score": "0.6141567", "text": "function regexVar(s) {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n */\n let re = /^(Mr\\.|Mrs\\.|Ms\\.|Dr\\.|Er\\.)[a-zA-Z]+$/\n\n \n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "031ac1dcc76bc5a424e2cb30b1f80168", "score": "0.61213934", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n */\n const re = new RegExp('^(Mr|Mrs|Ms|Dr|Er)(\\\\.)([a-zA-z])*$')\n\n\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "f939d679ea72458fb11def7058d2ba94", "score": "0.61197996", "text": "R(value) {\n return new RegExp(value, 'i');\n }", "title": "" }, { "docid": "2109204894876ecfebe75d6bf1fff8a6", "score": "0.61156726", "text": "function readRegexp() {\n var content = \"\", escaped, inClass, start = tokPos;\n for (;;) {\n if (tokPos >= inputLen) raise(start, \"Unterminated regular expression\");\n var ch = input.charAt(tokPos);\n if (newline.test(ch)) raise(start, \"Unterminated regular expression\");\n if (!escaped) {\n if (ch === \"[\") inClass = true;\n else if (ch === \"]\" && inClass) inClass = false;\n else if (ch === \"/\" && !inClass) break;\n escaped = ch === \"\\\\\";\n } else escaped = false;\n ++tokPos;\n }\n var content = input.slice(start, tokPos);\n ++tokPos;\n // Need to use `readWord1` because '\\uXXXX' sequences are allowed\n // here (don't ask).\n var mods = readWord1();\n var tmp = content;\n if (mods) {\n var validFlags = /^[gmsiy]*$/;\n if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/;\n if (!validFlags.test(mods)) raise(start, \"Invalid regular expression flag\");\n if (mods.indexOf('u') >= 0 && !regexpUnicodeSupport) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence that represents such a symbol with a single\n // ASCII symbol to avoid throwing on regular expressions that\n // are only valid in combination with the `/u` flag.\n tmp = tmp\n .replace(/\\\\u\\{([0-9a-fA-F]{5,6})\\}/g, \"x\")\n .replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, \"x\");\n }\n }\n // Detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n if (e instanceof SyntaxError) raise(start, \"Error parsing regular expression: \" + e.message);\n raise(e);\n }\n // Get a regular expression object for this pattern-flag pair, or `null` in\n // case the current environment doesn't support the flags it uses.\n try {\n var value = new RegExp(content, mods);\n } catch (err) {\n value = null;\n }\n return finishToken(_regexp, {pattern: content, flags: mods, value: value});\n }", "title": "" }, { "docid": "2109204894876ecfebe75d6bf1fff8a6", "score": "0.61156726", "text": "function readRegexp() {\n var content = \"\", escaped, inClass, start = tokPos;\n for (;;) {\n if (tokPos >= inputLen) raise(start, \"Unterminated regular expression\");\n var ch = input.charAt(tokPos);\n if (newline.test(ch)) raise(start, \"Unterminated regular expression\");\n if (!escaped) {\n if (ch === \"[\") inClass = true;\n else if (ch === \"]\" && inClass) inClass = false;\n else if (ch === \"/\" && !inClass) break;\n escaped = ch === \"\\\\\";\n } else escaped = false;\n ++tokPos;\n }\n var content = input.slice(start, tokPos);\n ++tokPos;\n // Need to use `readWord1` because '\\uXXXX' sequences are allowed\n // here (don't ask).\n var mods = readWord1();\n var tmp = content;\n if (mods) {\n var validFlags = /^[gmsiy]*$/;\n if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/;\n if (!validFlags.test(mods)) raise(start, \"Invalid regular expression flag\");\n if (mods.indexOf('u') >= 0 && !regexpUnicodeSupport) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence that represents such a symbol with a single\n // ASCII symbol to avoid throwing on regular expressions that\n // are only valid in combination with the `/u` flag.\n tmp = tmp\n .replace(/\\\\u\\{([0-9a-fA-F]{5,6})\\}/g, \"x\")\n .replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, \"x\");\n }\n }\n // Detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n if (e instanceof SyntaxError) raise(start, \"Error parsing regular expression: \" + e.message);\n raise(e);\n }\n // Get a regular expression object for this pattern-flag pair, or `null` in\n // case the current environment doesn't support the flags it uses.\n try {\n var value = new RegExp(content, mods);\n } catch (err) {\n value = null;\n }\n return finishToken(_regexp, {pattern: content, flags: mods, value: value});\n }", "title": "" }, { "docid": "b539a5dbbea4c4ed4738dd47307cd7d9", "score": "0.60983217", "text": "function readRegexp() {\n var content = \"\", escaped, inClass, start = tokPos;\n for (;;) {\n if (tokPos >= inputLen) raise(start, \"Unterminated regular expression\");\n var ch = nextChar();\n if (newline.test(ch)) raise(start, \"Unterminated regular expression\");\n if (!escaped) {\n if (ch === \"[\") inClass = true;\n else if (ch === \"]\" && inClass) inClass = false;\n else if (ch === \"/\" && !inClass) break;\n escaped = ch === \"\\\\\";\n } else escaped = false;\n ++tokPos;\n }\n var content = input.slice(start, tokPos);\n ++tokPos;\n // Need to use `readWord1` because '\\uXXXX' sequences are allowed\n // here (don't ask).\n var mods = readWord1();\n // Detect invalid regular expressions.\n var tmp = content;\n if (mods) {\n var validFlags = /^[gmsiy]*$/;\n if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/;\n if (!validFlags.test(mods)) raise(start, \"Invalid regular expression flag\");\n if (mods.indexOf('u') >= 0 && !regexpUnicodeSupport) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence that represents such a symbol with a single\n // ASCII symbol to avoid throwing on regular expressions that\n // are only valid in combination with the `/u` flag.\n tmp = tmp\n .replace(/\\\\u\\{([0-9a-fA-F]{5,6})\\}/g, \"x\")\n .replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, \"x\");\n }\n }\n // Detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n if (e instanceof SyntaxError) raise(start, \"Error parsing regular expression: \" + e.message);\n raise(e);\n }\n // Get a regular expression object for this pattern-flag pair, or `null` in\n // case the current environment doesn't support the flags it uses.\n try {\n var value = new RegExp(content, mods);\n } catch (err) {\n value = null;\n }\n return finishToken(_regexp, {pattern: content, flags: mods, value: value});\n }", "title": "" }, { "docid": "52424a17742dee2dcb0195384fa4eb57", "score": "0.6091173", "text": "function simple_form(name){return RegExp(\"(\\\\()\"+name+\"(?=[\\\\s\\\\)])\")}// booleans and numbers", "title": "" }, { "docid": "66dde1d3a09f314da2da41bb4f8ee117", "score": "0.6082839", "text": "function getRegEx(arg1, arg2, arg3) {\n var regEx = '(' + arg1 + ')(' + arg2 + ')(' + arg3 + ')';\n regEx = new RegExp(regEx, 'gi');\n return regEx;\n }", "title": "" }, { "docid": "0e899b59279a9edb575430505e5272da", "score": "0.6076872", "text": "function $regex_nong( r ) {\n if (r.regexng) return r.regexng;\n r.regexng = new RegExp( r.regex.source, r.flags )\n return r.regexng;\n}", "title": "" }, { "docid": "956a7fa6895a9f4fb44d204ba37b2b04", "score": "0.6057659", "text": "function generateRegExp(text) {\n return new RegExp([\"^\",text,\"$\"].join(\"\"), \"i\");\n}", "title": "" }, { "docid": "c66c977256ba29cf2d487ffd4a35f4a4", "score": "0.6030385", "text": "function panggilRegExpFlag_g() {\n let str = \"abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz\";\n\n console.log(str.match(/c/));\n console.log(str.match(/c/g));\n}", "title": "" }, { "docid": "72c30d52413493f0476e560e393f0ace", "score": "0.60032713", "text": "function buildRexExp() {\n\n var types = [];\n\n for ( var type in corpus )\n\n types.push( type );\n\n var content = '@(type)'.replace( 'type', types.join( '|' ) );\n\n regex = new RegExp( content, 'gi' );\n }", "title": "" }, { "docid": "5ce222fb8eb5f103917e0b8e1baffd37", "score": "0.59969556", "text": "function regExPrac1() {\n var str1 = 'RomulusJuliusAugustusoOptimus';\n var pat1 = /julius/i;\n str1 = str1.replace(pat1, 'Vitalius');\n var search1 = str1.search(pat1); // cache search1\n\n var regTest = /US/gi.test(str1);\n var regExec = /OPT/gi.exec(str1);\n\n // just to see some output:\n console.log('---');\n console.log('regExec = '+regExec);\n console.log(\"pos of Julius = \"+ (search1 === -1 ?\n 'Sorry. pattern \"Julius\" not found :(' : search1));\n}", "title": "" }, { "docid": "503e2b5eae6b19bf89c2537f0ba76373", "score": "0.5993979", "text": "function make_a_matcher() {\n return /a/gi;\n}", "title": "" }, { "docid": "85b1e28abcc062d8dc61e02e03eb4c87", "score": "0.59798104", "text": "function tryCreateRegexp(src,flags,throwErrorAt,parser){try{return new RegExp(src,flags);}catch(e){if(throwErrorAt!==undefined){if(e instanceof SyntaxError)parser.raise(throwErrorAt,\"Error parsing regular expression: \"+e.message);throw e;}}}", "title": "" }, { "docid": "c08461aa3fee970884ea8ce92c08aae0", "score": "0.5944951", "text": "function regExpFromPattern(pattern) {\n\t\t//translate osc-style patterns into RegExp\n\t\tpattern = pattern.replace(\"*\", \".+\");\n\t\tpattern = pattern.replace('{', \"(\");\n\t\t\tpattern = pattern.replace('}', \")\");\n\t\t\tpattern = pattern.replace(',', \"|\");\n\t\t\tpattern = pattern.replace('?', '.');\n\t\t//match '!' only if after '['\n\t\tpattern = pattern.replace('[!', '[^');\n\t\t//add the end-of-line to the pattern so that it stops matching\n\t\tpattern += '$';\n\t\tvar regExp = new RegExp(pattern);\n\t\treturn regExp;\n\t}", "title": "" }, { "docid": "4c1a295258c80c25b4d214c3807ddd4a", "score": "0.59352595", "text": "function regex_match()\n{\n\t//We use the \"g\" flag to mimic\n\t//the c++ counterparts.\n\tvar key=new RegExp(\"^\"+reg+\"$\",\"g\");\n\tkeys=key.exec(phrase);\n\t\n\tif (keys==null)\n\t\treturn false;\n\telse\n\t\treturn true;\n}", "title": "" }, { "docid": "06f2e4499e29304ea08774a50f45ca7d", "score": "0.5910582", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n * --------------------------------------------------------------\n * ^ -> asserts position at start of the string\n * 1st -> Capturing Group (Mr.|Mrs.|Ms.|Dr.|Er.)\n * \\. -> Decimal\n * +$ -> asserts position at the end of the string matches [A-Za-z] before it at least once (+)\n */\n\n const re = /^(Mr|Mrs|Ms|Dr|Er)\\.[A-Za-z]+$/;\n \n return re;\n}", "title": "" }, { "docid": "51efdb39e407eff05118870bca5c4b96", "score": "0.59103197", "text": "function buildRexExp() {\n\n var types = [];\n\n for ( var type in corpus )\n\t\t\t\n types.push( type );\n\t\t\n types = types.sort(function (a, b) {\n if (a.length == b.length) {\n\t\t\t\treturn 0\n\t\t\t}\n return a.length > b.length ? -1 : 1\n\t\t})\n\t\t\n var content = '@(type)'.replace( 'type', types.join( '|' ) );\n\n regex = new RegExp( content, 'gi' );\n }", "title": "" }, { "docid": "778e0ad32c414fe548c58a31fc04f0b8", "score": "0.5899802", "text": "toJsRegExp(javaSyntax) {\r\n const parts = javaSyntax.match(this.EXTRACT_JAVA_REGEXP_MODIFIERS);\r\n if (!parts) {\r\n return null;\r\n }\r\n const [, , modifiers, jsSyntax] = parts;\r\n try {\r\n return new RegExp(jsSyntax, modifiers);\r\n }\r\n catch (error) {\r\n if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"isDevMode\"])()) {\r\n console.warn(`WARNING: Could not convert Java regexp into Javascript. Original regexp: ${javaSyntax} \\nMessage: ${error}`);\r\n }\r\n return null;\r\n }\r\n }", "title": "" }, { "docid": "9e615ce03329440b8de2881d907be945", "score": "0.5899311", "text": "function patternRegex() {\n return /\\$\\{|[ \\t]|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "983e49d3215cc5612b0183ab8e14c614", "score": "0.5897492", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n const re = new RegExp('^([aeiou]).+\\\\1$')\n\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "ba94d5fa9a8fc43fa5404e219fdb4ba2", "score": "0.5878587", "text": "function regex_search()\n{\n\t//We use the \"g\" flag to mimic\n\t//the c++ counterparts.\n\tvar key=new RegExp(reg,\"g\");\n\tkeys=key.exec(phrase);\n\t\n\tif (keys==null)\n\t\treturn false;\n\telse\n\t\treturn true;\n}", "title": "" }, { "docid": "f3221f9852ea419487796509c8315d26", "score": "0.5870847", "text": "function test() {\r\n var s = \"Testxing here\";\r\n Logger.log(\"starts with Testing: \"+/Testing/.test(s));\r\n //sCarePlan.slice(0,7)===\"Testing\"\r\n \r\n \r\nvar regex1 = RegExp('foo*');\r\nvar regex2 = RegExp('foo*','g');\r\nvar str1 = 'table football';\r\n\r\nLogger.log(regex1.test(str1));\r\n// expected output: true\r\n\r\nLogger.log(regex1.test(str1));\r\n// expected output: true\r\n\r\nLogger.log(regex2.test(str1));\r\n// expected output: true\r\n\r\nLogger.log(regex2.test(str1)); // WHY???????????\r\n// expected output: false \r\n}", "title": "" }, { "docid": "68016f65611cd97dae3455f28ca15b75", "score": "0.5859531", "text": "function sc_pregexp(re) {\n return new RegExp(sc_string2jsstring(re));\n}", "title": "" }, { "docid": "68016f65611cd97dae3455f28ca15b75", "score": "0.5859531", "text": "function sc_pregexp(re) {\n return new RegExp(sc_string2jsstring(re));\n}", "title": "" }, { "docid": "436a6409690ae8cc63debaafc966f34a", "score": "0.58460265", "text": "function fromRegex (r) {\n return function (o) { return typeof o === 'string' && r.test(o) }\n }", "title": "" }, { "docid": "6bc4aeb16c5e2c006b8b38923320841b", "score": "0.5830085", "text": "function t(re, s) { assertTrue(re.test(s)); }", "title": "" }, { "docid": "8257087d72c83ba676256461851ecc63", "score": "0.5824445", "text": "get regexMod() {\n return this.ignoreCase ? \"gi\" : \"g\";\n }", "title": "" }, { "docid": "c1c1353ec4450a4ff0cab9bca052025e", "score": "0.581486", "text": "static matchAll (string, regexp) {\r\n let matches = [];\r\n\r\n string.replace(regexp, () => {\r\n let arr = [].slice.call(arguments, 0);\r\n let extras = arr.slice(-2);\r\n arr.index = extras[0];\r\n arr.input = extras[1];\r\n matches.push(arr);\r\n });\r\n\r\n return matches;\r\n }", "title": "" }, { "docid": "e082977dad234a339b5eba5697a87e46", "score": "0.5806728", "text": "function _RegExpLiteralExpressionEmitter() {\n}", "title": "" }, { "docid": "ddd616d5050ee4d6ae76cf2d56d8a3b7", "score": "0.5800399", "text": "function consumeRegexp(expression, ii, regexp) {\n for (var jj = ii;\n jj < expression.length &&\n expression.charAt(jj).match(regexp);\n jj++) {\n }\n return {'value': expression.substr(ii, jj-ii), 'position': jj};\n}", "title": "" }, { "docid": "ee062cc143bb61fbb0033203ed2dac81", "score": "0.5800009", "text": "function mattingPair(num, string){\r\n\tvar regexp = new RegExp('B8',g)\r\n\tvar regexp1 = new RegExp('8B',g)\r\n\treturn (s) =>(/regexp/,/regexp1/ function(){\r\n\t\t// traitmenttttt \r\n\t})\r\n}", "title": "" }, { "docid": "6031e0b21049b400fde0acc9727255c1", "score": "0.5795878", "text": "match(string, metadata = {depth: 0, parent: null}){\n var newMatchNode = new MatchNode()\n\n //matches, matchFound and matchLength need to be set in each case\n var matches = []\n var matchFound = false\n var matchLength = 0\n switch(this['friendly node type name']){\n case 'rule list':\n {\n //newMatchNode will be used as the parent node for all matches that are initiated by the current node\n //It is referred to at the end of the function\n let matchInfo = this.rules[0].match(string, {depth: 1, parent: newMatchNode})\n matchLength = matchInfo.matchLength\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n }\n break\n case 'rule':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matchLength = matchInfo.matchLength\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n\n newMatchNode.setProperties({name: this.name})\n }\n break\n case 'rule name':\n {\n let rule = this.parser.getRule(this.value)\n let matchInfo = rule.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n matchLength = matchInfo.matchLength\n newMatchNode.setProperties({value: this.value})\n }\n break\n case 'not':\n {\n let matchInfo = this['pattern'].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n \n matchFound = !matchInfo.matchFound\n if (matchFound){\n matchLength = string.length\n }\n matches = [matchInfo]\n }\n break\n case 'ws allow both':\n {\n let leadingWhitespace = Strings.headMatch(string, Strings.whitespace_characters)\n \n let remainderString = string.substring(leadingWhitespace.length)\n let matchInfo = this['inner pattern'].match(remainderString,{depth: metadata.depth + 1, parent: newMatchNode})\n if (matchInfo.matchFound){\n let afterInnerPattern = remainderString.substring(matchInfo.matchLength)\n let trailingWhitespace = Strings.headMatch(afterInnerPattern, Strings.whitespace_characters)\n matchLength = leadingWhitespace.length + matchInfo.matchLength + trailingWhitespace.length\n }\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n }\n break\n case 'sequence':\n {\n let tempString = string\n let totalMatchLength = 0\n \n let matchInfo\n for (let i = 0; i < this['patterns'].length; i++){\n matchInfo = this['patterns'][i].match(tempString,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (!matchInfo.matchFound){\n break;\n }else{\n totalMatchLength = totalMatchLength + matchInfo.matchLength\n tempString = tempString.substring(matchInfo.matchLength)\n }\n }\n matchFound = matchInfo.matchFound\n matchLength = totalMatchLength\n }\n break\n case 'or':\n {\n let matchInfo\n for (let i = 0; i < this.patterns.length; i++){\n matchInfo = this['patterns'][i].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (matchInfo.matchFound){\n break\n }\n }\n matchFound = matchInfo.matchFound\n matchLength = matchInfo.matchLength\n }\n break\n case 'and':\n {\n let matchInfo\n let andDetected = true\n \n for (let i = 0; i < this.patterns.length; i++){\n matchInfo = this['patterns'][i].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (!matchInfo.matchFound){\n andDetected = false\n matchLength = 0\n break\n }else{\n matchLength = matchInfo.matchLength\n }\n }\n \n //matchLength will be equal to the shortest match, or 0 if there was no match\n matchLength = match.matchLength\n\n matchFound = andDetected\n }\n break\n case 'multiple':\n {\n let tempString = string\n let totalMatchLength = 0\n \n let matchInfo = this.pattern.match(tempString,{depth: metadata.depth + 1, parent: newMatchNode})\n if (matchInfo.matchFound){\n matches.push(matchInfo)\n }\n while(matchInfo.matchFound){\n totalMatchLength = totalMatchLength + matchInfo.matchLength\n tempString = tempString.substring(matchInfo.matchLength)\n matchInfo = this.pattern.match(tempString,{depth: metadata.depth + 1, parent: this})\n matches.push(matchInfo)\n }\n\n if (matches.length > 0){\n matchFound = true\n }\n matchLength = totalMatchLength\n }\n break\n case 'quoted string':\n {\n //matches if the string starts with the quoted string\n let internalString = this['string']\n \n if (string.substring(0, internalString.length) == internalString){\n matchFound = true\n }\n \n if (matchFound){\n matchLength = internalString.length\n }\n newMatchNode.setProperties({string: this.string})\n }\n break\n case 'character class':\n {\n //matches if the string starts with characters from the character class\n let matchingString = ''\n //i is the number of characters to take for comparison\n //i goes from 1, 2, 3, ... to the length of the string\n for (let i = 1; i <= string.length; i++){\n let headString = string.substring(0,i)\n if (Strings.contains_only(headString,this['string'])){\n matchingString = headString\n }else{\n break\n }\n }\n \n if (matchingString.length > 0){\n matchFound = true\n matchLength = matchingString.length\n }\n }\n break\n case 'optional':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n matchLength = matchInfo.matchLength\n matchFound = true\n }\n break\n case 'exact':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (matchInfo.matchFound && matchInfo.matchLength == string.length){\n matchLength = matchInfo.matchLength\n matchFound = true \n }\n }\n }\n\n let matchString = string.substring(0, matchLength)\n newMatchNode.setProperties({parent: metadata.parent, string, type: this['friendly node type name'], id: this.id, serial: this.parser.getMatchCount(), depth: metadata.depth, matchFound, matchLength, matchString, matches})\n return newMatchNode\n }", "title": "" }, { "docid": "4b0f2d887a9ea35bdb8a3f125dfdda84", "score": "0.5794536", "text": "function fromRegex(r) {\n return function (o) {\n return typeof o === 'string' && r.test(o);\n };\n } // Try to apply a prefix to a name", "title": "" }, { "docid": "7d89aa7f4204b42ff71415829cfff933", "score": "0.5774955", "text": "function tokensToFunction(tokens){// Compile all the tokens into regexps.\nvar matches=new Array(tokens.length);// Compile all the patterns before compilation.\nfor(var i=0;i<tokens.length;i++){if((0,_typeof4.default)(tokens[i])==='object'){matches[i]=new RegExp('^(?:'+tokens[i].pattern+')$');}}return function(obj,opts){var path='';var data=obj||{};var options=opts||{};var encode=options.pretty?encodeURIComponentPretty:encodeURIComponent;for(var i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token==='string'){path+=token;continue;}var value=data[token.name];var segment;if(value==null){if(token.optional){// Prepend partial segment prefixes.\nif(token.partial){path+=token.prefix;}continue;}else{throw new TypeError('Expected \"'+token.name+'\" to be defined');}}if(isarray(value)){if(!token.repeat){throw new TypeError('Expected \"'+token.name+'\" to not repeat, but received `'+(0,_stringify3.default)(value)+'`');}if(value.length===0){if(token.optional){continue;}else{throw new TypeError('Expected \"'+token.name+'\" to not be empty');}}for(var j=0;j<value.length;j++){segment=encode(value[j]);if(!matches[i].test(segment)){throw new TypeError('Expected all \"'+token.name+'\" to match \"'+token.pattern+'\", but received `'+(0,_stringify3.default)(segment)+'`');}path+=(j===0?token.prefix:token.delimiter)+segment;}continue;}segment=token.asterisk?encodeAsterisk(value):encode(value);if(!matches[i].test(segment)){throw new TypeError('Expected \"'+token.name+'\" to match \"'+token.pattern+'\", but received \"'+segment+'\"');}path+=token.prefix+segment;}return path;};}", "title": "" }, { "docid": "5b676e26bb960f1865a77ee471be14f7", "score": "0.5773598", "text": "function gf(a){this.Zf=a;this.Jg=\"\";this.cm=new RegExp(this.Aa,\"g\")}", "title": "" }, { "docid": "4670011a9370f2ce6cc903f28f009458", "score": "0.5771341", "text": "function sc_pregexpMatch(re, s) {\n var reg = (re instanceof RegExp) ? re : sc_pregexp(re);\n var tmp = reg.exec(sc_string2jsstring(s));\n \n if (tmp == null) return false;\n \n var res = null;\n for (var i = tmp.length-1; i >= 0; i--) {\n\tif (tmp[i] !== null) {\n\t res = sc_cons(sc_jsstring2string(tmp[i]), res);\n\t} else {\n\t res = sc_cons(false, res);\n\t}\n }\n return res;\n}", "title": "" }, { "docid": "065ff58d0a92bb7b700b0e5614afddeb", "score": "0.57592744", "text": "function t(){t=function(t,e){return new c(t,void 0,e)};var n=RegExp.prototype,o=new WeakMap;function c(t,e,n){var u=new RegExp(t,e);return o.set(u,n||o.get(t)),r(u,c.prototype)}function u(t,e){var r=o.get(e);return Object.keys(r).reduce((function(e,n){return e[n]=t[r[n]],e}),Object.create(null))}return e(c,RegExp),c.prototype.exec=function(t){var e=n.exec.call(this,t);return e&&(e.groups=u(e,this)),e},c.prototype[Symbol.replace]=function(t,e){if(\"string\"==typeof e){var r=o.get(this);return n[Symbol.replace].call(this,t,e.replace(/\\$<([^>]+)>/g,(function(t,e){return\"$\"+r[e]})))}if(\"function\"==typeof e){var c=this;return n[Symbol.replace].call(this,t,(function(){var t=arguments;return\"object\"!=typeof t[t.length-1]&&(t=[].slice.call(t)).push(u(t,c)),e.apply(this,t)}))}return n[Symbol.replace].call(this,t,e)},t.apply(this,arguments)}", "title": "" }, { "docid": "643e1d3f099e31e426423458be49c1eb", "score": "0.57557404", "text": "function panggilRegExp_HurufAngkaSpasi(value) {\n var hurufAngka = value.match(/\\w/g) //huruf dan angka\n var angka = value.match(/\\d/g) //angka saja\n var spasi = value.match(/\\s/g) //spasi saja\n var bukanHurufAngka = value.match(/\\W/g) //karakter selain huruf dan angka\n var selainAngka = value.match(/\\D/g) //karakter selain angka\n var selainSpasi = value.match(/\\S/g) //karakter selain spasi\n\n console.log(hurufAngka)\n console.log(angka);\n console.log(spasi);\n console.log(bukanHurufAngka);\n console.log(selainAngka);\n console.log(selainSpasi);\n}", "title": "" }, { "docid": "a7d5db125cb3341d5746ba336a40c224", "score": "0.57369316", "text": "toMMPattern() {\n if (this !== this.#root)\n return this.#root.toMMPattern();\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? \"i\" : \"\") + (uflag ? \"u\" : \"\");\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob\n });\n }", "title": "" }, { "docid": "8c540dc887ed6e70e1646870e2327483", "score": "0.57331395", "text": "function tokensToFunction (tokens) { // 110\n // Compile all the tokens into regexps. // 111\n var matches = new Array(tokens.length) // 112\n // 113\n // Compile all the patterns before compilation. // 114\n for (var i = 0; i < tokens.length; i++) { // 115\n if (typeof tokens[i] === 'object') { // 116\n matches[i] = new RegExp('^' + tokens[i].pattern + '$') // 117\n } // 118\n } // 119\n // 120\n return function (obj) { // 121\n var path = '' // 122\n var data = obj || {} // 123\n // 124\n for (var i = 0; i < tokens.length; i++) { // 125\n var token = tokens[i] // 126\n // 127\n if (typeof token === 'string') { // 128\n path += token // 129\n // 130\n continue // 131\n } // 132\n // 133\n var value = data[token.name] // 134\n var segment // 135\n // 136\n if (value == null) { // 137\n if (token.optional) { // 138\n continue // 139\n } else { // 140\n throw new TypeError('Expected \"' + token.name + '\" to be defined') // 141\n } // 142\n } // 143\n // 144\n if (isarray(value)) { // 145\n if (!token.repeat) { // 146\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"') // 147\n } // 148\n // 149\n if (value.length === 0) { // 150\n if (token.optional) { // 151\n continue // 152\n } else { // 153\n throw new TypeError('Expected \"' + token.name + '\" to not be empty') // 154\n } // 155\n } // 156\n // 157\n for (var j = 0; j < value.length; j++) { // 158\n segment = encodeURIComponent(value[j]) // 159\n // 160\n if (!matches[i].test(segment)) { // 161\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n } // 163\n // 164\n path += (j === 0 ? token.prefix : token.delimiter) + segment // 165\n } // 166\n // 167\n continue // 168\n } // 169\n // 170\n segment = encodeURIComponent(value) // 171\n // 172\n if (!matches[i].test(segment)) { // 173\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n } // 175\n // 176\n path += token.prefix + segment // 177\n } // 178\n // 179\n return path // 180\n } // 181\n} // 182", "title": "" }, { "docid": "d8a253efdaec203a26a1e4b9624f4948", "score": "0.57244146", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match ALL occurrences of numbers in a string.\n */\n\n /*\n * Do not remove the return statement\n */\n return new RegExp(\"\\\\d+\", \"g\");\n}", "title": "" }, { "docid": "13f308974bf5bf22c283d63bcf5c7633", "score": "0.57135963", "text": "function greadyMatch(){\nlet y = document.getElementById(\"p9a\").innerHTML\nlet myRegex = /<.*>/gi // . means amcth any character, ie numbers, letters, symbol \ndocument.getElementById(\"p9b\").innerHTML = `Matched string : ${myRegex}`;\ndocument.getElementById(\"p9c\").innerHTML = y.match(myRegex);\nconsole.log(y.match(myRegex)) //this return array of all matched character\n\n}", "title": "" }, { "docid": "52b2eb3e420285dd5f4dc07d100eaa54", "score": "0.57087946", "text": "function run(regex, value, start) {\n regex.lastIndex = start || 0;\n return regex.exec(value);\n }", "title": "" }, { "docid": "f40c6c3be97f693c30d8b1ca9199ec92", "score": "0.570383", "text": "static regex() {\n\t\treturn /^[a-zA-Z]{1}[a-zA-Z0-9_]+((\\.[a-zA-Z]{1}[a-zA-Z0-9_]+)|(\\[([0-9]+|\\$?[a-zA-Z_]{1}[a-zA-Z0-9_.\\[\\'\\]]+)\\])|(\\[\\'[^\\[\\]\\']+\\'\\]))*$/;\n\t}", "title": "" }, { "docid": "da5c1c23972bb56369957ad60bf9630c", "score": "0.57030624", "text": "function RE(s, flag) {\n return new RegExp(s, flag);\n}", "title": "" }, { "docid": "da5c1c23972bb56369957ad60bf9630c", "score": "0.57030624", "text": "function RE(s, flag) {\n return new RegExp(s, flag);\n}", "title": "" }, { "docid": "da5c1c23972bb56369957ad60bf9630c", "score": "0.57030624", "text": "function RE(s, flag) {\n return new RegExp(s, flag);\n}", "title": "" }, { "docid": "8cb35152a00729e87e8a2d53c32b1479", "score": "0.56959647", "text": "function tokensToFunction(tokens){// Compile all the tokens into regexps.\nvar matches=new Array(tokens.length);// Compile all the patterns before compilation.\nfor(var i=0;i<tokens.length;i++){if(_typeof3(tokens[i])==='object'){matches[i]=new RegExp('^(?:'+tokens[i].pattern+')$');}}return function(obj,opts){var path='';var data=obj||{};var options=opts||{};var encode=options.pretty?encodeURIComponentPretty:encodeURIComponent;for(var i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token==='string'){path+=token;continue;}var value=data[token.name];var segment;if(value==null){if(token.optional){// Prepend partial segment prefixes.\nif(token.partial){path+=token.prefix;}continue;}else{throw new TypeError('Expected \"'+token.name+'\" to be defined');}}if(isarray(value)){if(!token.repeat){throw new TypeError('Expected \"'+token.name+'\" to not repeat, but received `'+JSON.stringify(value)+'`');}if(value.length===0){if(token.optional){continue;}else{throw new TypeError('Expected \"'+token.name+'\" to not be empty');}}for(var j=0;j<value.length;j++){segment=encode(value[j]);if(!matches[i].test(segment)){throw new TypeError('Expected all \"'+token.name+'\" to match \"'+token.pattern+'\", but received `'+JSON.stringify(segment)+'`');}path+=(j===0?token.prefix:token.delimiter)+segment;}continue;}segment=token.asterisk?encodeAsterisk(value):encode(value);if(!matches[i].test(segment)){throw new TypeError('Expected \"'+token.name+'\" to match \"'+token.pattern+'\", but received \"'+segment+'\"');}path+=token.prefix+segment;}return path;};}", "title": "" }, { "docid": "a3bfe63407d7afbb6d2dacca3dc4648f", "score": "0.56906384", "text": "function regExTransform(book){\n const reg = book.split(\"{\").join(\"TOKEN_ACCOUV\");\n const reg1 = reg.split(\"}\").join(\"TOKEN_ACCFER\");\n const reg2 = reg1.split(\"\\\\\").join(\"TOKEN_ANTI\");\n const reg3 = reg2.split(\"/\").join(\"TOKEN_SLASH\");\n const reg4 = reg3.split(\" \").join(\"TOKEN_SPACE\")\n const reg5 = reg4.split(\"^\").join(\"TOKEN_HAT\")\n return reg5\n}", "title": "" }, { "docid": "69af600632a871a116b8879e928bfd94", "score": "0.56892514", "text": "function start()\n{\t\t\n\t// Variables\n\tvar myExpression \t= HTML_Tags.Span_Search.value;\n\tvar myFlag\t\t = HTML_Tags.Span_Flags.value;\n\tvar myTokens\t\t= HTML_Tags.Span_Token.innerHTML;\n\tvar myTestArea\t\t= HTML_Tags.Span_Test;\n\tvar myMatchArea\t\t= HTML_Tags.Span_Match;\n\tvar myText\t\t = HTML_Tags.Textarea_text.value;\n\t\n\n\t// Checking if any flag is selected\n\tif(myFlag !== \"none\")\n\t{\n\t\tvar myRegexp \t= new RegExp(myExpression, myFlag);\n\t}\n\telse\n\t{\n\t\tvar myRegexp \t= new RegExp(myExpression);\n\t}\n\t\n\t\n\t//-----START: Comparing system defined regex to user given regex-----//\n\tif(myExpression === \"[0-9]+\" || myExpression === \"[A-Z]+\")\n\t{\n\t\t\n\t\tif( Solutions[0] === myTokens)\n\t\t{\n\t\t\tmyTestArea.innerHTML = myRegexp.test(myText);\n\t\t\tmyMatchArea.innerHTML = myText.match(myRegexp);\t\t\n\t\t\t//MONITOR\n\t\t\tconsole.table(myText.match(myRegexp))\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmyTestArea.innerHTML \t= \"No test done, due to failure in used tokens!\";\n\t\t\tmyMatchArea.innerHTML \t= \"No match done, due to failure in used tokens!\";\n\t\t\t\n\t\t}\n\t\t\n\t}\n\telse if(myExpression === \"c+|l+\")\n\t{\n\t\t\n\t\tif( Solutions[1] === myTokens)\n\t\t{\n\t\t\tmyTestArea.innerHTML = myRegexp.test(myText);\n\t\t\tmyMatchArea.innerHTML = myText.match(myRegexp);\n\t\t\t//MONITOR\n\t\t\tconsole.table(myText.match(myRegexp))\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmyTestArea.innerHTML \t= \"No test done, due to failure in used tokens!\";\n\t\t\tmyMatchArea.innerHTML \t= \"No match done, due to failure in used tokens!\";\n\t\t\t\n\t\t}\n\t\t\n\t}\n\telse if(myExpression === \"\\\\(.+\\\\)\")\n\t{\n\t\t\n\t\tif( Solutions[2] === myTokens)\n\t\t{\n\t\t\tmyTestArea.innerHTML = myRegexp.test(myText);\n\t\t\tmyMatchArea.innerHTML = myText.match(myRegexp);\t\n\t\t\t//MONITOR\n\t\t\tconsole.table(myText.match(myRegexp))\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmyTestArea.innerHTML \t= \"No test done, due to failure in used tokens!\";\n\t\t\tmyMatchArea.innerHTML \t= \"No match done, due to failure in used tokens!\";\n\t\t\t\n\t\t}\n\t\t\n\t}\n\telse if(myExpression === \"[A-Za-z]*ion\")\n\t{\n\t\t\n\t\tif( Solutions[3] === myTokens)\n\t\t{\n\t\t\tmyTestArea.innerHTML = myRegexp.test(myText);\n\t\t\tmyMatchArea.innerHTML = myText.match(myRegexp);\t\n\t\t\t//MONITOR\n\t\t\tconsole.table(myText.match(myRegexp))\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmyTestArea.innerHTML \t= \"No test done, due to failure in used tokens!\";\n\t\t\tmyMatchArea.innerHTML \t= \"No match done, due to failure in used tokens!\";\n\t\t\t\n\t\t}\n\t\t\n\t}\n\telse if(myExpression === \"[^A-Za-z]\")\n\t{\n\t\t\n\t\tif( Solutions[4] === myTokens)\n\t\t{\n\t\t\tmyTestArea.innerHTML = myRegexp.test(myText);\n\t\t\tmyMatchArea.innerHTML = myText.match(myRegexp);\t\n\t\t\t//MONITOR\n\t\t\tconsole.table(myText.match(myRegexp))\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmyTestArea.innerHTML \t= \"No test done, due to failure in used tokens!\";\n\t\t\tmyMatchArea.innerHTML \t= \"No match done, due to failure in used tokens!\";\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t//-----END:Comparing system defined regex to user given regex-----//\n\t\n}", "title": "" }, { "docid": "0217e8ccdb78c1b1a379baa00a210dd3", "score": "0.5689238", "text": "function tokensToFunction(tokens){// Compile all the tokens into regexps.\nvar matches=new Array(tokens.length);// Compile all the patterns before compilation.\nfor(var i=0;i<tokens.length;i++){if(_typeof2(tokens[i])==='object'){matches[i]=new RegExp('^(?:'+tokens[i].pattern+')$');}}return function(obj,opts){var path='';var data=obj||{};var options=opts||{};var encode=options.pretty?encodeURIComponentPretty:encodeURIComponent;for(var i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token==='string'){path+=token;continue;}var value=data[token.name];var segment;if(value==null){if(token.optional){// Prepend partial segment prefixes.\nif(token.partial){path+=token.prefix;}continue;}else{throw new TypeError('Expected \"'+token.name+'\" to be defined');}}if(isarray(value)){if(!token.repeat){throw new TypeError('Expected \"'+token.name+'\" to not repeat, but received `'+JSON.stringify(value)+'`');}if(value.length===0){if(token.optional){continue;}else{throw new TypeError('Expected \"'+token.name+'\" to not be empty');}}for(var j=0;j<value.length;j++){segment=encode(value[j]);if(!matches[i].test(segment)){throw new TypeError('Expected all \"'+token.name+'\" to match \"'+token.pattern+'\", but received `'+JSON.stringify(segment)+'`');}path+=(j===0?token.prefix:token.delimiter)+segment;}continue;}segment=token.asterisk?encodeAsterisk(value):encode(value);if(!matches[i].test(segment)){throw new TypeError('Expected \"'+token.name+'\" to match \"'+token.pattern+'\", but received \"'+segment+'\"');}path+=token.prefix+segment;}return path;};}", "title": "" }, { "docid": "f5f579378a99941e4c1d7d27c80fb527", "score": "0.5679557", "text": "function overwrite_exec(i,j){\n\t\t\treturn function exec(s){\n\t\t\t\tvar res = RegExp.prototype.exec.call(this,s);\n\t\t\t\treturn res && {\n\t\t\t\t\tmatch: res[i],\n\t\t\t\t\tfullmatch: res[j],\n\t\t\t\t\tindex: res.index\n\t\t\t\t};\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "085851396b0e5a4b9afbf78e8a864132", "score": "0.5677941", "text": "function pattern ( targetString ) { \n\nlet result;\nresult = targetString.indexOf(\"Script\") ;\n\n if (result === 4)\n \n return (targetString.replace(\"Script\", \"\"));\n \n else \n\n return (targetString);\n\n}", "title": "" }, { "docid": "e62a7ab2e097bf66c041487a3e8a1927", "score": "0.5670422", "text": "function createRegexp (s) {\n let mExp = /^\\/(.*)\\/([gimy]*)$/.exec(s)\n if (mExp) {\n return new RegExp(mExp[1], mExp[2])\n } else {\n return new RegExp(s)\n }\n}", "title": "" }, { "docid": "4e1f8ae1a5ccffadcb9aabc1aedefc46", "score": "0.5668401", "text": "function ua(a){for(var b,c=[],d=/\\[([^\\]]*)\\]|\\(([^\\)]*)\\)|(LTS|LT|(\\w)\\4*o?)|([^\\w\\[\\(]+)/g;b=d.exec(a);)b[1]?// a literal string inside [ ... ]\r\nc.push(b[1]):b[2]?// non-zero formatting inside ( ... )\r\nc.push({maybe:ua(b[2])}):b[3]?// a formatting token\r\nc.push({token:b[3]}):b[5]&&// an unenclosed literal string\r\nc.push(b[5]);return c}// export", "title": "" }, { "docid": "46dc0f3624fb5687f0ecdb127de47b0f", "score": "0.56603575", "text": "function RegExpClass(runtime, scope, instanceConstructor, baseClass) {\n var c = new Class(\"RegExp\", XRegExp, C(XRegExp));\n c.extendBuiltin(baseClass);\n\n // Make exec and test visible via RegExpClass since we need to link them in, in\n // RegExp.as using unsafeJSNative().\n\n RegExpClass.exec = function exec() {\n var result = this.exec.apply(this, arguments);\n if (!result) {\n return result;\n }\n // For some reason named groups in AS3 are set to the empty string instead of\n // undefined as is the case for indexed groups. Here we just emulate the AS3\n // behaviour.\n var keys = Object.keys(result);\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (!isNumeric(k)) {\n if (result[k] === undefined) {\n result[k] = \"\";\n }\n }\n }\n publicizeProperties(result);\n return result;\n };\n\n RegExpClass.test = function test() {\n return this.exec.apply(this, arguments) !== null;\n };\n\n c.native = {\n instance: {\n global: {\n get: function () {\n return this.global;\n }\n },\n source: {\n get: function () {\n return this.source;\n }\n },\n ignoreCase: {\n get: function () {\n return this.ignoreCase;\n }\n },\n multiline: {\n get: function () {\n return this.multiline;\n }\n },\n lastIndex: {\n get: function () {\n return this.lastIndex;\n },\n set: function (i) {\n this.lastIndex = i;\n }\n },\n dotall: {\n get: function () {\n return this.dotall;\n }\n },\n extended: {\n get: function () {\n return this.extended;\n }\n },\n exec: RegExpClass.exec,\n test: RegExpClass.test\n }\n };\n\n return c;\n }", "title": "" }, { "docid": "6f28883e2ebff2bcf649214b8235c695", "score": "0.56557506", "text": "function matchEndingOfString(){\n let y = document.getElementById(\"p13a\").innerHTML\nlet myRegex = /racing$/gi \n// let myRegex = /g$/gi //if just last charater \ndocument.getElementById(\"p13b\").innerHTML = `Matched string : ${myRegex}`;\ndocument.getElementById(\"p13c\").innerHTML = y.match(myRegex); \n}", "title": "" }, { "docid": "1dae58db201666762a429bd683dfd9db", "score": "0.5653024", "text": "function fromRegex (r) {\n return function (o) { return typeof o === 'string' && r.test(o) }\n}", "title": "" }, { "docid": "1dae58db201666762a429bd683dfd9db", "score": "0.5653024", "text": "function fromRegex (r) {\n return function (o) { return typeof o === 'string' && r.test(o) }\n}", "title": "" }, { "docid": "1dae58db201666762a429bd683dfd9db", "score": "0.5653024", "text": "function fromRegex (r) {\n return function (o) { return typeof o === 'string' && r.test(o) }\n}", "title": "" }, { "docid": "3dcf6b1d00369ecb04116663a45284a7", "score": "0.56499344", "text": "function compileRegExp(lexer, str) {\n var n = 0;\n while (str.indexOf('@') >= 0 && n < 5) { // at most 5 expansions\n n++;\n str = str.replace(/@(\\w+)/g, function (s, attr) {\n var sub = '';\n if (typeof (lexer[attr]) === 'string') {\n sub = lexer[attr];\n }\n else if (lexer[attr] && lexer[attr] instanceof RegExp) {\n sub = lexer[attr].source;\n }\n else {\n if (lexer[attr] === undefined) {\n throw createError(lexer, 'language definition does not contain attribute \\'' + attr + '\\', used at: ' + str);\n }\n else {\n throw createError(lexer, 'attribute reference \\'' + attr + '\\' must be a string, used at: ' + str);\n }\n }\n return (monarchCommon_empty(sub) ? '' : '(?:' + sub + ')');\n });\n }\n return new RegExp(str, (lexer.ignoreCase ? 'i' : ''));\n}", "title": "" }, { "docid": "1726a221edbd25ece423a58225489192", "score": "0.56447417", "text": "regularExpression(name, fullname, number, date) {\n var filestream = require('fs');\n try {\n var data = filestream.readFileSync(\"regex.txt\", 'utf8');\n data = data.replace(/<<name>>/g, name)\n data = data.replace(/ <<full name>>/g, fullname)\n data = data.replace(/91-xxxxxxxxxx/g, number)\n data = data.replace(/<<xx-xx-xxxx>>/g, date)\n console.log();\n console.log(data);\n } catch (err) {\n console.log(err.message);\n\n }\n }", "title": "" }, { "docid": "d38010a0dd7c6ee14de8a6c8c24365ec", "score": "0.56403124", "text": "function matchParenths(str) {\n}", "title": "" }, { "docid": "a6a7b207b0eb1c69fe44b98b264aad45", "score": "0.56401736", "text": "escapeRegExp(text) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\n }", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.56373703", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.56373703", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.56373703", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.56373703", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "baad22012278c0a7a1b20fdcd3155e21", "score": "0.56336576", "text": "function simple_form(name) {\n return RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])')\n } // booleans and numbers", "title": "" }, { "docid": "baad22012278c0a7a1b20fdcd3155e21", "score": "0.56336576", "text": "function simple_form(name) {\n return RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])')\n } // booleans and numbers", "title": "" }, { "docid": "4539129f1f0d5f3c502182d7c3d05273", "score": "0.56310314", "text": "function patternToRegExp(str) {\n return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');\n }", "title": "" }, { "docid": "3dad4a5cb77401705ff89a713bb1f0b0", "score": "0.56294614", "text": "function tokensToFunction(tokens){// Compile all the tokens into regexps.\nvar matches=new Array(tokens.length);// Compile all the patterns before compilation.\nfor(var i=0;i<tokens.length;i++){if(_typeof(tokens[i])==='object'){matches[i]=new RegExp('^'+tokens[i].pattern+'$');}}return function(obj){var path='';var data=obj||{};for(var i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token==='string'){path+=token;continue;}var value=data[token.name];var segment;if(value==null){if(token.optional){continue;}else{throw new TypeError('Expected \"'+token.name+'\" to be defined');}}if(isarray(value)){if(!token.repeat){throw new TypeError('Expected \"'+token.name+'\" to not repeat, but received \"'+value+'\"');}if(value.length===0){if(token.optional){continue;}else{throw new TypeError('Expected \"'+token.name+'\" to not be empty');}}for(var j=0;j<value.length;j++){segment=encodeURIComponent(value[j]);if(!matches[i].test(segment)){throw new TypeError('Expected all \"'+token.name+'\" to match \"'+token.pattern+'\", but received \"'+segment+'\"');}path+=(j===0?token.prefix:token.delimiter)+segment;}continue;}segment=encodeURIComponent(value);if(!matches[i].test(segment)){throw new TypeError('Expected \"'+token.name+'\" to match \"'+token.pattern+'\", but received \"'+segment+'\"');}path+=token.prefix+segment;}return path;};}", "title": "" }, { "docid": "346264561d55e68cdd6b2a28363d3566", "score": "0.5627124", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match ALL occurrences of numbers in a string.\n */\n let re = new RegExp('\\\\d+', 'g')\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "a42e92c1efae68bb8972c77db898cde0", "score": "0.5623553", "text": "function SHOULD_MATCH_IDENTIFIER() { return (/(\\w|\\$)+/g); }", "title": "" }, { "docid": "078ccb56cf8b476dd0906f31eba0e378", "score": "0.5619156", "text": "function createRegex() {\n // if no subjects\n if (timeTable.subjects().length <= 0) return undefined;\n \n /**\n * Tokenize each subjects(for class group), then wrap it with '(?=.*' and ')'.\n * The wrapped strings are then merged with delimiter '|'.\n * \n * For example: [WIX1002 G4, WIA1001] will become (?=.*WIX1002)(?=.*G4)|(?=.*WIA1001)\n */\n var regexStr = timeTable.subjects()\n .map(function(subject) {\n return subject.name()\n .split(\" \")\n .reduce(function(subject, token) {\n return (token.length > 0) ? subject + \"(?=.*\" + token + \")\" : subject;\n }, \"\");\n })\n .reduce(function(regex, subject) {\n return (subject.length > 0) ? regex + \"|\" + subject : regex;\n });\n \n return new RegExp(regexStr);\n}", "title": "" }, { "docid": "6b8597258632e129ce61b9edddb8cadb", "score": "0.56191385", "text": "function getTokenizedExp(token, flag){\n var p = token + \"$\" + flag;\n return Exps[p] || (Exps[p] = RegExp(\"(?:^|\\\\s)\"+token+\"(?:$|\\\\s)\", flag));\n }", "title": "" }, { "docid": "456f9e9ca5afeee534da2b23b8ac1b56", "score": "0.5618647", "text": "function list_regexp () {\n return ['str_123', 'str_2'];\n}", "title": "" }, { "docid": "9c750e7c7139189cfbbb745b62e8b67f", "score": "0.5617991", "text": "function matchBegginingOfString(){\nlet y = document.getElementById(\"p12a\").innerHTML\nlet myRegex = /^Cal/gi // if the string is written as this will not be matched: Ricky and Cal both like racing\ndocument.getElementById(\"p12b\").innerHTML = `Matched string : ${myRegex}`;\ndocument.getElementById(\"p12c\").innerHTML = y.match(myRegex);\n}", "title": "" }, { "docid": "e307c3bcbe44a3ac22329f238b3bb520", "score": "0.56160384", "text": "get findRegExp() {\n return RegExp(this.findTerm, !this.caseSensitive ? \"i\" : \"\")\n }", "title": "" }, { "docid": "c0d6362ff2ea04408e71fcd270e95f01", "score": "0.56041616", "text": "function validatePattern(regex, inputElement) {\n\t\t// function returns event handler function preloaded with parameters for matchPattern from parent scope parameters\n\t\treturn function handleInputEvent(event) {\n\t\t\tvar parameters = {\n \t\tpattern: regex, \n \t\t\tinput: event.target.value,\n \t\t\telement: inputElement,\n \t\t\terror: inputElement.title\n\t \t}\n \t\tmatchPattern(parameters)\n\t\t}\n\t}", "title": "" } ]
9fedc4aec4ebacad9a933b5339bd0fa5
definition of the function sortUser
[ { "docid": "7c7961b6c9aefcf2fec8751e2ff69102", "score": "0.69088304", "text": "function sortUser(){\n data.sort((a,b) => a.balance - b.balance);\n//update DOM after sorting the data array \n updateUI();\n }", "title": "" } ]
[ { "docid": "dc73388bb35f5167ed471f65c9208616", "score": "0.7457347", "text": "function sortUsers(){\n uasort($this->users, array($this,\"cmp\"));\n\n //if 'total' is set, sort by total time spent on server instead of default\n if(isset($_GET['total'])){\n uasort($this->users, array($this,\"cmpTime\"));\n }\n}", "title": "" }, { "docid": "7e958e83b38d99bf434e2981dbe2f8c4", "score": "0.7430457", "text": "function sortUserHander() {\n displayUserInfo('', 'yes');\n\n}", "title": "" }, { "docid": "ff673012603b4508bcdca7c820332f3d", "score": "0.7369557", "text": "function sortTable(column){\n let change = false;\n // sort by id\n if(column === \"id\"){\n props.userState.userList.sort(function(b, a){\n if(a.id < b.id) { \n change = true;\n return -1; \n }\n if(a.id > b.id) { \n return 1; \n }\n return 0;\n });\n if(change === false){\n props.userState.userList.sort(function(a, b){\n if(a.id < b.id) { return -1; }\n if(a.id > b.id) { return 1; }\n return 0;\n });\n }\n }\n // sort by first name\n if(column === \"firstName\"){\n props.userState.userList.sort(function(b, a){\n if(a.firstName < b.firstName) { \n change = true;\n return -1; \n }\n if(a.firstName > b.firstName) { \n return 1; \n }\n return 0;\n });\n if(change === false){\n props.userState.userList.sort(function(a, b){\n if(a.firstName < b.firstName) { return -1; }\n if(a.firstName > b.firstName) { return 1; }\n return 0;\n });\n }\n }\n // sort by last name\n if(column === \"lastName\"){\n props.userState.userList.sort(function(b, a){\n if(a.lastName < b.lastName) { \n change = true;\n return -1; \n }\n if(a.lastName > b.lastName) { \n return 1; \n }\n return 0;\n });\n if(change === false){\n props.userState.userList.sort(function(a, b){\n if(a.lastName < b.lastName) { return -1; }\n if(a.lastName > b.lastName) { return 1; }\n return 0;\n });\n }\n }\n // sort by age\n if(column === \"age\"){\n props.userState.userList.sort(function(b, a){\n if(a.age < b.age) { \n change = true;\n return -1; \n }\n if(a.age > b.age) { \n return 1; \n }\n return 0;\n });\n if(change === false){\n props.userState.userList.sort(function(a, b){\n if(a.age < b.age) { return -1; }\n if(a.age > b.age) { return 1; }\n return 0;\n });\n }\n }\n // sort by country\n if(column === \"country\"){\n props.userState.userList.sort(function(b, a){\n if(a.country < b.country) { \n change = true;\n return -1; \n }\n if(a.country > b.country) { \n return 1; \n }\n return 0;\n });\n if(change === false){\n props.userState.userList.sort(function(a, b){\n if(a.country < b.country) { return -1; }\n if(a.country > b.country) { return 1; }\n return 0;\n });\n }\n }\n //after sorting is done, repopulate the table\n setTableList(searchState.searchTerm);\n }", "title": "" }, { "docid": "fb21d24aace3cc291278d7d544876308", "score": "0.7293188", "text": "handleSort() {\n\t\tlet sortUser;\n\t\tif (!this.state.sorted) {\n\t\t\tsortUser = this.state.users.sort((a, b) =>\n\t\t\t\ta.name.first < b.name.first ? -1 : 1\n\t\t\t);\n\t\t\tthis.setState({ users: sortUser, sorted: true });\n\t\t} else {\n\t\t\tthis.setState({ users: this.state.users.reverse() });\n\t\t}\n\t}", "title": "" }, { "docid": "956160825e60d6cfb9934a8e801a3b2e", "score": "0.7291606", "text": "function sortUser(type) {\n var usersList = $(\"div.user\");\n if (type == \"sortByNameAZ\") {\n\n var alphabeticallyOrderedDivs = usersList.sort(function (a, b) {\n return $(a).find(\"h3\").text() > $(b).find(\"h3\").text();\n });\n\n } else if (type == \"sortByNameZA\") {\n\n var alphabeticallyOrderedDivs = usersList.sort(function (a, b) {\n return $(a).find(\"h3\").text() < $(b).find(\"h3\").text();\n });\n\n } else if (type == \"sortByRankAsc\") {\n\n var alphabeticallyOrderedDivs = usersList.sort(function (a, b) {\n return parseInt($(a).find(\".userContent p .score\").text()) > parseInt($(b).find(\".userContent p .score\").text());\n });\n\n } else if (type == \"sortByRankDesc\") {\n var alphabeticallyOrderedDivs = usersList.sort(function (a, b) {\n return parseInt($(a).find(\".userContent p .score\").text()) < parseInt($(b).find(\".userContent p .score\").text());\n });\n }\n $(\"#gitUsersList\").html(alphabeticallyOrderedDivs);\n}", "title": "" }, { "docid": "8eaf0077194465aa7d9b9ab738e20379", "score": "0.72347057", "text": "sortingByName(users){\n\t\treturn users.sort((a, b) => {\n\t\t\tlet primaryName = a.firstName;\n\t\t\tlet secondaryName = b.firstName;\n\t\t\tif(primaryName < secondaryName){ \n\t\t\t\treturn -1;\n\t\t\t}else if(primaryName > secondaryName){\n\t\t\t\treturn 1;\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "0727ff7d9ad7072b257a52d253aab35c", "score": "0.7208951", "text": "sortUsers() {\n let data = angular.copy(this.users.raw);\n data = this.$filter('orderBy')(\n data,\n this.users.orderBy,\n this.users.orderDesc,\n );\n this.users.sorted = data;\n }", "title": "" }, { "docid": "0dee3e642b1f82f1eda0cb98e002e867", "score": "0.7137328", "text": "function sortUsers() {\n\tconst sortedUsers = data.sort((a,b) => b.money - a.money);\n\taddUserToDOM(sortedUsers);\n}", "title": "" }, { "docid": "f5b6eee741e0827d72c2c7dc59e176bb", "score": "0.7133397", "text": "function sortUsers(a, b) {\n var f1 = a.name.first.toLowerCase();\n var f2 = b.name.first.toLowerCase();\n\n var l1 = a.name.last.toLowerCase();\n var l2 = b.name.last.toLowerCase();\n\n if (l1 < l2) return -1;\n if (l1 > l2) return 1;\n if (f1 < f2) return -1;\n if (f1 > f2) return 1;\n return 0;\n}", "title": "" }, { "docid": "12bca250555df1ba8b8be4c940dbb98c", "score": "0.7013197", "text": "function InitUserTableRowSort() {\n users = new Array();\n users[0] = { column:0, reverse:false, comparer:function(a, b) {return CompareTextCells(a, b, 0);} }; // Name\n users[1] = { column:2, reverse:false, comparer:function(a, b) {return CompareTextCells(a, b, 2);} }; // Title\n users[2] = { column:3, reverse:false, comparer:function(a, b) {return CompareNumCells(a, b, 3);} }; // Level\n users[3] = { column:4, reverse:false, comparer:function(a, b) {return CompareDateCells(a, b, 4);} }; // Created\n SetupTableHeadings('users', users);\n}", "title": "" }, { "docid": "43b6d2eeac7a00df83708da5d541e68a", "score": "0.69091654", "text": "function userSortFn(a, b) {\n var nameA = a.name.toUpperCase(); // ignore upper and lowercase\n var nameB = b.name.toUpperCase(); // ignore upper and lowercase\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n\n return 0;\n}", "title": "" }, { "docid": "69beaa3301dc90ccd81bd34f98754508", "score": "0.68309164", "text": "function sortUsers(userInfo) {\n\n // Content for each list item\n let addContent = function(name, online, url, logo, des) {\n\n des = (des.length >= 18) ? des.substr(0, 15) + '...' : des;\n\n logo === undefined ? (logo = 'images/user.svg') : (logo = logo);\n\n return `\n <a href=\"${url}\" target=\"blank\" class=\"list-group-item list-group-item-action\">\n <div class=\"row\">\n <div class=\"col-2 user-icon\">\n <img src=\"${logo}\" class=\"logo\">\n </div>\n <div class=\"col\">\n <h2 class=\"user-title\">${name}</h2>\n <span class=\"user-des\">${des}</span>\n </div>\n <div class=\"col-2\">\n <p class=\"user-status text-center ${online}\"></p>\n </div>\n </div>\n </a>\n `;\n }\n\n for (let i = 0; i < userInfo.length; i++) {\n\n let user = userInfo[i];\n\n // Push to online/ offline users\n let onlineStatus = false;\n let description = '';\n\n if (user.isOnline) {\n onlineUser.push(user);\n onlineStatus = 'online';\n description = user.des;\n } else {\n offlineUser.push(user);\n onlineStatus = 'offline';\n description = '';\n }\n\n // All users\n allUserList.append(addContent(user.user, onlineStatus, user.url, user.logo, description));\n }\n\n // Online users\n onlineUser.forEach(function(user) {\n onlineUserList.append(addContent(user.user, 'online', user.url, user.logo, user.des));\n });\n\n // Offline users\n offlineUser.forEach(function(user) {\n offlineUserList.append(addContent(user.user, 'offline', user.url, user.logo, ''));\n });\n\n filterUser(userInfo, onlineUser, offlineUser);\n }", "title": "" }, { "docid": "c3a7664909f004c3e345ed75bdf0d5b3", "score": "0.6734051", "text": "function user_id_sort(a, b){\r\n if(a.length > 0 && b.length > 0){\r\n return array_sort_desc(a[0].user_id, b[0].user_id);\r\n }\r\n return 0;\r\n}", "title": "" }, { "docid": "6b80c0e4df319f44fa269382f35c6eda", "score": "0.6696869", "text": "function user_enabled_id_sort_asc(a, b){\r\n return array_sort_asc(a.user_id, b.user_id);\r\n}", "title": "" }, { "docid": "6d7e4feec6eaff1c72f898ee921d7e88", "score": "0.669489", "text": "function userSortFn(a, b) {\n var nameA = a.name.toUpperCase(); // ignore upper and lowercase\n var nameB = b.name.toUpperCase(); // ignore upper and lowercase\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n\n // names must be equal\n return 0;\n}", "title": "" }, { "docid": "3ea076ecc7e2b89e31721d795283127b", "score": "0.6672962", "text": "function sortList(trs, start, end, offset, userids) {\r\n for (var x = start+1; x <= end; x++) {\r\n var useridx = trs[x-1].getElementsByTagName(\"td\")[offset+3].innerHTML.split('/id:')[1].split('/\"')[0];\r\n var userid = trs[x].getElementsByTagName(\"td\")[offset+3].innerHTML.split('/id:')[1].split('/\"')[0];\r\n var points = offset<0?userpts[x-1]:CachedPoints[CacheIndex(userid)];\r\n if (points >= (offset<0?userpts[x-2]:CachedPoints[CacheIndex(useridx)]))\r\n continue;\r\n var lower = start;\r\n var upper = x - 1;\r\n while (lower <= upper) {\r\n var middle = Math.floor((lower + upper) / 2);\r\n var useridx = trs[middle].getElementsByTagName(\"td\")[offset+3].innerHTML.split('/id:')[1].split('/\"')[0];\r\n if (points >= (offset<0?userpts[middle-1]:CachedPoints[CacheIndex(useridx)]))\r\n lower = middle + 1;\r\n else\r\n upper = middle - 1;\r\n }\r\n var oldtr = trs[x].parentNode.removeChild(trs[x]);\r\n trs[lower].parentNode.insertBefore(oldtr, trs[lower]);\r\n if (offset < 0) {\r\n userid = userids[x-1];\r\n var username = usernames[x-1];\r\n userids.splice(x-1,1);\r\n usernames.splice(x-1,1);\r\n userpts.splice(x-1,1);\r\n userids.splice(lower-1, 0, userid);\r\n usernames.splice(lower-1, 0, username);\r\n userpts.splice(lower-1, 0, points);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0d9c3b2d519d16a14ed18f8319faa557", "score": "0.6671935", "text": "function sortData() {\n var avatarList = Object.keys(userObject);\n userArray = avatarList.map(function (uuid) { \n return userObject[uuid]; \n });\n }", "title": "" }, { "docid": "078acaaa40753efd90f71a0265a8fa66", "score": "0.6667367", "text": "function sortName() {\n students.sort(sortByName);\n createTable();\n }", "title": "" }, { "docid": "110c24b92660731ac4a0176d96b9ed6b", "score": "0.6651647", "text": "function sortUserName() {\n console.log(\"userName =\", userName);\n //make name an array\n var nameArray = userName.split('');\n console.log(\"nameArray =\", nameArray);\n //sort array\n var nameArraySort = nameArray.sort();\n console.log(\"nameArraySort =\", nameArraySort);\n //reverse sorted array\n var nameArrayReverse = nameArraySort.reverse();\n console.log(\"nameArrayReverse =\", nameArrayReverse);\n // join reverse sorted array for new name\n var nameSort = nameArrayReverse.join('');\n console.log(\"nameSort =\", nameSort);\n return nameSort;\n}", "title": "" }, { "docid": "0532f72f8b81fd5e9fd2f7d52ff8b1f9", "score": "0.65538734", "text": "testSortFunction() {\n const calculatedSortedData = data.sort(SortUtilHelper.sortByUserId);\n assert.deepStrictEqual(calculatedSortedData, sortedData, 'Sort By UserId Function has failed to sort by user_id');\n console.log('testSortFunction => Successfully Completed');\n }", "title": "" }, { "docid": "60aaaa37fb519123de1400f69e9e6ee0", "score": "0.6538733", "text": "function resort_users(bool_order_by_lname)\n {\n\t\tpropagate_csrf_code();\n jQuery.ajax({\n url: \"/ajax/resort_users_admin\",\n type: \"POST\",\n data: { \n \"bool_order_by_lname\":bool_order_by_lname,\n },\n dataType : \"json\",\n beforeSend: function () {\n }, \n success: function( data ) {\n\t\t\t\t$(\"#user_id\").empty();\n\t\t\t\t$.each(data, function(index, item) {\n\t\t \t$(\"#user_id\").append(new Option(item.content, item.id));\n\t\t });\n\t\t\t},\n error: function( xhr, status, errorThrown ) {\n console.log(\"Ajax error\");\n }\n }); // end jquery ajax\n \n } // end function resort users", "title": "" }, { "docid": "cd089d55123191e423d393d0727983c1", "score": "0.6529891", "text": "function userList (sort, type) {\n\n\t\tvar sortBy;\n\t\tif (sort) {\n\t\t\tsortBy = sort;\n\t\t} else {\n\t\t\tsortBy = \"created_at\";\t\t\t\n\t\t\ttype = defaultSortType;\t\t\n\t\t}\n\n\t\tvar page = angular.isDefined($scope.paging) ? $scope.paging.page : 1;\t\n\n\t\thttp.get('/admin/user-list?type='+$scope.lastIndex+\"&page=\"+page+\"&sortBy=\"+sortBy+\"&sortType=\"+type).then(function(response){\n\t\t\t\n\t\t\t$scope.data = response;\n\t\t\t$scope.paging = response.paging;\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "19fceb84c1625cdbf5c6426093ae41e0", "score": "0.64835507", "text": "function sortByAssignee() { todoistShortcut('r'); }", "title": "" }, { "docid": "0cb4b239c6e4949929dc355abd316adb", "score": "0.64692134", "text": "function sortDataByUserId(data) {\n data = data.sort((a, b) => a['user_id'] - b['user_id']);\n return data;\n}", "title": "" }, { "docid": "57e4fb34196a6e76ded2e6b4eaf29585", "score": "0.6462134", "text": "function SortByAge() {\n\n}", "title": "" }, { "docid": "064d03909cbb04b0f7ac77a3f9148cc1", "score": "0.6439953", "text": "function getOrderedByName(users) {\n // your code here\n return _.sortBy(users, [\"name\"]);\n} // output order [{id:3, name: \"a\",...},{id:2, name: \"b\",...},{id:1, name: \"c\", ...}]", "title": "" }, { "docid": "b7c4aa7609ee3cecd40b33739a0db17a", "score": "0.64025825", "text": "Sort() {}", "title": "" }, { "docid": "6946f2f9a15fdcc256163df20b9096c0", "score": "0.6394835", "text": "function ascByUserName(todo1, todo2) {\n return todo1.userName.localeCompare(todo2.userName);\n}", "title": "" }, { "docid": "5494def5084d5b866acb42c3949f4f64", "score": "0.63765824", "text": "function sorted(userName) {\n //changing strings to array\n var userArray = userName.split(\"\");\n console.log(userArray)\n //sorting array\n var sortArray = userArray.sort();\n console.log(sortArray)\n //chaninging arrays to strings\n var sortedName = sortArray.join(\"\");\n console.log(sortedName)\n return sortedName;\n }", "title": "" }, { "docid": "521b8ec6c518ca2ed735a07d890e828b", "score": "0.6375744", "text": "function sortByHouseThenFirstname() {}", "title": "" }, { "docid": "068f0b3b393ca95e20343bcddcc50cf2", "score": "0.63627666", "text": "function sortUserName() {\nvar userName = window.prompt(\"Hi! Pleese teel me yoür namé soo I cån ffix iT.\");\nconsole.log(\"username =\", userName);\n\nvar nameArray = userName.split('');\nconsole.log(\"nameArray =\", nameArray);\n\nvar nameArraySort = nameArray.sort();\nconsole.log(\"nameArraySort =\", nameArraySort);\n\nvar nameSorted = nameArraySort.join('');\nconsole.log(\"nameSprted =\", nameSorted);\n\nreturn nameSorted;\n}", "title": "" }, { "docid": "9a3b654b9dfc29170e0f6987de30323d", "score": "0.6360271", "text": "function sortUserName() {\n\n //In the function, declare a variable userName and use window.prompt() to get the user's name from the user.\n var userName = window.prompt(\"Hi. Please type in your name so I can sort it.\");\n console.log(\"userName =\", userName);\n\n //Sort the letters of the user's name and return those from the function.\n var nameArray = userName.split('');\n console.log(\"nameArray =\", nameArray);\n\n var nameArraySort = nameArray.sort();\n console.log(\"nameArraySort =\", nameArraySort);\n\n var nameSorted = nameArraySort.join('');\n console.log(\"nameSorted =\", nameSorted);\n\n return nameSorted;\n}", "title": "" }, { "docid": "d4844f06e8d76617da22dccdbf573ccc", "score": "0.63578963", "text": "function sortUsersList() {\n let i, users, shouldSwitch;\n let list = document.getElementById(\"users-list\");\n let switching = true;\n\n while (switching) {\n switching = false;\n users = list.getElementsByClassName(\"list-group-item\");\n for (i = 0; i < (users.length - 1); ++i) {\n shouldSwitch = false;\n if (users[i].innerHTML.toLowerCase() > users[i + 1].innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n }\n if (shouldSwitch) {\n users[i].parentNode.insertBefore(users[i + 1], users[i]);\n switching = true;\n }\n }\n }", "title": "" }, { "docid": "fcd3fe34871cd7db2eaa0352bd571aa1", "score": "0.6342716", "text": "sortAge(){\n let sortedArray = this.state.users\n function compare(a, b) {\n if (a.dob.age > b.dob.age) {\n return -1;\n }\n if (a.dob.age < b.dob.age) {\n return 1;\n }\n // a must be equal to b\n return 0;\n }\n this.setState({user: sortedArray.sort(compare)})\n }", "title": "" }, { "docid": "be5286e091ad403354f75d66ec0563b0", "score": "0.63112706", "text": "function CorrectUserSort(){\n\n\t\tvar correctResult = sortArray();\n\t\tcorrectArray(correctResult, 0, global.type, global.points);\n\t\tif(type==1){\n\t\t\t$(\"#pointsText\")[0].innerHTML = ((global.points*2).toString() + \" / \"+(global.POINTS*2)+\" Punkte\");\n\t\t}else{\n\t\t\t$(\"#pointsText\")[0].innerHTML = (global.points.toString() + \" / \"+global.POINTS+\" Punkte\");\n\t\t}\n\t\t\n\t\t$(\"#CorrectButton\").prop(\"disabled\",true);\n\t\t$(\"#CorrectButton\").css('color','grey');\n}", "title": "" }, { "docid": "2743016b0f74c99d59996cb45f489d5f", "score": "0.63103086", "text": "function sortByDate() {;} // will implement later", "title": "" }, { "docid": "924c69bc7e79d9ebcd39adc5cdf3b584", "score": "0.6300331", "text": "function sortUsersByEloRating(userA, userB) {\n\t\tif (userA.EloRating > userB.EloRating) {\n\t\t\treturn -1;\n\t\t} else if (userA.EloRating < userB.EloRating) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\tif (userA.GamesPlayed > userB.GamesPlayed) {\n\t\t\t\treturn -1;\n\t\t\t} else if (userA.GamesPlayed < userB.GamesPlayed) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\tif (userA.Wins > userB.Wins) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (userA.Wins < userB.Wins) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn userA.FirstName > userB.FirstName;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "02197d761828212cb949e5324f1616ef", "score": "0.6244469", "text": "function App() {\n //const [search, setSearch] = useState(\"\");\n\n const [users, setUsers] = useState([]);\n const [filteredUsers, setFilteredUsers] = useState(null);\n const [sortByLastName, setSortByLastName] = useState(false);\n const [sortByTitle, setSortByTitle] = useState(false);\n\n// pull from randomizer user api\n useEffect(() => {\n axios.get(`https://randomuser.me/api/?results=20`).then((response) => {\n setUsers(response.data.results);\n });\n }, []);\n\n const handleInputChange = (event) => {\n\n setFilteredUsers(event.target.value);\n\n };\n// sort all users\nlet allUsers = users\n\nif (filteredUsers != null) {\n allUsers = users.filter((user) => {\n return (user.name.title + \" \" + user.name.first + \" \" + user.name.last).indexOf(filteredUsers) >= 0;\n });\n console.log()\n}\n\nif (sortByLastName === true) {\n allUsers = allUsers.sort((a,b) => {\n console.log(a,b)\n return (a.name.last> b.name.last) ? 1 : ((b.name.last > a.name.last) ? -1 : 0)}); \n}\n\nif (sortByTitle === true) {\n allUsers = allUsers.sort((a,b) => {\n console.log(a,b)\n return (a.name.title> b.name.title) ? 1 : ((b.name.title > a.name.title) ? -1 : 0)}); \n}\n return (\n <div className=\"App\">\n <Nav />\n <SearchForm handleInputChange={handleInputChange} />\n <SortButtons setSortByLastName={setSortByLastName} setSortByTitle={setSortByTitle}/>\n <EmployeeTable users={allUsers}/>\n </div>\n );\n}", "title": "" }, { "docid": "ececfa2334019af8fcd80abe1b2d332d", "score": "0.62211007", "text": "function sortByDesc() {\n return users.sort(function (a, b) {\n if (a.id < b.id) return 1;\n if (a.id > b.id) return -1;\n if (a.id === b.id) return 0;\n\n })\n}", "title": "" }, { "docid": "ce00fc3194302e94d18138b6261dbe83", "score": "0.62174684", "text": "function sortUserName() {\n \tvar userName = window.prompt(\"Sup. Write your name so I can sort it. I dare you.\");\n \tconsole.log(\"userName =\", userName);\n \t// splitting string to array\n \tvar nameArray = userName.split('');\n \tconsole.log(\"nameArray =\", nameArray);\n \t// sorting array\n \tvar nameArraySort = nameArray.sort();\n \tconsole.log(\"nameArraySort =\", nameArraySort);\n \t//joining array back to string\n \tvar nameSorted = nameArraySort.join('');\n \tconsole.log(\"nameSorted =\", nameSorted);\n \treturn nameSorted;\n }", "title": "" }, { "docid": "b065ab75335e0e42c21ec8afb0746fb9", "score": "0.6214998", "text": "function UserCompare(a, b) {\n\treturn a.login().toLowerCase() > b.login().toLowerCase() ? 1 : -1; \n}", "title": "" }, { "docid": "74600aca20ab71457009b61038eaf530", "score": "0.6190328", "text": "function sortEmployees (unsorted) {\n if (direction == \"⬇️\") {\n setDirection(\"⬆️\")\n return unsorted.sort((a, b) => (a.name.last > b.name.last) ? 1 :\n (a.name.last === b.name.last) ? ((a.name.first > b.name.first) ? 1 \n : -1) : -1 )\n } else {\n setDirection(\"⬇️\")\n return unsorted.reverse()\n }\n\n }", "title": "" }, { "docid": "54a880210009801974bb10ccaecf2896", "score": "0.6178293", "text": "function ShowUserGroups_sorter(a, b) {\n var PredeterminedOrder = {\n 'staff': -100,\n 'util': -99,\n 'restricted-login': -98,\n 'restricted-login-auto': -97,\n 'restricted-login-exempt': -96,\n 'devboxpanel': -95,\n 'translator': -94,\n 'content-reviewer': -93,\n 'lookupuser': -92,\n 'lookupcontribs': -91,\n 'helper': -80,\n 'vstf': -70,\n 'global-discussions-moderator': -60,\n 'voldev': -50,\n 'vanguard': -40,\n 'council': -30,\n 'authenticated': -20,\n 'fandom-editor': -10,\n 'bot-global': 0,\n 'bot': 10,\n 'codeadmin': 20,\n 'checkuser': 30,\n 'bureaucrat': 40,\n 'sysop': 50,\n 'content-moderator': 60,\n 'threadmoderator': 70,\n 'chatmoderator': 80,\n 'rollback': 90,\n 'poweruser': 110,\n 'autoconfirmed': 120\n };\n \n var sortA = typeof PredeterminedOrder[a] === \"number\"\n ? PredeterminedOrder[a]\n : 100;\n var sortB = typeof PredeterminedOrder[b] === \"number\"\n ? PredeterminedOrder[b]\n : 100;\n \n return sortA - sortB;\n}", "title": "" }, { "docid": "5a0a31edc382ed778633ca80cff0787b", "score": "0.61474895", "text": "function DataSort()\n{\n\tif(isNaN($('#order').val()) && isNaN($('#type').val()))\n\t{\n\t\tvar type = $(\"#type\").val()\n\t\tvar order = $(\"#order\").val()\n\t\taxios.get('api/get.php?page='+current_page+'&type='+type+'&sort='+order+'').then(function(res){\n\t\t\t$('#users').html('')\n\t\t\tmax_pages=parseInt(res.data[0].max_page)\n\n\t\t\tmaximum_pages=max_pages\n\n\t\t\t$('#page_nr').html(`<u><h5>You are currently on page `+current_page+` of `+max_pages+`</h5></u>`)\n\n\t\t\tres.data.forEach(function(element,index){\n\t\t\t\t$('#users').append(`\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>`+(index+1)+`</td>\n\t\t\t\t\t\t<td>`+element.name+`</td>\n\t\t\t\t\t\t<td>`+element.surname+`</td>\n\t\t\t\t\t\t<td>`+element.birth+`</td>\n\t\t\t\t\t\t<td>`+element.cellphone+`</td>\n\t\t\t\t\t\t<td>`+element.email+`</td>\n\t\t\t\t\t\t<td>`+element.date_captured+`</td>\n\t\t\t\t\t</tr>\n\t\t\t\t`)\n\t\t\t})\n\t\t})\n\t}\n\telse\n\t{\n\t\t//select\n\t}\n}", "title": "" }, { "docid": "fd1a9b8d0e7a1d2e0dc346f16c3fd749", "score": "0.61439383", "text": "function sortArray(){\n userData.sort((a,b)=> b.money - a.money);\n updateDOM();\n}", "title": "" }, { "docid": "aa020f5d6f60ab2d3d25e133e93e2694", "score": "0.6114681", "text": "async function fetchUsersAndSort() {\r\n const response = await fetch(url);\r\n const users = await response.json();\r\n users.sort(compare)\r\n const ul = document.getElementById('bestPlayers');\r\n if (users.length > 3) users.length = 3;\r\n users.map(function(user) {\r\n let li = createNode('li'),\r\n span = createNode('span');\r\n // br=createNode('br')\r\n span.innerHTML = `${user.name}`+\"<br>\"+`score: ${user.score}`;\r\n append(li, span);\r\n append(ul, li);\r\n })\r\n}", "title": "" }, { "docid": "0056cb3209da93c760865503a272a77e", "score": "0.6049981", "text": "initSort() {\r\n $('[name=sortBy]').on('change', () => {\r\n console.log('=== Sort users!');\r\n this.populateList();\r\n })\r\n\r\n }", "title": "" }, { "docid": "d1b28837b27b5a21907e8ed2cf09c442", "score": "0.6035377", "text": "function SortObjects() {\n\t}", "title": "" }, { "docid": "c7e40342bdfc7f7dc26bc8950bc48347", "score": "0.60155827", "text": "function nameSorter() {\n var userName = document.getElementById(\"user-name\").value;\n console.log(\"userName: \", userName);\n // Split string and convert to array\n var nameArray = userName.split('');\n console.log(\"nameArray = \", nameArray);\n // Sort the array\n var sortNameArray = nameArray.sort();\n console.log(\"sortedNameArray= \", sortNameArray);\n // Join array and convert back to a string\n var sortedName = sortNameArray.join('');\n console.log(\"sortedName= \", sortedName);\n // return the new (sorted) name\n return sortedName;\n}", "title": "" }, { "docid": "a3ca6520594d90051186da476e4a938e", "score": "0.5993075", "text": "async function sortUsersByScore() {\n try {\n const sortedUsers = await User.find().sort({'score': 'desc'});\n if (sortedUsers) {\n const topFive = [];\n for (let i = 0; i < 5; i++) {\n if (sortedUsers[i]) {\n topFive[topFive.length] = sortedUsers[i];\n }\n }\n return topFive;\n }\n } catch (error) {\n\n }\n}", "title": "" }, { "docid": "0016dc2745393196232b200e675715d0", "score": "0.5991042", "text": "function sort_and_filter(data){\n\n}", "title": "" }, { "docid": "32faca2a6fc632c5753dd8beb172540d", "score": "0.59854686", "text": "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "title": "" }, { "docid": "32faca2a6fc632c5753dd8beb172540d", "score": "0.59854686", "text": "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "title": "" }, { "docid": "499c351a6cf5630fc03c5ab7a7cbb6a2", "score": "0.5983556", "text": "sortBy(element){\n const people = this.filteredPeople.length ? this.filteredPeople : this.people;\n if(this.sortType === 'asc'){\n people.sort((a,b)=> { return a[element] < b[element] ? -1: 1});\n this.sortType = 'desc';\n } else {\n people.sort((a,b)=> { return a[element] > b[element] ? -1: 1});\n this.sortType = 'asc';\n }\n \n this.renderTable(people);\n }", "title": "" }, { "docid": "fa95b5d96afc82a960adba6435382038", "score": "0.5982572", "text": "function bwCreateUserList( sSortBy ) {\r\n var aNewsList = bwGetComments();\r\n var aUserList = new Array();\r\n var i2 = -1;\r\n \r\n if ( aNewsList.length != 0 ) {\r\n aNewsList.sort( sortCommentPath );\r\n for ( var i1 = 0; i1 < aNewsList.length; i1++ ) {\r\n if ( aUserList.length == 0 || aNewsList[i1].path != aUserList[i2].path ) {\r\n aUserList.push( { user: aNewsList[i1].user, \r\n path: aNewsList[i1].path, \r\n userId: aNewsList[i1].userId, \r\n type: aNewsList[i1].type, \r\n score: 0, \r\n count: 0, \r\n comments: 0 } );\r\n i2++;\r\n }\r\n aUserList[i2].comments++;\r\n aUserList[i2].score += parseInt(aNewsList[i1].score);\r\n aUserList[i2].count += parseInt(aNewsList[i1].count);\r\n }\r\n if ( sSortBy == null ) {\r\n sSortBy = bwGetCookie( '_bw_mUS' );\r\n if ( sSortBy == \"\" ) sSortBy = 'User';\r\n }\r\n bwSetCookie( '_bw_mUS', sSortBy, 365 );\r\n \r\n switch ( sSortBy ) {\r\n case 'Type': aUserList.sort( sortCommentTypeUserPath ); break;\r\n case 'Score': aUserList.sort( sortCommentScoreUserPath ); break;\r\n case 'Count': aUserList.sort( sortCommentCountScoreUserPath ); break;\r\n case 'Comments': aUserList.sort( sortCommentCommentsCountScoreUserPath ); break;\r\n default: aUserList.sort( sortCommentUserPath ); break;\r\n }\r\n var sInnerHTML = \"\";\r\n for ( var i1 = 0; i1 < aUserList.length; i1++ ) {\r\n var nComments = parseInt( aUserList[i1].comments );\r\n var sUserId = aUserList[i1].userId;\r\n var sType = aUserList[i1].type;\r\n var sPath = aUserList[i1].path;\r\n var sUser = aUserList[i1].user;\r\n var nCount = parseInt( aUserList[i1].count );\r\n var nScore = parseInt( aUserList[i1].score );\r\n sInnerHTML += bwToHtml( \r\n '&lt;div style=\"height:18px; position:relative; overflow:hidden;\"&gt;' +\r\n '&lt;a class=\"comment_counter\" style=\"text-decoration:none;\" href=\"#\" onClick=\"javascript:bwCreateNewsList(' + sUserId + '); return false;\"&gt;' + \r\n nComments + '&lt;/a&gt;' +\r\n '&lt;span style=\"float:right; margin-right:5px; width:52px; text-align:right;\"&gt;' + ( nScore > 0 ? '+' : '' ) + nScore + '/' + nCount + '&lt;/span&gt;' +\r\n '&lt;/span&gt;' + bwCreateScoreCode( sType, sUserId ) + \r\n '&nbsp;&nbsp;&lt;a href=\"' + sPath + '\" target=\"_new\"&gt;' + sUser + '&lt;/a&gt;' +\r\n '&lt;/div&gt;' );\r\n }\r\n document.getElementById( 'bwUserMenuUsers' ).innerHTML = sInnerHTML;\r\n }\r\n aNewsList = null;\r\n aUserList = null;\r\n }", "title": "" }, { "docid": "66ab31576ab83c1771f91031bbe9b344", "score": "0.59820557", "text": "function sortUsersByPointsAndRanking(a,b){ // -1 va antes 1 despues 0 mantiene\n\tif(a.playersPoints == b.playersPoints)\n {\n\t\tfor(player in a.players){\n\t\t\tif(a.players[player].playerPoints!=b.players[player].playerPoints){return (a.players[player].playerPoints > b.players[player].playerPoints) ? -1 : 1;}\n\t\t}\n\t\treturn (a.id > b.id) ? -1 : 1;// En caso de empate lo ordeno por id\n }\n else\n {\n return (a.playersPoints > b.playersPoints) ? -1 : 1;\n }\n\n}", "title": "" }, { "docid": "45e6a07bfb7962a9f7e23b276bff53d3", "score": "0.59733486", "text": "function sortBy(element){\n switch(element){\n case \"Time\":\n element = \"timestamp\";\n break;\n case \"Nickname\":\n element = \"userNick\";\n break;\n case \"Content\":\n element = \"content\";\n break;\n case \"Total votes\":\n element = \"votes\";\n break;\n case \"User vote\":\n element = \"userVote\";\n break;\n }\n return function(a, b){\n if(element == \"userNick\" || element == \"content\"){\n // Ignore case\n var compareA = String(a[element]).toUpperCase();\n var compareB = String(b[element]).toUpperCase();\n } else {\n var compareA = a[element];\n var compareB = b[element];\n }\n if(compareA < compareB){\n return -1;\n } else if(compareA > compareB){\n return 1;\n } else {\n return 0;\n }\n }\n}", "title": "" }, { "docid": "b74c99ece6fed5cc91fe38e419367ee9", "score": "0.59709907", "text": "function sortUserName() {\n\tvar userName = window.prompt(\"Hello, give name :).\");\n\tconsole.log(\"userName= \",userName )\n\n//spilt array\n\tvar nameArray= userName.split('');\n\tconsole.log(\"nameArray = \", nameArray);\n\n//sort array\n\tvar nameArraySort= nameArray.sort();\n\tconsole.log(\"nameArraySort= \", nameArraySort );\n\n// join back to string\n\tvar nameSorted= nameArraySort.join();\n\tconsole.log(\"nameSorted=\", nameSorted);\n\n//\n\treturn nameSorted;\n}", "title": "" }, { "docid": "b273880ee7c0cc93cae4af56f6688dd6", "score": "0.5949495", "text": "function sortGrade() {\n students.sort(sortByGrade);\n createTable();\n }", "title": "" }, { "docid": "b46764bc3ef70661f2d5f4eebf116c99", "score": "0.5936587", "text": "function getOrderedByScore(users) {\n // your code here\n return _.orderBy(users, [\"score\"], [\"desc\"]);\n} // output order [{id:3, score: 30, ...},{id:2, score: 10, ...}, {id:1, score: 2,...}]", "title": "" }, { "docid": "c446eb85c27a1d604332ce7c17d7a7e2", "score": "0.59152186", "text": "sortListEmployee(sort = 'up') {\n\t\tthis.listEmployee.sort((a, b) => {\n\t\t\tvar idA = a.id.toUpperCase(); // ignore upper and lowercase\n\t\t\tvar idB = b.id.toUpperCase(); // ignore upper and lowercase\n\t\t\tif(idA < idB) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(idA > idB) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t// id must be equal\n\t\t\treturn 0;\n\t\t});\n\t\tif(sort == 'down') this.listEmployee.reverse();\n\t}", "title": "" }, { "docid": "483ad3b848eae1a242f0250bef589019", "score": "0.59089416", "text": "function sortByUsersCount() {\n return groupByCompany().sort(function (a, b) {\n if (a.users.length > b.users.length) return 1;\n if (a.users.length < b.users.length) return -1;\n if (a.users.length === b.users.length) return 0;\n })\n}", "title": "" }, { "docid": "f1ba49ed6ac16cf616dd5cda6938ce69", "score": "0.58951664", "text": "sortEmail() {\n const sortedEmail = this.state.employees.sort(this.compareEmail);\n this.setState({ employees: sortedEmail });\n const orderEmail = this.state.sortOrder ? \"ASC\" : \"DESC\";\n this.setState({ sortOrder: orderEmail })\n }", "title": "" }, { "docid": "d9fb78d08686d1b6b3fdba658f6b7f2b", "score": "0.589305", "text": "function sortFunction( a, b ) {\n\n\t\treturn a - b;\n\n\t}", "title": "" }, { "docid": "d9fb78d08686d1b6b3fdba658f6b7f2b", "score": "0.589305", "text": "function sortFunction( a, b ) {\n\n\t\treturn a - b;\n\n\t}", "title": "" }, { "docid": "0d2691c690d1b8c5319d026ae07d4a30", "score": "0.58714956", "text": "function sortProfArray(by) {\r\n\tif (by == \"lname\") { // sort by last name\r\n\t\tprofArray.sort(function(a, b) { // call the built in sort function\r\n\t\t\tvar aLast = a.getLast();\r\n\t\t\tvar bLast = b.getLast();\r\n\t\t\tif (aLast < bLast) {\r\n\t\t\t\treturn -1;\r\n\t\t\t} else if (aLast > bLast) {\r\n\t\t\t\treturn 1;\r\n\t\t\t} else { // professors have the same last name, decide on room number\r\n\t\t\t\tvar aRoom = a.getRoom().replace(/\\s/g, '');\r\n\t\t\t\tvar bRoom = b.getRoom().replace(/\\s/g, '');\r\n\t\t\t\tif (aRoom < bRoom) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else if (by == \"room\") { // sort by room\r\n\t\tprofArray.sort(function(a, b) {\r\n\t\t\tvar aRoom = a.getRoom().replace(/\\s/g, '');\r\n\t\t\tvar bRoom = b.getRoom().replace(/\\s/g, '');\r\n\t\t\tif (aRoom < bRoom) {\r\n\t\t\t\treturn -1;\r\n\t\t\t} else if (aRoom > bRoom) {\r\n\t\t\t\treturn 1;\r\n\t\t\t} else { // professors have same room number, decide on last name\r\n\t\t\t\tvar aLast = a.getLast();\r\n\t\t\t\tvar bLast = b.getLast();\r\n\t\t\t\tif (aLast < bLast) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "952c928286c7887d6e4dbcae831418e6", "score": "0.58638805", "text": "function user_enabled_id_sort_desc(a, b){\r\n var v = array_sort_desc(a.enabled, b.enabled);\r\n return v? v:array_sort_desc(a.user_id, b.user_id);\r\n}", "title": "" }, { "docid": "bd4d5e82aab1f45e8b7d401027036674", "score": "0.5863432", "text": "function sortFnc(a, b) {\n return a.id > b.id\n }", "title": "" }, { "docid": "1fe2f67e5c596e3d3c4d994a374a0c61", "score": "0.5859844", "text": "function myFunction(currentUser, sortBy = \"acctNum\", sortDirection = \"asc\") {\n\n // Helper variable which combines balance into acctData\n const completeAccountData = acctData;\n for (const account of completeAccountData) {\n for (const acctNum in balance) {\n if (acctNum === account.acctNum) {\n account[\"balanceAmt\"] = balance[acctNum]\n }\n }\n }\n\n\n // pre sort completeAccountData based on sortBy === \"acctNum\" or \"balance\" && sortDirection = \"asc\" or \"desc\"\n if (sortBy === \"acctNum\") {\n if (sortDirection === \"asc\") {\n completeAccountData.sort((acct1, acct2) => acct1.acctNum.replace(/-|\\s/g, \"\").localeCompare(acct2.acctNum.replace(/-|\\s/g, \"\")))\n } else if (sortDirection === \"desc\") {\n completeAccountData.sort((acct1, acct2) => acct2.acctNum.replace(/-|\\s/g, \"\").localeCompare(acct1.acctNum.replace(/-|\\s/g, \"\")))\n }\n }\n\n if (sortBy === \"balance\") {\n if (sortDirection === \"asc\") {\n completeAccountData.sort((acct1, acct2) => acct1.balanceAmt - acct2.balanceAmt)\n } else if (sortDirection === \"desc\") {\n completeAccountData.sort((acct1, acct2) => acct2.balanceAmt - acct1.balanceAmt)\n }\n }\n\n console.log(completeAccountData)\n\n const accountNumbers = [];\n completeAccountData.map(account => {\n if (account.user === currentUser) {\n accountNumbers.push(account.acctNum);\n }\n })\n console.log(accountNumbers)\n\n // return only an array of account numbers\n return accountNumbers\n}", "title": "" }, { "docid": "e199ea63bc2045422362ac1a5eeed9be", "score": "0.58572495", "text": "function sortFn(a, b) {\n var nameA = a.toUpperCase(); // ignore upper and lowercase\n var nameB = b.toUpperCase(); // ignore upper and lowercase\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n}", "title": "" }, { "docid": "5593f8f333bf914018efe2e07eefa1c8", "score": "0.5843838", "text": "function SortByNamexOlderThan(age) {\n\n}", "title": "" }, { "docid": "a208c7bf5506df7395c52724a6d7c1c3", "score": "0.5838556", "text": "function sort() {\n // Create object to store functions that format and compare the different column data\n // types\n var compareObj = {\n name: function(a, b) {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n },\n number: function(a, b) {\n a = Number(a);\n b = Number(b);\n return a - b;\n },\n date: function(a, b) {\n if (a === '') a = '1970-01-01'; // Blank should be sorted to bottom\n a = new Date(a);\n if (b === '') b = '1970-01-01';\n b = new Date(b);\n return b - a;\n },\n rating: function(a, b) {\n a = Number(a.split('(')[0]);\n if (isNaN(a)) a = -1; // If no rating, put at bottom of list\n b = Number(b.split('(')[0]);\n if (isNaN(b)) b = -1;\n return b - a; // The default order is to have highest rated products first\n },\n boolean: function(a, b) {\n // Active (i.e. true) should be before inactive (i.e. false|nil) in ascending sort\n a = (a === 'true') ? 1 : 2;\n b = (b === 'true') ? 1 : 2;\n return a - b;\n },\n rplfwd: function(a, b) {\n // Messages that were not a reply/forward (i.e. '') should be after messages that\n // were a reply/forward (i.e. not '') in ascending sort\n a = (a === '') ? 2 : 1;\n b = (b === '') ? 2 : 1;\n return a - b;\n },\n subject: function(a, b) {\n a = a.replace(' (Reply)*', '').toUpperCase();\n b = b.replace(' (Reply)*', '').toUpperCase();\n\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n }\n };\n // Loop on all the tables with class of sortable-table, as this can handle multiple\n // sortable tables on the same page.\n $('table.sortable-table').each(function() {\n // Set up variables specific to each table\n var $table = $(this);\n var $tbody = $table.find('tbody');\n var $headers = $table.find('th');\n var rows = [] // This needs to be an array so can use sort() and reverse()\n rows = $tbody.find('tr').toArray();\n\n // Add event listener to each column heading\n $headers.on('click', function() {\n // Set up variables for each header/listener\n var $header = $(this);\n var dataType;\n var columnIndex; // The index of the column being sorted\n\n // Already sorted on this column; just change sort order\n // default and reversed are used instead of ascending and descending because the\n // primary sort order for ratings and dates is to put the highest first \n // (descending), while the primary sort order for all the rest is ascending\n if ($header.is('.default') || $header.is('.reversed')) {\n $header.toggleClass('default reversed');\n $tbody.append(rows.reverse());\n } else { // Not already sorted on that column\n $headers.removeClass('default reversed');\n $header.addClass('default');\n dataType = $header.data('sort');\n if (compareObj.hasOwnProperty(dataType)) {\n columnIndex = $headers.index(this);\n rows.sort(function(a, b) {\n a = $(a).find('td').eq(columnIndex).text();\n b = $(b).find('td').eq(columnIndex).text();\n return compareObj[dataType](a, b);\n });\n $tbody.append(rows);\n }\n }\n });\n });\n}", "title": "" }, { "docid": "9a21966fc343014ca4c91f2c2ceb80c7", "score": "0.5838065", "text": "function sortResults(){\n\t\tvar attribute = $(\"#sort\").val();\n\n\t\tif(attribute==null){ //If no attribute chosen, just leave as is\n\t\t\tshowResults();\n\t\t\treturn;\n\t\t}\n\t\tif(attribute=='title' || attribute=='user') currentResults.sort(function(a, b){return a[attribute].localeCompare(b[attribute]);});\n\t\telse if(attribute=='createDate') currentResults.sort(function(a, b){return -a[attribute].localeCompare(b[attribute]);}); \n\t\telse currentResults.sort(function(a, b){return b[attribute]-a[attribute];}); \n\t\tshowResults();\n\t}", "title": "" }, { "docid": "b384d5ecea6c5f5f40dad80ece9f4c76", "score": "0.583577", "text": "function sortContacts(a, b) {\n if (a.fullName.toUpperCase() > b.fullName.toUpperCase())\n {\n return 1;\n } \n else if (a.fullName.toUpperCase() < b.fullName.toUpperCase()) \n {\n return -1;\n }\n return 0;\n}", "title": "" }, { "docid": "71acb0f6b5f3d74865e9ac852447fddd", "score": "0.5759321", "text": "groupUserList(userList) {\n\t\tvar output = {};\n\n\t\tforOwn(userList, (data, username) => {\n\t\t\tlet { symbol } = data;\n\n\t\t\tif (!output[symbol]) {\n\t\t\t\toutput[symbol] = [];\n\t\t\t}\n\n\t\t\toutput[symbol].push({ username, ...data });\n\t\t});\n\n\t\tforOwn(output, (list) => {\n\t\t\tlist.sort(function(a, b) {\n\t\t\t\tif (a && b) {\n\t\t\t\t\treturn a.username.toLowerCase()\n\t\t\t\t\t\t.localeCompare(b.username.toLowerCase());\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\t});\n\t\t});\n\n\t\treturn output;\n\t}", "title": "" }, { "docid": "32aa21e269c7183e381a0d2ef878226b", "score": "0.5752338", "text": "function handleSort(event) {\n event.preventDefault();\n let unsorted = results\n setResults(sortEmployees(unsorted))\n \n }", "title": "" }, { "docid": "96d778cb5103eef08084f9fd3cf8d6ba", "score": "0.57417476", "text": "sortBy(field, reverse, primer) {\n let key = primer ?\n function(x) {return primer(x.hasOwnProperty(field) ? (typeof x[field] === 'string' ? x[field].toLowerCase() : x[field]) : 'zzz')} :\n function(x) {return x.hasOwnProperty(field) ? (typeof x[field] === 'string' ? x[field].toLowerCase() : x[field]) : 'zzz'};\n //checks if the two rows should switch places\n reverse = !reverse ? 1 : -1;\n return function (a, b) {\n return a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n }\n }", "title": "" }, { "docid": "4400f12736bf9c56da4aaa1f9d28ed17", "score": "0.57348907", "text": "function sort(sortField) {\n\t\t// if the sortfield hasn't changed, just reverse the direction\n\t\tif (sortField == vm.options.currentSortColumn) {\n\t\t\tvm.options.currentSortAscending = !vm.options.currentSortAscending;\n\t\t} else if (sortField) { // if null, use the current sort column, if any\n\t\t\tvm.options.currentSortColumn = sortField;\n\t\t\tvm.options.currentSortAscending = true;\n\t\t}\n\t\tif (!vm.options.currentSortColumn || vm.options.currentSortColumn==\"\") return;\n\t\t\n\t\tvm.sortClasses={} // for display of asc and desc markers\n\t\tvm.sortClasses[sortField] = 'glyphicon glyphicon-chevron-' + (vm.options.currentSortAscending ? 'up' : 'down');\n\n\t\tvm.data.tickets.sort(function(a,b) {\n\t\t\tvar valA, valB\n\t\t\tif (sortField == \"milestone\") {\n\t\t\t\tvalA = vm.data.milestones[a.milestone_id] ? vm.data.milestones[a.milestone_id].initials : '';\n\t\t\t\tvalB = vm.data.milestones[b.milestone_id] ? vm.data.milestones[b.milestone_id].initials : '';\n\t\t\t} else if (sortField == \"assigned_to_id\") {\n\t\t\t\tvalA = vm.data.users[a.assigned_to_id] ? vm.data.users[a.assigned_to_id].initials : '';\n\t\t\t\tvalB = vm.data.users[b.assigned_to_id] ? vm.data.users[b.assigned_to_id].initials : '';\n\t\t\t} else {\n\t\t\t\tvalA = getValueByPropPath(sortField,a,\"\");\n\t\t\t\tvalB = getValueByPropPath(sortField,b,\"\");\n\t\t\t}\n\t\t\tif (sortField=='number') {\n\t\t\t\tvalA = parseInt(valA || 0);\n\t\t\t\tvalB = parseInt(valB || 0);\n\t\t\t} else {\n\t\t\t\tvalA = valA || '';\n\t\t\t\tvalB = valB || '';\n\t\t\t\tvalA = valA.toString ? valA.toString() : valA;\n\t\t\t\tvalB = valB.toString ? valB.toString() : valB;\n\t\t\t\tvalA = valA.toLowerCase();\n\t\t\t\tvalB = valB.toLowerCase();\n\t\t\t}\n\t\t\t\n\t\t\tif (!vm.options.currentSortAscending) { var h = valA; valA=valB; valB = h; }\n\t\t\t\n\t\t\tif (valA<valB) return -1;\n\t\t\tif (valA==valB) return 0;\n\t\t\tif (valA>valB) return 1;\n\t\t});\n\t}", "title": "" }, { "docid": "73b66a8ed6ae31f675dc851047909a4d", "score": "0.5719019", "text": "function sortByLastName(students) {\n students.sort(compare);\n}", "title": "" }, { "docid": "24863e21158943a246d37ad0ae92f589", "score": "0.57145625", "text": "function sort() {\n index++;\n predicate = ng.isFunction(getter(scope)) ? getter(scope) : attr.stSort;\n if (index % 3 === 0 && attr.stSkipNatural === undefined) {\n //manual reset\n index = 0;\n ctrl.tableState().sort = {};\n ctrl.tableState().pagination.start = 0;\n ctrl.pipe();\n } else {\n ctrl.sortBy(predicate, index % 2 === 0);\n }\n }", "title": "" }, { "docid": "80e2e6e70d5dd50dd6d78e35ba361069", "score": "0.57143456", "text": "function sort(keyname) {\n vm.sortKey = keyname; //set the sortKey to the param passed\n vm.reverse = !vm.reverse; //if true make it false and vice versa\n }", "title": "" }, { "docid": "80e2e6e70d5dd50dd6d78e35ba361069", "score": "0.57143456", "text": "function sort(keyname) {\n vm.sortKey = keyname; //set the sortKey to the param passed\n vm.reverse = !vm.reverse; //if true make it false and vice versa\n }", "title": "" }, { "docid": "f7e536b132608e2db252397761aa31e3", "score": "0.5711848", "text": "ascending_sort() {\r\n this.lessons.sort(this.compare); //referencing the method below\r\n\r\n }", "title": "" }, { "docid": "a49950ec3ea4ed874b8322028a872b08", "score": "0.5707322", "text": "function userSortRequests(userList, allRequestsList) {\n let requestsWithUserIndex = userList.map(eachUser => {\n return allRequestsList.filter(eachRequest => {\n return eachRequest.authorName === eachUser;\n });\n });\n return requestsWithUserIndex;\n}", "title": "" }, { "docid": "2f60c768340239967c504232de59ba6e", "score": "0.56952614", "text": "function sortData(a,b){\n\n return b-a;\n \n}", "title": "" }, { "docid": "4aada4a42788c23db698475b8c827be7", "score": "0.5693408", "text": "function sortByFirstName(a, b) {\n if (a.firstName < b.firstName) {\n return -1;\n } else if (a.firstName > b.firstName) {\n return 1;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "5f84f43b9a85ba8e379f3333db6086e1", "score": "0.5688044", "text": "function sortByUser(cardArray) {\n let card = [];\n for (let i = 0 ; i < cardArray.length; i++){\n if (cardArray[i].name === user.displayName){\n card.push(cardArray[i]);\n }\n }\n return card;\n }", "title": "" }, { "docid": "1d482439774dea202208f6de995b5b15", "score": "0.5686233", "text": "sort(items) {\n let sortingObject = {};\n let sortingCallback;\n\n switch('date') {\n case 'date': sortingCallback = this.sortByDate;\n break;\n case 'name': sortingCallback = this.sortByName;\n break;\n }\n \n sortingCallback(items, sortingObject);\n \n return sortingObject;\n }", "title": "" }, { "docid": "6ce1ff137c599426e8bc8ed85c837b26", "score": "0.568265", "text": "getSortValues() {}", "title": "" }, { "docid": "41209105a50638157780109c8cf2cadb", "score": "0.56788915", "text": "function SortUserStories() {\n var sortedArray = [];\n\n $.each(storiesToSort, function(i, userObject) { // Loop through user objects - Userinfo + 10 latest stories\n\n $.each(userObject.userStories, function(j, userStory) {\n\n // Build object\n var articleImageLink = userStory.thumbnail;\n var articleHeading = userStory.title;\n var articleLink = userStory.link;\n var articleAuthorName = userStory.author;\n var articleAuthorLink = userObject.userData.link;\n var articleSummary = userStory.description;\n var articleDate = userStory.pubDate;\n\n // Check if the story has an image\n var storyHasImage = articleImageLink.match(/\\.(jpeg|jpg|gif|png)$/) != null ? true : false;\n\n // Strip and truncate summary\n var articleSummaryStripped = articleSummary.replace(/<(?:.|\\n)*?>/gm, '');\n var articleSummaryTruncated = jQuery.trim(articleSummaryStripped)\n .substring(0, 700) + \"...\";\n\n // Create storyobject (similar to usersList.json)\n var storyObj = {\n 'articleImageLink' : articleImageLink,\n 'articleHeading' : articleHeading,\n 'articleLink' : articleLink,\n 'articleAuthorName' : articleAuthorName,\n 'articleAuthorLink' : articleAuthorLink,\n 'articleSummary' : articleSummaryTruncated,\n 'articleDate' : articleDate,\n };\n\n // If the story has an image, accept is as an article\n if(storyHasImage) {\n // if sorted array is empty, insert object - first object always inserted\n if(sortedArray.length == 0) {\n sortedArray.push(storyObj);\n }\n\n else {\n $.each(sortedArray, function(k, sortedStoryObject) {\n\n // If date is bigger than current date, insert before..\n if (new Date(storyObj.articleDate) > new Date(sortedStoryObject.articleDate)) { // no touchstory.pubDate: ', sortedStoryObject.story.pubDate);\n\n sortedArray.splice(k, 0, storyObj);\n return false; // break label - foreach\n\n // if end of array, insert last\n } else if(k == sortedArray.length-1) {\n sortedArray.push(storyObj);\n return false; // break label - foreach\n }\n \n }); // end of for\n\n } // end of else (sortedArray is not empty)\n\n } // end of if (article has image)\n \n }); // end of userStory\n \n }); // end of userObject\n \n // Run function to convert array to HTML\n BuildHtmlArticles(sortedArray, 'latest', 'article article-latest', '.latest-articles-page .container');\n // Clear stories array again\n storiesToSort = []; \n }", "title": "" }, { "docid": "baee31c79ca2e676b060c6ebfe758dd2", "score": "0.567709", "text": "function sortingResultForMember(groupmember, challenge) {\n if (challenge.sortingType === \"høy\") {\n return getResultForMember(groupmember);\n } else {\n return -getResultForMember(groupmember);\n }\n }", "title": "" }, { "docid": "842ab55cc8fce8f6de0cea7bc544d438", "score": "0.5673752", "text": "function get_teams_sorted(user_id){\n\n\tvar ul_ranking = document.getElementById('ul_ranking');\n\tvar self_ranking = document.getElementById('self_ranking');\n\t\n\tif(users.length){\n\t\n\t\tfor(var i=0 in users){\n\t\t\n\t\t\tif(users[i].lastPosition != null){\n\t\t\t\til_y_a = func_il_y_a(users[i].lastPosition.created);\n\t\t\t}\n\t\t\telse{\n\t\t\t\til_y_a = \"Jamais actualisé\";\n\t\t\t}\n\t\t\t\n\t\t\tvar rank = parseInt(i)+1;\n\t\t\n\t\t\tvar newLi = document.createElement('li');\n\t\t\tul_ranking.appendChild(newLi);\n\t\t\tnewLi.innerHTML = \"<a onclick='display_team_route_from_list(\"+i+\");'><div id='ptr_div'><div class='sprite last\"+users[i].team_number+\"'></div></div><div id='info_div'><span class='team'><strong>\"+rank+\"</strong>. \"+users[i].team_name+\"</span><br/>Polytech \"+users[i].school_name+\"</br><span class='times'><span class='kms'>\"+users[i].distance+\" Km - </span>\"+il_y_a+\"</span></div></a></a>\";\n\t\t\t\n\t\t\t//pour le classement de l'équipe connectée\n\t\t\tif(user_id == users[i].id){\n\t\t\t\tvar liSelfRanking = document.createElement('li');\n\t\t\t\tself_ranking.appendChild(liSelfRanking);\n\t\t\t\tliSelfRanking.innerHTML = \"Mon classement : \"+rank+\"/\"+users.length;\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tvar newLi = document.createElement('li');\n\t\tul_ranking.appendChild(newLi);\n\t\tnewLi.innerHTML = \"<a>Aucun équipage</a>\";\n\t}\n}", "title": "" }, { "docid": "550e1902418c331b35b56f21bcd8285a", "score": "0.5665326", "text": "function sortTree() {\n tree.sort(function(a, b) {\n if (currentValue == \"Person\") return b.id.toLowerCase() < a.id.toLowerCase() ? 1 : -1;\n var b_order = b.sortorder;\n if (typeof(b_order) == \"string\") {\n if (b_order.length < 2) b_order = \"0\" + b_order;\n }\n\n var a_order = a.sortorder;\n if (typeof(a_order) == \"string\") {\n if (a_order.length < 2) a_order = \"0\" + a_order;\n }\n\n return b_order < a_order ? 1 : -1;\n // return b.sortorder < a.sortorder ? 1 : -1;\n });\n }", "title": "" }, { "docid": "74cc16da6ad3edcc21b6b29bea7ee1ec", "score": "0.56623006", "text": "function sortFieldsByIndex(userFields, index) {\n var indexFields = index.def.fields.map(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"f\" /* getKey */]);\n\n return userFields.slice().sort(function (a, b) {\n var aIdx = indexFields.indexOf(a);\n var bIdx = indexFields.indexOf(b);\n if (aIdx === -1) {\n aIdx = Number.MAX_VALUE;\n }\n if (bIdx === -1) {\n bIdx = Number.MAX_VALUE;\n }\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"h\" /* compare */])(aIdx, bIdx);\n });\n}", "title": "" }, { "docid": "f421f3576b406880776e87e245506d96", "score": "0.56606877", "text": "function sortFunc(objA, objB) {\nvar nameA = objA.names[0], nameB = objB.names[0];\n\nif (nameA < nameB) {\nreturn -1;\n} else if (nameA > nameB) {\nreturn 1;\n} else {\nreturn 0;\n}\n}", "title": "" }, { "docid": "21e3627c94680239ebbff38c2e38a7a9", "score": "0.5660324", "text": "function sortFirstName(a, b)\n{ \n var aCols = a.split(\",\");\n var bCols = b.split(\",\");\n var x = \"\";\n try\n {\n x = aCols[gSortCol].toLowerCase(); \n }\n catch(ex)\n { \n }\n\n var y = \"\";\n try\n {\n y = bCols[gSortCol].toLowerCase();\n }\n catch(ex)\n {\n }\n\n var result;\n if (gSortDir)\n {\n result = ((x < y) ? -1 : ((x > y) ? 1 : 0));\n }\n else\n {\n result = ((x > y) ? -1 : ((x < y) ? 1 : 0));\n }\n return result;\n}", "title": "" }, { "docid": "03dcb59f8ac4c1dc5121ad2d0cd82fe8", "score": "0.56587446", "text": "sortMortonNumbers () {}", "title": "" }, { "docid": "7c49b2dae37627a782c912d7973e94c5", "score": "0.5654525", "text": "function sortEmployeeData() {\n switch (sortOrder) {\n default:\n break;\n case \"accending\":\n employeeData = employeeData\n .slice(0, loadLength)\n .sort((a, b) =>\n `${a.getFirstName()} ${a.getLastName()}` <\n `${b.getFirstName()} ${b.getLastName()}`\n ? -1\n : 1\n )\n .concat(employeeData.slice(loadLength));\n break;\n case \"decending\":\n employeeData = employeeData\n .slice(0, loadLength)\n .sort((a, b) =>\n `${a.getFirstName()} ${a.getLastName()}` >\n `${b.getFirstName()} ${b.getLastName()}`\n ? -1\n : 1\n )\n .concat(employeeData.slice(loadLength));\n break;\n }\n}", "title": "" }, { "docid": "22ba755b22d9ddfa4aad25b2020d2743", "score": "0.5649024", "text": "function sortAge(a, b) {\n return a.age - b.age;\n}", "title": "" }, { "docid": "f8dfc13370d1090056fa7c3c3629053b", "score": "0.5648899", "text": "function sortByFirstName(a, b) {\n if (a.firstName < b.firstName) {\n return -1;\n }\n if (a.firstName > b.firstName) {\n return 1;\n }\n return 0;\n}", "title": "" } ]
83702563ad4525222399c00dda7096e5
Creates a property accessor on the element prototype if one does not exist. The property setter calls the property's `hasChanged` property option or uses a strict identity check to determine whether or not to request an update.
[ { "docid": "bf486c939d9384f99e877132f0f43eff", "score": "0.6280112", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n\n this._classProperties.set(name, options); // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n\n\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n\n this._requestUpdate(name, oldValue);\n },\n\n configurable: true,\n enumerable: true\n });\n }", "title": "" } ]
[ { "docid": "8fe0699ba99b340eced982c62ffd4efc", "score": "0.6794266", "text": "function internalProperty(options){return property({attribute:!1,hasChanged:null===options||void 0===options?void 0:options.hasChanged})}", "title": "" }, { "docid": "35d88ceb88ee95991ad5675d912a8e03", "score": "0.6542349", "text": "function internalProperty(options) {\n return property({ attribute: false, hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged });\n}", "title": "" }, { "docid": "35d88ceb88ee95991ad5675d912a8e03", "score": "0.6542349", "text": "function internalProperty(options) {\n return property({ attribute: false, hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged });\n}", "title": "" }, { "docid": "35d88ceb88ee95991ad5675d912a8e03", "score": "0.6542349", "text": "function internalProperty(options) {\n return property({ attribute: false, hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged });\n}", "title": "" }, { "docid": "8a8618699a30eed68d6becb53cec2ded", "score": "0.6506405", "text": "function internalProperty(options) {\n return property({\n attribute: false,\n hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged\n });\n }", "title": "" }, { "docid": "05c3f53323774f8b231cf4ef4aadfdc7", "score": "0.6207027", "text": "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "title": "" }, { "docid": "9dba16d3943297598cc3f1e70d54da9d", "score": "0.6091807", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n // tslint:disable-next-line:no-any no symbol in index\n const oldValue = this[name];\n // tslint:disable-next-line:no-any no symbol in index\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "86d10ba72125daffe1a6bc74cba7a161", "score": "0.6033766", "text": "function setterDirtiesAttribute(prototype, propertyName, opt_attrName) {\n var attrName = opt_attrName || propertyName;\n Object.defineProperty(prototype, propertyName, {\n get: function() {\n return this.impl[propertyName];\n },\n set: function(v) {\n this.impl[propertyName] = v;\n invalidateRendererBasedOnAttribute(this, attrName);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "13c18fe840b1c660b3142e606063cf14", "score": "0.600308", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "f3ac26dfff37a03f3badf3def6e9d89e", "score": "0.6002556", "text": "function property(cls, prop, get, set) {\n\tlet proto = cls.prototype || cls\n\tassert(!(prop in proto), '{0}.{1} already exists', cls.type || cls.name, prop)\n\tlet descriptor = isobject(get) ? get : {get: get, set: set}\n\tObject.defineProperty(proto, prop, descriptor)\n}", "title": "" }, { "docid": "4dbf81c2f8f3b073adf91415585a79e1", "score": "0.5999647", "text": "function PropertyUpdater(element, props, bindingContext)\n{\n this.setup = function(metadata)\n {\n // Since we are tracking all our dependencies explicitly, we are suspending dependency detection here.\n // update() will be called only once as a result\n\n var metadataProps = metadata['properties'];\n if (metadataProps)\n {\n // Override set/removeAttribute so we get notifications when DOM changes\n originalMethods.setAttribute = element.setAttribute,\n originalMethods.removeAttribute = element.removeAttribute\n element.setAttribute = function(name, value)\n {\n changeAttribute(name, value, originalMethods.setAttribute);\n };\n element.removeAttribute = function(name)\n {\n changeAttribute(name, null, originalMethods.removeAttribute);\n };\n var changeAttribute = function(name, value, operation)\n {\n name = name.toLowerCase();\n var previousValue = element.getAttribute(name);\n operation.apply(element, arguments);\n var newValue = element.getAttribute(name);\n var propName = _attributeToPropertyName(name);\n if (element.hasOwnProperty(propName) && newValue !== previousValue)\n {\n _setPropertyFromAttribute(props, metadataProps[propName], propName, newValue);\n }\n }\n\n var names = Object.keys(metadataProps);\n\n _setInitializing(true);\n\n try{\n\n names.forEach(\n function(name)\n {\n var attrName = _propertyNameToAttribute(name);\n var elemHasAttr = element.hasAttribute(attrName);\n var propertyMetadata = metadataProps[name];\n if (elemHasAttr)\n {\n var attrVal = element.getAttribute(attrName);\n _setPropertyFromAttribute(props, propertyMetadata, name, attrVal);\n }\n else\n {\n if (!propertyMetadata['readOnly'])\n {\n element[name] = propertyMetadata['value'];\n }\n }\n }\n );\n }\n finally\n {\n _setInitializing(false);\n }\n }\n return this;\n }\n\n this.isInitializing = function()\n {\n return _initializing;\n }\n\n function _setPropertyFromAttribute(props, metadata, propName, attrVal)\n {\n if (!_setupExpression(attrVal, props, propName, metadata) && !metadata['readOnly'])\n {\n var value = _coerceValue(attrVal, metadata['type']);\n _setElementProperty(propName, value);\n }\n }\n\n function _coerceValue(val, type)\n {\n // We only support primitive types and JSON objects for coerced properties\n var typeLwr = type.toLowerCase();\n switch (typeLwr) {\n case \"boolean\":\n return Boolean(val);\n case \"number\":\n return Number(val);\n case \"string\":\n return val;\n default:\n return JSON.parse(val);\n }\n }\n\n this.teardown = function(element)\n {\n var names;\n [observableListeners, expressionListeners].forEach(\n function(listeners)\n {\n names = Object.keys(listeners);\n for (var i=0; i<names.length; i++)\n {\n expressionListeners[names[i]]['dispose']();\n }\n }\n );\n observableListeners = {};\n expressionListeners = {};\n\n\n // reset overridden methods\n names = Object.keys(originalMethods);\n var i;\n for (i=0; i<names.length; i++)\n {\n var method = names[i];\n element[method] = originalMethods[method];\n }\n originalMethods = {};\n\n // reset change listeners\n names = Object.keys(changeListeners);\n for (i=0; i<names.length; i++)\n {\n var prop = names[i];\n element.removeEventListener(prop + _CHANGED_EVENT_SUFFIX, changeListeners[prop]);\n }\n changeListeners = {};\n }\n\n function _attributeToPropertyName(attr)\n {\n return attr.toLowerCase().replace(/-(.)/g,\n function(match, group1)\n {\n return group1.toUpperCase();\n }\n );\n }\n\n // This function should be called when the bindings are applied initially and whenever the expression attribute changes\n function _setupExpression(attrVal, props, propName, metadata)\n {\n var info = oj.ExpressionUtils.getExpressionInfo(attrVal);\n\n delete propsWithLocalValue[propName];\n\n var oldListener = expressionListeners[propName];\n if (oldListener)\n {\n oldListener['dispose']();\n delete expressionListeners[propName];\n }\n\n // Clean up property change listeners to handler the case when the type of the expression changes\n var changeListener = changeListeners[propName];\n if (changeListener)\n {\n element.removeEventListener(propName + _CHANGED_EVENT_SUFFIX, changeListener);\n delete changeListeners[propName];\n }\n\n var cleanupObservableListener;\n\n var readOnly = metadata['readOnly'];\n\n if (!readOnly)\n {\n cleanupObservableListener = function()\n {\n var observableListener = observableListeners[propName];\n if (observableListener)\n {\n observableListener['dispose']();\n delete observableListeners[propName];\n }\n }\n cleanupObservableListener();\n }\n\n var expr = info.expr;\n\n if (expr)\n {\n // TODO: consider moving __CreateEvaluator() to a more generic utility class\n var evaluator = oj.ComponentBinding.__CreateEvaluator(expr);\n\n if (!readOnly)\n {\n ko.ignoreDependencies(\n function()\n {\n expressionListeners[propName] = ko.computed(\n // The read() function for the computed will be called when the computed is created and whenever any of\n // the expression's dependency changes\n function()\n {\n cleanupObservableListener();\n\n if (!propsWithLocalValue[propName])\n {\n var value = evaluator(bindingContext);\n if (ko.isObservable(value))\n {\n observableListeners[propName] = _setAndWatchObservableValue(propName, value);\n }\n else\n {\n _setElementProperty(propName, value);\n }\n }\n }\n );\n }\n );\n }\n\n changeListeners[propName] = _listenToPropertyChanges(propName, expr, evaluator, metadata['writeback'] && !info.downstreamOnly);\n\n return true;\n }\n\n\n return false;\n }\n\n function _setAndWatchObservableValue(propName, value)\n {\n ko.ignoreDependencies(\n function()\n {\n _setElementProperty(propName, ko.utils.unwrapObservable(value));\n }\n );\n\n var listener = value['subscribe'](\n\n function(newVal)\n {\n if (!propsWithLocalValue[propName])\n {\n _setElementProperty(propName, newVal);\n }\n }\n\n );\n\n return listener;\n }\n\n\n function _listenToPropertyChanges(propName, expr, evaluator, writable)\n {\n var listener = function(evt)\n {\n var written = false;\n if (!_settingProperty)\n {\n if (writable)\n {\n ko.ignoreDependencies(\n function()\n {\n var value = evt['detail']['value'];\n\n var target = evaluator(bindingContext);\n\n if (ko.isWriteableObservable(target))\n {\n written = true;\n target(value);\n }\n else\n {\n var writerExpr = oj.ExpressionUtils.getPropertyWriterExpression(expr);\n if (writerExpr != null)\n {\n // TODO: consider caching the evaluator\n var wrirerEvaluator = oj.ComponentBinding.__CreateEvaluator(writerExpr);\n wrirerEvaluator(bindingContext)(value);\n written = true;\n }\n }\n }\n );\n }\n if (!written)\n {\n propsWithLocalValue[propName] = true;\n }\n }\n\n };\n\n element.addEventListener(propName + _CHANGED_EVENT_SUFFIX, listener);\n return listener;\n }\n\n function _propertyNameToAttribute(name)\n {\n return name.replace(/([A-Z])/g,\n function(match)\n {\n return '-' + match.toLowerCase();\n }\n );\n }\n\n function _setInitializing(flag)\n {\n _initializing = flag;\n }\n\n function _setElementProperty(propName, value)\n {\n _settingProperty = true;\n try\n {\n element[propName] = value;\n }\n finally\n {\n _settingProperty = false;\n }\n }\n\n var expressionListeners = {};\n var observableListeners = {};\n var changeListeners = {};\n var originalMethods = {};\n var propsWithLocalValue = {};\n var _initializing;\n var _settingProperty;\n var _CHANGED_EVENT_SUFFIX = \"-changed\";\n}", "title": "" }, { "docid": "9320a57d8beb970c2605e99fb20e90f0", "score": "0.59808326", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "b4fc7eb5b567915161c0381f89f16a6e", "score": "0.5858391", "text": "function createBridgeToElementDescriptor(propName, descriptor) {\n const {\n get,\n set,\n enumerable,\n configurable\n } = descriptor;\n\n if (!isFunction$1(get)) {\n if (undefined !== 'production') {\n assert.fail(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard getter.`);\n }\n\n throw new TypeError();\n }\n\n if (!isFunction$1(set)) {\n if (undefined !== 'production') {\n assert.fail(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard setter.`);\n }\n\n throw new TypeError();\n }\n\n return {\n enumerable,\n configurable,\n\n get() {\n const vm = getAssociatedVM(this);\n\n if (isBeingConstructed(vm)) {\n if (undefined !== 'production') {\n logError(`The value of property \\`${propName}\\` can't be read from the constructor because the owner component hasn't set the value yet. Instead, use the constructor to set a default value for the property.`, vm);\n }\n\n return;\n }\n\n componentValueObserved(vm, propName);\n return get.call(vm.elm);\n },\n\n set(newValue) {\n const vm = getAssociatedVM(this);\n\n if (undefined !== 'production') {\n const vmBeingRendered = getVMBeingRendered();\n assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${propName}`);\n assert.invariant(!isUpdatingTemplate, `When updating the template of ${vmBeingRendered}, one of the accessors used by the template has side effects on the state of ${vm}.${propName}`);\n assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);\n assert.invariant(!isObject(newValue) || isNull(newValue), `Invalid value \"${newValue}\" for \"${propName}\" of ${vm}. Value cannot be an object, must be a primitive value.`);\n }\n\n if (newValue !== vm.cmpProps[propName]) {\n vm.cmpProps[propName] = newValue;\n componentValueMutated(vm, propName);\n }\n\n return set.call(vm.elm, newValue);\n }\n\n };\n}", "title": "" }, { "docid": "36712a73f92a33ebac1cedb0efe3f3f4", "score": "0.5815455", "text": "function synchronizedAccessor(defineOn, accessorKey, propertyName) {\n Object.defineProperty(defineOn.prototype, propertyName, {\n enumerable: true,\n configurable: true,\n\n get() {\n return this[accessorKey].value;\n },\n\n set(value) {\n this[accessorKey].value = value;\n }\n\n });\n }", "title": "" }, { "docid": "5050291c383a2d73ebd3586d73087da9", "score": "0.5638466", "text": "_redefineProperty(propertyName) {\n const that = this;\n\n Object.defineProperty(that, propertyName, {\n get: function () {\n return that.properties[propertyName].value;\n },\n set(value) {\n function replacer(key, value) {\n if (value instanceof JQX.Utilities.BigNumber) {\n return value.toString();\n }\n\n return value;\n }\n\n const oldValue = that.properties[propertyName].value,\n stringifiedOldValue = JSON.stringify(oldValue, replacer),\n stringifiedValue = JSON.stringify(value, replacer);\n\n if (stringifiedOldValue === stringifiedValue) {\n return;\n }\n\n that.properties[propertyName].value = value;\n\n if (that.isReady && (!that.ownerElement || (that.ownerElement && that.ownerElement.isReady)) && that.context !== that) {\n const context = that.context;\n\n that.context = that;\n that.propertyChangedHandler(propertyName, oldValue, value);\n that.context = context;\n }\n }\n });\n }", "title": "" }, { "docid": "032a7096824627939ea814161de8e565", "score": "0.56281114", "text": "function toggleable_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; }", "title": "" }, { "docid": "032a7096824627939ea814161de8e565", "score": "0.56281114", "text": "function toggleable_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; }", "title": "" }, { "docid": "6935b2d8f43afd56c62b7564ce91195a", "score": "0.5618455", "text": "prop(elem) {\r\n this._prop(elem, \"prop\");\r\n }", "title": "" }, { "docid": "263ab909da2158764aa61327ed2b669c", "score": "0.56183606", "text": "function elementProperty(index, propName, value, sanitizer) {\n if (value === NO_CHANGE)\n return;\n var node = loadElement(index);\n var tNode = node.tNode;\n // if tNode.inputs is undefined, a listener has created outputs, but inputs haven't\n // yet been checked\n if (tNode && tNode.inputs === undefined) {\n // mark inputs as checked\n tNode.inputs = generatePropertyAliases(node.tNode.flags, 0 /* Input */);\n }\n var inputData = tNode && tNode.inputs;\n var dataValue;\n if (inputData && (dataValue = inputData[propName])) {\n setInputsForProperty(dataValue, value);\n markDirtyIfOnPush(node);\n }\n else {\n // It is assumed that the sanitizer is only added when the compiler determines that the property\n // is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? sanitizer(value) : value;\n var native = node.native;\n ngDevMode && ngDevMode.rendererSetProperty++;\n isProceduralRenderer(renderer) ? renderer.setProperty(native, propName, value) :\n (native.setProperty ? native.setProperty(propName, value) :\n native[propName] = value);\n }\n}", "title": "" }, { "docid": "04dd222c3e002ef29b0ffb39143dc1a4", "score": "0.560901", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n ) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n }", "title": "" }, { "docid": "04dd222c3e002ef29b0ffb39143dc1a4", "score": "0.560901", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n ) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n }", "title": "" }, { "docid": "04dd222c3e002ef29b0ffb39143dc1a4", "score": "0.560901", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n ) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n }", "title": "" }, { "docid": "04dd222c3e002ef29b0ffb39143dc1a4", "score": "0.560901", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n ) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n }", "title": "" }, { "docid": "04dd222c3e002ef29b0ffb39143dc1a4", "score": "0.560901", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n ) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n }", "title": "" }, { "docid": "364c6b3a2d5cf18530af61cd5dc1abb9", "score": "0.557462", "text": "prop(elem) {\n this._prop(elem, \"prop\")\n }", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "9e9cea25d6c86827b6561d8f647a0a18", "score": "0.5570961", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "76ee1aca6ffc7ead30b46ea13270a1fc", "score": "0.5555718", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (false) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "76ee1aca6ffc7ead30b46ea13270a1fc", "score": "0.5555718", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (false) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "76ee1aca6ffc7ead30b46ea13270a1fc", "score": "0.5555718", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (false) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "824cb92f9b14daaa4c2964b9e2f7ff0b", "score": "0.5554723", "text": "function makeProp (name) {\n return {\n get: function () {\n return this.ns[name];\n },\n set: function (newVal) {\n return this.attributeChangedCallback(name, this.ns[name], newVal);\n }\n };\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "6cc82496f21e32f2595eb94814e93b62", "score": "0.5546863", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if ( true && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "2c797babe15266ce2ef85a1a0eee112f", "score": "0.5536384", "text": "function PropertyUpdater(element, props, bindingContext, parseFunction)\n{\n this.setup = function(metadata)\n {\n // Since we are tracking all our dependencies explicitly, we are suspending dependency detection here.\n // update() will be called only once as a result\n\n var metadataProps = metadata['properties'];\n if (metadataProps)\n {\n var expressionHandler = this._expressionHandler = \n new oj.__ExpressionPropertyUpdater(element, bindingContext);\n \n // Override set/removeAttribute so we get notifications when DOM changes\n originalMethods.setAttribute = element.setAttribute,\n originalMethods.removeAttribute = element.removeAttribute\n element.setAttribute = function(name, value)\n {\n changeAttribute(name, value, originalMethods.setAttribute, false);\n };\n element.removeAttribute = function(name)\n {\n changeAttribute(name, null, originalMethods.removeAttribute, true);\n };\n var changeAttribute = function(name, value, operation, bRemove)\n {\n name = name.toLowerCase();\n var previousValue = element.getAttribute(name);\n operation.apply(element, arguments);\n var newValue = element.getAttribute(name);\n if (newValue !== previousValue)\n {\n var propName = oj.__AttributeUtils.attributeToPropertyName(name);\n _setPropertyFromAttribute(props, metadataProps[propName], propName, newValue, expressionHandler, bRemove);\n }\n }\n\n var names = Object.keys(metadataProps);\n\n _setInitializing(true);\n\n try\n {\n names.forEach(\n function(name)\n {\n var attrName = oj.__AttributeUtils.propertyNameToAttribute(name);\n var elemHasAttr = element.hasAttribute(attrName);\n var propertyMetadata = metadataProps[name];\n if (elemHasAttr)\n {\n var attrVal = element.getAttribute(attrName);\n _setPropertyFromAttribute(props, propertyMetadata, name, attrVal, expressionHandler, false);\n }\n // Set default values from metadata for properties not defined by attribute values or were readOnly\n // and bound to upstream-only expressions\n if (!elemHasAttr || propertyMetadata['readOnly'])\n {\n try \n {\n _setDefaulting(true);\n element[name] = propertyMetadata['value'];\n }\n finally\n {\n _setDefaulting(false);\n }\n }\n }\n );\n\n element.classList.add('oj-complete');\n }\n finally\n {\n _setInitializing(false);\n }\n }\n return this;\n }\n\n this.isInitializing = function()\n {\n return _initializing;\n }\n\n this.isDefaulting = function()\n {\n return _defaulting;\n }\n\n function _setPropertyFromAttribute(props, metadata, propName, attrVal, expressionHandler, bRemove)\n { \n // Only deal with element defined attribute changes\n if (!metadata)\n return;\n\n if (!expressionHandler.setupExpression(attrVal, propName, metadata) && !metadata['readOnly'])\n {\n var value;\n if (bRemove)\n {\n // Coercion is skipped if we are resetting the property to the default metadata value when the attribute is removed\n value = metadata['value'];\n }\n else\n {\n // Use the composite's custom parse function if one is provided\n if (parseFunction)\n {\n value = parseFunction(attrVal, propName, metadata, \n function(value) \n {\n return oj.__AttributeUtils.coerceValue(propName, value, metadata['type']); \n }\n );\n }\n else \n {\n value = oj.__AttributeUtils.coerceValue(propName, attrVal, metadata['type']);\n }\n }\n element[propName] = value;\n }\n }\n\n\n this.teardown = function(element)\n {\n this._expressionHandler.teardown();\n // reset overridden methods\n var names = Object.keys(originalMethods);\n var i;\n for (i=0; i<names.length; i++)\n {\n var method = names[i];\n element[method] = originalMethods[method];\n }\n originalMethods = {};\n\n }\n\n function _setInitializing(flag)\n {\n _initializing = flag;\n }\n\n function _setDefaulting(flag)\n {\n _defaulting = flag;\n }\n\n\n\n\n var originalMethods = {};\n var _initializing;\n var _defaulting;\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" }, { "docid": "af1407da9decd31c66761326d02896d1", "score": "0.5535299", "text": "function defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}", "title": "" } ]
bbe21cbf0d72c9c4f498298f8c1f8614
======= ======= ======= makeAggregator ======= ======= =======
[ { "docid": "3062fb546cedc177042669df002224e9", "score": "0.58744735", "text": "function makeAggregator(displayObject) {\n console.log(\"makeAggregator\");\n\n // == make aggregator arrays for aggregated zone data\n zoneGeojson = displayObject.zoneGeojson ;\n displayObject.zoneNameArray = [];\n displayObject.zoneDataArray = [];\n\n // == data files have different property keys for zone name\n for (var i = 0; i < zoneGeojson.features.length; i++) {\n nextZoneName = zoneGeojson.features[i].properties.NAME;\n\n // == remove abbreviations in zone names (e.g. Cooke, H.D.) if any\n var checkName = nextZoneName.indexOf(\", \");\n if (checkName > -1) {\n splitZoneName = nextZoneName.split(\", \");\n nextZoneName = splitZoneName[0];\n }\n displayObject.zoneNameArray.push(nextZoneName);\n\n // == build zone data aggregator place-holders\n displayObject.zoneDataArray.push(0);\n }\n console.log(\" displayObject.zoneDataArray.length: \", displayObject.zoneDataArray.length);\n}", "title": "" } ]
[ { "docid": "a48a3f9be47d5c71aec688a6c61d3121", "score": "0.6552619", "text": "function createAggregator(aggregateType) {\n switch (aggregateType) {\n case \"Average\":\n return new AverageAggregator();\n case \"Count\":\n return new CountAggregator();\n case \"Max\":\n return new MaxAggregator();\n case \"Min\":\n return new MinAggregator();\n case \"Sum\":\n return new SumAggregator();\n default:\n return new StaticValueAggregator();\n }\n}", "title": "" }, { "docid": "59acc4f9977b71bc60ee2650cda33013", "score": "0.5932494", "text": "setLexemeAggregator (callback) {\n this.aggregateLexemes = callback\n }", "title": "" }, { "docid": "320c79fcf24b48b6cfb2d1fb360fe50f", "score": "0.58109826", "text": "function aggregate () {\n self.aggregate();\n }", "title": "" }, { "docid": "ffc6b92c80ce737f341689083de4ca70", "score": "0.56578606", "text": "visitCreateAggregate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "55794df679206611edb9c4e4b1dadb43", "score": "0.56567025", "text": "function Aggregation(aggregator, context, pivotOptions) {\n\t\tif (!(this instanceof Aggregation)) {\n\t\t\treturn new Aggregation(aggregator);\n\t\t}\n\t\t//this.result = undefined;\n\t\t//this.count = undefined;\n\t\tthis.aggregator = aggregator;\n\t\tthis.finilized = false;\n\t\tthis.context = context;\n\t\tthis.pivotOptions = pivotOptions;\n\t}", "title": "" }, { "docid": "7e7d5717d127661f5b500dc93694b903", "score": "0.54448426", "text": "visitAggregate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a4e4349412e78db4cb64fe429586616e", "score": "0.53064", "text": "function makeZoneAggregator(zonesCollectionObj) {\n console.log(\"makeZoneAggregator\");\n\n zonesCollectionObj.zoneNamesArray = [];\n zonesCollectionObj.zoneDataArray = [];\n if (zonesCollectionObj.zoneGeojson) {\n for (var i = 0; i < zonesCollectionObj.zoneGeojson.features.length; i++) {\n nextZoneName = zonesCollectionObj.zoneGeojson.features[i].properties.NAME;\n splitZoneName = nextZoneName.split(\", \");\n nextZoneName = splitZoneName[0];\n zonesCollectionObj.zoneNamesArray.push(nextZoneName);\n zonesCollectionObj.zoneDataArray.push(0);\n }\n } else {\n console.log(\"ERROR: no geojson data\");\n }\n console.log(\" aggregator\", zonesCollectionObj.zoneDataArray);\n}", "title": "" }, { "docid": "12ee613ad2548288341bd7149eecfa34", "score": "0.52039695", "text": "function moduleAggregator(callback) {\n var dep = pkgJson.dependencies,\n mod,\n size = 0,\n counter = 0,\n pkg = {};\n\n if (aggregatedModules.length > 0) {\n return callback(null, aggregatedModules);\n }\n\n Object.keys(dep).forEach(function (key) {\n size++;\n var modPath = path.join(root, 'node_modules', key, 'package.json');\n fs.exists(modPath, function (exists) {\n counter++;\n if (exists) {\n pkg = {};\n mod = require(modPath);\n pkg.name = mod.name;\n pkg.version = mod.version;\n aggregatedModules.push(pkg);\n }\n if (counter === size) {\n callback(null, aggregatedModules);\n }\n });\n\n });\n}", "title": "" }, { "docid": "0dcd913660a861e441e70c5c46eff689", "score": "0.5059573", "text": "function postAggregation(grouping) {\n\n }", "title": "" }, { "docid": "5427adcc08f994108e5bc9c17b3ab76c", "score": "0.5047841", "text": "function ProductDataConsolidator() { }", "title": "" }, { "docid": "86bd12be2d93d3de197fe2c5bf7818bd", "score": "0.49534598", "text": "toAggregate(signer) {\n if (this.type === TransactionType_1.TransactionType.AGGREGATE_BONDED || this.type === TransactionType_1.TransactionType.AGGREGATE_COMPLETE) {\n throw new Error('Inner transaction cannot be an aggregated transaction.');\n }\n return Object.assign({ __proto__: Object.getPrototypeOf(this) }, this, { signer });\n }", "title": "" }, { "docid": "66ab7c04b54a1d850c21d7892061f32c", "score": "0.49525565", "text": "async function createAggregate(deps, payload, agg) {\n return await deps.mongo.insert(agg);\n}", "title": "" }, { "docid": "4c0801f93c31fb77f6a3361433428e09", "score": "0.49376565", "text": "function MultiFlattener() {}", "title": "" }, { "docid": "c8daa77f1052a75803607db3cce76f63", "score": "0.49235663", "text": "transform(item) {\n return item;\n }", "title": "" }, { "docid": "afa2034cf48af2ed0af166873ea393d2", "score": "0.48705575", "text": "function runAggregation() {\n sub._ids = sub._ids || {};\n sub._iteration = sub._iteration || 0;\n var matchedLocations = Locations.aggregate(pipeline);\n _(matchedLocations).forEach(function(location){\n var _id = location.insertedBy;\n if(typeof sub._ids[_id] !== 'undefined'){\n // Aggregate and update our collection with the new data changes\n sub.changed('locations', location.insertedBy, location);\n }\n else {\n // Aggregate and then add a new record to our collection\n sub.added('locations', location.insertedBy, location);\n }\n sub._ids[_id] = sub._iteration++;\n });\n }", "title": "" }, { "docid": "c52a88166803a8089dcec7587f3e8e41", "score": "0.4867291", "text": "assembleGroup(signals = []) {\n const group = {};\n signals = signals.concat(this.assembleSignals());\n\n if (signals.length > 0) {\n group.signals = signals;\n }\n\n const layout = this.assembleLayout();\n\n if (layout) {\n group.layout = layout;\n }\n\n group.marks = [].concat(this.assembleHeaderMarks(), this.assembleMarks()); // Only include scales if this spec is top-level or if parent is facet.\n // (Otherwise, it will be merged with upper-level's scope.)\n\n const scales = !this.parent || isFacetModel(this.parent) ? assembleScales(this) : [];\n\n if (scales.length > 0) {\n group.scales = scales;\n }\n\n const axes = this.assembleAxes();\n\n if (axes.length > 0) {\n group.axes = axes;\n }\n\n const legends = this.assembleLegends();\n\n if (legends.length > 0) {\n group.legends = legends;\n }\n\n return group;\n }", "title": "" }, { "docid": "1fcde1a9fbb452590666c661f81c086b", "score": "0.48494413", "text": "aggregate(other) {\n this.value += other;\n }", "title": "" }, { "docid": "6a78a8caddec41186fd8237fd606e76b", "score": "0.4836557", "text": "postProcessor(hierarchyVals) {\n //if not implemented just return the same object\n return hierarchyVals;\n }", "title": "" }, { "docid": "41f01b860ff7bcac43002aabd94b029f", "score": "0.4817763", "text": "makeModels(data) {\n var result = [];\n for(var key in data) {\n result.push(new SummaryEntry(data[key]));\n }\n return result;\n }", "title": "" }, { "docid": "cdf805c73c7df6d6552e3dc9f7eaaec9", "score": "0.47948807", "text": "function _Aggregate(foo) { /* Intf1 .. Intfn */\r\n if (foo instanceof Function) {\r\n Interface.RegisterInterface.apply(_Aggregate, arguments);\r\n return Interface.RegisterInterface.call(new Interfaces(arguments), foo);\r\n }\r\n }", "title": "" }, { "docid": "9302230ee691bc2081fa1f328f41ba79", "score": "0.47723952", "text": "buildPipeline() {\n if (this.built) {\n throw new Error('build() has already been called: can only call it once');\n }\n this.doBuildPipeline();\n this.built = true;\n }", "title": "" }, { "docid": "e281fb229c3ab567b0ad1f9bab4a0a1b", "score": "0.47723827", "text": "function createBatcher() {\n var queue = new Set();\n var add = function (child) { return queue.add(child); };\n var flush = function (_a) {\n var _b = _a === void 0 ? defaultHandler : _a, measureLayout = _b.measureLayout, layoutReady = _b.layoutReady;\n var order = Array.from(queue).sort(sortByDepth);\n /**\n * Write: Reset any transforms on children elements so we can read their actual layout\n */\n order.forEach(function (child) { return child.resetTransform(); });\n /**\n * Read: Measure the actual layout\n */\n order.forEach(measureLayout);\n /**\n * Write: Notify the VisualElements they're ready for further write operations.\n */\n order.forEach(layoutReady);\n /**\n * After all children have started animating, ensure any Entering components are set to Present.\n * If we add deferred animations (set up all animations and then start them in two loops) this\n * could be moved to the start loop. But it needs to happen after all the animations configs\n * are generated in AnimateSharedLayout as this relies on presence data\n */\n order.forEach(function (child) {\n if (child.isPresent)\n child.presence = Presence.Present;\n });\n queue.clear();\n };\n return { add: add, flush: flush };\n}", "title": "" }, { "docid": "5b42053ec1c9dee818bdc765049db4e1", "score": "0.47708842", "text": "function runAggregation() {\n sub._ids = sub._ids || {};\n sub._iteration = sub._iteration || 0;\n var matchedLocations = Positions.aggregate(pipeline);\n _(matchedLocations).forEach(function(location){\n var _id = location.createdBy;\n if(typeof sub._ids[_id] !== 'undefined'){\n // Aggregate and update our collection with the new data changes\n sub.changed('positions', location.createdBy, location);\n }\n else {\n // Aggregate and then add a new record to our collection\n sub.added('positions', location.createdBy, location);\n }\n sub._ids[_id] = sub._iteration++;\n });\n }", "title": "" }, { "docid": "b969d0964a28fd1b31c09c2d6df2ba44", "score": "0.47626808", "text": "function flattenAggregations (aggregations) {\n var articles = []\n aggregations.forEach(function (result) {\n articles = articles.concat(result)\n })\n return articles\n }", "title": "" }, { "docid": "b6181e020bed9c31443c4869b9b44026", "score": "0.4749278", "text": "function AddTransformer() {}", "title": "" }, { "docid": "c2efbd1f32b47fccabb74ac78e16ff74", "score": "0.47482976", "text": "eventListeners() {\n\n let that = this;\n\n // Event triggered when item is added\n this.onAddSubscribe = this.eventAggregator.subscribe( that.nameOnAdd, evt => {\n let src = evt.from;\n let dest = evt.to;\n let item = evt.item;\n\n // Dragging widget into new page\n if ( item.dataset.type ) {\n let type = item.dataset.type;\n let qId = item.dataset.value;\n let path = item.dataset.html;\n\n let itemInstance = {};\n itemInstance.type = type;\n itemInstance.qId = qId;\n itemInstance.path = path;\n itemInstance.name = type + '_' + qId;\n\n that.object.elements.splice( evt.newIndex, 0, itemInstance );\n\n var i = 0;\n that.object.elements.forEach( function ( element ) {\n console.log( element );\n element.index = i;\n i++;\n } );\n\n }\n } );\n\n\n // // Events for when sorting takes place, we need to update the array to let\n // // Aurelia know that changes have taken place and our repeater is up-to-date\n // this.onUpdateSubscribe = this.eventAggregator.subscribe( that.nameOnUpdate, evt => {\n // // The item being dragged\n // let el = evt.item;\n //\n // // Old index position of item\n // let oldIndex = evt.oldIndex;\n //\n // // New index position of item\n // let newIndex = evt.newIndex;\n //\n // that.collectionUtil.updatePositions( newIndex, oldIndex, that.object, true );\n //\n // if( that.object.type === 'scales' ){\n // let data = {oldIndex:oldIndex, newIndex:newIndex};\n // this.eventAggregator.publish( that.object.id + '-swap-scales', data );\n // }\n //\n // } );\n }", "title": "" }, { "docid": "265fe11ff8a4f85c8afd596e19ab77d0", "score": "0.472781", "text": "function setUpAg(){\n\t/*\n\t\t\"important\" set is \"p\", \"blockquote\", and \"h4\"\n\t\tthe \"<H2>\" title element right before the clauses start is the \"start\" element\n\t\taggregator handles elements and assembling them into a favorable format\n\t\t\"end\" element is either null(end of DOM level)\n\t*/\n\t\n\t// Initialize\n\tag = new Aggregator({\n\t\timportantTags:\n\t\t\t[\"P\", \"BLOCKQUOTE\", \"H4\", \"H2\"],\n\t\t\t\n\t\tblacklistedTags:\n\t\t\t[\"FONT\"],\n\t\t\t\n\t\tfalsePositiveFirstCharacters:\n\t\t\t['=', '°', 'K', 'N']\n\t});\n\t\n\t// Add important tags\n\t//ag.addImportantTags();\n\t\n\t// Add blacklist tags\n\t//ag.addBlacklistTags([\"FONT\"]);\n\t\n\t// Add blacklisted false positive inducing second word first characters\n\t//ag.addFalsePositiveFirstCharacters(['=', '°', 'K', 'N']);\n}", "title": "" }, { "docid": "dedbea0cd83f0fc192b78af15cf1184b", "score": "0.4684856", "text": "function aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = accessorFields(key).concat(accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse);\n\n // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n}", "title": "" }, { "docid": "ae810b5f003235f8ca1714483d7d1226", "score": "0.4647662", "text": "function aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = vegaUtil.accessorFields(key).concat(vegaUtil.accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse); // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n } // Generate aggregate field accessor.", "title": "" }, { "docid": "8539025cb3078e286e8f62d963865ce5", "score": "0.46470383", "text": "function postAggregationCalculations() {\n\n var totals = {};\n\n var data = self.extractData();\n\n data.forEach(function(d) {\n\n calculateMeans(d);\n\n calculateCumulativeValues(d, totals);\n\n });\n\n if (correlationPairProperties.length > 0) {\n\n calculateCorrelations();\n\n }\n\n // Run any user injected functions post aggregation\n postAggregation(self);\n }", "title": "" }, { "docid": "5def49a02658d469d9313c959edf5ad1", "score": "0.46444964", "text": "if (typeof saga === 'function') {\n return [saga];\n }", "title": "" }, { "docid": "a9be04ff6a02c161af530de3093bc300", "score": "0.46382034", "text": "ingest() {\n\n\t}", "title": "" }, { "docid": "d17ad801a30c6a26c0febbd163140b4f", "score": "0.46316373", "text": "function Aggregate(parent) {\n Grid.Inject(GridAggregate);\n this.parent = parent;\n this.flatChildRecords = [];\n this.summaryQuery = [];\n }", "title": "" }, { "docid": "f8279ccfe890a9c583f602fbe345ae5b", "score": "0.4624189", "text": "collect(matcher) {\n let result = this.children.map(p => p.collect(matcher)).flat();\n if (matcher(this)) {\n result.unshift(this);\n }\n return result;\n }", "title": "" }, { "docid": "aa7f8b73ed5a8ad4548258cad458aa05", "score": "0.46198985", "text": "function transform() {}", "title": "" }, { "docid": "9c1efb1877bb6953d8a18a65ae281a7a", "score": "0.46014684", "text": "function JobStatsAggregator(collection, statsKey, idKey) {\n this.statsKey = statsKey || '95thPercentile';\n this.idKey = idKey || 'name';\n this.processCollection(collection);\n }", "title": "" }, { "docid": "450f7e9e4659078e35ae89134070e024", "score": "0.45943683", "text": "addPatternMethods() {\n // XXX shouldn't use audio id by default... sigh\n const id = Gibber.Audio.Gibberish.utilities.getUID()\n\n // store ids of all controlled sequencers\n const seqIds = []\n for( let key in this.seqs ) {\n seqIds.push( this.seqs[ key ].id )\n }\n\n // this object will be transferred to audio thread\n const obj = { id, seqIds }\n\n groupMethodNames.forEach( name => {\n // EASY PART \n this[ name ] = function( ...args ) { \n for( let key in this.seqs ) { \n this.seqs[ key ].values[ name ].apply( this, args ) \n } \n }\n\n this[ name ].sequencers = []\n this[ name ].seq = ( values, timings, number = 0, delay = 0 ) => {\n const s = Gibber.Seq({ \n values, \n timings, \n target:this.__wrapped,\n key:name,\n priority:1,\n }).start()\n \n this[ name ].sequencers.push( s )\n\n // needed for annotations\n this[ name ][ number ] = s\n\n return this \n } \n\n // store function body to create function in audio thread representation of steps\n // needs to be one line for stringify / parsing\n // XXX ugh arguments? is there ever more than one argument?\n obj[ name ] = `for( let seq of this.seqs ) { seq.values.${name}.apply( this, arguments ); seq.timings.${name}.apply( this, arguments )}`\n })\n\n // HARD PART\n // code to be evaluated in audio thread\n // 1. create a new object, steps, bassed on stringifying obj\n // 2. add all of the transform methods\n // 3. store all controlled sequencers in steps.seqs after getting references\n // from Gibberish.ugens \n const code = `const steps = JSON.parse( \\`${JSON.stringify(obj)}\\` )\n const methods = ${JSON.stringify( groupMethodNames ) }\n steps.seqs = steps.seqIds.map( id => Gibberish.ugens.get( id ) )\n for( let method of methods ) {\n steps[ method ] = new Function( steps[ method ] ) \n }\n Gibberish.ugens.set( steps.id, steps )`\n \n Gibber.Audio.Gibberish.worklet.port.postMessage({\n address:'eval',\n code\n }) \n\n this.__wrapped = obj\n }", "title": "" }, { "docid": "641e39abd0f45cc1301760d09c6644c6", "score": "0.45936972", "text": "function aggregateParams(_, pulse) {\n const key = _.field, value = _.value, op = (_.op === 'count' ? '__count__' : _.op) || 'sum', fields = vegaUtil.accessorFields(key).concat(vegaUtil.accessorFields(value)), keys = pivotKeys(key, _.limit || 0, pulse);\n // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n }", "title": "" }, { "docid": "827647ef4333465afdc2358241ea3d57", "score": "0.4588547", "text": "function aggregate(data, fcn) {\n // Aggregator functions are closures that maintain an internal state,\n // and are called over and over, accumulating state. Each as a res()\n // function to return a final (possibly calculated) result.\n\n function sum(name) {\n let total = 0;\n return {\n agg: (v) => {\n if (_isNaN(v)) return; // ignore NaN\n total += v;\n },\n res: () => total,\n };\n }\n\n function max(name) {\n let _max = 0;\n return {\n agg: (v) => {\n if (_isNaN(v)) return; // ignore NaN\n if (v > _max) _max = v;\n },\n res: () => _max,\n };\n }\n\n function min(name) {\n let _min = 0;\n return {\n agg: (v) => {\n if (_isNaN(v)) return; // ignore NaN\n if (v < _min) _min = v;\n },\n res: () => _min,\n };\n }\n\n function count(name) {\n let total = 0;\n return {\n agg: (v) => {\n if (_isNaN(v)) return; // ignore NaN\n total += 1;\n },\n res: () => total,\n };\n }\n\n function mean(name) {\n let acc = 0;\n let total = 0;\n return {\n agg: (v, data, weight) => {\n if (_isNaN(v)) return; // ignore NaN\n acc += v;\n total += 1;\n },\n res: () => acc / total,\n };\n }\n\n // aggregator name => aggregator function lookup\n const aggFcns = {\n sum,\n max,\n min,\n mean,\n count,\n };\n\n let res = {\n // [metricName1]: aggregatorFunction,\n // [metricName2]: aggregatorFunction,\n // etc ... will build up as we iterate over data, even if data have different shapes\n };\n data.forEach((chunk) => {\n Object.keys(chunk).forEach((field) => {\n if (!_isNumber(chunk[field])) return; // only numbers.\n // if we haven't seen this metric before, add it to res, with the proper function\n let _fcn = fcn;\n if (typeof fcn === 'object') _fcn = fcn[field];\n if (!_fcn) _fcn = \"sum\"; // because some fields are present that are ignored\n if (!res[field]) res[field] = aggFcns[_fcn](field);\n // and now call the agg function with the value, the chunk data and weight function\n res[field].agg(chunk[field], chunk);\n });\n });\n // Now we have a single object (res) with\n // [metricName1]: aggregatorFunction,\n // [metricName2]: aggregatorFunction,\n // where each aggregator function is a closure with accumulated state ...\n // Iterate through those keys, calling the .res() part of the closure to get the final result,\n // and transfer that (key => result) to the final result.\n let result = {...data[0]};\n Object.keys(res).forEach((field) => {\n if (res[field] && res[field].res) {\n result[field] = res[field].res();\n }\n });\n return result;\n}", "title": "" }, { "docid": "d3e85b1645d890db54d0b8de87d0bcbe", "score": "0.4584975", "text": "function nuggetFactory (animalInput) {\n\t// chickens are cut up\n\tcutUpInput(animalInput);\n\t// chickens are separated into chunks\n\t// take the chunks and fry them\n\t//package the nuggets\n}", "title": "" }, { "docid": "c46c65c9a737fe66026e78f3e372e04d", "score": "0.45790425", "text": "function createBatcher() {\n var queue = new Set();\n return {\n add: function (child) { return queue.add(child); },\n flush: function (_a) {\n var _b = _a === void 0 ? defaultHandler : _a, measureLayout = _b.measureLayout, layoutReady = _b.layoutReady, parent = _b.parent;\n var order = Array.from(queue).sort(_render_utils_compare_by_depth_js__WEBPACK_IMPORTED_MODULE_0__[\"compareByDepth\"]);\n var resetAndMeasure = function () {\n /**\n * Write: Reset any transforms on children elements so we can read their actual layout\n */\n order.forEach(function (child) { return child.resetTransform(); });\n /**\n * Read: Measure the actual layout\n */\n order.forEach(measureLayout);\n };\n parent\n ? parent.withoutTransform(resetAndMeasure)\n : resetAndMeasure();\n /**\n * Write: Notify the VisualElements they're ready for further write operations.\n */\n order.forEach(layoutReady);\n /**\n * After all children have started animating, ensure any Entering components are set to Present.\n * If we add deferred animations (set up all animations and then start them in two loops) this\n * could be moved to the start loop. But it needs to happen after all the animations configs\n * are generated in AnimateSharedLayout as this relies on presence data\n */\n order.forEach(function (child) {\n if (child.isPresent)\n child.presence = _types_js__WEBPACK_IMPORTED_MODULE_1__[\"Presence\"].Present;\n });\n queue.clear();\n },\n };\n}", "title": "" }, { "docid": "1217a56164b43506c127893f45215d72", "score": "0.4578982", "text": "buildOwnQuery(query) {\n if (!this.loadAggregations) {\n return query\n } else {\n return query.setAggs(\n FilterBucket(\n this.uuid,\n this.createAggFilter(query),\n ...this.fieldContext.wrapAggregations(\n this.getTermsBucket(query),\n CardinalityMetric(`${this.key}_count`, this.key)\n )\n )\n )\n }\n }", "title": "" }, { "docid": "0acff05800d3205dfbb628d9f661d81c", "score": "0.4572062", "text": "function callAggregate() {\n \"use strict\";\n\n var allNodes = JSON.parse(localStorage.nodes),\n selectedNode = $(\"#node option:selected\").val(),\n filename = [\"Port\", selectedNode, allNodes[selectedNode].output],\n calculation = $(\"#method option:selected\").val(),\n interval = $(\"#interval option:selected\").val(),\n out = $(\"#outtime option:selected\").val(),\n cyclic = $(\"input[name='cyclic']:checked\").val();\n\n var repopulateVals = {\n \"html\" : \"stepHTML/aggregate.html\",\n \"values\" : {\n \"#calc\" : calculation,\n \"#node\" : filename[1],\n \"#interval\" : interval,\n \"#outtime\" : out\n }\n };\n\n var cyclicSelector = \"input[name='\" + cyclic + \"']\";\n repopulateVals.values[cyclicSelector] = true;\n\n aggregate(filename, calculation, interval, out, cyclic, repopulateVals);\n}", "title": "" }, { "docid": "0320d21d5beafe61f2649b0e5c9911b6", "score": "0.4570762", "text": "transformRegistry(registry) {\n if (!registry) {\n this.logger.warn('Unable to transform empty registry');\n } else {\n if (!registry.applications.application) {\n return;\n }\n const newCache = { app: {}, vip: {} };\n if (Array.isArray(registry.applications.application)) {\n registry.applications.application.forEach((app) => {\n this.transformApp(app, newCache);\n });\n } else {\n this.transformApp(registry.applications.application, newCache);\n }\n this.cache = newCache;\n }\n }", "title": "" }, { "docid": "17b8a7eba8ed472499af12e2481afd74", "score": "0.45703733", "text": "function extend(){\n\t\tvar args = [this];\n\t\targs.push.apply(args, arguments);\n\t\treturn Compose.apply(0, args);\n\t}", "title": "" }, { "docid": "ecb8777733f6f194508bb6e612d9a9de", "score": "0.45435023", "text": "function _runJobStreetAggregation(){\n console.log('STARTED _runJobStreetAggregation');\n var date = new Date();\n\n var pipeline = [\n { \n $match: {\n title: {$ne: null},\n description: {$ne: null}\n }\n },\n { \n $project: {\n _id: 0,\n ref_id: \"$_id\",\n rawTitle: '$title',\n rawDescription: '$description',\n newTitleTags: { $literal: null } ,\n newDescriptionTags: { $literal: null } ,\n createdAt: { $literal: date } \n }\n },\n { $out: 'JSNewTags'}\n ];\n\n console.log('COMPLETED _runJobStreetAggregation');\n return JobStreetItems.aggregate(pipeline, {allowDiskUse: true});\n}", "title": "" }, { "docid": "41eaa91a0ffc6fe3318ca6485767c721", "score": "0.45420802", "text": "_resolveItem (item, params, fn, next) {\n if (item instanceof Pipeline) {\n return item.compose(params, fn)(next)\n }\n return fn(item, params.concat(next))\n }", "title": "" }, { "docid": "3b0eb572cd18b862d39c0eaac25b6791", "score": "0.45407996", "text": "collect(handler) {\r\n return this.flatten().map(handler);\r\n }", "title": "" }, { "docid": "1a0b97c17800914137236f5aeb5c591e", "score": "0.45091644", "text": "getItems() {\n const items = super.getItems()\n return items.map(item => ({\n ...item,\n doc_count: item[REVERSE_NESTED_AGG_KEY]\n ? item[REVERSE_NESTED_AGG_KEY].doc_count\n : item.doc_count\n }))\n }", "title": "" }, { "docid": "22b52010e98bd276e04192386aa54870", "score": "0.45044944", "text": "static from(array){\n let groupFrom= new Group;\n for (let value of array){\n groupFrom.add(value);\n }\n return groupFrom;\n }", "title": "" }, { "docid": "3bdd8e7204feffce8d84c3b34c6d2ec5", "score": "0.44920352", "text": "joinComplexes(complexes) {\n // clear target complex\n this._chains = [];\n this._components = [];\n this._helices = [];\n this._sheets = [];\n this.structures = [];\n this._atoms = [];\n this._residues = [];\n this._bonds = [];\n this._sgroups = [];\n\n const self = this;\n let atomBias = 0;\n let bondBias = 0;\n let residueBias = 0;\n let chainBias = 0;\n let componentBias = 0;\n\n function processAtom(atom, bias) {\n atom._serial += bias;\n atom._index += bias;\n }\n\n function processBond(bond, bias) {\n bond._index += bias;\n }\n\n function processResidue(residue, bias) {\n residue._index += bias;\n }\n\n function processChain(chain, bias) {\n chain._complex = self;\n chain._index += bias;\n }\n\n function processComponent(component, bias) {\n component._complex = self;\n component._index += bias;\n }\n\n /**\n * Simple function to do nothing.\n */\n function doNothing() {\n }\n\n for (let i = 0; i < complexes.length; ++i) {\n const c = complexes[i];\n this.addElement(c._atoms, this._atoms, atomBias, processAtom);\n this.addElement(c._bonds, this._bonds, bondBias, processBond);\n this.addElement(c._residues, this._residues, residueBias, processResidue);\n this.addElement(c._chains, this._chains, chainBias, processChain);\n this.addElement(c._sheets, this._sheets, 0, doNothing);\n this.addElement(c._helices, this._helices, 0, doNothing);\n this.addElement(c._sgroups, this._sgroups, 0, doNothing);\n this.addElement(c._components, this._components, componentBias, processComponent);\n this.addElement(c.structures, this.structures, 0, doNothing);\n // merge residue types\n for (const rt in c._residueTypes) {\n if (c._residueTypes.hasOwnProperty(rt)) {\n this._residueTypes[rt] = c._residueTypes[rt];\n }\n }\n\n atomBias += c._atoms.length;\n bondBias += c._bonds.length;\n residueBias += c._residues.length;\n chainBias += c._chains.length;\n componentBias += c._components.length;\n }\n\n this._computeBounds();\n }", "title": "" }, { "docid": "ba81e716875a3c5828b9a527ea001713", "score": "0.44876325", "text": "function correlationReduceAdd(aggregatedData) {\n\n var globalData = aggregatedData;\n\n /*\n * This is the function that does the reduction to produce working data for correlation calculations.\n */\n return function(workings, addingData) {\n\n allCorrelationProperties.forEach(function(propertyName) {\n\n if (addingData.hasOwnProperty(propertyName)) {\n\n // get this grouping from the global data\n var groupData = insight.utils.takeWhere(globalData, 'key', self.dimension.aggregationFunction(addingData))[0].value;\n\n // get the group mean from global data for this grouping\n var groupMean = groupData[propertyName].mean;\n\n var value = addingData[propertyName];\n var deviation = value - groupMean;\n var deviationSquared = deviation * deviation;\n\n // we need to track each deviation and its square so add them to workings\n if (!workings[propertyName]) {\n workings[propertyName] = {\n deviation: [],\n deviationSquared: []\n };\n }\n\n workings[propertyName].deviation.push(deviation);\n workings[propertyName].deviationSquared.push(deviationSquared);\n\n }\n\n });\n\n // having added to the deviation and deviationSquared we can now add\n // the product of each pair's deviations to the workings object\n correlationPairProperties.forEach(function(pair) {\n\n var xName = pair[0],\n yName = pair[1],\n xDeviation = insight.utils.lastElement(workings[xName].deviation),\n yDeviation = insight.utils.lastElement(workings[yName].deviation),\n correlationName = deviationProductNameFunction(xName, yName);\n\n if (!workings[correlationName]) {\n workings[correlationName] = [];\n }\n\n workings[correlationName].push(xDeviation * yDeviation);\n\n });\n\n return workings;\n\n };\n\n }", "title": "" }, { "docid": "e7b8305fc529bbeef2de504705aaab31", "score": "0.44799942", "text": "build() {\n // create a promise\n const deferred = q.defer();\n // builder pipe\n const builders = [];\n // add a build pipe for each module\n for (const mod of this.modules) {\n builders.push((callback) => {\n mod.build().then(() => {\n callback();\n });\n });\n }\n // executing all builders\n waterfall(builders, () => {\n deferred.resolve({ error: false, message: 'Success building Modules of project' });\n });\n // return promise\n return deferred.promise;\n }", "title": "" }, { "docid": "0c55c76b6b0fb758b014b39e3653301f", "score": "0.4477603", "text": "meals() {\n return this.deliveries().map(\n function (delivery) {\n return delivery.meal();\n }.bind(this)\n );\n }", "title": "" }, { "docid": "7964d7ff8c5c96b4f9d1bb3df7793ddc", "score": "0.44675747", "text": "function manipulators(prototype) {\n\n prototype.manipulators = function() {\n return [this.export(false), {\n type: 'group',\n from: {\n mark: this.name,\n transform: [\n {\n type: ns('manipulators_' + this.type),\n lyra_id: this._id\n },\n {\n type: 'facet',\n groupby: ['manipulator']\n }\n ]\n },\n marks: TYPES\n }];\n };\n\n}", "title": "" }, { "docid": "285f5787f9a121c383cc62465ce51b7a", "score": "0.44640136", "text": "function calculateAndGroup(source){\n let transformed = d3.nest()\n .key(d => d.date).sortKeys(d3.descending)\n .key(d => d.continentLabel)\n .rollup(d => {\n return {\n amountOfCountryItems: Number(d3.sum(d.map(itemsPerCountry => itemsPerCountry.choCount))),\n contLat: d[0].contLat,\n contLong: d[0].contLong,\n country: d[0].landLabel,\n countryLat: d[0].countryLat,\n countryLong: d[0].countryLong,\n continent: d[0].continentLabel,\n date: d[0].date\n }\n })\n .entries(source);\n return transformed\n }", "title": "" }, { "docid": "56c9fc71f5d264c9e7050d82d4da84aa", "score": "0.44618574", "text": "visitKwAggregate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c1a99d36188de06a3ab08c651956a96d", "score": "0.44603115", "text": "function genPack(root){\n\t\t\t\tvar escape = [],\n\t\t\t\tresult = d3.layout.pack()\n\t\t\t\t\t\t .padding(1.2)\n\t\t\t\t\t\t .size([180, 180])\n\t\t\t\t\t\t .radius(4)\n\t\t\t\t\t\t .children(function(d) { return d.values; })\n\t\t\t\t\t\t .nodes({values: root});\n\t\t\t\tescape.push(result);\n\t\t\t\treturn(escape);\n\t\t}", "title": "" }, { "docid": "d8f02bf1f0b938b27a8c40faa4e49204", "score": "0.44530007", "text": "pipe(processor) {\n this._pipeline.push(processor);\n return this;\n }", "title": "" }, { "docid": "84a8d3b3b4300b2851e2167b206edc8c", "score": "0.44438305", "text": "aggregate(other) {\n if (other === undefined) {\n return;\n }\n if (this.sum === undefined) {\n this.sum = other;\n }\n else {\n this.sum += other;\n }\n }", "title": "" }, { "docid": "708d71eed8a47c172b18046d839ec2c7", "score": "0.44430354", "text": "get transformedDataMaps() {\n //trace();\n // returns boxed computed, whose value can be reached by .get()\n // if we'd call .get() in here (returning the value), each change would lead to applying all transformations\n // because transformedDataMaps() would be observering all stepResults\n // would be nice to find a way for transformedDataMaps to just return the value instead of a boxed computed\n const results = new Map();\n let stepResult = mobx.observable.box(this.dataMapCache, { deep: false });\n this.transformations.forEach(({name, fn}) => {\n let prevResult = stepResult; // local reference for closure of computed\n stepResult = mobx.computed(\n () => {\n //trace();\n const previous = prevResult.get();\n //const t0 = performance.now();\n const result = fn(previous);\n //const t1 = performance.now();\n //pipelineTime += t1 - t0;\n //console.log('Pipeline ' + fn.name + ':', t1-t0, 'Total:', pipelineTime);\n return result;\n }, \n { name }\n );\n results.set(name, stepResult);\n });\n results.set('final', stepResult);\n return results;\n }", "title": "" }, { "docid": "93a4df845562883defbcdad4b4086d46", "score": "0.44403258", "text": "initialGroup() {\n\n // Keep track of groups by 2-dimensional array\n let groups = [];\n for (let i = 0; i < this.variables.length + 1; i++) {\n groups.push([]);\n }\n\n // Iterate through values\n for (const value of this.allValues) {\n\n // Count number of 1's in value's bit equivalent\n let count = 0;\n let bits = this.getBits(value);\n for (const bit of bits) {\n if (bit == \"1\") {\n count += 1;\n }\n }\n\n // Add count to proper group\n groups[count].push(new Minterm([value], bits));\n }\n\n return groups;\n }", "title": "" }, { "docid": "60b70c38002c0192e508250feeba4448", "score": "0.44382936", "text": "generateAggregateEventsArray() {\n return [\n { \n aggregateType: 'Device',\n messageType: 'gateway.graphql.query.getDevicesLocation' \n },\n { \n aggregateType: 'Device',\n messageType: 'gateway.graphql.query.getDeviceGroups' \n }\n ];\n}", "title": "" }, { "docid": "a6ceee34ff2985031a48447e05869376", "score": "0.4433202", "text": "add(...args){\n //add to the start of the array so we can iterate forwards\n this.functions.push(args);\n return this;\n }", "title": "" }, { "docid": "9dec4c35a7509b538abfb98d729b1834", "score": "0.44329536", "text": "collectionOfExtractors(extractors) {\n \treturn function(sample, features) {\n \t\tfor (var i=0; i<extractors.length; ++i)\n \t\t\textractors[i](sample, features);\n \t}\n }", "title": "" }, { "docid": "3cd298acf7bb51c91f8765d8227d18a6", "score": "0.44305354", "text": "function transformData(data) {\n\tlet result = _.groupBy(data, 'agency');\n\tvar i = 0;\n\tlet tempRoot = {\n\t\t\"name\": \"flare\",\n\t\t\"children\": []\n\t};\n\n\t// Re-structure data\n\tfor (let agency in result) {\n\t\tresult[agency] = _.groupBy(result[agency], 'subagency');\n\t\ttempRoot.children.push({ \"name\": agency, \"children\": [] });\n\n\t\tfor (let subagency in result[agency]) {\n\t\t\tif (result[agency][subagency] && result[agency][subagency].length > 0) {\n\t\t\t\tresult[agency][subagency] = result[agency][subagency][0].obligation;\n\t\t\t} else {\n\t\t\t\tresult[agency][subagency] = 0;\n\t\t\t}\n\t\t\ttempRoot.children[i].children.push({ \"name\": subagency, \"children\": [], \"color\": null, \"size\": result[agency][subagency] });\n\t\t}\n\t\ti++;\n\t}\n\n\trecipient = result;\n\n\t// add color\n\tfor (var i = 0; i < tempRoot.children.length; i++) {\n\t\tfor (var j = 0; j < tempRoot.children[i].children.length; j++) {\n\t\t\ttempRoot.children[i].children[j].color = color[i];\n\t\t}\n\t}\n\treturn tempRoot;\n}", "title": "" }, { "docid": "d658f33cc28b53dca6b856cd972d6e9f", "score": "0.44271824", "text": "addItems(items) {\n items\n .map(item => this.addItem(item))\n .forEach(item => item && item.closure());\n }", "title": "" }, { "docid": "a2e13ad8294f14cf6ef96c5ffbabdc0e", "score": "0.44200256", "text": "constructor() { \n \n AggregateResponse.initialize(this);\n }", "title": "" }, { "docid": "9bf603a26f1512019072786babcbf9aa", "score": "0.4415416", "text": "function AnimationObjectGroup(){this.uuid=_Math.generateUUID();// cached objects followed by the active ones\nthis._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;// threshold\n// note: read by PropertyBinding.Composite\nvar indices={};this._indicesByUUID=indices;// for bookkeeping\nfor(var i=0,n=arguments.length;i!==n;++i){indices[arguments[i].uuid]=i;}this._paths=[];// inside: string\nthis._parsedPaths=[];// inside: { we don't care, here }\nthis._bindings=[];// inside: Array< PropertyBinding >\nthis._bindingsIndicesByPath={};// inside: indices in these arrays\nvar scope=this;this.stats={objects:{get total(){return scope._objects.length;},get inUse(){return this.total-scope.nCachedObjects_;}},get bindingsPerObject(){return scope._bindings.length;}};}", "title": "" }, { "docid": "9bf603a26f1512019072786babcbf9aa", "score": "0.4415416", "text": "function AnimationObjectGroup(){this.uuid=_Math.generateUUID();// cached objects followed by the active ones\nthis._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;// threshold\n// note: read by PropertyBinding.Composite\nvar indices={};this._indicesByUUID=indices;// for bookkeeping\nfor(var i=0,n=arguments.length;i!==n;++i){indices[arguments[i].uuid]=i;}this._paths=[];// inside: string\nthis._parsedPaths=[];// inside: { we don't care, here }\nthis._bindings=[];// inside: Array< PropertyBinding >\nthis._bindingsIndicesByPath={};// inside: indices in these arrays\nvar scope=this;this.stats={objects:{get total(){return scope._objects.length;},get inUse(){return this.total-scope.nCachedObjects_;}},get bindingsPerObject(){return scope._bindings.length;}};}", "title": "" }, { "docid": "a273d68393d54368d5b72755583a73d3", "score": "0.4405827", "text": "function EventSourcedAggregate(){\n\t/**\n\t * Aggregate ID, used when loading (rehydrating) the object from an Event Sink.\n\t * @private\n\t * @type string\n\t */\n\tthis._aggregateID = undefined;\n\t/**\n\t * Pending event sequence number, used for event ordering and optimistic concurrency collision detection.\n\t * @private\n\t * @type number\n\t */\n\tthis._nextSequenceNumber = 1;\n\t/**\n\t * Array of the events to be saved to the Event Sink within a single commit when commit() is called.\n\t * @private\n\t * @type module:esdf/core/Event~Event[]\n\t */\n\tthis._stagedEvents = undefined;\n\t/**\n\t * The assigned Event Sink that events will be committed to. This variable should be assigned from the outside using the assignEventSink method.\n\t * @private\n\t * @type Object\n\t */\n\tthis._eventSink = undefined;\n\t/**\n\t * Aggregate's proper type name - used to check if commits belong here when loading. Validation makes it impossible to apply another class's commits.\n\t * @private\n\t * @type string\n\t */\n\tthis._aggregateType = undefined;\n\t/**\n\t * Snapshotting strategy used while committing changes. The default is to save a snapshot every commit (if a snapshotter is at all available).\n\t * @private\n\t * @type function\n\t */\n\tthis._snapshotStrategy = SnapshotStrategy.every(1);\n\t/**\n\t * Whether to ignore missing event handlers when applying events (both online and during rehydration).\n\t * For example, if \"Done\" is the event name and there is no onDone method defined within the aggregate, an error would normally be thrown.\n\t * This safety mechanism is in place to catch programmer errors early.\n\t * Setting this flag to true will prevent error generation in such cases (when you need events without any handlers). It should be done in the aggregate's constructor or prototype, preferably.\n\t * @private\n\t * @type boolean\n\t */\n\tthis._allowMissingEventHandlers = false;\n\t/**\n\t * The object whose emit(operationOutcomeName, operationDetails) method shall be called when I/O operations finish or fail.\n\t * Supported operation names are ['CommitSinkSuccess', 'CommitSinkFailure', 'SnapshotSaveSuccess' 'SnapshotSaveFailure'].\n\t * For CommitSinkSuccess and CommitSinkFailure, the following fields in the operationDetails object are defined:\n\t * commitObject: contains the complete commit object which was due to be saved\n\t * Additionally, CommitSinkFailure defines the following fields:\n\t * failureReason: an error (from a lower layer - not necessarily an Error object) explaining why the sink operation failed\n\t * For SnapshotSaveSuccess and SnapshotSaveFailure, the following fields in the operationDetails object are defined:\n\t * snapshotObject: contains the complete snapshot object which was due to be saved\n\t * Additionally, SnapshotSaveFailure defines the following fields:\n\t * failureReason: an error (from a lower layer - not necessarily an Error object) explaining why the save operation failed\n\t * @private\n\t * @type {external:EventEmitter}\n\t */\n\tthis._IOObserver = null;\n}", "title": "" }, { "docid": "39d96dcd7515210349a484ebc274f1bc", "score": "0.44034413", "text": "transform(components){\n\t\tif(this.constructor.HOCs){\n\t\t\tconst HOCs=this.constructor.HOCs\n\t\t\treturn Object.keys(HOCs).reduce((transformed,k)=>{\n\t\t\t\ttransformed[k]=HOCs[k](components)\n\t\t\t\treturn transformed\n\t\t\t},{...components})\n\t\t}\n\t\treturn {...components}\n\t}", "title": "" }, { "docid": "33ff723c590151d09640f22c3eb0e95a", "score": "0.44023183", "text": "function makeTagGroup(dim, targetfact) {\n\n switch (targetfact) {\n case \"treeTags\":\n var group = dim.groupAll().reduce(\n function(p, v) {\n v.treeTags.forEach(function(val, idx) {\n p[val] = (p[val] || 0) + 1; //increment counts\n });\n return p;\n },\n function(p, v) {\n v.treeTags.forEach(function(val, idx) {\n p[val] = (p[val] || 0) - 1; //decrement counts\n });\n return p;\n },\n function() {\n return {};\n }\n ).value();\n group.all = function() {\n var newObject = [];\n for (var key in this) {\n if (this.hasOwnProperty(key) && key != \"all\" && key != \"top\") {\n newObject.push({\n key: key,\n value: this[key]\n });\n }\n }\n return newObject;\n };\n group.top = function(count) {\n var newObject = this.all();\n newObject.sort(function(a, b) {\n return b.value - a.value\n });\n return newObject.slice(0, count);\n };\n return group;\n break;\n case \"hazardTags\":\n var group = dim.groupAll().reduce(\n function(p, v) {\n v.hazardTags.forEach(function(val, idx) {\n p[val] = (p[val] || 0) + 1; //increment counts\n });\n return p;\n },\n function(p, v) {\n v.hazardTags.forEach(function(val, idx) {\n p[val] = (p[val] || 0) - 1; //decrement counts\n });\n return p;\n },\n function() {\n return {};\n }\n ).value()\n group.all = function() {\n var newObject = [];\n for (var key in this) {\n if (this.hasOwnProperty(key) && key != \"all\" && key != \"top\") {\n newObject.push({\n key: key,\n value: this[key]\n });\n }\n }\n return newObject;\n };\n group.top = function(count) {\n var newObject = this.all();\n newObject.sort(function(a, b) {\n return b.value - a.value\n });\n return newObject.slice(0, count);\n };\n return group;\n break;\n case \"propertyTags\":\n var group = dim.groupAll().reduce(\n function(p, v) {\n v.propertyTags.forEach(function(val, idx) {\n p[val] = (p[val] || 0) + 1; //increment counts\n });\n return p;\n },\n function(p, v) {\n v.propertyTags.forEach(function(val, idx) {\n p[val] = (p[val] || 0) - 1; //decrement counts\n });\n return p;\n },\n function() {\n return {};\n }\n ).value()\n group.all = function() {\n var newObject = [];\n for (var key in this) {\n if (this.hasOwnProperty(key) && key != \"all\" && key != \"top\") {\n newObject.push({\n key: key,\n value: this[key]\n });\n }\n }\n return newObject;\n };\n group.top = function(count) {\n var newObject = this.all();\n newObject.sort(function(a, b) {\n return b.value - a.value\n });\n return newObject.slice(0, count);\n };\n return group;\n break; \n }\n\n }", "title": "" }, { "docid": "38bae39044f37d001af7d0aeeb5eda2c", "score": "0.43987292", "text": "mk(ok, [[type, name]] = Object.entries(ok)){\n let ty = this.types.empl(type, {})[0];\n let ret = ty.empl(name, ctor(()=>new Mcl(this, type, name)))[0];\n this.props[name] = ret;\n return ret;\n }", "title": "" }, { "docid": "d1ba3010523bfaeb499d22c6da892341", "score": "0.4398234", "text": "get items() {\n // @ts-ignore\n\n // If the items have already been processed, it's an immediate return\n if (processedItems.length) {\n return processedItems;\n }\n\n const basePath = path.join(__basedir, 'src', 'pattern-library', 'patterns');\n\n // Gets pattern paths, excluding hidden files/folders\n const getPatternPaths = (refPath) => {\n return fs\n .readdirSync(refPath)\n .filter((item) => !/(^|\\/)\\.[^/.]/g.test(item));\n };\n\n // Parses out the pattern name from the last segment in its path\n const getPatternName = (patternPath) => {\n const pathParts = patternPath.split('/').filter((x) => x.length);\n return pathParts[pathParts.length - 1];\n };\n\n const patterns = getPatternPaths(basePath);\n\n // For creating a result collection\n const result = [];\n\n // This is used for both patterns and variants to grab markup, data and docs\n const buildPattern = (\n patternPath,\n patternName,\n parentPath = null,\n parentName = null,\n contextData = null,\n ) => {\n const response = {};\n\n // Attempt to load markup from the pass patternPath and patternName first,\n // but if that can’t be found, attempt to load from the parent instead, if\n // its details have been passed in\n if (fs.existsSync(path.resolve(patternPath, `${patternName}.njk`))) {\n response.markup = fs.readFileSync(\n path.resolve(patternPath, `${patternName}.njk`),\n 'utf8',\n );\n } else {\n if (parentPath !== null && parentName !== null) {\n if (fs.existsSync(path.resolve(parentPath, `${parentName}.njk`))) {\n response.markup = fs.readFileSync(\n path.resolve(parentPath, `${parentName}.njk`),\n 'utf8',\n );\n }\n }\n }\n\n // All markup avenues exhausted so time to bail out\n if (!response.markup.length) {\n console.log(\n warning(\n `Markup file, ${patternName}.njk wasn’t found, so this pattern (${patternPath}) can’t be built up`,\n ),\n );\n return null;\n }\n\n // If specific context data has been passed, we prioritise that\n if (contextData) {\n response.data = contextData.context\n ? contextData\n : {context: contextData};\n }\n // If not, we look for a data file\n else if (\n fs.existsSync(path.resolve(patternPath, `${patternName}.json`))\n ) {\n response.data = buildPatternData(\n fs.readFileSync(\n path.resolve(patternPath, `${patternName}.json`),\n 'utf8',\n ),\n path.resolve(patternPath, `${patternName}.json`),\n );\n }\n\n response.rendered = nunjucksEnv.renderString(response.markup, {\n data: response.data.context || {},\n });\n\n if (fs.existsSync(path.resolve(patternPath, `${patternName}.md`))) {\n response.docs = fs.readFileSync(\n path.resolve(patternPath, `${patternName}.md`),\n 'utf8',\n );\n }\n\n return response;\n };\n\n // Take data input and attempt to parse as JSON\n const buildPatternData = (input, filePath) => {\n try {\n return JSON.parse(input);\n } catch (ex) {\n console.log(\n error(\n `Pattern data was malformed and couldn’t be parsed (${filePath})`,\n ),\n );\n return {};\n }\n };\n\n // Loop each patterns folder, attempt to grab all the things and return\n // back a fully formed object to use\n patterns.forEach((item) => {\n const patternRoot = path.resolve(basePath, item);\n const patternName = getPatternName(patternRoot);\n const patternResponse = buildPattern(patternRoot, patternName);\n const patternVariantsRoot = path.resolve(patternRoot, 'variants');\n const patterVariantsData = patternResponse.data.variants || [];\n\n // Error will have been logged in buildPattern, but this is\n // not an acceptable response.\n if (!patternResponse) {\n return;\n }\n\n // Urls for pattern page and preview\n patternResponse.url = `/design-system/pattern/${patternName}/`;\n patternResponse.previewUrl = `/design-system/preview/${patternName}/`;\n\n // An empty container for variants for if one or the other methods of loading\n // them results in nothing\n patternResponse.variants = [];\n\n // If this pattern has a variants folder\n // run the whole process on all that can be found\n if (fs.existsSync(patternVariantsRoot)) {\n const variants = getPatternPaths(patternVariantsRoot);\n\n patternResponse.variants = variants.map((variant) => {\n const variantRoot = path.resolve(patternVariantsRoot, variant);\n const variantName = getPatternName(variantRoot);\n\n return {\n ...{\n name: variantName,\n previewUrl: `/design-system/preview/${patternName}/${variantName}/`,\n },\n ...buildPattern(variantRoot, variantName, patternRoot, patternName),\n };\n });\n }\n\n // If variants are defined in the root pattern's config,\n // we need to render them too, using the root pattern's markup\n if (patterVariantsData.length) {\n const dataVariantItems = [];\n\n patterVariantsData.forEach((variant) => {\n dataVariantItems.push({\n ...{\n name: variant.name,\n previewUrl: `/design-system/preview/${patternName}/${variant.name}/`,\n },\n ...buildPattern(patternRoot, patternName, null, null, {\n title: variant.title || variant.name,\n context: {...patternResponse.data.context, ...variant.context}, // Merge existing context with variant context so we don't have to repeat ourselves a lot\n }),\n });\n });\n\n // Now with the data variants built, we need to loop,\n // check that a file-based one wasn't already made,\n // then add it to the collection\n dataVariantItems.forEach((variantItem) => {\n const existingPattern = patternResponse.variants.find(\n (x) => x.name === variantItem.name,\n );\n\n // Variant data files take priority, so if a rendered pattern exists, bail on this iteration\n if (existingPattern) {\n console.log(\n warning(\n `The variant, ${variantItem.name} was already processed with a data file, which takes priority over variants defined in the root pattern’ (${patternName}) data file`,\n ),\n );\n return;\n }\n\n patternResponse.variants.push(variantItem);\n });\n }\n\n // Lastly, sort variants by name if pattern hasn't\n // specifically defined source order sorting\n if (patternResponse.data.sort !== 'source') {\n if (patternResponse.variants) {\n patternResponse.variants = patternResponse.variants.sort((a, b) =>\n a.name.localeCompare(b.name),\n );\n }\n }\n\n result.push(patternResponse);\n });\n\n processedItems = result;\n return result;\n }", "title": "" }, { "docid": "592b39267057f910bb1f5a1c11e53ada", "score": "0.43946597", "text": "function _compose() {\n \tvar args = arguments;\n \tvar start = args.length - 1;\n \treturn function () {\n \t\tvar i = start;\n \t\tvar result = args[start].apply(this, arguments);\n \t\twhile (i--) {\n \t\t\tresult = args[i].call(this, result);\n \t\t}return result;\n \t};\n }", "title": "" }, { "docid": "59b34135382fca6a40d3b0a17ab55f53", "score": "0.43909553", "text": "function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "59b34135382fca6a40d3b0a17ab55f53", "score": "0.43909553", "text": "function processor() {\n var destination = unified()\n var index = -1\n\n while (++index < attachers.length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "5d4019cf910b3dc6044b56fd6ab143b9", "score": "0.43906355", "text": "function processor() {\n\t\t\tvar destination = unified();\n\t\t\tvar length = attachers.length;\n\t\t\tvar index = -1;\n\n\t\t\twhile (++index < length) {\n\t\t\t\tdestination.use.apply(null, attachers[index]);\n\t\t\t}\n\n\t\t\tdestination.data(extend(true, {}, namespace));\n\n\t\t\treturn destination\n\t\t}", "title": "" }, { "docid": "3c5a82f35455c3c118576103cd27560d", "score": "0.4389643", "text": "static from (iterableObject) {\n let group = new Group;\n for (let item of iterableObject) {\n group.add(item);\n }\n return group;\n }", "title": "" }, { "docid": "5632e275a31b5fe5297b4d0f922449c7", "score": "0.43869093", "text": "function init() {\n _subMediator();\n }", "title": "" }, { "docid": "08b06e26f5d5115b698273e5f28993f0", "score": "0.438084", "text": "function Radium(ComposedComponent) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__enhancer__[\"a\" /* default */])(ComposedComponent);\n}", "title": "" }, { "docid": "53ddf69fd132c5f609ee8920efa756bb", "score": "0.4374443", "text": "function aggregateStaticWithMixins(key) {\n return _.compact([\n Pure[key] || {},\n ..._.map(Pure.mixins, (mixin) => _.isObject(mixin.props) && mixin.props[key]),\n ]);\n }", "title": "" }, { "docid": "99a7c9a348777479208100cd12c0a54e", "score": "0.43714488", "text": "function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "99a7c9a348777479208100cd12c0a54e", "score": "0.43714488", "text": "function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "99a7c9a348777479208100cd12c0a54e", "score": "0.43714488", "text": "function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "99a7c9a348777479208100cd12c0a54e", "score": "0.43714488", "text": "function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "99a7c9a348777479208100cd12c0a54e", "score": "0.43714488", "text": "function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "99a7c9a348777479208100cd12c0a54e", "score": "0.43714488", "text": "function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }", "title": "" }, { "docid": "4e4485aa478562fcc60a9eb5b99ce7a2", "score": "0.4369049", "text": "function processor() {\n\t\t\tvar destination = unified$1();\n\t\t\tvar length = attachers.length;\n\t\t\tvar index = -1;\n\n\t\t\twhile (++index < length) {\n\t\t\t\tdestination.use.apply(null, attachers[index]);\n\t\t\t}\n\n\t\t\tdestination.data(extend(true, {}, namespace));\n\n\t\t\treturn destination\n\t\t}", "title": "" }, { "docid": "cad1fd1af9f4ec37baa9d9847d90a3ae", "score": "0.43690258", "text": "buildJustInTime() {\n if (!this.built) {\n this.buildPipeline();\n }\n }", "title": "" }, { "docid": "5f7e3fbe77975803e3690102840060dd", "score": "0.43648037", "text": "function buildParser(...args) {\n return (result) => {\n if (result.stack.length !== args.length) {\n throw new Error(`Wrong number of items to parse! Expected ${args.length} but got ${result.stack.length}!`);\n }\n return result.stack.map((item, i) => args[i](item));\n };\n}", "title": "" }, { "docid": "dc537ba77ab6169da46c896acddab01a", "score": "0.43633145", "text": "transform(array, args) {\n const instance = this.createInstance(array, args);\n // create pagination information\n this.angularPaginatorService.registerInstance(instance);\n // set the slicing range\n const start = (instance.currentPage - 1) * instance.itemsPerPage;\n const end = instance.currentPage * instance.itemsPerPage;\n return array.slice(start, end);\n }", "title": "" }, { "docid": "0f088fa605bf06e7ce6e16d2f7979fd4", "score": "0.43621993", "text": "package() {\n let res = [];\n if (!this.root)\n return res;\n\n return this.packageR(this.root, res);\n }", "title": "" }, { "docid": "87f3245c8d10f982a62883893e4fa003", "score": "0.4361352", "text": "setupTarget( el, sort = true, group = 'group_' + this.object.id ) {\n let that = this;\n let name = \"sorted_\" + that.object.id;\n new sortable( el, {\n name: name,\n sort: sort,\n group: false,\n\n onAdd: evt => {\n that.eventAggregator.publish( that.nameOnAdd, evt );\n },\n onUpdate: evt => {\n\n let oldIndex = evt.oldIndex;\n let newIndex = evt.newIndex;\n let scaleIndex;\n\n if( that.object.type === 'steps' ){\n scaleIndex = that.object.elements[0].scaleIndex;\n }\n\n let data = {\n oldIndex: oldIndex,\n newIndex: newIndex,\n qNumber: that.object.elements[0].qNumber,\n type: that.object.type, //sortable list identificator\n scaleIndex: scaleIndex,\n };\n\n that.eventSources.addEvent( 'sortable.update', data );\n // that.eventAggregator.publish( that.nameOnUpdate, evt );\n }\n } );\n }", "title": "" }, { "docid": "aa10c07454100be3fe367ccca0731ebd", "score": "0.43610215", "text": "newGeneration() {\n\t\tthis.evalGeneration()\n\t\tvar topPerformer1 = this.population[0]\n\t\tvar topPerformer2 = this.population[1]\n\t\tthis.population = this.population.map(() => this.createChild())\n\n\t\t// ensure variance in new populations\n\t\tfor (var i = 0; i < 10; ++i)\n\t\t\tthis.population[i] = new Agent()\n\n\t\t// ensure that top performers are more favored in new population\n\t\tfor (var i = 10; i < 20; ++i)\n\t\t\tthis.population[i] = topPerformer1.reproduce(topPerformer2, this.mutationRate)\n\t}", "title": "" }, { "docid": "ca9221ec3ea192bc70c516048b8930a0", "score": "0.43608516", "text": "combinedObjects() {\n return [this];\n }", "title": "" }, { "docid": "a6f70fa56f6701dc9ea9a8df4bfe758a", "score": "0.4356668", "text": "function group()\n{\n return new Group(Array.prototype.slice.call(arguments));\n}", "title": "" }, { "docid": "4154409725b155ddb6712b5c313f4932", "score": "0.43558943", "text": "function _subMediator() {\n Mediator.sub(CFG.CNL.VIEW_LOAD, _create)\n .sub(CFG.CNL.VIEW_RESTORE, _restore)\n .sub(CFG.CNL.TERMS_SERVE, _updateTerms)\n .sub(CFG.CNL.FEATURED_SERVE, _updateFeatured);\n }", "title": "" }, { "docid": "6d133fe0643824a46bbfe3e630adf9d5", "score": "0.4352597", "text": "static aggregate(type, startMoment, endMoment) {\n // Assume we only have one FOI - as the endpoint requires\n // const properties = typeIds.map(t => new Type(t).property);\n const timestamps = generateTimestamps(startMoment, endMoment, 1, 'hours');\n const { property } = new Type(type);\n return timestamps.map((t) => {\n const bucket = { time_bucket: t };\n bucket[property] = {\n count: Math.round(Math.random() * 100),\n avg: Math.random(),\n };\n return bucket;\n });\n }", "title": "" } ]
98b9cad5018ba7909b3f8463609bff08
Reverse String adalah cara yang digunakan untuk membalikkan sebuah string atau kata di dalam bahasa pemrograman join => adalah method yang digunakan untuk menggabungkan seluruh array menjadi sebuah string split => Split digunakan untuk membagi string menjadi array substring dan mengembalikan array baru tanpa mengubah string asli Reverse No.1
[ { "docid": "d1a54181c303c787e761f67c4ab249e5", "score": "0.0", "text": "function kebalikan(){\n let cek= ['Saya','Belajar','Java Scirpt']\n console.log(cek.reverse()) \n}", "title": "" } ]
[ { "docid": "c4b2b479468cd54f449d16b2be288c6d", "score": "0.78768533", "text": "reverse(str){\n var splitString = str.split(\"\");\n var reverseArray = splitString.reverse();\n var joinArray = reverseArray.join(\"\");\n\n return joinArray;\n }", "title": "" }, { "docid": "d404c590c9ecf6d46108e7ce201e9a38", "score": "0.77024376", "text": "function reverse (str) { \n\n\tvar split_str = str.split(\"\");\n\n\n\tvar reverse_arr = split_str.reverse();\n\n\tvar join_array = reverse_arr.join(\"\");\n\n\treturn join_array\n\n}", "title": "" }, { "docid": "cffdae0b32e7327e2f85990c65735317", "score": "0.77000815", "text": "function reverse(str) {\n var splitString = str.split('')\n var reverseArray = splitString.reverse()\n var joinArray = reverseArray.join('')\n return joinArray\n\n}", "title": "" }, { "docid": "ca948d4ae1574b5301c34b5fd5ac7377", "score": "0.75346124", "text": "function reverseString(string){\n var arr=string.split(\"\");\n console.log(arr);\n var arrReverse=arr.reverse();\n console.log(arrReverse);\n return arrReverse.join(\"\")\n}", "title": "" }, { "docid": "bc05001b4f778f8af3a4c3ac8b6d300c", "score": "0.7461202", "text": "function reverse(string){\nmakeArray=string.split(\"\");\nreverseIt=makeArray.reverse();\nreturn backtoString=reverseIt.join(\"\");\n}", "title": "" }, { "docid": "926817a4737d7b91af1cccd53f9a3cb4", "score": "0.7399871", "text": "function reverseWithBuildInMethods (str) {\n\n \t// const arr = str.split('');\n \t// arr.reverse();\n \t// return arr.join('') \n\t//same as above, but in one line\n\treturn str.split(\"\").reverse().join(\"\");\n\n\t// return [...str].reverse().join('');\n}", "title": "" }, { "docid": "e1b730d77378870e1fa36d148d96b2f7", "score": "0.736784", "text": "function reverseString(str){\n // return str.split(\"\").reverse(\"\").join() is same as below\n const arr = str.split(\" \")\n console.log(arr)\n const reversed = arr.reverse()\n return reversed.join()\n}", "title": "" }, { "docid": "c8524a648de8149d6e73f7fc9b683a3b", "score": "0.7318667", "text": "function reverse(str) {\n var splitString = str.split(\"\")\n var reverseArray = splitString.reverse()\n var joinArray = reverseArray.join(\"\")\n return joinArray\n}", "title": "" }, { "docid": "218f3dc8bfe72956adb2ae943d6b41d6", "score": "0.7308309", "text": "function stringReverse(str) {\n //use the split() mehtod to return a new array\n let splitString = str.split(\"\");\n\n //use the reverse() mehod to revere the new creted array;\n let reverseArray = splitString.reverse();\n\n //use the join() mehod to join all elements of the array into string\n let joinArray = reverseArray.join(\"\");\n return joinArray;\n\n // we can do everything above in one line\n // return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "b23b75a2267047b77f1a1b3a35d541f0", "score": "0.7276817", "text": "function revString(str) {\n splitStr = str.split(\"\"); //split the string into array\n\n revStr = splitStr.reverse(); //reverse the Array\n\n joinArr = revStr.join(\"\");\n\n return joinArr;\n}", "title": "" }, { "docid": "633519b133754b31a292cacd7fdedb69", "score": "0.7275867", "text": "function reverseString_long(str) {\n // var arr = []\n // arr.push(str.split(''))\n var splitstring = str.split('')\n var arr = splitstring.reverse()\n var x = arr.join('')\n\n // console.log(arr);\n console.log(str);\n console.log(splitstring);\n console.log(x);\n return x;\n}", "title": "" }, { "docid": "191bb01fed3b186dc118555efca0d72b", "score": "0.72719663", "text": "function myReverseString(str){\nvar newString = \"\";\nvar newStingArray = str.split(\"\");\n\nfor (var i = newStingArray.length - 1; i >= 0; i--){\n newString = newString + newStingArray[i];\n }\n\n return newString;\n}", "title": "" }, { "docid": "319c9c96ae7670ccc3730347fbdafe56", "score": "0.726095", "text": "function simpleReverse(str){\n var myString = str.split(\"\");\n var result = \"\";\n for(var i= myString.length -1; i >= 0; i--){\n result += myString[i]; \n }\n return result;\n }", "title": "" }, { "docid": "7f15a08f0f9088d3061d7c9c5b7c17d0", "score": "0.72461045", "text": "function reverse(str) {\n var arr = str.split(\"\")\n // console.log(arr.length)\n var newArr = []\n for (let i = arr.length - 1; i >= 0; i--) {\n newArr.push(arr[i])\n }\n\n return newArr.join(\"\")\n // return str.split('').reverse().join('')\n}", "title": "" }, { "docid": "e4dbabdb3d2adef60fdd75276801c2d1", "score": "0.71829563", "text": "function reverse(str) {\n // Split string into an array\n const arr = str.split('');\n debugger;\n\n // Call reverse()\n arr.reverse();\n debugger;\n // Join back into a string\n newString = arr.join('');\n debugger;\n // Return string\n return newString;\n}", "title": "" }, { "docid": "577d97b499b7f21369323ce3238839d4", "score": "0.71757084", "text": "function reverse(str) {\n let strToArray = str.split('');\n // console.log(strToArray);\n let reversed = strToArray.reverse();\n // console.log(reversed);\n return reversed.join('');\n}", "title": "" }, { "docid": "5ca48b1c65bf24e5c0225898cb1f9e70", "score": "0.7165323", "text": "function reverseString(str) {\n //return str;\n var newArray = [];\n newArray = str.split(\"\");\n var revArray = [];\n revArray = newArray.reverse();\n var revString = '';\n revString = revArray.join(\"\");\n console.log(revString);\n return revString;\n}", "title": "" }, { "docid": "96d8e880488b22ccb23ab3662ef85ea7", "score": "0.7128907", "text": "function strReverse ( a ) {\nreturn a.split('').reverse().join('');\n}", "title": "" }, { "docid": "785d4b96d00194e353b31f028439211b", "score": "0.71261734", "text": "function reverseString(str) {\n var splitString = str.split(\"\"); //split the string into an array\n var reverseArray = splitString.reverse(); // reverse the array\n var joinArray = reverseArray.join(\"\"); // join all elements of the array into a string\n return joinArray;\n}", "title": "" }, { "docid": "d56827592a07c47fec3f545664a5c21a", "score": "0.7110698", "text": "function reverse (str) {\n let splitStr = str.split('')\n let reverseArray = splitStr.reverse()\n let joinArray = reverseArray.join('')\n return joinArray\n}", "title": "" }, { "docid": "1ebc168648d4df614b0c4727c15e2463", "score": "0.70699126", "text": "function reverseStr(someStr){\n someStr = someStr.split(\"\");\n someStr.reverse();\n someStr = someStr.join(\"\");\n return someStr;\n}", "title": "" }, { "docid": "d7f0ea94b54da94dbd2761f9967e2784", "score": "0.7041899", "text": "function reverse_a_string(string) {\nvar word = string.split(\"\").reverse().join('');\nconsole.log(word);\n}", "title": "" }, { "docid": "fbdb922d9f29ccda634c6e6d0546b662", "score": "0.7027352", "text": "function strReverse ( a ) {\n return a.split('').reverse().join('');\n }", "title": "" }, { "docid": "c67ca86ebdabd07d4bc7bc137edb4278", "score": "0.70217574", "text": "function strReverse(a) {\r\n return a\r\n .split(\"\")\r\n .reverse()\r\n .join(\"\");\r\n }", "title": "" }, { "docid": "67edf7fcbcbad9412abba4a95e55aeeb", "score": "0.70040613", "text": "function reverseWordsInString(arr){\n var result=\"\";\n var a;\n for(var i=0; i<arr.length; i++){\n a=arr[i];\n for(var j=a.length-1; j>=0; j--){\n result+=a[j];\n } \n result+=\" \";\n }\n\n document.getElementById('content').innerHTML =result;\n \n }", "title": "" }, { "docid": "aaa07860ba6f356d78bc3edcb93bcc4f", "score": "0.6978587", "text": "function solution(str){\n // let splitString = \"world\".split(\"\");\n let splitString = str.split(\"\");\n \n // let reverseArray = [\"w\", \"o\", \"r\", \"l\", \"d\"].reverse();\n // [\"d\", \"l\", \"r\", \"o\", \"w\"]\n let reverseArray = splitString.reverse();\n \n // let joinArray = [\"d\", \"l\", \"r\", \"o\", \"w\"].join(\"\");\n let joinArray = reverseArray.join(\"\");\n return joinArray;\n}", "title": "" }, { "docid": "e2214ddb2f9774eb9ac81f82b8ed614f", "score": "0.69752955", "text": "function reverse(str) {\r\n //check the i/p\r\n if (!str || str.length < 2 || typeof str !== \"string\") {\r\n return \"not a valid string\";\r\n }\r\n\r\n const revarr = [];\r\n const len = str.length - 1;\r\n for (let i = len; i >= 0; i--) {\r\n revarr.push(str[i]);\r\n }\r\n console.log(revarr);\r\n return revarr.join(\"\");\r\n}", "title": "" }, { "docid": "bff4d674ce98f91258824aba1a1067f5", "score": "0.69696563", "text": "function reverseStrings(arr) {\n let reversedStr = arr.reverse();\n console.log(reversedStr.join(' '));\n}", "title": "" }, { "docid": "883e902215879655c0d6b192c85471b8", "score": "0.6964469", "text": "function strReverse ( a ) {\n return a.split('').reverse().join('');\n }", "title": "" }, { "docid": "369acc16a2802e46d3d208e48e0f8295", "score": "0.69578683", "text": "function reverseSentence(str) {\n\n var splitSentence = str.split(\" \");\n\n var reverseSentence = splitSentence.reverse();\n\n var joinArray = reverseSentence.join(\" \");\n\n return joinArray;\n}", "title": "" }, { "docid": "3e8a7fff6d879c4586a1f11f8bd46833", "score": "0.69509006", "text": "function reverseBuiltIn(str){\n // return [...str].reverse().join('');\n // using spread operator to split string into array;\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "707578a0ef3cef1233834a769ddc636f", "score": "0.6946438", "text": "function jumble(string){\n\n // string = string.split(\"\");\n // var reversedString = string.reverse();\n // reversedString = reversedString.join('');\n // console.log(reversedString);\n\n\n //Refeactored\n string = string.split(\"\").reverse().join(\"\");\n console.log(string);\n}", "title": "" }, { "docid": "301be5034ce536e2c5b24fe259d4b14a", "score": "0.69367766", "text": "function strReverse(a) {\n return a.split('').reverse().join('');\n }", "title": "" }, { "docid": "301be5034ce536e2c5b24fe259d4b14a", "score": "0.69367766", "text": "function strReverse(a) {\n return a.split('').reverse().join('');\n }", "title": "" }, { "docid": "3b3d386f4c234b990827922dc69629d6", "score": "0.6932949", "text": "function reverseInput(str) {\n\tvar splitWord = str.split(\"\");\n\tvar reverseWord = splitWord.reverse();\n\tvar joinWord = reverseWord.join('');\n\tconsole.log(joinWord);\n}", "title": "" }, { "docid": "a3fa1c26b8189fd70184a016ddfb8bd9", "score": "0.6932614", "text": "function reverse(str){\n var rtnStr = [];\n if(!str || typeof str != 'string' || str.length < 2 ) return str;\n \n for(var i = str.length-1; i>=0;i--){\n rtnStr.push(str[i]);\n }\n return rtnStr.join('');\n }", "title": "" }, { "docid": "5dd7e5195998e7a47fa97a5373e4f86a", "score": "0.6922532", "text": "function reverseString(a){\n let result = \"\";\n for (let i = a.length - 1; i >= 0; i--){\n reslut += a[i];\n }\n return result;\n}", "title": "" }, { "docid": "4c5adf9b86109f61352d70681bf5df89", "score": "0.6911483", "text": "function reverseLyrics(arr) {\n var newStr = arr.reverse().join(' ')\n return newStr\n}", "title": "" }, { "docid": "4df5f032117bb3720e30bbcf37ce281a", "score": "0.69019693", "text": "function reverseString(str) {\n // return str.split('').reverse().join('');\n var stringArr = str.split('').reverse().join('');\n //chek work with console.log\n console.log(stringArr);\n // if everything works fine then return the stringArr\n return stringArr;\n }", "title": "" }, { "docid": "9bb8132fb984a0062de95cf69ac6610b", "score": "0.689712", "text": "function reverse(a){\n return a.split('').reverse().join('')\n}", "title": "" }, { "docid": "d56d154136dedd4f5b0ad56282838a30", "score": "0.6893358", "text": "function revStringOri(str) {\r\n const stringArray = str.split(''); // Seperate each letter from the string into their own arrays.\r\n stringArray.reverse();// Pass in the variable with the split letters and reverse the letters.\r\n return stringArray.join('');// Convert the reversed letters back into a string.\r\n console.log(stringArray);// Test output\r\n}", "title": "" }, { "docid": "4b5fdcc8039d30516a7b2c22621ef0f6", "score": "0.68855876", "text": "function strReverse ( a ) {\n\t\treturn a.split('').reverse().join('');\n\t}", "title": "" }, { "docid": "4b5fdcc8039d30516a7b2c22621ef0f6", "score": "0.68855876", "text": "function strReverse ( a ) {\n\t\treturn a.split('').reverse().join('');\n\t}", "title": "" }, { "docid": "4b5fdcc8039d30516a7b2c22621ef0f6", "score": "0.68855876", "text": "function strReverse ( a ) {\n\t\treturn a.split('').reverse().join('');\n\t}", "title": "" }, { "docid": "4b5fdcc8039d30516a7b2c22621ef0f6", "score": "0.68855876", "text": "function strReverse ( a ) {\n\t\treturn a.split('').reverse().join('');\n\t}", "title": "" }, { "docid": "f4320bff5598a0b4e65703b733558b6d", "score": "0.68841434", "text": "function reversedShortStrArr(str){\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "01b34601abcbd116f0ec6ceea042d203", "score": "0.68827987", "text": "function reverseStr1(str){\n //turn str to an array of characters\n const arr = str.split('')\n //use reverse method\n arr.reverse()\n return arr.join('')\n}", "title": "" }, { "docid": "754a48f702e5c3a97dd83c79e6c79e31", "score": "0.6879274", "text": "function reverseString(str) {\n //check input\n if (!str || str.length < 2 || typeof str !== 'string') {\n return 'Invalid string to reverse.'\n }\n\n const backwards = [];\n const totalItems = str.length - 1;\n\n for (let i = totalItems; i >= 0; i--){\n backwards.push(str[i]);\n }\n console.log(backwards);\n\n // return backwards.toString //option 1\n return backwards.join('') //option 2: join all the items in array\n}", "title": "" }, { "docid": "250ce758afad59d884c70ad05414fa35", "score": "0.68624264", "text": "function strReverse(a) {\n\t\treturn a.split('').reverse().join('');\n\t}", "title": "" }, { "docid": "250ce758afad59d884c70ad05414fa35", "score": "0.68624264", "text": "function strReverse(a) {\n\t\treturn a.split('').reverse().join('');\n\t}", "title": "" }, { "docid": "5cc5ee0785b313f99e6504a6ec78b2bb", "score": "0.68613565", "text": "function stringReverse() {\n \n var string = \"Hello World!\";\n var reversed = string.split(\"\").reverse().join(\"\");\n // var reversed = \"\";\n // for (var i=string.length-1; i>=0; i--) {\n\n // var char = string[i];\n // reversed += char;\n // }\n\n console.log(reversed);\n}", "title": "" }, { "docid": "2b0daaaf0f8ee9f908c42c8268a874fb", "score": "0.68491507", "text": "function reverse(r){\n // YOUR CODE HERE\n return r.split (\"\").reverse.join(\"\");\n}", "title": "" }, { "docid": "b776fb5aae4f69a5efddd7db6fd4def3", "score": "0.68358153", "text": "function reverseStrings2(arr) {\n\n for(let i = 0; i < Math.floor(arr.length / 2); i++) {\n let temp = arr[i];\n arr[i] = arr[arr.length - (i + 1)]\n arr[arr.length - (i + 1)] = temp;\n }\n console.log(arr.join(' '));\n}", "title": "" }, { "docid": "ef25b1ba3901565090df8d7c932f255f", "score": "0.68350005", "text": "function reverseString(a){\n return a.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "eb86411df99155427aaaf41ecd6b70c2", "score": "0.68318135", "text": "function reverse(){\n \"use strict\";\n return phrase.split('').reverse().join('');\n }", "title": "" }, { "docid": "f0093aacd3675eebc02905ae21a41206", "score": "0.682984", "text": "function reverString(str){\n \n //Method 1\n //Convert string to array first using split\n //Then reverse the array using revers\n //Parse the array back in to the string using join\n return str.split('').reverse().join('');\n\n //Method 2\n //initialise an empty string called revString\n //Run through an array , start from back to front\n //for every visited index concat to the front of the string\n let revString = ''\n for(let i = str.length -1 ; i >= 0 ; i--){\n revString = revString + str[i]\n }\n return revString\n}", "title": "" }, { "docid": "016efdcab3d70cd405bffe2d64d11af6", "score": "0.68297523", "text": "function reverse(string){\n\tvar strArray = string.split(\"\");\n\tvar answerString = \" \";\n\tconsole.log(answerString);\n\t// need to use .length -1 because the length of the array is not zero indexed\n\t// so length returns a value that is index + 1\n\tfor (i = strArray.length - 1; i >= 0; i--){\n\t\tanswerString += strArray[i];\n\t}\n\treturn answerString;\n}", "title": "" }, { "docid": "0e0b053d0547f2d2b06bae87c24ddf27", "score": "0.6822379", "text": "function reverseString(str) {\n var splitStr = str.split(\"\");\n var reverseArr = splitStr.reverse();\n var joinArr = reverseArr.join(\"\");\n return joinArr;\n}", "title": "" }, { "docid": "1b9fdeba44446dde638203f64b75ecd0", "score": "0.6815899", "text": "function reverse(str) {\n let arr = str.split('');\n for (let leftIndex =0; leftIndex < arr.length/2; leftIndex++) {\n const rightIndex = arr.length - 1 - leftIndex\n const temp = arr[leftIndex]\n arr[leftIndex] = arr[rightIndex]\n arr[rightIndex] = temp\n }\n return arr.join('')\n}", "title": "" }, { "docid": "44f6492e0719ae87a26705229d428904", "score": "0.68091244", "text": "function reverse(string){\n\tvar stringToArray = string.split('');\n var reversedArray = stringToArray.reverse();\n var revArrayToRevString = reversedArray.join('');\n return revArrayToRevString;\n}", "title": "" }, { "docid": "d4fbea4adf23dbf2eafca7191c02bf73", "score": "0.6804004", "text": "function reverse(str) {\n\tvar rtnString = [];\n\tif (!str || typeof str !== 'string' || str.length < 2) return str;\n\n\tfor (var i = str.length - 1; i >= 0; i--) {\n\t\trtnStr.push(str[i]);\n\t}\n\treturn rtnStr.join('');\n}", "title": "" }, { "docid": "fafc09a9b46d7f1e0d3d21b0a9976c4f", "score": "0.67997503", "text": "function reverseString(array){\n let i = 0;\n let j = array.length - 1\n while (i < j) {\n let holder = array[i];\n array[i] = array[j];\n array[j] = holder;\n i++;\n j--;\n }\n return array;\n}", "title": "" }, { "docid": "b5025c6d2927a75d5fe1522cea1cf2b8", "score": "0.6790855", "text": "function reverse(phrase){\n \"use strict\";\n //...\n var phraseArray = phrase.split(\"\");\n // console.log(phraseArray);\n var phraseReverse = phraseArray.reverse();\n // console.log(phraseReverse);\n var phraseJoined = phraseReverse.join(\"\");\n // console.log(phraseJoined);\n return phraseJoined;\n console.log(phraseJoined);\n}", "title": "" }, { "docid": "85b0bc77cefacdced56eae8496d11cc2", "score": "0.678266", "text": "function reverse(string) {\r\n\tvar protoanswer = [];\r\n\tvar phase1 = string.split(\"\");\r\n\tfor (var i = phase1.length; i >= 0; i--) {\r\n\t\tprotoanswer.push(phase1[i]);\r\n\t}\r\n\tvar answer = protoanswer.join(\"\");\r\n\treturn answer;\r\n}", "title": "" }, { "docid": "cde0a329a496cd8ed397791af7ad4552", "score": "0.67699015", "text": "function reverse(str) {\n var arrString = str.split(\"\");\n var reverse = arrString.reverse();\n return reverse.join(\"\");\n}", "title": "" }, { "docid": "3014819d5a767c85f3a29f7f0a95595b", "score": "0.6763218", "text": "function reverse(str) {\n\t// check input\n\tif (!str || str.length < 2 || typeof str !== 'string') {\n\t\treturn 'uhmm that is not good'\n\t}\n\n\tconst backwards = []\n\tconst totalItems = str.length - 1\n\n\tfor (let i = totalItems; i >= 0; i--) {\n\t\tbackwards.push(str[i])\n\t}\n\n\tconsole.log(backwards)\n\treturn backwards.join('')\n}", "title": "" }, { "docid": "bfe65cf49d09d8735e482ca06dde7ed8", "score": "0.67619836", "text": "function reverseString(reverse) {\n\tvar backwards = \"\" //Make new variable, leave it empty until after for loop\n\tfor(var i = reverse.length - 1; i >= 0; i--) { //You want to count back so use i>=0 and i--\n\t\tbackwards += reverse[i]\n\t}\n\treturn backwards\n}", "title": "" }, { "docid": "6bd434eff9e242f1cc57156c34351adf", "score": "0.67518204", "text": "function reverseSlice(str) {\n \n str = [...str].reduce((accumulator, currentValue) => currentValue + accumulator, '')\n const arr = [];\n for(let i=0; i < str.length; i++){\n arr.push(str.slice(0 + i))\n }\n return arr\n \n \n }", "title": "" }, { "docid": "3010d7ae592692a95db339a0a144a021", "score": "0.6749714", "text": "function reverse1(str) {\r\n return str.split(\"\").reverse().join(\"\");\r\n}", "title": "" }, { "docid": "b812c5d49bc16049186af2ccfb5b6108", "score": "0.67366695", "text": "function reverseString(string) {\n reverseArray = []\n for (var i = (string.length - 1); i >= 0; i--) {\n reverseArray.push(string[i]);\n }\n console.log(reverseArray.join());\n return reverseArray.join();\n}", "title": "" }, { "docid": "261ccb4a399c421ba31c577afcad6bb0", "score": "0.6727684", "text": "function reverse(string){\n var reversed_string = string.split(\"\").reverse().join(\"\");\n return reversed_string\n\n}", "title": "" }, { "docid": "d6a893f1f3a82172e3bb62b40adbf350", "score": "0.67186713", "text": "function reverse(str) {\n // check input\n if (!str || str.length <2 || typeof str !== 'string') {\n return 'not a reversible string'\n }\n\n // create a backwards array\n const backwards = [];\n // track the elements in the string\n const totalItems = str.length - 1;\n // loop through the string\n for (let i = totalItems; i >= 0; i--) {\n backwards.push(str[i]);\n }\n console.log(backwards);\n\n\n // return the array that is reversed as a string using join() method\n return backwards.join('');\n}", "title": "" }, { "docid": "961d42700e250e07dfde459477c882be", "score": "0.67178816", "text": "function reverse_string(string){\n var string_array = string.split(\"\");\n var reverse_array = []\n for (var i = 0; i <= string_array.length; i++){\n reverse_array.push(string_array[string_array.length-i]);\n }\n return reverse_array.join(\"\");\n}", "title": "" }, { "docid": "c1e00330e5ea273f41214ce25d9f81af", "score": "0.6714387", "text": "function reverseString(a){\n let result = \"\";\n for (let i = a.length - 1; i >= 0; i--){\n result += a[i];\n }\n return result;\n}", "title": "" }, { "docid": "c4424c82970ca2af16137ad1ae906051", "score": "0.6712377", "text": "function reverseParola(str) {\r\n return str.split(\"\").reverse().join(\"\");\r\n}", "title": "" }, { "docid": "5435a32e240be5615eed8f4b3b32929e", "score": "0.6696856", "text": "function reverseString(name){\n \nfor(i=name.length-1;i>=0;i--){\n \n reverse = reverse + (name[i])\n // console.log(reverse)\n }\n console.log(reverse) \nreturn name;\n}", "title": "" }, { "docid": "c6b91b91ed8d25c68e2722bec3204a53", "score": "0.6693892", "text": "function reverseStr(str)\n{\n\tvar splitStr = str.split(\"\");\n\tconsole.log(splitStr);\n\tvar reverseString = [];\n\tfor(var i = 0, j = splitStr.length - 1; i <= splitStr.length -1 ; i++, j--)\n\t{\n\t\t\n\t\t\treverseString[i] = splitStr[j];\n\n\t}\n\n\treturn reverseString.toString().replace(/[&\\/\\\\#,+()$~%.'\":*?<>{}]/g, '');\n}", "title": "" }, { "docid": "1846a119d9adc91eeeb7dcea7195fb7d", "score": "0.6685271", "text": "function reverse(x){\n\nvar first_array = x.split('').map(function(n) {\n return (n);\n}); \nvar reverse_string = \"\";\n\nvar reversefunc = function (y) {\nvar reversed = y.reverse();\nreversed.map(function(n) {\nreverse_string += n;\n})};\n\nreversefunc (first_array);\nreturn reverse_string;\n\n}", "title": "" }, { "docid": "00a84b504ef3f6f3d08b2550c806846e", "score": "0.6675352", "text": "function reverse(text) {\n var textArray = text.split(\"\");\n var textArrayReverse = textArray.reverse();\n var textArrayJoin = textArrayReverse.join(\"\");\n return textArrayJoin;\n}", "title": "" }, { "docid": "081643a2dfb2454a44fbaa9ff7417f92", "score": "0.66649866", "text": "function reverse2(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "85028f5d101d7905981c2c87d9a50da8", "score": "0.6663347", "text": "function simpleReverse(str) {\n return str\n .split('')\n .reverse()\n .join('');\n}", "title": "" }, { "docid": "5adf96088f3ca08ea68dfbf967d9fc07", "score": "0.66568214", "text": "function reverse(inputForReversal) {\n var items = [];\n var reversedItems = [];\n var isString = false;\n\n if (typeof inputForReversal === \"string\") {\n items = inputForReversal.split(\"\");\n isString = true;\n } else {\n items = inputForReversal;\n }\n\n for (var i = (items.length - 1); i >= 0; i--) {\n reversedItems.push(items[i]);\n }\n\n return isString ? reversedItems.join('') : reversedItems; \n}", "title": "" }, { "docid": "4d8605d1cf6601abd1e0429d923189d5", "score": "0.66566676", "text": "function reverse(str) {\n str = str.split('');\n var len = str.length,\n halfIndex = Math.floor(len / 2) - 1,\n revStr;\n for (var i = 0; i <= halfIndex; i++) {\n revStr = str[len - i - 1];\n str[len - i - 1] = str[i];\n str[i] = revStr;\n }\n return str.join('');\n }", "title": "" }, { "docid": "a7f0a938d314391cafd4f51b1ed68a1f", "score": "0.6649589", "text": "function reverseStr(str){\n// return str.split('').reverse().join('')\n let newStr = ''\n for(let i = str.length - 1; i>=0;i--){\n newStr += str[i]\n }\n return newStr\n}", "title": "" }, { "docid": "1397b0d696a58a5b7d00b080dd74ea76", "score": "0.6647162", "text": "function reverseMe(str){\n var reversed = str.split(\"\").reverse().join('')\n return reversed\n}", "title": "" }, { "docid": "fed7a9770065a2ec7107121eb5b867ca", "score": "0.6632812", "text": "function reverse(string){\n \"use strict\";\n\n var reverseString;\n\n reverseString = string.split('').reverse().join('');\n\n //console.log(reverseString);\n\n return reverseString;\n\n\n\n //...\n}", "title": "" }, { "docid": "716ee687081fb498f757e4ff6c035e78", "score": "0.6627573", "text": "function reverseString(a) {\n\treturn a.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "e1db7375d040ec79ede28bb8b93f72ae", "score": "0.66263145", "text": "function reverse2(input) {\n return input.split(\"\").reverse().join('');\n}", "title": "" }, { "docid": "29fd273841c66c9b7106d2ec0e22b986", "score": "0.66237146", "text": "function stringReverse (someString2) {\n var arr3 = (someString2.split('')).reverse();\n var newWord = '';\n for (var i = 0; i < arr3.length; i++) {\n newWord = newWord + arr3[i];\n }\n return newWord;\n}", "title": "" }, { "docid": "dbf81dad5b98f8cdb9537ac418b31fb0", "score": "0.66236156", "text": "function reverse(s) {\n return s.split('').reverse().join('');\n }", "title": "" }, { "docid": "6a3e2e1f2940f5d24a81594cb2aae23d", "score": "0.66219574", "text": "function reverseString(a){\n var reversed = '';\n var split = a.split(\" \");\n \n for(let word of split){\n reversed = word + \" \" +reversed;\n }\n \n return reversed;\n}", "title": "" }, { "docid": "2b3836e59f01633a745dabc370964869", "score": "0.6619162", "text": "function reverse(input){\n\tvar result = [];\n\tfor(var i = input.length - 1; i >= 0; i--){\n\t\tresult.push(input[i]);\n\t}\n\treturn result.join(\"\");\n}", "title": "" }, { "docid": "3c7e465306c284eff16f3deafbcaba2d", "score": "0.6618307", "text": "function reverse2(str) {\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "10ed03ea32b83613a3f67bd1b40c0fb5", "score": "0.66163003", "text": "function reverse(stringTest){\n var newString = stringTest.split('').reverse().join('')\n return newString\n }", "title": "" }, { "docid": "7ce448213ca703e5b60789b15c0bf733", "score": "0.6605897", "text": "function reverse (string) {\n let arr = string.split()\n console.log(arr)\n}", "title": "" }, { "docid": "511dce9f37babeee121d96859d0b7d87", "score": "0.6598774", "text": "function reverseString(str){\n return str.split('').reverse().join('');\n //console.log(\"function is working.\");\n}", "title": "" }, { "docid": "5e126cbc2e9707f1d9df5e30e5a9ed3e", "score": "0.6591858", "text": "function stringReverse( str ) {\n let array = str.split('').reverse().join('')\n return(array)\n}", "title": "" }, { "docid": "60698d3977137de12123ac7fe8d0c053", "score": "0.6591252", "text": "function reverse(string) {\r\n var s = \"\"; // empty string in order to store array\r\n for (var i = string.length - 1; i >= 0; i--) { // .length - 1 in order to get rid of undefined\r\n s += string[i]; // stores array into string to display\r\n }\r\n console.log(s);\r\n}", "title": "" }, { "docid": "e8db375fdb8420288beb50e6b4a2025e", "score": "0.65713537", "text": "reverse(input){\n return input.split('').reverse().join(\"\");\n }", "title": "" }, { "docid": "2e7696560635d519a435e5cbb7dc8a5c", "score": "0.6566607", "text": "function reverse(string){\n return string.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "7492e742a6e3f1d486fcf9ef33a43fb3", "score": "0.65641904", "text": "function reverse (string){\n\t var newString = \"\";\n\t \tfor (var i = string.length - 1; i >= 0; i--) { \n newString = newString + string[i];\n }\n\treturn newString;\n}", "title": "" } ]
26056bb738ca798b7ffc4ab8398692f0
Method to load a 221 Lego block object
[ { "docid": "ea5221fa08dfa7430c9e1235ed0f8af9", "score": "0.6147977", "text": "function modelo_221(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 221;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_221.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =0;\n\t\t\t\t\tobject.position.y =93.5;\n\t\t\t\t\tobject.position.z =-14.5;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1;\n\t\t\t\tobject.scale.y=1;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 2;\n\t\t\t\tobject.height = 1;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, BlockType, modelo_color);\n\t\t\n\t\t\n\t}", "title": "" } ]
[ { "docid": "6cadd08fffa5cf9c7311e7dca057acbd", "score": "0.69626015", "text": "load() {\n try {\n this.blocks = Serializer_1.deserialize(block_1.Block, JSON.parse(fs.readFileSync(this.storagePath, \"utf8\")));\n }\n catch (err) {\n if (err.code !== \"ENOENT\") {\n throw err;\n }\n this.blocks = [Blockchain.GENESIS_BLOCK];\n }\n finally {\n this.verify();\n }\n }", "title": "" }, { "docid": "cddbc194924bdbea3e98f58e668419be", "score": "0.6569553", "text": "load() {\n\t\tthrow new Error(\n\t\t\t`Method 'load' not implemented for 'block' base class.`);\n\t}", "title": "" }, { "docid": "3de3c6b94acddea997245f95a20a6c2d", "score": "0.6108629", "text": "function modelo_281(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 281;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_281.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-64;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-90\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 8;\n\t\t\t\tobject.height = 1;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "69142ef7c0fd4653a837198caea1e9e8", "score": "0.60834754", "text": "function loadMap() {\n\tvar block;\n\tfor ( var i = 0; i < 13; i++) {\n\t\tfor ( var j = 0; j < 13; j++) {\n\t\t\tvar type = landMap[j][i];\n\t\t\tswitch (type) {\n\t\t\tcase BRICK:\n\t\t\t\tblock = new Brick(i, j);\n\t\t\t\tbreak\n\t\t\tcase GRASS:\n\t\t\t\tblock = new Grass(i, j);\n\t\t\t\tbreak\n\t\t\tcase LAND:\n\t\t\t\tblock = new Land(i, j);\n\t\t\t\tbreak\n\t\t\tcase STEEL:\n\t\t\t\tblock = new Steel(i, j);\n\t\t\t\tbreak\n\t\t\tcase RIVER:\n\t\t\t\tblock = new River(i, j);\n\t\t\t\tbreak\n\t\t\tcase EAGLE:\n\t\t\t\tblock = new Eagle(i, j);\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tblock.createBlock();\n\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "d60fe267cc9ab1c2d2cea892c2454b5c", "score": "0.6071325", "text": "function modelo_242(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 242;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_242.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-32;\n\t\t\t\t\tobject.position.y =29;\n\t\t\t\t\tobject.position.z =-90;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1;\n\t\t\t\tobject.scale.y=1;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 4;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "114357c6412666061255b78f2691a07c", "score": "0.59991807", "text": "function modelo_213(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 213;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_213.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =0;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 1;\n\t\t\t\tobject.height = 3;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "38eeabbca8124bd1e83537f230bde948", "score": "0.59845865", "text": "static load(addr){\n // Load Part Data from Accompanying JSON File:\n let data = JSON.parse(fs.readFileSync(addr, 'utf8'));\n data.costTable = new CostTable(data.costTable) || new CostTable();\n data.sourcingCostTable = new CostTable(data.sourcingCostTable) || new CostTable();\n\n return new Part(addr, data);\n }", "title": "" }, { "docid": "9b861daf80c52d03a0e7617c4c4cb8c6", "score": "0.59662074", "text": "function modelo_222(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 222;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_222.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-16;\n\t\t\t\t\tobject.position.y =94.1;\n\t\t\t\t\tobject.position.z =-14.5;\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1;\n\t\t\t\tobject.scale.y=1;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 2;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color,\"Normal\");\n\t\n\t}", "title": "" }, { "docid": "8c4d87c6ae41c9bf74e421f869fc0205", "score": "0.59595054", "text": "function Block(PartCode, Type, Color, PosX, PosZ, objHeight, objLength){\n\t\t\n\t\tthis.PartCode = PartCode;\t//Specific part code of the piece instanciated\n\t\tthis.Type = Type;\t\t\t//There are 3 types: Chassis, Normal, Special\n\t\tthis.Color = Color;\t\t\t//Color\n\t\tthis.PosX = PosX;\t\t\t//Horizontal position\n\t\tthis.PosZ = PosZ;\t\t\t//Vertical position\n\t\tthis.objHeight = objHeight;\t//Heigth of the Lego block (1, 2 or 3)\n\t\tthis.objLength = objLength;\t//Length of the Lego block \n\t\t\n\t}", "title": "" }, { "docid": "9e4eeb44f25f346309763d5a487a4a68", "score": "0.5905687", "text": "function modelo_241(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 241;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_241.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =14;\n\t\t\t\t\tobject.position.y =36.5;\n\t\t\t\t\tobject.position.z =-17.5;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1;\n\t\t\t\tobject.scale.y=1;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 4;\n\t\t\t\tobject.height = 1;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "016c45bbf80bac5824913b57df99e46d", "score": "0.58994067", "text": "function modelo_232(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 232;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_techo_232.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object\n\t\t\t\t\tobject.position.x =0;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 3;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "6a525beea640c120d80c313fdc8e66a8", "score": "0.58985186", "text": "function modelo_233(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 233;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_techo_233.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =0;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 3;\n\t\t\t\tobject.height = 3;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "51fbf5a6ffcd1972930aabfb4509146e", "score": "0.5891243", "text": "function modelo_261(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 261;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_261.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-49;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-90\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 6;\n\t\t\t\tobject.height = 1;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "7c1ad2b3e724057eb9adae2d92ebbb66", "score": "0.58763534", "text": "function modelo_232_w(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 232;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_232_ww.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =0;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego bloc\n\t\t\t\tobject.length = 3;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "e7a7e3739800fbc04cff48b5aef192a3", "score": "0.58521694", "text": "function modelo_222_w(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 222;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_ventana_222.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-16;\n\t\t\t\t\tobject.position.y =94.1;\n\t\t\t\t\tobject.position.z =-14.5;\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1;\n\t\t\t\tobject.scale.y=1;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 2;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color,\"Normal\");\n\n\t}", "title": "" }, { "docid": "12f2273a70ecdab81a7748cd91ef6e42", "score": "0.58422136", "text": "static initialize(obj, block) { \n obj['block'] = block;\n }", "title": "" }, { "docid": "df7fc088c2030b72fcf71d3c300b4676", "score": "0.5840029", "text": "function modelo_222_w_recto(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 222;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_ventana_recto_222.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-16;\n\t\t\t\t\tobject.position.y =94.1;\n\t\t\t\t\tobject.position.z =-14.5;\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\t\t\t\t\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1;\n\t\t\t\tobject.scale.y=1;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 2;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\n\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color,\"Normal\");\n\n}", "title": "" }, { "docid": "ea15d1492ed84cdd6d4cab4e12b61e35", "score": "0.57795405", "text": "function InitFindMainBlockFirstLayer() {\r\n\tTargetBlock = new Block(0,0,1,2,2,1); \t\r\n\tModeStatus = ModeStatusEnum.FindMainBlockFirstLayer;\r\n}", "title": "" }, { "docid": "a6310c4a813991fec70a5dc5c2243ebb", "score": "0.57588667", "text": "_get_block(ref) {\r\n if (this.ctx !== undefined) {\r\n //a very paranoid test, for edge cases\r\n //where ctx.object is not the same as\r\n //ctx.datalib.get(new DataRef(ctx.object))\r\n //\r\n //I might get rid of it later.\r\n if (ref.lib_id === this.ctx.object.lib_id)\r\n return this.ctx.object;\r\n else\r\n return this.ctx.datalib.get(ref);\r\n }\r\n }", "title": "" }, { "docid": "fd48bcff8e8e232aeff14eeb84441422", "score": "0.5756464", "text": "load (cb) {\n const ext = this._getExt()\n const filename = path.resolve(this.dirname, 'VSOP87' + this.type + '.' + ext)\n fs.readFile(filename, 'utf8', (err, data) => {\n if (!err) {\n this.parse(data)\n }\n cb(err)\n })\n }", "title": "" }, { "docid": "aec2cf42a0df198ebd77fb44c55e982f", "score": "0.5715357", "text": "createBlock() {\n // TBD\n }", "title": "" }, { "docid": "ee5c67ce2e682c47cf122a983e1e6b0b", "score": "0.56595474", "text": "define() {\n if (!this.name) {\n throw 'Block definition does not have a valid name. Cannot be added to ' +\n 'Blockly.Blocks map.';\n return;\n }\n const json = JSON.parse(this.json);\n Blockly.Blocks[this.name] = {\n init: function() {\n this.jsonInit(json);\n }\n };\n }", "title": "" }, { "docid": "65cac72aff886586ef4c341c1a68412b", "score": "0.5638215", "text": "handle_block() {\n var active_block = this.get_block_by_name(this.syntaxReader.read_name());\n // Maybe uncomment this, for the wheel package example I made som changes is the get_block_by_name function and pushed the block there instead\n //this.active_package.add_block(active_block);\n // This was done to make sure the block created after being referenced as parts still got the same object reference at both places\n\n var next_char = this.syntaxReader.check_next_word();\n //var next_char = this.syntaxReader.read_next_char();\n // console.log(active_block, next_char);\n switch(next_char) {\n case \";\":\n this.syntaxReader.skip_next_char();\n // Done\n return;\n case \"{\":\n this.syntaxReader.skip_next_char();\n this.handle_block_content(active_block);\n break;\n case \"specializes\":\n this.syntaxReader.skip_next_char();\n this.syntaxReader.read_name();\n this.syntaxReader.skip_newlines_blankspace()\n this.specialize(active_block, next_char);\n break;\n case \":>\":\n this.syntaxReader.skip_next_char();\n next_char = this.syntaxReader.read_next_char();\n\n if(next_char == \">\") {\n this.syntaxReader.skip_next_char();\n this.syntaxReader.skip_newlines_blankspace();\n\n /* var old_block = active_block;\n\n active_block = Object.assign(new Block(old_block.name), this.get_abstract_block_by_name(this.syntaxReader.read_name()));\n\n active_block.name = old_block.name; */\n\n let special_block_name = this.syntaxReader.read_name();\n let special_block = this.active_package.get_block_by_name(special_block_name);\n\n active_block = this.get_block_from_abstract_block(active_block.name, this.get_abstract_block_by_name(special_block_name));\n\n this.replace_block_by_name(active_block.name, active_block);\n\n active_block.add_subset(special_block);\n\n next_char = this.syntaxReader.read_next_char();\n this.syntaxReader.skip_newlines_blankspace();\n if(next_char == \"{\"){\n this.handle_block_content(active_block);\n }\n\n //this.specialize(active_block, next_char);\n break;\n }\n default:\n this.syntaxReader.error(\"Expected ; or { \");\n }\n\n }", "title": "" }, { "docid": "e7ec84bf6ca8c10d6f776f1f864f6f42", "score": "0.5606709", "text": "function GetDappBlock(Block,Tr,F)\r\n{\r\n DappBlockFile(Block,Tr,function (Err,Data)\r\n {\r\n if(!Err && Data.Type===135)\r\n {\r\n try{var Params=JSON.parse(Data.Params);}catch (e){}\r\n if(Params)\r\n {\r\n F(0,Params,Data.MethodName,Data.FromNum);\r\n return;\r\n }\r\n }\r\n F(1);\r\n });\r\n}", "title": "" }, { "docid": "e014812c73cf2447cb9543d07793e8de", "score": "0.55990875", "text": "function Block(data) {\n\tif (\"object\" !== typeof data) {\n\t\tdata = {}\n\t}\n\tthis.version = data.version || null;\n\tthis.timestamp = data.timestamp || null;\n\tthis.previousBlockId = data.previousBlockId || 0;\n\tthis.generatorPublicKey = data.generatorPublicKey || Config.NULL_HASH;\n\tthis.previousBlockHash = data.previousBlockHash || Config.NULL_HASH;\n\tthis.totalAmount = data.totalAmount || 0;\n\tthis.totalFee = data.totalFee || 0;\n\tthis.payloadLength = data.payloadLength || 0;\n\tthis.generationSignature = data.generationSignature || Config.NULL_HASH;\n\tthis.payloadHash = data.payloadHash || Config.NULL_HASH;\n\tthis.transactionIds = data.transactionIds || [];\n\tthis.blockTransactions = data.blockTransactions || [];\n\tthis.blockSignature = data.blockSignature || null;\n\tthis.cumulativeDifficulty = data.cumulativeDifficulty || BigInteger.zero; //new bigint(\"0\");\n\tthis.baseTarget = data.baseTarget || Constants.InitialBaseTarget; //Config.INITIAL_BASE_TARGET;\n\tthis.nextBlockId = data.nextBlockId || null;\n\tthis.height = typeof data.height !== \"undefined\" ? data.height : -1;\n\tthis.id = data.id || null;\n\tthis.stringId = data.stringId || null;\n\tthis.generatorId = data.generatorId || null;\n\tthis.confirmations = data.confirmations || 0;\n\tif (typeof this.previousBlockId == \"string\") {\n\t\tthis.previousBlockId = Utils.stringToLong(this.previousBlockId)\n\t}\n\tif (typeof this.generatorPublicKey == \"string\") {\n\t\tthis.generatorPublicKey = new Buffer(this.generatorPublicKey, \"hex\")\n\t}\n\tif (typeof this.previousBlockHash == \"string\") {\n\t\tthis.previousBlockHash = new Buffer(this.previousBlockHash, \"hex\")\n\t}\n\tif (typeof this.generationSignature == \"string\") {\n\t\tthis.generationSignature = new Buffer(this.generationSignature, \"hex\")\n\t}\n\tif (typeof this.payloadHash == \"string\") {\n\t\tthis.payloadHash = new Buffer(this.payloadHash, \"hex\")\n\t}\n\tif (typeof this.blockSignature == \"string\") {\n\t\tthis.blockSignature = new Buffer(this.blockSignature, \"hex\")\n\t}\n\tif (typeof this.nextBlockId == \"string\") {\n\t\tthis.nextBlockId = Utils.stringToLong(this.nextBlockId)\n\t}\n\tif (typeof this.id == \"string\") {\n\t\tthis.id = Utils.stringToLong(this.id)\n\t}\n\tif (typeof this.cumulativeDifficulty == \"string\") {\n\t\tthis.cumulativeDifficulty = new bigint(this.cumulativeDifficulty)\n\t}\n\n\t// --\n\n\tif (data.transactions.length > Constants.MaxNumberOfTransactions) {\n\t\tthrow new Error(\"ValidationException: attempted to create a block with \" + data.transactions.length + \" transactions\");\n\t}\n\n\tif (data.payloadLength > Constants.MaxPayloadLength || data.payloadLength < 0) {\n\t\tthrow new Error(\"ValidationException: attempted to create a block with payloadLength \" + data.payloadLength);\n\t}\n\n\tvar previousId = Constants.MinInt;\n\tfor (var i = 0; i < this.blockTransactions.length; i++ ) {\n\t\tvar tr = this.blockTransactions[i];\n\t\tif (tr.GetId() < previousId) {\n\t\t\tthrow new Error(\"ValidationException: Block transactions are not sorted!\");\n\t\t}\n\t\tthis.transactionIds.push(tr.GetId());\n\t\tpreviousId = tr.GetId();\n\t}\n\t//this.transactionIds = Collections.unmodifiableList(transactionIds);\n\treturn this;\n}", "title": "" }, { "docid": "270dcb091ee00fec81b1151aee32802b", "score": "0.55983746", "text": "Load() {\n\n }", "title": "" }, { "docid": "55553145c701a2df471775e59f1f5655", "score": "0.55904835", "text": "function Load() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.55744565", "text": "function LoaderProto() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.55744565", "text": "function LoaderProto() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.55744565", "text": "function LoaderProto() {}", "title": "" }, { "docid": "50c770fb9e2f5490de3a32d785047915", "score": "0.5562543", "text": "function loadMap(element) {\n\tvar block;\n\t\n\tif (isNaN(element)) {\n\t\telement=1;\n\t}\n\tfor ( var i = 0; i < 13; i++) {\n\t\tfor ( var j = 0; j < 13; j++) {\n\t\t\tvar mapContainer = maps[element-1];\n\t\t\tvar type = mapContainer[j][i];\n\t\t\tswitch (type) {\n\t\t\tcase WALL:\n\t\t\t\tblock = new Wall(i, j);\n\t\t\t\tbreak\n\t\t\tcase GRASS:\n\t\t\t\tblock = new Grass(i, j);\n\t\t\t\tbreak\n\t\t\tcase GROUND:\n\t\t\t\tblock = new Ground(i, j);\n\t\t\t\tbreak\n\t\t\tcase PLATINUM:\n\t\t\t\tblock = new Platinum(i, j);\n\t\t\t\tbreak\n\t\t\tcase WATER:\n\t\t\t\tblock = new Water(i, j);\n\t\t\t\tbreak\n\t\t\tcase CROWN:\n\t\t\t\tblock = new Crown(i, j);\n\t\t\t\tbreak\n\t\t\tcase SHIELD:\n\t\t\t\tblock = new Shield(i, j);\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tblock.createBlock();\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "7baf94b44ea1c5eda4b870f17a490f1b", "score": "0.552374", "text": "async function getBlock(blockHeight){\n return JSON.parse(await getBlockFromLevelDB(blockHeight));\n }", "title": "" }, { "docid": "49f1e092bf8998f28097644f945401f2", "score": "0.5519839", "text": "AdBlock(data){\n let blockNumber = this.Blocks.length + 1;\n let prevHash = \"0000000000000000000000000000000000000000000000000000000000000000\";\n if (blockNumber !== 1){\n prevHash = this.Blocks[this.Blocks.length - 1].Hash;\n }\n\n let newBlock = new Block(blockNumber, data, 0, prevHash);\n newBlock.Mine();\n this.Blocks.push(newBlock)\n }", "title": "" }, { "docid": "a1ae87a441fbd80f7c9f29e6ffbc1980", "score": "0.5517844", "text": "function Block(PartCode, Type, Color, BlockType){\n\t\t\n\t\tthis.PartCode = PartCode;\t//Specific part code of the piece instanciated\n\t\tthis.Type = Type;\t\t\t//There are 3 types: Chassis, Normal, Special\n\t\tthis.Color = Color;\t\t\t//Color\n\t\tthis.BlockType = BlockType;\t//The BlockType is given depending the dimentions of the Lego block. WLH(width, length, height)\n\t\tthis.PHP_last_id_block = PHP_last_id_js;\t//PHP OrderID to be sent to the server\n\t\t\n\t}", "title": "" }, { "docid": "f9bdd82838c00a65799b9341bb2a525d", "score": "0.5505058", "text": "_createNewLedger() {\n this.address = this._wallet.createAddress();\n let outputs = [\n new Output(this.config.startingAmount, this.address.pubKey)\n ];\n let transaction = new Transaction([], outputs, \"\");\n transaction.hash = sc.findHash(JSON.stringify(transaction.data));\n let newBlock = new BlockData(\n 0,\n \"\",\n [transaction],\n \"\",\n 0\n );\n let _hash = st.findNonce(newBlock, this.config.LEAD);\n let blocks = [{data:newBlock,hash:_hash}];\n this.ledger = new Ledger(blocks);\n this._wallet.receiveBlock(JSON.stringify(blocks[0]));\n }", "title": "" }, { "docid": "ca5abb88f2075f08263939dda3c536cb", "score": "0.5505031", "text": "RetrieveBlock(blockHash = \"\", verbosity = \"1\") {}", "title": "" }, { "docid": "ca5abb88f2075f08263939dda3c536cb", "score": "0.5505031", "text": "RetrieveBlock(blockHash = \"\", verbosity = \"1\") {}", "title": "" }, { "docid": "2217fba75d8dd1ad45705814d45df6fe", "score": "0.5500737", "text": "getBData() {\n // Getting the encoded data saved in the Block\n let self = this;\n\n return new Promise((resolve, reject) => {\n // Decoding the data to retrieve the JSON representation of the object\n let data = hex2ascii(self.body)\n\n // Parse the data to an object to be retrieve.\n data = JSON.parse(data)\n\n // Resolve with the data if the object isn't the Genesis block\n if (self.height !== 0) {\n resolve(data)\n }\n resolve(null)\n });\n }", "title": "" }, { "docid": "ee88213262af09ffc8ff8978ed612c45", "score": "0.5487979", "text": "addBlock(newBlock){\n getBlockHeightFromLevelDB(function(height) {\n // Block height\n newBlock.height = (height + 1);\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n // previous block hash\n if(height>=0){\n getDataFromLevelDB(height, function(data) {\n newBlock.previousBlockHash = JSON.parse(data).hash;\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Store newBlock in LevelDB\n addDataToLevelDB(newBlock.height, JSON.stringify(newBlock).toString());\n });\n } else {\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Store newBlock in LevelDB\n addDataToLevelDB(newBlock.height, JSON.stringify(newBlock).toString());\n }\n });\n }", "title": "" }, { "docid": "9895f5aa9c5eccbf29f2f40f00b5f140", "score": "0.5481369", "text": "getBData() {\n let self = this;\n return new Promise((resolve, reject) => {\n // Getting the encoded data saved in the Block\n let encodedData = self.body;\n\n // Decoding the data to retrieve the JSON representation of the object\n let decodedData = hex2ascii(encodedData);\n\n if (self.height > 0) {\n // Parse the data to an object to be retrieve.\n let jsonObject = JSON.parse(decodedData);\n\n // Resolve with the data if the object isn't the Genesis block\n resolve(jsonObject);\n } else {\n reject(decodedData);\n }\n });\n }", "title": "" }, { "docid": "076372cd14a445b872835e5272ae05cb", "score": "0.54747033", "text": "function modelo_242_techo_w(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 242;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_techo_242_w.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-32;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 4;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "fa90780da14b927ff4a43e779a624950", "score": "0.54610425", "text": "addBlock(newBlock){\n \n // Height do bloco a partir da chain em memória\n newBlock.height = this.chain[this.chain.length - 1].height + 1;\n \n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n \n // Hash do bloco anterior\n if(newBlock.height>0){\n \n // Vai ter que mudar para nenhum valor de hash anterior, ou seja, a partir de 0 \n newBlock.previousBlockHash = this.chain[this.chain.length-1].hash;\n }\n \n // Hash do bloco com SHA256 usando newBlock e convertendo para uma string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n \n // Adicionando objeto de bloco à cadeia\n db.addDataToLevelDB(JSON.stringify(newBlock).toString());\n \n // Adicionar bloco à cadeia na memória\n \tthis.chain.push(newBlock);\n }", "title": "" }, { "docid": "aa51eb17d16f50d1872cd039878cedc1", "score": "0.5455405", "text": "load() {}", "title": "" }, { "docid": "41eaa7438eff521ad40056fa0341a892", "score": "0.5443728", "text": "static loadBlockFiles () {\n Blockly = new BlocklyClass()\n parse(fs.readFileSync('index.html', 'utf-8'))\n .querySelector('#tidyblocks')\n .querySelectorAll('script')\n .map(node => node.attributes.src)\n .filter(path => !path.includes('/r/'))\n .map(path => ({path: path, src: fs.readFileSync(path, 'utf-8')}))\n .map(({path, src}) => {\n const start = src.indexOf('/** NOT FOR TESTING **/')\n if (start >= 0) {\n src = src.substring(0, start)\n }\n return {path, src}\n })\n .forEach(({path, src}) => {\n try {\n eval(src)\n }\n catch (err) {\n console.log(`ERROR in ${path}: ${err}`)\n process.exit(1)\n }\n })\n }", "title": "" }, { "docid": "227b212c55926f0fc133b0f19e687e1a", "score": "0.54418683", "text": "getBlock(height) {\n // Add your code here\n let self = this;\n return self.db.getLevelDBData(height).then((str_block) => { return JSON.parse(str_block);});\n }", "title": "" }, { "docid": "56e0e0a266def5c56a10ce0e25563250", "score": "0.5439022", "text": "function modelo_243_tanque(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 243;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_tanque.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-32;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 4;\n\t\t\t\tobject.height = 3;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "21959534769811ef33c9598c7035138d", "score": "0.54043543", "text": "static load(state) {\n let brick = new BasicBrick(state.brickID, state.color, state.colorType, state.width, state.height, state.depth);\n if (state.uuid) brick._uuid = state.uuid; // override uuid when creating brick from server\n brick.setPosition(state.position, true);\n if (state.angle != 0) {\n brick.rotateY(state.angle);\n }\n return brick;\n }", "title": "" }, { "docid": "fe4bb10eae03fad6d48a8f954082b059", "score": "0.5401856", "text": "function addBlocks (Blockly) {\n const QH_DATABASE_COLOR = '#5b67a5'\n const QH_DATABASE_ICO = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjIwODAxMjEwNzY2IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE5NDkiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNDgiIGhlaWdodD0iNDgiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTUxMiA5NmwxMi4yODggMC4wNjRDNzQ4LjczNiA5OC4xMTIgOTI4IDE1Ni44NjQgOTI4IDI1MnY1MjBDOTI4IDg2OC44NjQgNzQyLjE3NiA5MjggNTEyIDkyOFM5NiA4NjguODY0IDk2IDc3MlYyNTJDOTYgMTk5LjQ1NiAxNTAuNDY0IDE1OC4wOCAyMzcuMTIgMTMxLjE2OGwxLjkyLTAuNTc2YzQuMzg0LTEuMzQ0IDguODk2LTIuNjU2IDEzLjQ0LTMuOTM2bDMuOTM2LTEuMDg4YTU4Ni40IDU4Ni40IDAgMCAxIDE5LjI5Ni00LjkyOGM1LjQ0LTEuMjggMTEuMDA4LTIuNTYgMTYuNjQtMy43NDQgNTMuNzYtMTEuNTIgMTE1LjY4LTE4LjQ2NCAxODIuMjA4LTIwLjM1MiA4LjQ4LTAuMjU2IDE3LjAyNC0wLjQxNiAyNS42LTAuNDhoMC4xNkw1MTIgOTZ6IG0wIDU3MmMtMTQ0Ljg5NiAwLTI3Mi4yNTYtMjMuNDI0LTM0Ni42ODgtNjQuOTZ2MTY4Ljk2YzAgMTIuMDMyIDI5LjY5NiAzNC4zNjggODcuNTUyIDUyLjc2OCA2Ny4zOTIgMjEuNDQgMTYwIDMzLjkyIDI1OS4xMzYgMzMuOTIgOTkuMTM2IDAgMTkxLjc0NC0xMi40OCAyNTkuMTM2LTMzLjkyIDU3Ljg1Ni0xOC40IDg3LjUyLTQwLjczNiA4Ny41Mi01Mi43NjhsMC4wMzItMTY4Ljk2Yy03NC40MzIgNDEuNTM2LTIwMS43OTIgNjQuOTYtMzQ2LjY4OCA2NC45NnpNODU4LjY4OCAzNDMuMDRjLTc0LjQzMiA0MS41MzYtMjAxLjc5MiA2NC45Ni0zNDYuNjg4IDY0Ljk2cy0yNzIuMjU2LTIzLjQyNC0zNDYuNjg4LTY0Ljk2VjUxMmMwIDEyLjAzMiAyOS42OTYgMzQuMzY4IDg3LjU1MiA1Mi43NjggNjcuMzkyIDIxLjQ0IDE2MCAzMy45MiAyNTkuMTM2IDMzLjkyIDk5LjEzNiAwIDE5MS43NDQtMTIuNDggMjU5LjEzNi0zMy45MiA1NC45NDQtMTcuNTA0IDg0LjQ4LTM4LjUyOCA4Ny4yOTYtNTAuODhsMC4yMjQtMS44ODh6TTUxMiAxNjUuMzQ0bC0xMy4zMTIgMC4wNjRhMTE2OC45NiAxMTY4Ljk2IDAgMCAwLTExLjY0OCAwLjE5MmwxMS42NDgtMC4xOTJjLTUuNzYgMC4wNjQtMTEuNDg4IDAuMTYtMTcuMTg0IDAuMzJsNS41MzYtMC4xMjhjLTQuOTI4IDAuMDk2LTkuNzkyIDAuMjI0LTE0LjY1NiAwLjQxNmw5LjEyLTAuMjg4Yy02LjQzMiAwLjE2LTEyLjg2NCAwLjM4NC0xOS4yMzIgMC42NGwxMC4xMTItMC4zNTJjLTUuMjggMC4xNi0xMC41MjggMC4zODQtMTUuNzEyIDAuNjRsNS42LTAuMjU2Yy00Ljk5MiAwLjE5Mi05Ljk4NCAwLjQ0OC0xNC45MTIgMC43MzZsOS4yOC0wLjQ4Yy03LjUyIDAuMzItMTUuMDQgMC43NjgtMjIuNDY0IDEuMjhsMTMuMTg0LTAuOGMtNC42NCAwLjI1Ni05LjI0OCAwLjU0NC0xMy44MjQgMC44NjRsMC42NC0wLjA2NGMtNC41NzYgMC4zMi05LjEyIDAuNjQtMTMuNjMyIDEuMDI0bDEyLjk5Mi0wLjk2Yy02LjY4OCAwLjQ0OC0xMy4zMTIgMC45Ni0xOS44NzIgMS41MzZsNi44OC0wLjU3NmMtNC4yODggMC4zMi04LjU0NCAwLjcwNC0xMi44IDEuMTJsNS45Mi0wLjU0NGMtNi4wMTYgMC41MTItMTEuOTY4IDEuMDg4LTE3Ljg4OCAxLjcyOGwxMi0xLjE4NGMtNS4zNDQgMC40OC0xMC42NTYgMS4wMjQtMTUuOTA0IDEuNmwzLjkwNC0wLjQxNmMtNS4wMjQgMC41MTItOS45ODQgMS4wODgtMTQuOTEyIDEuNjY0bDExLjAwOC0xLjI4LTE2LjQ0OCAxLjk1MiA1LjQ0LTAuNjRjLTQuNDggMC41MTItOC45NiAxLjA4OC0xMy4zNzYgMS42OTZsNy45MzYtMS4wNTZjLTYuMDggMC43NjgtMTIuMDMyIDEuNi0xNy45MiAyLjQ2NGw5Ljk4NC0xLjQwOGMtNC44OTYgMC42NC05LjcyOCAxLjM0NC0xNC41MjggMi4wOGw0LjUxMi0wLjY3MmMtNC4zNTIgMC42NC04LjY0IDEuMjgtMTIuOTI4IDEuOTg0bDguNDE2LTEuMzEyYy01Ljk1MiAwLjg5Ni0xMS44NCAxLjg1Ni0xNy42NjQgMi44OGw5LjI4LTEuNTY4LTEzLjY5NiAyLjMzNiA0LjQxNi0wLjc2OGE3ODAuOCA3ODAuOCAwIDAgMC0xNC4xNzYgMi41Nmw5Ljc2LTEuNzkyYy00LjggMC44NjQtOS42IDEuNzkyLTE0LjMwNCAyLjcybDQuNTQ0LTAuODk2Yy00Ljc2OCAwLjkyOC05LjQ3MiAxLjg4OC0xNC4xMTIgMi44OGw5LjU2OC0xLjk4NGMtNC44NjQgMC45Ni05LjY2NCAxLjk4NC0xNC40IDMuMDA4bDQuODMyLTEuMDI0Yy00LjE2IDAuODY0LTguMjU2IDEuNzkyLTEyLjI4OCAyLjcybDcuNDU2LTEuNjk2Yy00LjY0IDEuMDI0LTkuMTg0IDIuMDgtMTMuNjk2IDMuMmw2LjI0LTEuNTA0Yy00LjQ0OCAxLjA1Ni04LjggMi4xMTItMTMuMTIgMy4ybDYuODgtMS42OTZjLTQuNDggMS4wODgtOC44NjQgMi4yMDgtMTMuMTg0IDMuMzZsNi4zMzYtMS42NjRjLTMuOTM2IDEuMDI0LTcuNzc2IDIuMDQ4LTExLjU1MiAzLjEwNGw1LjIxNi0xLjQ0Yy00LjM1MiAxLjE4NC04LjY0IDIuMzY4LTEyLjggMy42MTZsLTcuMTA0IDIuMTc2LTMuMzYgMS4wNTZhNDIyLjA4IDQyMi4wOCAwIDAgMC0xNi45NiA1LjgyNGw0LjM4NC0xLjYtNi40IDIuMzM2IDIuMDE2LTAuNzM2LTYuMzM2IDIuNCA0LjMyLTEuNjY0LTcuMTM2IDIuNzg0IDIuODE2LTEuMTItNi41NiAyLjYyNCAzLjc0NC0xLjUwNGMtMi40MzIgMC45Ni00Ljc2OCAxLjkyLTcuMDQgMi44OGwzLjI5Ni0xLjM3NmEzMDcuNzEyIDMwNy43MTIgMCAwIDAtNS41MDQgMi4zNjhsMi4yNC0wLjk2Yy0yLjI0IDAuOTI4LTQuMzUyIDEuODU2LTYuNCAyLjgxNmw0LjE2LTEuODU2LTYuMjA4IDIuNzg0IDIuMDQ4LTAuOTZhMjYyLjMwNCAyNjIuMzA0IDAgMCAwLTUuMjggMi40OTZsMy4yMzItMS41MzZjLTIzLjM5MiAxMC45NDQtMzcuNzYgMjEuODI0LTQyLjk0NCAzMC4xNDRhMTIuMjU2IDEyLjI1NiAwIDAgMC0yLjE3NiA2LjMzNmMwIDEyLjAzMiAyOS42NjQgMzQuMzY4IDg3LjUyIDUyLjc2OCA2Ny4zOTIgMjEuNDQgMTYwIDMzLjkyIDI1OS4xMzYgMzMuOTIgOTkuMTM2IDAgMTkxLjc0NC0xMi40OCAyNTkuMTM2LTMzLjkyIDU3Ljg1Ni0xOC40IDg3LjUyLTQwLjczNiA4Ny41Mi01Mi43NjggMC0xMi4wMzItMjkuNjY0LTM0LjM2OC04Ny41Mi01Mi43NjgtNjcuMzkyLTIxLjQ0LTE2MC0zMy45Mi0yNTkuMTM2LTMzLjkyeiIgZmlsbD0iIzJjMmMyYyIgcC1pZD0iMTk1MCI+PC9wYXRoPjwvc3ZnPg==';\n\n //网络微数据库初始化\n Blockly.Blocks.QDP_network_microdatabase_initialization = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_network_microdatabase_initialization,\n args0: [\n {\n type: 'field_image',\n src: QH_DATABASE_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n {\n type: \"input_value\",\n name: \"ssid\"\n },\n {\n type: \"input_value\",\n name: \"pass\"\n }\n ],\n \"tooltip\": \"网络微数据库初始化\",\n colour:QH_DATABASE_COLOR,\n extensions: ['shape_statement']\n });\n }\n };\n\n //网络微数据库初始化\n Blockly.Blocks.QDP_web_microdatabase_update_tags = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_web_microdatabase_update_tags,\n args0: [\n {\n type: 'field_image',\n src: QH_DATABASE_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n {\n type: \"input_value\",\n name: \"tag\"\n },\n {\n type: \"input_value\",\n name: \"value\"\n }\n ],\n \"tooltip\": \"网络微数据库 更新标签\",\n colour:QH_DATABASE_COLOR,\n extensions: ['shape_statement']\n });\n }\n };\n\n //网络微数据库 删除标签\n Blockly.Blocks.QDP_web_microdatabase_delete_tags = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_web_microdatabase_delete_tags,\n args0: [\n {\n type: 'field_image',\n src: QH_DATABASE_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n {\n type: \"input_value\",\n name: \"tag\"\n }\n ],\n \"tooltip\": \"网络微数据库 删除标签\",\n colour:QH_DATABASE_COLOR,\n extensions: ['shape_statement']\n });\n }\n };\n\n //网络微数据库 获取标签的值\n Blockly.Blocks.QDP_web_microdatabase_get_tags = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_web_microdatabase_get_tags,\n args0: [\n {\n type: 'field_image',\n src: QH_DATABASE_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n {\n type: \"input_value\",\n name: \"tag\"\n }\n ],\n \"tooltip\": \"网络微数据库 获取标签的值(返回字符串)\",\n colour:QH_DATABASE_COLOR,\n extensions: ['output_number']\n });\n }\n };\n\n //网络微数据库 查询标签数\n Blockly.Blocks.QDP_web_microdatabase_count_tags = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_web_microdatabase_count_tags,\n args0: [\n {\n type: 'field_image',\n src: QH_DATABASE_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n ],\n \"tooltip\": \"网络微数据库 查询标签数(返回字符串)\",\n colour:QH_DATABASE_COLOR,\n extensions: ['output_number']\n });\n }\n };\n\n return Blockly;\n}", "title": "" }, { "docid": "d14dbf2a0ec6b9ceede0dbfeab63fd32", "score": "0.53988266", "text": "async getBlock(height) {\n // return object as a single string\n let block = await this.bd.getLevelDBData(height); \n\n // console.log(JSON.parse(block).hash);\n return JSON.parse(block);\n }", "title": "" }, { "docid": "15d136061eebeeaaafd9bc3d66504d8c", "score": "0.5397072", "text": "async _initializeChain() {\n if (this.height === -1) {\n let block = new BlockClass.Block({ data: 'Genesis Block' });\n await this._addBlock(block);\n }\n }", "title": "" }, { "docid": "e053f7e78197f6d1f202c674d269f988", "score": "0.53675693", "text": "static block(path, blockId, embed, display) {\n return new Link({\n path,\n embed,\n display,\n subpath: blockId,\n type: \"block\"\n });\n }", "title": "" }, { "docid": "5ce92abad8da38aa830fa8c197103e2a", "score": "0.53633237", "text": "function loadBoard(board, loader){\n\tloader.load( 'Models/Board/board.obj', 'Models/Board/board.mtl', function ( object ) {\n\n\t\tobject.position.x = -20;\n \tobject.scale.x = 10;\n \tobject.scale.y = 10;\n \tobject.scale.z = 10;\n\t\tobject.material = null;\n\t\tobject.traverse(function(mesh){\n\t\t\tif(mesh instanceof THREE.Mesh){\n\t\t\t\tmesh.receiveShadow = true;\n\t\t\t\tmesh.material.needsUpdate = true;\n\t\t\t}\n\t\t})\t\n\t\tboard.board = object;\n\t\tboard.scene.add(board.board);\n\t\tstart++;\n } );\n\t}", "title": "" }, { "docid": "1b788094357665185986de9640ded15c", "score": "0.53581667", "text": "constructor(data) {\n // Default properties for a new block\n this.hash = '';\n this.height = 0;\n this.body = data;\n this.time = new Date().getTime().toString().slice(0, -3);\n this.previousBlockHash = '';\n }", "title": "" }, { "docid": "7b534de0826d1d490076074575ef6c6f", "score": "0.53570235", "text": "load() { }", "title": "" }, { "docid": "2e0b884b63369e74a5d4d2c9d9555e0e", "score": "0.535677", "text": "async getBlock(height) {\n let self = this\n let self2 = this.bd;\n //let blockHeight\n let block\n\n //blockHeight = await self.getBlockHeight()\n block = await self2.getLevelDBData(height)\n return block\n }", "title": "" }, { "docid": "e5913a9ea8ec27734b64813ae9a7b6e7", "score": "0.5351657", "text": "constructor(data){\n\t\tthis.hash = null; // Hash of the block\n\t\tthis.height = 0; // Block Height (consecutive number of each block)\n\t\tthis.body = Buffer(JSON.stringify(data)).toString('hex'); // Will contain the transactions stored in the block, by default it will encode the data\n\t\tthis.time = 0; // Timestamp for the Block creation\n\t\tthis.previousBlockHash = null; // Reference to the previous Block Hash\n }", "title": "" }, { "docid": "670410dcbdee6d6ad2ef5a11e1566833", "score": "0.5348993", "text": "function load(objectToLoad, objectURL)\n{\n\t//console.log(PRELOADvertexPositionBuffer[objectURL])\n\t//console.log(\"qweqwe1 \" + vertexPositionBuffer[objectURL].numItems)\n\tobjectToLoad.vertexPositionBuffer = PRELOADvertexPositionBuffer[objectURL];\n\tobjectToLoad.textureBuffer = PRELOADtextureBuffer[objectURL];\n\tobjectToLoad.normalBuffer = PRELOADnormalBuffer[objectURL];\n\tobjectToLoad.vertexIndexBuffer = PRELOADvertexIndexBuffer[objectURL];\n\tobjectToLoad.textureFile = PRELOADtextureFile[objectURL];\n\t\n\t//console.log(objectToLoad.name + \" || \" + PRELOADobjectCollisionBox[objectURL]),\n\t//console.log(objectToLoad.name + \" \" + objectURL)\n\t//console.log(PRELOADnormalBuffer[objectURL])\n\t//if(objectToLoad.name == \"Hero\" ) \n\t//{\n\t\t\n\t\t//console.log(hero);\n\t//}\n\tobjectToLoad.collisionBox[x] = PRELOADobjectCollisionBox[objectURL][x];\n\tobjectToLoad.collisionBox[y] = PRELOADobjectCollisionBox[objectURL][y];\n\tobjectToLoad.collisionBox[z] = PRELOADobjectCollisionBox[objectURL][z];\n\t//objectToLoad.offset[x] = PRELOADobjectOffset[objectURL][x]\n\tobjectToLoad.offset[y] = PRELOADobjectOffset[objectURL][y];\n\t//objectToLoad.offset[z] = PRELOADobjectOffset[objectURL][z]\n\t//objectToLoad.collisionBox = PRELOADobjectCollisionBox[objectURL];\n\t//objectToLoad.offset = PRELOADobjectOffset[objectURL];\n}", "title": "" }, { "docid": "334574673718a8329ea0b440ae7ec0f5", "score": "0.53452235", "text": "function createLavaBlock(x,y) {\n //lava block code\n var hitZoneSize = 35;\n var damageFromObstacle = 10; \n var myLava = game.createObstacle(hitZoneSize,damageFromObstacle);\n myLava.x = x;\n myLava.y = y;\n game.addGameItem(myLava);\n var obstacleImage = draw.bitmap('img/lava.png');\n myLava.addChild(obstacleImage);\n obstacleImage.x =-31;\n obstacleImage.y = -30;\n \n }", "title": "" }, { "docid": "d9fb34f86f211edc0013a64510704bf8", "score": "0.5334043", "text": "async getBlock(height) {\n // Add your code here\n return JSON.parse(await this.bd.getLevelDBData(height));\n \n }", "title": "" }, { "docid": "6c7253d197c73e399c8496da356ba966", "score": "0.5331987", "text": "constructor(data, tStamp) {\r\n this.difficulty = 2\r\n this.head = new Block(data, tStamp, 0, this.difficulty, 0, false)\r\n\r\n }", "title": "" }, { "docid": "609e437b458f4bffc22b102a773d74ea", "score": "0.5323299", "text": "function modelo_242_techo(modelo_color, partcode){\n\t\t//Verifies if there is no piece to be set and if there is a chassis object\n\t\tif( ok1 && bChasis ){\n\t\t\t//As this is a new piece to be set, ok1 becomes false\n\t\t\tok1 = false;\n\t\t\t//Saves the passed partcode to the global variable Partcode\n\t\t\tPartCode = partcode;\n\t\t\t//Saves the BlockType of this method to the globl BlockType variable\n\t\t\tBlockType = 242;\n\t\t\t//The JSONLoader object loads the Lego block JSON file\n\t\t\tloader.load('JavaScript/modelo_techo_242.json',\n\t\t\tfunction (geometry){\n\t\t\t\t//The colour is passed to the material mesh\n\t\t\t\tMaterial_modelo=new THREE.MeshLambertMaterial({color:modelo_color});\n\t\t\t\t//Creation of the Lego block object with the loader geometry and the material mesh\n\t\t\t\tobject = new THREE.Mesh(geometry, Material_modelo);\n\t\t\t\t\t//Starring position for the object.\n\t\t\t\t\tobject.position.x =-32;\n\t\t\t\t\tobject.position.y =93.3;\t//29\n\t\t\t\t\tobject.position.z =-14.5;\t//-14.5\n\t\t\t\t\tobject.rotation.x +=90 * Math.PI / 18;\n\n\t\t\t\t\tobject.castShadow = false;\n\t\t\t\t\tobject.receiveShadow = false;\n\t\t\t\t\t\n\t\t\t\t\t//Adding the object to the scene\n\t\t\t\t\tEscenario.add(object);\n\t\t\t\t\t//Adding the object to the array of the client's car design\n\t\t\t\t\tobjects.push(object);\n\t\t\t\t\t//Increase the number of objects inside the client's car design\n\t\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\t//Correction of the scale for the JSON file\n\t\t\t\tobject.scale.x=1.01;\n\t\t\t\tobject.scale.y=1.01;\n\t\t\t\tobject.scale.z=1;\n\t\t\t\t\n\t\t\t\t//Completes the properties of the Lego block\n\t\t\t\tobject.length = 4;\n\t\t\t\tobject.height = 2;\n\t\t\t\tarrayBlock[arrayBlockCounter].objLength = object.length;\n\t\t\t\tarrayBlock[arrayBlockCounter].objHeight = object.height;\n\t\t\t\t;\n\t\t\t});\n\t\t\n\t}\n\t\t\n\t\t//Creating the Block object inside the arrayBlock of the client's car design with the constructor\n\t\tarrayBlock[arrayBlockCounter] = new Block(PartCode, \"LegoBlock\", modelo_color, \"Normal\");\n\n\t}", "title": "" }, { "docid": "b4c6c2908d16e63715b3743e52160e76", "score": "0.53196573", "text": "constructor(data){\n\t\tthis.hash = null; // Hash of the block\n\t\tthis.height = 0; // Block Height (consecutive number of each block)\n\t\tthis.body = Buffer.from(JSON.stringify(data)).toString('hex'); // Will contain the transactions stored in the block, by default it will encode the data\n\t\tthis.time = 0; // Timestamp for the Block creation\n\t\tthis.previousBlockHash = null; // Reference to the previous Block Hash\n }", "title": "" }, { "docid": "6a66f8ae2cd5fa6726c8bf82a1e96609", "score": "0.53172725", "text": "function TW21Loader() {}", "title": "" }, { "docid": "6a66f8ae2cd5fa6726c8bf82a1e96609", "score": "0.53172725", "text": "function TW21Loader() {}", "title": "" }, { "docid": "8cd5136921e829c459541ed3641c7078", "score": "0.53143865", "text": "async load() {}", "title": "" }, { "docid": "a8935e3959b4359679db3fac1ac4a6dd", "score": "0.5303107", "text": "function load() {\n getLanes();\n}", "title": "" }, { "docid": "c937affcad43dd2e796f8166311b8b10", "score": "0.52933675", "text": "async init(){\n let Height = await this.getBlockHeight(true);\n if (Height < 0) {\n await this.addBlock(new Block(\"First block in the chain - Genesis block\"));\n } else {\n null\n //console.log(Height);\n }\n }", "title": "" }, { "docid": "45974ffcbcfeda32fe781a05190f9438", "score": "0.52930635", "text": "static load(\n connection: Connection,\n payer: BvmAcct,\n elf: Array<number>,\n ): Promise<BvmAddr> {\n const controller = new BvmAcct();\n return ControllerLoader.load(connection, payer, controller, BpfControllerLoader.controllerId, elf);\n }", "title": "" }, { "docid": "e0c6254d1d884918e1863b0af5104438", "score": "0.5286322", "text": "async getBlockByHeight(blockHeight){\n return JSON.parse(await this.chain.getLevelDBData(blockHeight))\n }", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.5285956", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.5285956", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.5285956", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "87ffa41954dba6c5329c956e3e904a1c", "score": "0.52855086", "text": "function loadingObj(beerData, callback){\n let index = 0;\n $loadingHandle.setSetp(0.50);\n function innerLoadingObj(index){\n if(index >= beerData.length){\n callback();\n $loadingHandle.setSetp(0.70);\n return;\n }\n const loader = new THREE.OBJLoader();\n loader.load(beerData[index].objUrl, function(loadedMesh) {\n beerData[index].loadedMesh = loadedMesh\n index++;\n innerLoadingObj(index);\n });\n }\n innerLoadingObj(index);\n }", "title": "" }, { "docid": "41516292606377090001779c366170c1", "score": "0.52795947", "text": "function Block() {\n _classCallCheck(this, Block);\n\n Block.initialize(this);\n }", "title": "" }, { "docid": "946631b003a1e5c34d2b64ae5b6cc7e2", "score": "0.5273322", "text": "async get(indepHash) {\n const response = await this.api.get(`${Blocks.ENDPOINT}${indepHash}`);\n if (response.status === 200) {\n return response.data;\n }\n else {\n if (response.status === 404) {\n throw new error_1.default(\"BLOCK_NOT_FOUND\" /* BLOCK_NOT_FOUND */);\n }\n else {\n throw new Error(`Error while loading block data: ${response}`);\n }\n }\n }", "title": "" }, { "docid": "06f1643f831e7a63331290af4004dcf5", "score": "0.5257495", "text": "createGenesisBlock(){\r\n return new Block(0, \"01/01/2019\", \"Genesis block\", \"0\");\r\n }", "title": "" }, { "docid": "3a583a102bbb2180f9fec8af18177c7d", "score": "0.52566063", "text": "getBlock(height) {\n const self = this;\n return new Promise(function(resolve, reject) {\n const block = self.bd\n .getLevelDBData(height)\n .then(block => {\n resolve(block);\n })\n .catch(err => {\n console.log(err);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "02cce9a0e4dc70f4887f55f05379d835", "score": "0.52546436", "text": "constructor() {\n // constructor(): Scenes begin by populating initial values like the Shapes and Materials they'll need.\n super();\n this.block = new Shape_From_File('./assets/road-block-new.obj');\n\n this.materials = {\n phong: new Material(new Textured_Phong(), {\n color: hex_color(\"#ffffff\"),\n }),\n texture: new Material(new Textured_Phong(), {\n color: hex_color(\"#ffffff\"),\n ambient: .5, diffusivity: 0.1, specularity: 0.1,\n texture: new Texture(\"assets/road-block.jpg\")\n }),\n }\n\n // for (let i=0;i<this.block.arrays.texture_coord.length;i++){\n // this.block.arrays.texture_coord[i][0] *= 2;\n // this.block.arrays.texture_coord[i][1] *= 2;\n // }\n\n this.initial_camera_location = Mat4.look_at(vec3(0, 10, 20), vec3(0, 0, 0), vec3(0, 1, 0));\n\n }", "title": "" }, { "docid": "5dc10bc39b602d875a8165b3c313909d", "score": "0.52515286", "text": "function Loader() {}", "title": "" }, { "docid": "ca4c447cf6c7d8e61b9bc00c0ce455eb", "score": "0.5245689", "text": "createGenisisBlock() {\n return new Block(\"01/01/2019\", \"Genisis block\", \"0\");\n }", "title": "" }, { "docid": "f99962461d0d8aac197154e18f351f66", "score": "0.5240792", "text": "static genesis(){\r\n return new Block(\"today\",\"----\",\"hashh\",[])\r\n }", "title": "" }, { "docid": "5d743f3e6667c7eaf6df8acc6bd27eb3", "score": "0.523509", "text": "getBlock(height) {\n let self = this;\n \n return new Promise(function(resolve, reject) {\n self.db.getBlock(height)\n // return object as a single string\n .then((result) => resolve(JSON.parse(result)))\n .catch((err) => reject(err))\n });\n }", "title": "" }, { "docid": "5da500a50fa6aae511bbff1818f56cea", "score": "0.5232483", "text": "load() {\n // Load .mtl texture mapping file.\n var mtlLoader = new THREE.MTLLoader();\n mtlLoader.setPath(this.dir);\n\n // Having to save the state of the class... can't go too deep.\n var self = this;\n\n // Load the course model object.\n var objLoader = new THREE.OBJLoader();\n\n mtlLoader.load(this.mtlFile,\n function(m) {\n m.preload(); // Preload the materials.\n \n // Load the course model object.\n var objLoader = new THREE.OBJLoader();\n \n // Prime materials to be applied to the object.\n objLoader.setMaterials(m);\n \n // Actually load obj file.\n objLoader.setPath(self.dir);\n objLoader.load(self.objFile,\n function(o) {\n // Iterate over individual meshes for some tweaks.\n o.children.forEach(\n function(c) {\n // Ensure transparent PNGs render correctly.\n c.material.transparent = true;\n // Enable flat shading to prevent weird flickering issues.\n c.material.flatShading = true;\n // Allow for correct transparency on PNGs.\n c.material.alphaTest = 1;\n });\n \n // Scale course to a more reasonable size.\n o.scale.set(0.001, 0.001, 0.001);\n \n console.log(o);\n // Add course to scene.\n scene.add(o);\n });\n \n });\n }", "title": "" }, { "docid": "860b006d4411083b506cf14181f42b6c", "score": "0.5229686", "text": "function Block(spriteTexture,normalmap,light,name) {\n this.mRender = new IllumRenderable(spriteTexture,normalmap);\n this.mName = name;\n this.mRotate = 0.05;\n this.mRender.addLight(light.getLight());\n \n GameObject.call(this,this.mRender);\n \n this.getXform().setPosition(19,0);\n this.getXform().setSize(3,3);\n \n var r = new RigidRectangle(this.mRender.getXform(), 3,3);\n r.setMass(80); // less dense than Minions\n r.setRestitution(0.5);\n r.setVelocity([gManager.DefaultOptions.mBoxSpeed - 12 * Math.random(),-15 + 30 * Math.random()]);\n //r.setAcceleration([-10,-10]);\n this.setPhysicsComponent(r);\n \n}", "title": "" }, { "docid": "4191fa0ec7fb91f343b8ca2f4d16fe32", "score": "0.52192074", "text": "function loadRomFrame() {}", "title": "" }, { "docid": "50a60653acb480670fad5628f22bcf1b", "score": "0.5216966", "text": "function load_cb(data_id, success) {\n\n if (!success) {\n console.log(\"b4w load failure\");\n return;\n }\n\t// m_cfg.set('physics_use_wasm', true);\n\t\n\tm_system.init_system();\n\tm_env.init_environment();\n\tm_char.init_character();\n\tm_obj_man.init_objects_system();\n\tm_ui.init_ui();\n\t// initTRex();\n\t// place your code here\n\n}", "title": "" }, { "docid": "ec49ad3ddd6b3343574de36ba9cf599e", "score": "0.52148736", "text": "constructor(data) {\n this.hash = null; // Hash of the block\n this.height = 0; // Block Height (consecutive number of each block)\n this.body = Buffer.from(JSON.stringify(data)).toString('hex'); // Will contain the transactions stored in the block, by default it will encode the data\n logger.info(hex2ascii(this.body));\n this.time = 0; // Timestamp for the Block creation\n this.previousBlockHash = null; // Reference to the previous Block Hash\n }", "title": "" }, { "docid": "3fee18863ce1df9c72150726f9fac47e", "score": "0.5214449", "text": "async loadBlockchainData() { \n const web3 = window.web3\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n console.log('Account:', this.state.account)\n const networkId = '97' // Ganache -> 5777, Rinkeby -> 4, BSC -> 97\n console.log('networkid:', networkId)\n const networkData = contrato_loteria.networks[networkId]\n console.log('NetworkData:', networkData)\n\n if(networkData) {\n const abi = contrato_loteria.abi\n console.log('abi', abi)\n const address = networkData.address\n console.log('address:',address)\n const contract = new web3.eth.Contract(abi, address)\n this.setState({contract})\n } else {\n window.alert('¡El Smart Contract no se ha desplegado en la red!')\n }\n }", "title": "" }, { "docid": "2ad22f0ad9187480adc5906e63902a9c", "score": "0.5212078", "text": "async init (scene, data, indexOfPCB, tobeSaveInGeneral) {\n this.tobeSaveInGeneral = tobeSaveInGeneral\n this.scene = scene\n this._engine = scene.getEngine()\n this.canvas = this._engine.getRenderingCanvas()\n this.objects = {}\n\n const uniqueId = BABYLON.Tools.RandomId()\n this.objects[uniqueId] = {}\n this.indexOfPCB = indexOfPCB\n\n if (!data || !data.board) {\n data.board = {\n 'pcb_size': [50, 50],\n 'pcb_layers': 1,\n 'isCircle': false,\n 'color': '#0a7900',\n 'layerThickness': 0.16,\n 'visibility': [],\n 'routing_layers': 2,\n 'gridResolution': 0,\n 'enableGrid': false,\n 'fixingHoles': []\n }\n }\n \n this.data.board = data.board\n this.data.engine = data.engine || [[]]\n this.data.placement = data.placement || []\n this.data.routing = data.routing || []\n this.data.vias = data.vias || []\n\n this.tooltip = this.addTooltip()\n\n this.main = new BABYLON.AbstractMesh('__root__', this.scene)\n this.main.metadata = this.data\n\n this.board = new Board(this.data.board, this.scene)\n \n for(let i = 0; i < this.board.layers.length; i++) {\n this.board.layers[i].parent = this.main\n }\n this.board.grid.parent = this.main\n\n await this.importAssets(this.data.engine[0])\n\n return this\n }", "title": "" }, { "docid": "77135b31535f6c01bb344297e09f2c7d", "score": "0.5210689", "text": "async loadBinary(binary) {\n this.binary = binary;\n }", "title": "" }, { "docid": "6cec02aab64c3799da2eab5ac7f15e1e", "score": "0.52092946", "text": "load() {\n }", "title": "" }, { "docid": "6cec02aab64c3799da2eab5ac7f15e1e", "score": "0.52092946", "text": "load() {\n }", "title": "" }, { "docid": "2e0d11d84ba3c1c6d1d131ea5f1755d3", "score": "0.52035666", "text": "function Blocks () {\n if (sugarizerCompatibility.isInsideSugarizer()) {\n storage = sugarizerCompatibility.data;\n } else {\n storage = localStorage;\n }\n\n this.canvas = null;\n this.stage = null;\n this.refreshCanvas = null;\n this.trashcan = null;\n this.updateStage = null;\n this.getStageScale = null;\n\n // We keep a list of stacks in the trash.\n this.trashStacks = [];\n\n // We keep a dictionary for the proto blocks,\n this.protoBlockDict = {}\n // and a list of the blocks we create.\n this.blockList = [];\n\n // Track the time with mouse down.\n this.mouseDownTime = 0;\n this.longPressTimeout = null;\n\n // \"Copy stack\" selects a stack for pasting. Are we selecting?\n this.selectingStack = false;\n // and what did we select?\n this.selectedStack = null;\n // and a copy of the selected stack for pasting.\n this.selectedBlocksObj = null;\n\n // If we somehow have a malformed block database (for example,\n // from importing a corrupted datafile, we need to avoid infinite\n // loops while crawling the block list.\n this._loopCounter = 0;\n this._sizeCounter = 0;\n this._searchCounter = 0;\n\n // We need a reference to the palettes.\n this.palettes = null;\n // Which block, if any, is highlighted?\n this.highlightedBlock = null;\n // Which block, if any, is active?\n this.activeBlock = null;\n // Are the blocks visible?\n this.visible = true;\n // The group of blocks being dragged or moved together\n this.dragGroup = [];\n // The blocks at the tops of stacks\n this.stackList = [];\n // The blocks that need expanding\n this._expandablesList = [];\n // Number of blocks to load\n this._loadCounter = 0;\n // Stacks of blocks that need adjusting as blocks are repositioned\n // due to expanding and contracting or insertion into the flow.\n this._adjustTheseDocks = [];\n // Blocks that need collapsing after load.\n this.blocksToCollapse = [];\n // Arg blocks that need expanding after load.\n this._checkTwoArgBlocks = [];\n // Arg clamp blocks that need expanding after load.\n this._checkArgClampBlocks = [];\n // Clamp blocks that need expanding after load.\n this._clampBlocksToCheck = [];\n\n // We need to keep track of certain classes of blocks that exhibit\n // different types of behavior.\n\n // Blocks with parts that expand, e.g.,\n this._expandableBlocks = [];\n // Blocks that contain child flows of blocks\n this.clampBlocks = [];\n this.doubleExpandable = [];\n this.argClampBlocks = [];\n // Blocks that are used as arguments to other blocks\n this.argBlocks = [];\n // Blocks that return values\n this.valueBlocks = [];\n // Two-arg blocks with two arguments (expandable).\n this.twoArgBlocks = [];\n // Blocks that don't run when clicked.\n this.noRunBlocks = [];\n\n this._homeButtonContainers = [];\n this.blockScale = DEFAULTBLOCKSCALE;\n\n // We need to know if we are processing a copy or save stack command.\n this.inLongPress = false;\n\n // We stage deletion of prototype action blocks on the palette so\n // as to avoid palette refresh race conditions.\n this.deleteActionTimeout = 0;\n\n this.setCanvas = function (canvas) {\n this.canvas = canvas;\n return this;\n };\n\n this.setStage = function (stage) {\n this.stage = stage;\n return this;\n };\n\n this.setRefreshCanvas = function (refreshCanvas) {\n this.refreshCanvas = refreshCanvas;\n return this;\n };\n\n this.setTrashcan = function (trashcan) {\n this.trashcan = trashcan;\n return this;\n };\n\n this.setUpdateStage = function (updateStage) {\n this.updateStage = updateStage;\n return this;\n };\n\n this.setGetStageScale = function (getStageScale) {\n this.getStageScale = getStageScale;\n return this;\n };\n\n // Change the scale of the blocks (and the protoblocks on the palette).\n this.setBlockScale = function (scale) {\n console.log('New block scale is ' + scale);\n this.blockScale = scale;\n\n // Regenerate all of the artwork at the new scale.\n for (var blk = 0; blk < this.blockList.length; blk++) {\n // if (!this.blockList[blk].trash) {\n this.blockList[blk].resize(scale);\n // }\n }\n\n this.findStacks();\n for (var stack = 0; stack < this.stackList.length; stack++) {\n // console.log('Adjust Docks: ' + this.blockList[this.stackList[stack]].name);\n this.adjustDocks(this.stackList[stack], true);\n }\n\n // We reset the protoblock scale on the palettes, but don't\n // modify the palettes themselves.\n for (var palette in this.palettes.dict) {\n for (var blk = 0; blk < this.palettes.dict[palette].protoList.length; blk++) {\n this.palettes.dict[palette].protoList[blk].scale = scale;\n }\n }\n };\n\n // We need access to the msg block...\n this.setMsgText = function (msgText) {\n this.msgText = msgText;\n };\n\n // and the Error msg function.\n this.setErrorMsg = function (errorMsg) {\n this.errorMsg = errorMsg;\n return this;\n };\n\n // We need access to the macro dictionary because we add to it.\n this.setMacroDictionary = function (obj) {\n this.macroDict = obj;\n return this;\n };\n\n // We need access to the turtles list because we associate a\n // turtle with each start block.\n this.setTurtles = function (turtles) {\n this.turtles = turtles;\n return this;\n };\n\n // We need to access the \"pseudo-Logo interpreter\" when we click\n // on blocks.\n this.setLogo = function (logo) {\n this.logo = logo;\n return this;\n };\n\n // The scale of the graphics is determined by screen size.\n this.setScale = function (scale) {\n this.blockScale = scale;\n return this;\n };\n\n // Toggle state of collapsible blocks.\n this.toggleCollapsibles = function () {\n for (var blk in this.blockList) {\n var myBlock = this.blockList[blk];\n if (COLLAPSABLES.indexOf(myBlock.name) !== -1 && !myBlock.trash) {\n myBlock.collapseToggle();\n }\n }\n };\n\n // We need access to the go-home buttons and boundary.\n this.setHomeContainers = function (containers, boundary) {\n this._homeButtonContainers = containers;\n this.boundary = boundary;\n return this;\n };\n\n // set up copy/paste, dismiss, and copy-stack buttons\n this.makeCopyPasteButtons = function (makeButton, updatePasteButton) {\n var that = this;\n this.updatePasteButton = updatePasteButton;\n\n this.dismissButton = makeButton('cancel-button', '', 0, 0, 55, 0, this.stage);\n this.dismissButton.visible = false;\n\n this.saveStackButton = makeButton('save-blocks-button', _('Save stack'), 0, 0, 55, 0, this.stage);\n this.saveStackButton.visible = false;\n\n this.dismissButton.on('click', function (event) {\n that.saveStackButton.visible = false;\n that.dismissButton.visible = false;\n that.inLongPress = false;\n that.refreshCanvas();\n });\n\n this.saveStackButton.on('click', function (event) {\n // Only invoked from action blocks.\n var topBlock = that.findTopBlock(that.activeBlock);\n that.inLongPress = false;\n that.selectedStack = topBlock;\n that.saveStackButton.visible = false;\n that.dismissButton.visible = false;\n that.saveStack();\n that.refreshCanvas();\n });\n };\n\n // Walk through all of the proto blocks in order to make lists of\n // any blocks that need special treatment.\n this.findBlockTypes = function () {\n for (var proto in this.protoBlockDict) {\n if (this.protoBlockDict[proto].expandable) {\n this._expandableBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'clamp') {\n this.clampBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'argclamp') {\n this.argClampBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'argflowclamp') {\n this.clampBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'argclamparg') {\n this.argClampBlocks.push(this.protoBlockDict[proto].name);\n this.argBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'twoarg') {\n this.twoArgBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'arg') {\n this.argBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'value') {\n this.argBlocks.push(this.protoBlockDict[proto].name);\n this.valueBlocks.push(this.protoBlockDict[proto].name);\n }\n if (this.protoBlockDict[proto].style === 'doubleclamp') {\n this.doubleExpandable.push(this.protoBlockDict[proto].name);\n }\n }\n };\n\n this._actionBlock = function (name) {\n return ['do', 'doArg', 'calc', 'calcArg'].indexOf(name) !== -1;\n };\n\n this._namedActionBlock = function (name) {\n return ['nameddo', 'nameddoArg', 'namedcalc', 'namedcalcArg'].indexOf(name) !== -1;\n };\n\n // Adjust the docking postions of all blocks in the current drag\n // group.\n this._adjustBlockPositions = function () {\n if (this.dragGroup.length < 2) {\n return;\n }\n\n // console.log('Adjust Docks: ' + this.blockList[this.dragGroup[0]].name);\n this.adjustDocks(this.dragGroup[0], true)\n };\n\n // Adjust the size of the clamp in an expandable block when blocks\n // are inserted into (or removed from) the child flow. This is a\n // common operation for start and action blocks, but also for\n // repeat, forever, if, etc.\n this._adjustExpandableClampBlock = function () {\n if (this._clampBlocksToCheck.length === 0) {\n return;\n }\n\n var obj = this._clampBlocksToCheck.pop();\n var blk = obj[0];\n var clamp = obj[1];\n\n var myBlock = this.blockList[blk];\n\n if (myBlock.isArgFlowClampBlock()) {\n // Make sure myBlock is a clamp block.\n } else if (myBlock.isArgBlock() || myBlock.isTwoArgBlock()) {\n return;\n } else if (myBlock.isArgClamp()) {\n // We handle ArgClamp blocks elsewhere.\n this._adjustArgClampBlock([blk]);\n return;\n }\n\n function clampAdjuster(blocks, blk, myBlock, clamp) {\n // First we need to count up the number of (and size of) the\n // blocks inside the clamp; The child flow is usually the\n // second-to-last argument.\n\n if (myBlock.isArgFlowClampBlock()) {\n var c = 1; // 0: outie; and 1: child flow\n } else if (clamp === 0) {\n var c = myBlock.connections.length - 2;\n } else { // e.g., Bottom clamp in if-then-else\n var c = myBlock.connections.length - 3;\n }\n\n blocks._sizeCounter = 0;\n var childFlowSize = 1;\n if (c > 0 && myBlock.connections[c] != null) {\n childFlowSize = Math.max(blocks._getStackSize(myBlock.connections[c]), 1);\n }\n\n // Adjust the clamp size to match the size of the child\n // flow.\n var plusMinus = childFlowSize - myBlock.clampCount[clamp];\n if (plusMinus !== 0) {\n if (!(childFlowSize === 0 && myBlock.clampCount[clamp] === 1)) {\n myBlock.updateSlots(clamp, plusMinus);\n }\n }\n\n // Recurse through the list.\n setTimeout(function () {\n if (blocks._clampBlocksToCheck.length > 0) {\n blocks._adjustExpandableClampBlock();\n }\n }, 250);\n };\n\n clampAdjuster(this, blk, myBlock, clamp);\n };\n\n // Returns the block size.\n this._getBlockSize = function (blk) {\n var myBlock = this.blockList[blk];\n return myBlock.size;\n };\n\n // Adjust the slot sizes of arg clamps.\n this._adjustArgClampBlock = function (argBlocksToCheck) {\n if (argBlocksToCheck.length === 0) {\n return;\n }\n\n var blk = argBlocksToCheck.pop();\n var myBlock = this.blockList[blk];\n\n // Which connection do we start with?\n if (['doArg', 'calcArg'].indexOf(myBlock.name) !== -1) {\n var ci = 2;\n } else {\n var ci = 1;\n }\n\n // Get the current slot list.\n var slotList = myBlock.argClampSlots;\n\n var update = false;\n // Determine the size of each argument.\n for (var i = 0; i < slotList.length; i++) {\n var c = myBlock.connections[ci + i];\n var size = 1; // Minimum size\n if (c != null) {\n size = Math.max(this._getBlockSize(c), 1);\n }\n if (slotList[i] !== size) {\n slotList[i] = size;\n update = true;\n }\n }\n if (update) {\n myBlock.updateArgSlots(slotList);\n }\n };\n\n // We also adjust the size of twoarg blocks. It is similar to how\n // we adjust clamps, but enough different that it is in its own\n // function.\n this._adjustExpandableTwoArgBlock = function (argBlocksToCheck) {\n if (argBlocksToCheck.length === 0) {\n return;\n }\n\n var blk = argBlocksToCheck.pop();\n var myBlock = this.blockList[blk];\n\n // Determine the size of the first argument.\n var c = myBlock.connections[1];\n var firstArgumentSize = 1; // Minimum size\n if (c != null) {\n firstArgumentSize = Math.max(this._getBlockSize(c), 1);\n }\n\n // Expand/contract block by plusMinus.\n var plusMinus = firstArgumentSize - myBlock.clampCount[0];\n if (plusMinus !== 0) {\n if (!(firstArgumentSize === 0)) {\n myBlock.updateSlots(0, plusMinus);\n }\n }\n };\n\n this._addRemoveVspaceBlock = function (blk) {\n var myBlock = this.blockList[blk];\n\n var c = myBlock.connections[myBlock.connections.length - 2];\n var secondArgumentSize = 1;\n if (c != null) {\n var secondArgumentSize = Math.max(this._getBlockSize(c), 1);\n }\n\n var that = this;\n\n var vSpaceCount = howManyVSpaceBlocksBelow(blk);\n if (secondArgumentSize < vSpaceCount + 1) {\n // Remove a vspace block\n var n = Math.abs(secondArgumentSize - vSpaceCount - 1);\n for (var i = 0; i < n; i++) {\n var lastConnection = myBlock.connections.length - 1;\n var vspaceBlock = this.blockList[myBlock.connections[lastConnection]];\n var nextBlockIndex = vspaceBlock.connections[1];\n myBlock.connections[lastConnection] = nextBlockIndex;\n if (nextBlockIndex != null) {\n this.blockList[nextBlockIndex].connections[0] = blk;\n }\n vspaceBlock.connections = [null, null];\n vspaceBlock.trash = true;\n vspaceBlock.hide();\n }\n } else if (secondArgumentSize > vSpaceCount + 1) {\n // Add vspace blocks\n var n = secondArgumentSize - vSpaceCount - 1;\n var nextBlock = last(myBlock.connections);\n var thisBlock = myBlock;\n var newPos = this.blockList.length;\n\n var that = this;\n\n function vspaceAdjuster(args) { // nextBlock, vspace, i, n\n var thisBlock = args[0];\n var nextBlock = args[1];\n var vspace = args[2];\n var i = args[3];\n var n = args[4];\n var vspaceBlock = that.blockList[vspace];\n var lastDock = last(thisBlock.docks);\n var dx = lastDock[0] - vspaceBlock.docks[0][0];\n var dy = lastDock[1] - vspaceBlock.docks[0][1];\n vspaceBlock.container.x = thisBlock.container.x + dx;\n vspaceBlock.container.y = thisBlock.container.y + dy;\n vspaceBlock.connections[0] = that.blockList.indexOf(thisBlock);\n vspaceBlock.connections[1] = nextBlock;\n thisBlock.connections[thisBlock.connections.length - 1] = vspace;\n if (nextBlock) {\n that.blockList[nextBlock].connections[0] = vspace;\n }\n if (i + 1 < n) {\n var newPos = that.blockList.length;\n thisBlock = last(that.blockList);\n nextBlock = last(thisBlock.connections);\n that._makeNewBlockWithConnections('vspace', newPos, [null, null], vspaceAdjuster, [thisBlock, nextBlock, newPos, i + 1, n]);\n }\n };\n\n this._makeNewBlockWithConnections('vspace', newPos, [null, null], vspaceAdjuster, [thisBlock, nextBlock, newPos, 0, n]);\n };\n\n function howManyVSpaceBlocksBelow(blk) {\n // Need to know how many vspace blocks are below the block\n // we're checking against.\n var nextBlock = last(that.blockList[blk].connections);\n if (nextBlock && that.blockList[nextBlock].name === 'vspace') {\n return 1 + howManyVSpaceBlocksBelow(nextBlock);\n // Recurse until it isn't a vspace\n }\n return 0;\n };\n };\n\n this._getStackSize = function (blk) {\n // How many block units in this stack?\n var size = 0;\n this._sizeCounter += 1;\n if (this._sizeCounter > this.blockList.length * 2) {\n console.log('Infinite loop encountered detecting size of expandable block? ' + blk);\n return size;\n }\n\n if (blk == null) {\n return size;\n }\n\n var myBlock = this.blockList[blk];\n if (myBlock == null) {\n console.log('Something very broken in _getStackSize.');\n }\n\n if (myBlock.isClampBlock()) {\n var c = myBlock.connections.length - 2;\n var csize = 0;\n if (c > 0) {\n var cblk = myBlock.connections[c];\n if (cblk != null) {\n csize = this._getStackSize(cblk);\n }\n if (csize === 0) {\n size = 1; // minimum of 1 slot in clamp\n } else {\n size = csize;\n }\n }\n\n if (myBlock.isDoubleClampBlock()) {\n var c = myBlock.connections.length - 3;\n var csize = 0;\n if (c > 0) {\n var cblk = myBlock.connections[c];\n if (cblk != null) {\n csize = this._getStackSize(cblk);\n }\n\n if (csize === 0) {\n size += 1; // minimum of 1 slot in clamp\n } else {\n size += csize;\n }\n }\n }\n\n // add top and bottom of clamp\n size += myBlock.size;\n } else {\n size = myBlock.size;\n }\n\n // check on any connected block\n if (!myBlock.isValueBlock()) {\n var cblk = last(myBlock.connections);\n if (cblk != null) {\n size += this._getStackSize(cblk);\n }\n }\n return size;\n };\n\n this.adjustDocks = function (blk, resetLoopCounter) {\n // Give a block, adjust the dock positions\n // of all of the blocks connected to it\n\n var myBlock = this.blockList[blk];\n\n // For when we come in from makeBlock\n if (resetLoopCounter != null) {\n this._loopCounter = 0;\n }\n\n // These checks are to test for malformed data. All blocks\n // should have connections.\n if (myBlock == null) {\n console.log('Saw a null block: ' + blk);\n return;\n }\n\n if (myBlock.connections == null) {\n console.log('Saw a block with null connections: ' + blk);\n return;\n }\n\n if (myBlock.connections.length === 0) {\n console.log('Saw a block with [] connections: ' + blk);\n return;\n }\n\n // Value blocks only have one dock.\n if (myBlock.docks.length === 1) {\n return;\n }\n\n this._loopCounter += 1;\n if (this._loopCounter > this.blockList.length * 2) {\n console.log('Infinite loop encountered while adjusting docks: ' + blk + ' ' + this.blockList);\n return;\n }\n\n // Walk through each connection except the parent block; the\n // exception being the parent block of boolean 2arg blocks,\n // since the dock[0] position can change.\n if (myBlock.isTwoArgBooleanBlock()) {\n var start = 0;\n } else {\n var start = 1;\n }\n for (var c = start; c < myBlock.connections.length; c++) {\n // Get the dock position for this connection.\n var bdock = myBlock.docks[c];\n\n // Find the connecting block.\n var cblk = myBlock.connections[c];\n // Nothing connected here so continue to the next connection.\n if (cblk == null) {\n continue;\n }\n\n // Another database integrety check.\n if (this.blockList[cblk] == null) {\n console.log('This is not good: we encountered a null block: ' + cblk);\n continue;\n }\n\n // Find the dock position in the connected block.\n var foundMatch = false;\n for (var b = 0; b < this.blockList[cblk].connections.length; b++) {\n if (this.blockList[cblk].connections[b] === blk) {\n foundMatch = true;\n break\n }\n }\n\n // Yet another database integrety check.\n if (!foundMatch) {\n console.log('Did not find match for ' + myBlock.name + ' (' + blk + ') and ' + this.blockList[cblk].name + ' (' + cblk + ')');\n console.log(myBlock.connections);\n console.log(this.blockList[cblk].connections);\n break;\n }\n\n var cdock = this.blockList[cblk].docks[b];\n\n if (c > 0) {\n // Move the connected block...\n var dx = bdock[0] - cdock[0];\n var dy = bdock[1] - cdock[1];\n if (myBlock.container == null) {\n console.log('Does this ever happen any more?')\n } else {\n var nx = myBlock.container.x + dx;\n var ny = myBlock.container.y + dy;\n }\n this._moveBlock(cblk, nx, ny);\n } else {\n // or it's parent.\n var dx = cdock[0] - bdock[0];\n var dy = cdock[1] - bdock[1];\n var nx = this.blockList[cblk].container.x + dx;\n var ny = this.blockList[cblk].container.y + dy;\n this._moveBlock(blk, nx, ny);\n }\n\n if (c > 0) {\n // Recurse on connected blocks.\n this.adjustDocks(cblk, true);\n }\n }\n };\n\n this.addDefaultBlock = function (parentblk, oldBlock, skipOldBlock) {\n // Add an action name whenever the user removes the name from\n // an action block. Add a box name whenever the user removes\n // the name from a storein block. Add a Silence block\n // whenever the user removes all the blocks from a Note block.\n if (parentblk == null) {\n return;\n }\n\n if (this.blockList[parentblk].name === 'action') {\n var cblk = this.blockList[parentblk].connections[1];\n if (cblk == null) {\n var that = this;\n postProcess = function (args) {\n var parentblk = args[0];\n var oldBlock = args[1];\n\n var blk = that.blockList.length - 1;\n that.blockList[parentblk].connections[1] = blk;\n that.blockList[blk].value = that.findUniqueActionName(_('action'));\n var label = that.blockList[blk].value;\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n that.blockList[blk].text.text = label;\n that.blockList[blk].container.updateCache();\n\n if (that.blockList[blk].value !== that.blockList[oldBlock].value) {\n\n that.newNameddoBlock(that.blockList[blk].value, that.actionHasReturn(parentblk), that.actionHasArgs(parentblk));\n var blockPalette = that.palettes.dict['action'];\n for (var b = 0; b < blockPalette.protoList.length; b++) {\n var protoblock = blockPalette.protoList[b];\n if (protoblock.name === 'nameddo' && protoblock.defaults[0] === that.blockList[oldBlock].value) {\n setTimeout(function () {\n blockPalette.remove(protoblock, that.blockList[oldBlock].value);\n delete that.protoBlockDict['myDo_' + that.blockList[oldBlock].value];\n that.palettes.hide();\n that.palettes.updatePalettes('action');\n that.palettes.show();\n }, 500);\n\n break;\n }\n }\n\n that.renameNameddos(that.blockList[oldBlock].value, that.blockList[blk].value);\n if (skipOldBlock) {\n that.renameDos(that.blockList[oldBlock].value, that.blockList[blk].value, oldBlock);\n } else {\n that.renameDos(that.blockList[oldBlock].value, that.blockList[blk].value);\n }\n }\n\n that.adjustDocks(parentblk, true);\n };\n\n this._makeNewBlockWithConnections('text', 0, [parentblk], postProcess, [parentblk, oldBlock], false);\n }\n } else if (this.blockList[parentblk].name === 'storein') {\n var cblk = this.blockList[parentblk].connections[1];\n if (cblk == null) {\n var that = this;\n postProcess = function (args) {\n var parentblk = args[0];\n var oldBlock = args[1];\n\n var blk = that.blockList.length - 1;\n that.blockList[parentblk].connections[1] = blk;\n that.blockList[blk].value = _('box');\n var label = that.blockList[blk].value;\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n that.blockList[blk].text.text = label;\n that.blockList[blk].container.updateCache();\n\n that.adjustDocks(parentblk, true);\n };\n\n this._makeNewBlockWithConnections('text', 0, [parentblk], postProcess, [parentblk, oldBlock], false);\n }\n } else if (['newnote', 'osctime'].indexOf(this.blockList[parentblk].name) !== -1) {\n var cblk = this.blockList[parentblk].connections[2];\n if (cblk == null) {\n var blkname = 'vspace';\n var newVspaceBlock = this.makeBlock(blkname, '__NOARG__');\n this.blockList[parentblk].connections[2] = newVspaceBlock;\n this.blockList[newVspaceBlock].connections[0] = parentblk;\n var blkname = 'rest2';\n var newSilenceBlock = this.makeBlock(blkname, '__NOARG__');\n this.blockList[newSilenceBlock].connections[0] = newVspaceBlock;\n this.blockList[newSilenceBlock].connections[1] = null;\n this.blockList[newVspaceBlock].connections[1] = newSilenceBlock;\n } else if (this.blockList[cblk].name === 'vspace' && this.blockList[cblk].connections[1] == null) {\n var blkname = 'rest2';\n var newSilenceBlock = this.makeBlock(blkname, '__NOARG__');\n this.blockList[newSilenceBlock].connections[0] = cblk;\n this.blockList[newSilenceBlock].connections[1] = null;\n this.blockList[cblk].connections[1] = newSilenceBlock;\n }\n }\n };\n\n this.deleteNextDefault = function (thisBlock) {\n // Remove the Silence block from a Note block if another block\n // is inserted above the silence block.\n var thisBlockobj = this.blockList[thisBlock];\n for (var i = 1; i < thisBlockobj.connections.length; i++) {\n if (thisBlockobj.connections[i] && this.blockList[thisBlockobj.connections[i]].name === 'rest2') {\n var silenceBlock = thisBlockobj.connections[i];\n var silenceBlockobj = this.blockList[silenceBlock];\n silenceBlockobj.hide();\n silenceBlockobj.trash = true;\n this.blockList[thisBlock].connections[i] = silenceBlockobj.connections[1];\n break;\n }\n }\n };\n\n this.deletePreviousDefault = function (thisBlock) {\n // Remove the Silence block from a Note block if another block\n // is inserted just after the Silence block.\n var thisBlockobj = this.blockList[thisBlock];\n if (thisBlockobj && this.blockList[thisBlockobj.connections[0]] && this.blockList[thisBlockobj.connections[0]].name === 'rest2') {\n var silenceBlock = thisBlockobj.connections[0];\n var silenceBlockobj = this.blockList[silenceBlock];\n silenceBlockobj.hide();\n silenceBlockobj.trash = true;\n\n for (var i = 0; i < this.blockList[silenceBlockobj.connections[0]].connections.length; i++) {\n if (this.blockList[silenceBlockobj.connections[0]].connections[i] === silenceBlock) {\n this.blockList[silenceBlockobj.connections[0]].connections[i] = thisBlock;\n break;\n }\n }\n\n thisBlockobj.connections[0] = silenceBlockobj.connections[0];\n }\n\n return thisBlockobj.connections[0];\n };\n\n this.blockMoved = function (thisBlock) {\n // When a block is moved, we have lots of things to check:\n // (0) Is it inside of a expandable block?\n // Is it an arg inside an arg clamp?\n // (1) Is it an arg block connected to a two-arg block?\n // (2) Disconnect its connection[0];\n // (3) Look for a new connection;\n // Is it potentially an arg inside an arg clamp?\n // (4) Is it an arg block connected to a 2-arg block?\n // (5) Is it a pitch block being inserted or removed from\n // a Note clamp? In which case, we may have to remove\n // or add a silence block.\n // (6) Is it the name of an action block? In which case we\n // need to check to see if we need to rename it.\n // (7) Is it the name of a storein block? In which case we\n // need to check to see if we need to add a palette entry.\n // (8) And we need to recheck if it inside of a expandable block.\n\n // Find any containing expandable blocks.\n this._clampBlocksToCheck = [];\n if (thisBlock == null) {\n console.log('blockMoved called with null block.');\n return;\n }\n\n var blk = this._insideExpandableBlock(thisBlock);\n var expandableLoopCounter = 0;\n\n var parentblk = null;\n if (blk != null) {\n parentblk = blk;\n }\n\n var actionCheck = false;\n\n while (blk != null) {\n expandableLoopCounter += 1;\n if (expandableLoopCounter > 2 * this.blockList.length) {\n console.log('Infinite loop encountered checking for expandables?');\n break;\n }\n\n this._clampBlocksToCheck.push([blk, 0]);\n blk = this._insideExpandableBlock(blk);\n }\n\n this._checkTwoArgBlocks = [];\n var checkArgBlocks = [];\n var myBlock = this.blockList[thisBlock];\n if (myBlock == null) {\n console.log('null block found in blockMoved method: ' + thisBlock);\n return;\n }\n\n var c = myBlock.connections[0];\n if (c != null) {\n var cBlock = this.blockList[c];\n }\n\n // If it is an arg block, where is it coming from?\n if (myBlock.isArgBlock() && c != null) {\n // We care about twoarg (2arg) blocks with\n // connections to the first arg;\n if (this.blockList[c].isTwoArgBlock() || this.blockList[c].isArgClamp()) {\n if (cBlock.connections[1] === thisBlock) {\n this._checkTwoArgBlocks.push(c);\n }\n } else if (this.blockList[c].isArgBlock() && this.blockList[c].isExpandableBlock() || this.blockList[c].isArgClamp()) {\n if (cBlock.connections[1] === thisBlock) {\n this._checkTwoArgBlocks.push(c);\n }\n }\n }\n\n // Disconnect from connection[0] (both sides of the connection).\n if (c != null) {\n // Disconnect both ends of the connection.\n for (var i = 1; i < cBlock.connections.length; i++) {\n if (cBlock.connections[i] === thisBlock) {\n cBlock.connections[i] = null;\n break;\n }\n }\n myBlock.connections[0] = null;\n this.raiseStackToTop(thisBlock);\n }\n\n // Look for a new connection.\n var x1 = myBlock.container.x + myBlock.docks[0][0];\n var y1 = myBlock.container.y + myBlock.docks[0][1];\n\n // Find the nearest dock; if it is close enough, make the\n // connection.\n var newBlock = null;\n var newConnection = null;\n var min = (MINIMUMDOCKDISTANCE/DEFAULTBLOCKSCALE) * this.blockScale;\n var blkType = myBlock.docks[0][2];\n\n // Is the added block above the silence block or below?\n var insertAfterDefault = true;\n\n for (var b = 0; b < this.blockList.length; b++) {\n // Don't connect to yourself.\n if (b === thisBlock) {\n continue;\n }\n\n // Don't connect to a collapsed block.\n if (this.blockList[b].collapsed) {\n continue;\n }\n\n // Don't connect to a block in the trash.\n if (this.blockList[b].trash) {\n continue;\n }\n\n for (var i = 1; i < this.blockList[b].connections.length; i++) {\n // When converting from Python projects to JS format,\n // sometimes extra null connections are added. We need\n // to ignore them.\n if (i === this.blockList[b].docks.length) {\n break;\n }\n\n if ((i === this.blockList[b].connections.length - 1) && (this.blockList[b].connections[i] != null) && (this.blockList[this.blockList[b].connections[i]].isNoHitBlock())) {\n // Don't break the connection between a block and\n // a hidden block below it.\n continue;\n } else if ((['backward', 'status'].indexOf(this.blockList[b].name) !== -1) && (i === 1) && (this.blockList[b].connections[1] != null) && (this.blockList[this.blockList[b].connections[1]].isNoHitBlock())) {\n // Don't break the connection betweem a backward\n // block and a hidden block attached to its clamp.\n continue;\n } else if (this.blockList[b].name === 'action' && (i === 2) && (this.blockList[b].connections[2] != null) && (this.blockList[this.blockList[b].connections[2]].isNoHitBlock())) {\n // Don't break the connection betweem an action\n // block and a hidden block attached to its clamp.\n continue;\n }\n\n // Look for available connections.\n if (this._testConnectionType(blkType, this.blockList[b].docks[i][2])) {\n var x2 = this.blockList[b].container.x + this.blockList[b].docks[i][0];\n var y2 = this.blockList[b].container.y + this.blockList[b].docks[i][1];\n var dist = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);\n if (dist < min) {\n newBlock = b;\n newConnection = i;\n min = dist;\n }\n } else {\n // TODO: bounce away from illegal connection?\n // only if the distance was small\n // console.log('cannot not connect these two block types');\n }\n }\n }\n\n if (newBlock != null) {\n // We found a match.\n myBlock.connections[0] = newBlock;\n var connection = this.blockList[newBlock].connections[newConnection];\n if (connection == null) {\n if (this.blockList[newBlock].isArgClamp()) {\n // If it is an arg clamp, we may have to adjust\n // the slot size.\n if ((this.blockList[newBlock].name === 'doArg' || this.blockList[newBlock].name === 'calcArg') && newConnection === 1) {\n } else if (['doArg', 'nameddoArg'].indexOf(this.blockList[newBlock].name) !== -1 && newConnection === this.blockList[newBlock].connections.length - 1) {\n } else {\n // Get the size of the block we are inserting\n // adding.\n var size = this._getBlockSize(thisBlock);\n // console.log('inserting block of size ' + size + ' to arg clamp ' + this.blockList[newBlock].name);\n // Get the current slot list.\n var slotList = this.blockList[newBlock].argClampSlots;\n\n // Which slot is this block in?\n if (['doArg', 'calcArg'].indexOf(this.blockList[newBlock].name) !== -1) {\n var si = newConnection - 2;\n } else {\n var si = newConnection - 1;\n }\n if (slotList[si] !== size) {\n slotList[si] = size;\n this.blockList[newBlock].updateArgSlots(slotList);\n }\n }\n }\n } else {\n // Three scenarios in which we may be overriding an\n // existing connection:\n // (1) if it is an argClamp, add a new slot below the\n // current block;\n // (2) if it is an arg block, replace it; or\n // (3) if it is a flow block, insert it into the flow.\n // A few corner cases: Whenever we connect (or disconnect)\n // from an action block (c[1] arg), we need to ensure we have\n // a unique action name; Whenever we connect to a newnote\n // block (c[2] flow), we need to ensure we have either a silence\n // block or a pitch block. And if we are connecting to a\n // storein block, we need to ensure that there is a palette\n // entry for the new namedbox.\n insertAfterDefault = false;\n if (this.blockList[newBlock].isArgClamp()) {\n if ((this.blockList[newBlock].name === 'doArg' || this.blockList[newBlock].name === 'calcArg') && newConnection === 1) {\n // If it is the action name then treat it like\n // a standard replacement.\n this.blockList[connection].connections[0] = null;\n this.findDragGroup(connection);\n for (var c = 0; c < this.dragGroup.length; c++) {\n this.moveBlockRelative(this.dragGroup[c], 40, 40);\n }\n } else if (['doArg', 'nameddoArg'].indexOf(this.blockList[newBlock].name) !== -1 && newConnection === this.blockList[newBlock].connections.length - 1) {\n // If it is the bottom of the flow, insert as\n // usual.\n var bottom = this.findBottomBlock(thisBlock);\n this.blockList[connection].connections[0] = bottom;\n this.blockList[bottom].connections[this.blockList[bottom].connections.length - 1] = connection;\n } else {\n // Move the block in the current slot down one\n // slot (cascading and creating a new slot if\n // necessary).\n\n // Get the size of the block we are inserting adding.\n var size = this._getBlockSize(thisBlock);\n\n // Get the current slot list.\n var slotList = this.blockList[newBlock].argClampSlots;\n // Which slot is this block in?\n var ci = this.blockList[newBlock].connections.indexOf(connection);\n if (['doArg', 'calcArg'].indexOf(this.blockList[newBlock].name) !== -1) {\n var si = ci - 2;\n } else {\n var si = ci - 1;\n }\n\n var emptySlot = null;\n var emptyConnection = null;\n // Is there an empty slot below?\n for (var emptySlot = si; emptySlot < slotList.length; emptySlot++) {\n if (this.blockList[newBlock].connections[ci + emptySlot - si] == null) {\n emptyConnection = ci + emptySlot - si;\n break;\n }\n }\n\n if (emptyConnection == null) {\n slotList.push(1);\n this._newLocalArgBlock(slotList.length);\n emptyConnection = ci + emptySlot - si;\n this.blockList[newBlock].connections.push(null);\n\n // Slide everything down one slot.\n for (var i = slotList.length - 1; i > si + 1; i--) {\n slotList[i] = slotList[i - 1];\n }\n for (var i = this.blockList[newBlock].connections.length - 1; i > ci + 1; i--) {\n this.blockList[newBlock].connections[i] = this.blockList[newBlock].connections[i - 1];\n }\n }\n // The new block is added below the current\n // connection...\n newConnection += 1;\n // Set its slot size too.\n slotList[si + 1] = size;\n\n this.blockList[newBlock].updateArgSlots(slotList);\n }\n } else if (myBlock.isArgBlock()) {\n this.blockList[connection].connections[0] = null;\n this.findDragGroup(connection);\n for (var c = 0; c < this.dragGroup.length; c++) {\n this.moveBlockRelative(this.dragGroup[c], 40, 40);\n }\n\n // We need to rename the action stack.\n if (this.blockList[newBlock].name === 'action') {\n actionCheck = true;\n\n if (myBlock.value !== this.blockList[connection].value) {\n // Temporarily disconnect to ensure we don't\n // find myBlock when looking for a unique name.\n var c = myBlock.connections[0];\n myBlock.connections[0] = null;\n var name = this.findUniqueActionName(myBlock.value);\n myBlock.connections[0] = c;\n\n if (name !== myBlock.value) {\n myBlock.value = name;\n var label = name;\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n myBlock.text.text = label;\n myBlock.container.updateCache();\n }\n\n var that = this;\n setTimeout(function () {\n // A previously disconnected name may have left\n // an entry in the palette we need to remove.\n var name = that.blockList[connection].value;\n if (that.protoBlockDict['myDo_' + name] != undefined) {\n delete that.protoBlockDict['myDo_' + name];\n that.palettes.dict['action'].hideMenu(true);\n }\n\n that.newNameddoBlock(myBlock.value, that.actionHasReturn(newBlock), that.actionHasArgs(newBlock));\n var blockPalette = that.palettes.dict['action'];\n for (var b = 0; b < blockPalette.protoList.length; b++) {\n var protoblock = blockPalette.protoList[b];\n if (protoblock.name === 'nameddo' && protoblock.staticLabels[0] === that.blockList[connection].value) {\n setTimeout(function () {\n blockPalette.remove(protoblock, that.blockList[connection].value);\n delete that.protoBlockDict['myDo_' + that.blockList[connection].value];\n that.palettes.hide();\n that.palettes.updatePalettes('action');\n that.palettes.show();\n }, 500);\n\n break;\n }\n }\n\n that.renameNameddos(that.blockList[connection].value, myBlock.value);\n that.renameDos(that.blockList[connection].value, myBlock.value);\n }, 750);\n }\n } else if (this.blockList[newBlock].name === 'storein') {\n // We may need to add new storein and namedo\n // blocks to the palette.\n if (myBlock.value !== 'box') {\n this.newStoreinBlock(myBlock.value);\n this.newNamedboxBlock(myBlock.value);\n var that = this;\n setTimeout(function () {\n that.palettes.hide();\n that.palettes.updatePalettes('boxes');\n that.palettes.show();\n }, 500);\n }\n }\n } else if (!this.blockList[thisBlock].isArgFlowClampBlock()) {\n var bottom = this.findBottomBlock(thisBlock);\n this.blockList[connection].connections[0] = bottom;\n this.blockList[bottom].connections[this.blockList[bottom].connections.length - 1] = connection;\n }\n }\n\n this.blockList[newBlock].connections[newConnection] = thisBlock;\n\n // Remove the silence block (if it is present) after\n // adding a new block inside of a note block.\n if (this._insideNoteBlock(thisBlock) != null) {\n // If blocks are inserted above the silence block.\n if (insertAfterDefault) {\n newBlock = this.deletePreviousDefault(thisBlock);\n } else {\n this.deleteNextDefault(bottom);\n }\n }\n\n // If we attached a name to an action block, check to see\n // if we need to rename it.\n if (this.blockList[newBlock].name === 'action' && !actionCheck) {\n // Is there already another action block with this name?\n for (var b = 0; b < this.blockList.length; b++) {\n if (b === newBlock) continue;\n if (this.blockList[b].name === 'action') {\n if (this.blockList[b].connections[1] != null) {\n if (this.blockList[this.blockList[b].connections[1]].value === this.blockList[thisBlock].value) {\n this.blockList[thisBlock].value = this.findUniqueActionName(this.blockList[thisBlock].value);\n var label = this.blockList[thisBlock].value;\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n this.blockList[thisBlock].text.text = label;\n this.blockList[thisBlock].container.updateCache();\n this.newNameddoBlock(this.blockList[thisBlock].value, this.actionHasReturn(b), this.actionHasArgs(b));\n this.setActionProtoVisiblity(false);\n }\n }\n }\n }\n }\n\n // console.log('Adjust Docks: ' + this.blockList[newBlock].name);\n this.adjustDocks(newBlock, true);\n // TODO: some graphical feedback re new connection?\n }\n\n // If it is an arg block, where is it coming from?\n // FIXME: improve mechanism for testing block types.\n if ((myBlock.isArgBlock() || myBlock.name === 'calcArg' || myBlock.name === 'namedcalcArg') && newBlock != null) {\n // We care about twoarg blocks with connections to the\n // first arg;\n if (this.blockList[newBlock].isTwoArgBlock()) {\n if (this.blockList[newBlock].connections[1] === thisBlock) {\n if (this._checkTwoArgBlocks.indexOf(newBlock) === -1) {\n this._checkTwoArgBlocks.push(newBlock);\n }\n }\n } else if (this.blockList[newBlock].isArgBlock() && this.blockList[newBlock].isExpandableBlock()) {\n if (this.blockList[newBlock].connections[1] === thisBlock) {\n if (this._checkTwoArgBlocks.indexOf(newBlock) === -1) {\n this._checkTwoArgBlocks.push(newBlock);\n }\n }\n }\n // We also care about the second-to-last connection to an\n // arg block.\n var n = this.blockList[newBlock].connections.length;\n if (this.blockList[newBlock].connections[n - 2] === thisBlock) {\n // Only flow blocks, but not ArgClamps\n if (!this.blockList[newBlock].isArgClamp() && this.blockList[newBlock].docks[n - 1][2] === 'in') {\n checkArgBlocks.push(newBlock);\n }\n }\n }\n\n this.addDefaultBlock(parentblk, thisBlock, actionCheck);\n\n // Put block adjustments inside a slight delay to make the\n // addition/substraction of vspace and changes of block shape\n // appear less abrupt (and it can be a little racy).\n var that = this;\n setTimeout(function () {\n // If we changed the contents of a arg block, we may need a vspace.\n if (checkArgBlocks.length > 0) {\n for (var i = 0; i < checkArgBlocks.length; i++) {\n that._addRemoveVspaceBlock(checkArgBlocks[i]);\n }\n }\n\n // If we changed the contents of a two-arg block, we need to\n // adjust it.\n if (that._checkTwoArgBlocks.length > 0) {\n that._adjustExpandableTwoArgBlock(that._checkTwoArgBlocks);\n }\n\n // First, adjust the docks for any blocks that may have\n // had a vspace added.\n for (var i = 0; i < checkArgBlocks.length; i++) {\n // console.log('Adjust Docks: ' + this.blockList[checkArgBlocks[i]].name);\n that.adjustDocks(checkArgBlocks[i], true);\n }\n\n // Next, recheck if the connection is inside of a\n // expandable block.\n var blk = that._insideExpandableBlock(thisBlock);\n var expandableLoopCounter = 0;\n while (blk != null) {\n // Extra check for malformed data.\n expandableLoopCounter += 1;\n if (expandableLoopCounter > 2 * that.blockList.length) {\n console.log('Infinite loop checking for expandables?');\n console.log(that.blockList);\n break;\n }\n\n if (that.blockList[blk].name === 'ifthenelse') {\n that._clampBlocksToCheck.push([blk, 0]);\n that._clampBlocksToCheck.push([blk, 1]);\n } else {\n that._clampBlocksToCheck.push([blk, 0]);\n }\n\n blk = that._insideExpandableBlock(blk);\n }\n\n that._adjustExpandableClampBlock();\n that.refreshCanvas();\n }, 250);\n };\n\n this._testConnectionType = function (type1, type2) {\n // Can these two blocks dock?\n if (type1 === 'in' && type2 === 'out') {\n return true;\n }\n if (type1 === 'out' && type2 === 'in') {\n return true;\n }\n if (type1 === 'numberin' && ['numberout', 'anyout'].indexOf(type2) !== -1) {\n return true;\n }\n if (['numberout', 'anyout'].indexOf(type1) !== -1 && type2 === 'numberin') {\n return true;\n }\n if (type1 === 'textin' && ['textout', 'anyout'].indexOf(type2) !== -1) {\n return true;\n }\n if (['textout', 'anyout'].indexOf(type1) !== -1 && type2 === 'textin') {\n return true;\n }\n if (type1 === 'booleanout' && type2 === 'booleanin') {\n return true;\n }\n if (type1 === 'booleanin' && type2 === 'booleanout') {\n return true;\n }\n if (type1 === 'mediain' && type2 === 'mediaout') {\n return true;\n }\n if (type1 === 'mediaout' && type2 === 'mediain') {\n return true;\n }\n if (type1 === 'mediain' && type2 === 'textout') {\n return true;\n }\n if (type2 === 'mediain' && type1 === 'textout') {\n return true;\n }\n if (type1 === 'filein' && type2 === 'fileout') {\n return true;\n }\n if (type1 === 'fileout' && type2 === 'filein') {\n return true;\n }\n if (type1 === 'solfegein' && ['anyout', 'solfegeout', 'textout', 'noteout', 'numberout'].indexOf(type2) !== -1) {\n return true;\n }\n if (type2 === 'solfegein' && ['anyout', 'solfegeout', 'textout', 'noteout', 'numberout'].indexOf(type1) !== -1) {\n return true;\n }\n if (type1 === 'notein' && ['solfegeout', 'textout', 'noteout'].indexOf(type2) !== -1) {\n return true;\n }\n if (type2 === 'notein' && ['solfegeout', 'textout', 'noteout'].indexOf(type1) !== -1) {\n return true;\n }\n if (type1 === 'anyin' && ['textout', 'mediaout', 'numberout', 'anyout', 'fileout', 'solfegeout', 'noteout'].indexOf(type2) !== -1) {\n return true;\n }\n if (type2 === 'anyin' && ['textout', 'mediaout', 'numberout', 'anyout', 'fileout', 'solfegeout', 'noteout'].indexOf(type1) !== -1) {\n return true;\n }\n return false;\n };\n\n this.updateBlockPositions = function () {\n // Create the block image if it doesn't yet exist.\n for (var blk = 0; blk < this.blockList.length; blk++) {\n this._moveBlock(blk, this.blockList[blk].container.x, this.blockList[blk].container.y);\n }\n };\n\n this.bringToTop = function () {\n // Move all the blocks to the top layer of the stage\n this._adjustTheseStacks = [];\n\n for (var blk in this.blockList) {\n var myBlock = this.blockList[blk];\n /*\n this.stage.removeChild(myBlock.container);\n this.stage.addChild(myBlock.container);\n if (myBlock.collapseContainer != null) {\n this.stage.removeChild(myBlock.collapseContainer);\n this.stage.addChild(myBlock.collapseContainer);\n }\n */\n if (myBlock.connections[0] == null) {\n this._adjustTheseStacks.push(blk);\n }\n }\n for (var blk = 0; blk < this._adjustTheseStacks.length; blk++) {\n // console.log('Adjust Stack: ' + this.blockList[this._adjustTheseStacks[blk]].name);\n this.raiseStackToTop(this._adjustTheseStacks[blk]);\n }\n\n this.refreshCanvas();\n };\n\n this.checkBounds = function () {\n var onScreen = true;\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (this.blockList[blk].connections[0] == null) {\n if (this.blockList[blk].offScreen(this.boundary)) {\n this._homeButtonContainers[0].visible = true;\n this._homeButtonContainers[1].visible = false;\n this.boundary.show();\n onScreen = false;\n break;\n }\n }\n }\n if (onScreen) {\n this._homeButtonContainers[0].visible = false;\n this._homeButtonContainers[1].visible = true;\n this.boundary.hide();\n }\n };\n\n this._moveBlock = function (blk, x, y) {\n // Move a block (and its label) to x, y.\n var myBlock = this.blockList[blk];\n if (myBlock.container != null) {\n myBlock.container.x = x;\n myBlock.container.y = y;\n\n if (myBlock.collapseContainer != null) {\n myBlock.collapseContainer.x = x + COLLAPSEBUTTONXOFF * (this.blockList[blk].protoblock.scale / 2);\n myBlock.collapseContainer.y = y + COLLAPSEBUTTONYOFF * (this.blockList[blk].protoblock.scale / 2);\n }\n\n this.checkBounds();\n } else {\n console.log('No container yet for block ' + myBlock.name);\n }\n };\n\n this.moveBlockRelative = function (blk, dx, dy) {\n // Move a block (and its label) by dx, dy.\n if (this.inLongPress) {\n this.saveStackButton.visible = false;\n this.dismissButton.visible = false;\n this.inLongPress = false;\n }\n\n var myBlock = this.blockList[blk];\n if (myBlock.container != null) {\n myBlock.container.x += dx;\n myBlock.container.y += dy;\n\n if (myBlock.collapseContainer != null) {\n myBlock.collapseContainer.x += dx;\n myBlock.collapseContainer.y += dy;\n }\n\n this.checkBounds();\n } else {\n console.log('No container yet for block ' + myBlock.name);\n }\n };\n\n this.moveStackRelative = function (blk, dx, dy) {\n this.findDragGroup(blk)\n if (this.dragGroup.length > 0) {\n for (var b = 0; b < this.dragGroup.length; b++) {\n this.moveBlockRelative(this.dragGroup[b], dx, dy);\n }\n }\n };\n\n this.updateBlockText = function (blk) {\n // When we create new blocks, we may not have assigned the\n // value yet.\n var myBlock = this.blockList[blk];\n var maxLength = 8;\n if (myBlock.text == null) {\n return;\n }\n\n if (myBlock.name === 'loadFile') {\n try {\n var label = myBlock.value[0].toString();\n } catch (e) {\n var label = _('open file');\n }\n maxLength = 10;\n } else if (myBlock.name === 'solfege') {\n var obj = splitSolfege(myBlock.value);\n var label = i18nSolfege(obj[0]);\n var attr = obj[1];\n\n if (attr !== '♮') {\n label += attr;\n }\n } else if (myBlock.name === 'eastindiansolfege') {\n var obj = splitSolfege(myBlock.value);\n var label = WESTERN2EISOLFEGENAMES[obj[0]];\n var attr = obj[1];\n\n if (attr !== '♮') {\n label += attr;\n }\n } else {\n var label = myBlock.value.toString();\n }\n\n if (label.length > maxLength) {\n label = label.substr(0, maxLength - 1) + '...';\n }\n\n myBlock.text.text = label;\n\n // Make sure text is on top.\n var z = myBlock.container.getNumChildren() - 1;\n myBlock.container.setChildIndex(myBlock.text, z);\n\n if (myBlock.loadComplete) {\n myBlock.container.updateCache();\n } else {\n console.log('Load not yet complete for (' + blk + ') ' + myBlock.name);\n }\n };\n\n this.findTopBlock = function (blk) {\n // Find the top block in a stack.\n if (blk == null) {\n return null;\n }\n\n var myBlock = this.blockList[blk];\n if (myBlock.connections == null) {\n return blk;\n }\n\n if (myBlock.connections.length === 0) {\n return blk;\n }\n\n // Test for corrupted-connection scenario.\n if (myBlock.connections.length > 1 && myBlock.connections[0] != null && myBlock.connections[0] === last(myBlock.connections)) {\n console.log('WARNING: CORRUPTED BLOCK DATA. Block ' + myBlock.name + ' (' + blk + ') is connected to the same block ' + this.blockList[myBlock.connections[0]].name + ' (' + myBlock.connections[0] + ') twice.');\n return blk;\n }\n\n var topBlockLoop = 0;\n while (myBlock.connections[0] != null) {\n topBlockLoop += 1;\n if (topBlockLoop > 2 * this.blockList.length) {\n // Could happen if the block data is malformed.\n console.log('infinite loop finding topBlock?');\n console.log(this.blockList.indexOf(myBlock) + ' ' + myBlock.name);\n break;\n }\n blk = myBlock.connections[0];\n myBlock = this.blockList[blk];\n }\n return blk;\n };\n\n this.sameGeneration = function (firstBlk, childBlk) {\n if (firstBlk == null || childBlk == null) {\n return false;\n }\n\n if (firstBlk === childBlk) {\n return true;\n }\n\n var myBlock = this.blockList[firstBlk];\n if (myBlock.connections == null) {\n return false;\n }\n\n if (myBlock.connections.length === 0) {\n return false;\n }\n\n var bottomBlockLoop = 0;\n while (last(myBlock.connections) != null) {\n bottomBlockLoop += 1;\n if (bottomBlockLoop > 2 * this.blockList.length) {\n // Could happen if the block data is malformed.\n console.log('infinite loop finding bottomBlock?');\n break;\n }\n blk = last(myBlock.connections);\n myBlock = this.blockList[blk];\n if (blk === childBlk) {\n return true;\n }\n }\n return false;\n }\n\n this.findBottomBlock = function (blk) {\n // Find the bottom block in a stack.\n if (blk == null) {\n return null;\n }\n\n var myBlock = this.blockList[blk];\n if (myBlock.connections == null) {\n return blk;\n }\n\n if (myBlock.connections.length === 0) {\n return blk;\n }\n\n var bottomBlockLoop = 0;\n while (last(myBlock.connections) != null) {\n bottomBlockLoop += 1;\n if (bottomBlockLoop > 2 * this.blockList.length) {\n // Could happen if the block data is malformed.\n console.log('infinite loop finding bottomBlock?');\n break;\n }\n blk = last(myBlock.connections);\n myBlock = this.blockList[blk];\n }\n return blk;\n };\n\n this.findStacks = function () {\n // Find any blocks with null in the first connection.\n this.stackList = [];\n for (var i = 0; i < this.blockList.length; i++) {\n if (this.blockList[i].connections[0] == null) {\n this.stackList.push(i)\n }\n }\n };\n\n this._findClamps = function () {\n // Find any clamp blocks.\n this._expandablesList = [];\n this.findStacks(); // We start by finding the stacks\n for (var i = 0; i < this.stackList.length; i++) {\n this._searchCounter = 0;\n this._searchForExpandables(this.stackList[i]);\n }\n\n this._searchForArgFlow();\n };\n\n this._findTwoArgs = function () {\n // Find any expandable arg blocks.\n this._expandablesList = [];\n for (var i = 0; i < this.blockList.length; i++) {\n if (this.blockList[i].isArgBlock() && this.blockList[i].isExpandableBlock()) {\n this._expandablesList.push(i);\n } else if (this.blockList[i].isTwoArgBlock()) {\n this._expandablesList.push(i);\n }\n }\n };\n\n this._searchForArgFlow = function () {\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (this.blockList[blk].isArgFlowClampBlock()) {\n this._expandablesList.push(blk);\n }\n }\n };\n\n this._searchForExpandables = function (blk) {\n // Find the expandable blocks below blk in a stack.\n while (blk != null && this.blockList[blk] != null && !this.blockList[blk].isValueBlock()) {\n // More checks for malformed or corrupted block data.\n this._searchCounter += 1;\n if (this._searchCounter > 2 * this.blockList.length) {\n console.log('infinite loop searching for Expandables? ' + this._searchCounter);\n console.log(blk + ' ' + this.blockList[blk].name);\n break;\n }\n\n if (this.blockList[blk].isClampBlock()) {\n this._expandablesList.push(blk);\n var c = this.blockList[blk].connections.length - 2;\n this._searchForExpandables(this.blockList[blk].connections[c]);\n if (this.blockList[blk].name === 'ifthenelse') {\n // search top clamp too\n var c = 2;\n this._searchForExpandables(this.blockList[blk].connections[c]);\n }\n } else if (this.blockList[blk].isArgClamp()) {\n this._expandablesList.push(blk);\n }\n\n if (this.blockList[blk].connections.length > 1) {\n blk = last(this.blockList[blk].connections);\n } else {\n // A value block only connects back to its parent, so\n // end the search here.\n blk = null;\n }\n }\n };\n\n this._expandTwoArgs = function () {\n // Expand expandable 2-arg blocks as needed.\n this._findTwoArgs();\n this._adjustExpandableTwoArgBlock(this._expandablesList);\n this.refreshCanvas();\n };\n\n this._expandClamps = function () {\n // Expand expandable clamp blocks as needed.\n this._findClamps();\n this._clampBlocksToCheck = [];\n for (var i = 0; i < this._expandablesList.length; i++) {\n if (this.blockList[this._expandablesList[i]].name === 'ifthenelse') {\n this._clampBlocksToCheck.push([this._expandablesList[i], 0]);\n this._clampBlocksToCheck.push([this._expandablesList[i], 1]);\n } else {\n this._clampBlocksToCheck.push([this._expandablesList[i], 0]);\n }\n }\n\n this._adjustExpandableClampBlock();\n this.refreshCanvas();\n };\n\n this.changeDisabledStatus = function (name, flag) {\n // Some blocks, e.g., sensor blocks for Butia, change their\n // appearance depending upon if they have been enabled or\n // disabled.\n for (var blk in this.blockList) {\n var myBlock = this.blockList[blk];\n if (myBlock.name === name) {\n myBlock.protoblock.disabled = flag;\n myBlock.regenerateArtwork(false);\n }\n }\n };\n\n this.unhighlightAll = function () {\n for (var blk in this.blockList) {\n this.unhighlight(blk);\n }\n };\n\n this.unhighlight = function (blk) {\n if (!this.visible) {\n return;\n }\n if (blk != null) {\n var thisBlock = blk;\n } else {\n var thisBlock = this.highlightedBlock;\n }\n if (thisBlock != null) {\n\n this.blockList[thisBlock].unhighlight();\n }\n if (this.highlightedBlock = thisBlock) {\n this.highlightedBlock = null;\n }\n };\n\n this.highlight = function (blk, unhighlight) {\n if (!this.visible) {\n return;\n }\n if (blk != null) {\n if (unhighlight) {\n this.unhighlight(null);\n }\n this.blockList[blk].highlight();\n this.highlightedBlock = blk;\n }\n };\n\n this.hide = function () {\n for (var blk in this.blockList) {\n this.blockList[blk].hide();\n }\n this.visible = false;\n };\n\n this.show = function () {\n for (var blk in this.blockList) {\n this.blockList[blk].show();\n }\n this.visible = true;\n };\n\n this._makeNewBlockWithConnections = function (name, blockOffset, connections, postProcess, postProcessArg, collapsed) {\n if (typeof(collapsed) === 'undefined') {\n collapsed = false\n }\n myBlock = this.makeNewBlock(name, postProcess, postProcessArg);\n if (myBlock == null) {\n console.log('could not make block ' + name);\n return;\n }\n\n // myBlock.collapsed = !collapsed;\n for (var c = 0; c < connections.length; c++) {\n if (c === myBlock.docks.length) {\n break;\n }\n if (connections[c] == null) {\n myBlock.connections.push(null);\n } else {\n myBlock.connections.push(connections[c] + blockOffset);\n }\n }\n };\n\n this.makeNewBlock = function (name, postProcess, postProcessArg) {\n // Create a new block\n if (!name in this.protoBlockDict) {\n // Should never happen: nop blocks should be substituted\n console.log('makeNewBlock: no prototype for ' + name);\n return null;\n }\n\n if (this.protoBlockDict[name] == null) {\n // Should never happen\n console.log('makeNewBlock: no prototype for ' + name);\n return null;\n }\n\n // Deprecated\n // If we drag in a synth block, we need to load the synth.\n if (['sine', 'sawtooth', 'triangle', 'square'].indexOf(name) !== -1) {\n if (_THIS_IS_MUSIC_BLOCKS_) {\n this.logo.synth.loadSynth(name);\n }\n }\n\n if (['namedbox', 'nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg'].indexOf(name) !== -1) {\n this.blockList.push(new Block(this.protoBlockDict[name], this, postProcessArg[1]));\n } else if (name === 'namedarg') {\n this.blockList.push(new Block(this.protoBlockDict[name], this, 'arg ' + postProcessArg[1]));\n } else {\n this.blockList.push(new Block(this.protoBlockDict[name], this));\n }\n\n if (last(this.blockList) == null) {\n // Should never happen\n console.log('failed to make protoblock for ' + name);\n return null;\n }\n\n // We copy the dock because expandable blocks modify it.\n var myBlock = last(this.blockList);\n myBlock.copySize();\n\n // We may need to do some postProcessing to the block\n myBlock.postProcess = postProcess;\n myBlock.postProcessArg = postProcessArg;\n\n // We need a container for the block graphics.\n myBlock.container = new createjs.Container();\n this.stage.addChild(myBlock.container);\n myBlock.container.snapToPixelEnabled = true;\n myBlock.container.x = 0;\n myBlock.container.y = 0;\n\n // and we need to load the images into the container.\n myBlock.imageLoad();\n return myBlock;\n };\n\n this.makeBlock = function (name, arg) {\n // Make a new block from a proto block.\n // Called from palettes.\n\n if (name === 'text') {\n console.log('makeBlock ' + name + ' ' + arg);\n }\n var postProcess = null;\n var postProcessArg = null;\n var that = this;\n var thisBlock = this.blockList.length;\n if (name === 'start') {\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = that.turtles.turtleList.length;\n that.turtles.addTurtle(that.blockList[thisBlock]);\n };\n\n postProcessArg = thisBlock;\n } else if (name === 'drum') {\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = that.turtles.turtleList.length;\n that.turtles.addDrum(that.blockList[thisBlock]);\n };\n\n postProcessArg = thisBlock;\n } else if (name === 'text') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value;\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, _('text')];\n } else if (name === 'solfege') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value;\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, 'sol'];\n } else if (name === 'eastindiansolfege') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = WESTERN2EISOLFEGENAMES[value];\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, 'sol'];\n } else if (name === 'notename') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value;\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, 'G'];\n } else if (name === 'drumname') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value;\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, 'kick'];\n } else if (name === 'voicename') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value;\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, 'sine'];\n } else if (name === 'modename') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value;\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, 'Major'];\n } else if (name === 'number') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = Number(args[1]);\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value.toString();\n that.blockList[thisBlock].container.updateCache();\n };\n\n postProcessArg = [thisBlock, NUMBERBLOCKDEFAULT];\n } else if (name === 'media') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n if (value == null) {\n that.blockList[thisBlock].image = 'images/load-media.svg';\n } else {\n that.blockList[thisBlock].image = null;\n }\n };\n\n postProcessArg = [thisBlock, null];\n } else if (name === 'camera') {\n postProcess = function (args) {\n console.log('post process camera ' + args[1]);\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = CAMERAVALUE;\n if (value == null) {\n that.blockList[thisBlock].image = 'images/camera.svg';\n } else {\n that.blockList[thisBlock].image = null;\n }\n };\n\n postProcessArg = [thisBlock, null];\n } else if (name === 'video') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = VIDEOVALUE;\n if (value == null) {\n that.blockList[thisBlock].image = 'images/video.svg';\n } else {\n that.blockList[thisBlock].image = null;\n }\n };\n\n postProcessArg = [thisBlock, null];\n } else if (name === 'loadFile') {\n postProcess = function (args) {\n that.updateBlockText(args[0]);\n };\n\n postProcessArg = [thisBlock, null];\n } else if (['namedbox', 'nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg', 'namedarg'].indexOf(name) !== -1) {\n postProcess = function (args) {\n that.blockList[thisBlock].value = null;\n that.blockList[thisBlock].privateData = args[1];\n };\n\n postProcessArg = [thisBlock, arg];\n }\n\n var protoFound = false;\n for (var proto in that.protoBlockDict) {\n if (that.protoBlockDict[proto].name === name) {\n if (arg === '__NOARG__') {\n that.makeNewBlock(proto, postProcess, postProcessArg);\n protoFound = true;\n break;\n } else if (that.protoBlockDict[proto].defaults[0] === arg) {\n that.makeNewBlock(proto, postProcess, postProcessArg);\n protoFound = true;\n break;\n } else if (['namedbox', 'nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg', 'namedarg'].indexOf(name) !== -1) {\n if (that.protoBlockDict[proto].defaults[0] === undefined) {\n that.makeNewBlock(proto, postProcess, postProcessArg);\n protoFound = true;\n break;\n }\n }\n }\n }\n\n if (!protoFound) {\n console.log(name + ' not found!!');\n }\n\n var blk = this.blockList.length - 1;\n var myBlock = this.blockList[blk];\n for (var i = 0; i < myBlock.docks.length; i++) {\n myBlock.connections.push(null);\n }\n\n // Attach default args if any\n var cblk = blk + 1;\n for (var i = 0; i < myBlock.protoblock.defaults.length; i++) {\n var value = myBlock.protoblock.defaults[i];\n\n if (myBlock.name === 'action') {\n // Make sure we don't make two actions with the same name.\n value = this.findUniqueActionName(_('action'));\n if (value !== _('action')) {\n // TODO: are there return or arg blocks?\n this.newNameddoBlock(value, false, false);\n this.palettes.hide();\n this.palettes.updatePalettes('action');\n this.palettes.show();\n }\n }\n\n var that = this;\n var thisBlock = this.blockList.length;\n if (myBlock.docks.length > i && myBlock.docks[i + 1][2] === 'anyin') {\n if (value == null) {\n console.log('cannot set default value');\n } else if (typeof(value) === 'string') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n var label = value.toString();\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n that.blockList[thisBlock].text.text = label;\n that.blockList[thisBlock].container.updateCache();\n };\n\n this.makeNewBlock('text', postProcess, [thisBlock, value]);\n } else {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = Number(args[1]);\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value.toString();\n };\n\n this.makeNewBlock('number', postProcess, [thisBlock, value]);\n }\n } else if (myBlock.docks[i + 1][2] === 'textin') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n var label = value.toString();\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n that.blockList[thisBlock].text.text = label;\n };\n\n this.makeNewBlock('text', postProcess, [thisBlock, value]);\n } else if (myBlock.docks[i + 1][2] === 'solfegein') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n var label = value.toString();\n that.blockList[thisBlock].text.text = label;\n };\n\n this.makeNewBlock('solfege', postProcess, [thisBlock, value]);\n } else if (myBlock.docks[i + 1][2] === 'notein') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n var label = value.toString();\n that.blockList[thisBlock].text.text = label;\n };\n\n this.makeNewBlock('notename', postProcess, [thisBlock, value]);\n } else if (myBlock.docks[i + 1][2] === 'mediain') {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n if (value != null) {\n // loadThumbnail(that, thisBlock, null);\n }\n };\n\n this.makeNewBlock('media', postProcess, [thisBlock, value]);\n } else if (myBlock.docks[i + 1][2] === 'filein') {\n postProcess = function (blk) {\n that.updateBlockText(blk);\n }\n this.makeNewBlock('loadFile', postProcess, thisBlock);\n } else {\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.blockList[thisBlock].text.text = value.toString();\n };\n\n this.makeNewBlock('number', postProcess, [thisBlock, value]);\n }\n\n var myConnectionBlock = this.blockList[cblk + i];\n myConnectionBlock.connections = [blk];\n myConnectionBlock.value = value;\n myBlock.connections[i + 1] = cblk + i;\n }\n\n // Generate and position the block bitmaps and labels\n this.updateBlockPositions();\n // console.log('Adjust Docks: ' + this.blockList[blk].name);\n this.adjustDocks(blk, true);\n this.refreshCanvas();\n\n return blk;\n };\n\n this.findDragGroup = function (blk) {\n // Generate a drag group from blocks connected to blk\n this.dragLoopCounter = 0;\n this.dragGroup = [];\n this._calculateDragGroup(blk);\n };\n\n this._calculateDragGroup = function (blk) {\n // Give a block, find all the blocks connected to it\n this.dragLoopCounter += 1;\n if (this.dragLoopCount > this.blockList.length) {\n console.log('maximum loop counter exceeded in calculateDragGroup... this is bad. ' + blk);\n return;\n }\n\n if (blk == null) {\n console.log('null block passed to calculateDragGroup');\n return;\n }\n\n var myBlock = this.blockList[blk];\n // If this happens, something is really broken.\n if (myBlock == null) {\n console.log('null block encountered... this is bad. ' + blk);\n return;\n }\n\n // As before, does these ever happen?\n if (myBlock.connections == null) {\n this.dragGroup = [blk];\n return;\n }\n\n // Some malformed blocks might have no connections.\n if (myBlock.connections.length === 0) {\n this.dragGroup = [blk];\n return;\n }\n\n this.dragGroup.push(blk);\n\n for (var c = 1; c < myBlock.connections.length; c++) {\n var cblk = myBlock.connections[c];\n if (cblk != null) {\n // Recurse\n this._calculateDragGroup(cblk);\n }\n }\n };\n\n this.setActionProtoVisiblity = function (state) {\n // By default, the nameddo protoblock is hidden.\n var actionsPalette = this.palettes.dict['action'];\n var stateChanged = false;\n for (var blockId = 0; blockId < actionsPalette.protoList.length; blockId++) {\n var block = actionsPalette.protoList[blockId];\n if ('nameddo' === block.name && block.defaults.length === 0) {\n if (block.hidden === state) {\n block.hidden = !state;\n stateChanged = true;\n }\n }\n }\n\n // Force an update if the name has changed.\n if (stateChanged) {\n this.palettes.hide();\n this.palettes.updatePalettes('action');\n this.palettes.show();\n }\n };\n\n this.findUniqueActionName = function (name) {\n // If we have a stack named 'action', make the protoblock visible.\n if (name === _('action')) {\n this.setActionProtoVisiblity(true);\n }\n\n // Make sure we don't make two actions with the same name.\n var actionNames = [];\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if ((this.blockList[blk].name === 'text' || this.blockList[blk].name === 'string') && !this.blockList[blk].trash) {\n var c = this.blockList[blk].connections[0];\n if (c != null && this.blockList[c].name === 'action' && !this.blockList[c].trash) {\n actionNames.push(this.blockList[blk].value);\n }\n }\n }\n\n var i = 1;\n var value = name;\n while (actionNames.indexOf(value) !== -1) {\n value = name + i.toString();\n i += 1;\n }\n return value;\n };\n\n this._findDrumURLs = function () {\n // Make sure we initialize any drum with a URL name.\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (this.blockList[blk].name === 'text' || this.blockList[blk].name === 'string') {\n var c = this.blockList[blk].connections[0];\n if (c != null && ['playdrum', 'setdrum', 'setvoice'].indexOf(this.blockList[c].name) !== -1) {\n if (this.blockList[blk].value.slice(0, 4) === 'http') {\n if (_THIS_IS_MUSIC_BLOCKS_) {\n this.logo.synth.loadSynth(this.blockList[blk].value);\n }\n }\n }\n }\n }\n };\n\n this.renameBoxes = function (oldName, newName) {\n if (oldName === newName) {\n return;\n }\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (this.blockList[blk].name === 'text') {\n var c = this.blockList[blk].connections[0];\n if (c != null && this.blockList[c].name === 'box') {\n if (this.blockList[blk].value === oldName) {\n this.blockList[blk].value = newName;\n this.blockList[blk].text.text = newName;\n try {\n this.blockList[blk].container.updateCache();\n } catch (e) {\n console.log(e);\n }\n }\n }\n }\n }\n };\n\n this.renameNamedboxes = function (oldName, newName) {\n if (oldName === newName) {\n return;\n }\n\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (this.blockList[blk].name === 'namedbox') {\n if (this.blockList[blk].privateData === oldName) {\n this.blockList[blk].privateData = newName;\n this.blockList[blk].overrideName = newName;\n this.blockList[blk].regenerateArtwork();\n // Update label...\n try {\n this.blockList[blk].container.updateCache();\n } catch (e) {\n console.log(e);\n }\n }\n }\n }\n\n // Update the palette\n var blockPalette = this.palettes.dict['boxes'];\n var nameChanged = false;\n for (var blockId = 0; blockId < blockPalette.protoList.length; blockId++) {\n var block = blockPalette.protoList[blockId];\n if (block.name === 'namedbox' && block.defaults[0] !== _('box') && block.defaults[0] === oldName) {\n // console.log('renaming ' + block.defaults[0] + ' to ' + newName);\n block.defaults[0] = newName;\n nameChanged = true;\n }\n }\n\n // Force an update if the name has changed.\n if (nameChanged) {\n this.palettes.hide();\n this.palettes.updatePalettes('boxes');\n this.palettes.show();\n }\n };\n\n this.renameDos = function (oldName, newName, skipBlock) {\n if (oldName === newName) {\n return;\n }\n\n // Update the blocks, do->oldName should be do->newName\n // Named dos are modified in a separate function below.\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (blk === skipBlock) {\n continue;\n }\n\n var myBlock = this.blockList[blk];\n var blkParent = this.blockList[myBlock.connections[0]];\n if (blkParent == null) {\n continue;\n }\n\n if (['do', 'calc', 'doArg', 'calcArg', 'action'].indexOf(blkParent.name) === -1) {\n continue;\n }\n\n var blockValue = myBlock.value;\n if (blockValue === oldName) {\n myBlock.value = newName;\n var label = myBlock.value;\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n myBlock.text.text = label;\n myBlock.container.updateCache();\n }\n }\n };\n\n this.renameNameddos = function (oldName, newName) {\n if (oldName === newName) {\n return;\n }\n\n // Update the blocks, do->oldName should be do->newName\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (['nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg'].indexOf(this.blockList[blk].name) !== -1) {\n if (this.blockList[blk].privateData === oldName) {\n this.blockList[blk].privateData = newName;\n var label = newName;\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n\n this.blockList[blk].overrideName = label;\n // console.log('regenerating artwork for ' + this.blockList[blk].name + ' block[' + blk + ']: ' + oldName + ' -> ' + label);\n this.blockList[blk].regenerateArtwork();\n }\n }\n }\n\n // Update the palette\n var actionsPalette = this.palettes.dict['action'];\n var nameChanged = false;\n for (var blockId = 0; blockId < actionsPalette.protoList.length; blockId++) {\n var block = actionsPalette.protoList[blockId];\n if (['nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg'].indexOf(block.name) !== -1 /* && block.defaults[0] !== _('action') */ && block.defaults[0] === oldName) {\n // console.log('renaming ' + block.name + ': ' + block.defaults[0] + ' to ' + newName);\n block.defaults[0] = newName;\n nameChanged = true;\n }\n }\n\n // Force an update if the name has changed.\n if (nameChanged) {\n this.palettes.hide();\n this.palettes.updatePalettes('action');\n this.palettes.show();\n }\n };\n\n this.newStoreinBlock = function (name) {\n if (name == null) {\n console.log('null name passed to newStoreinBlock');\n return;\n } else if (name == undefined) {\n console.log('undefined name passed to newStoreinBlock');\n return;\n } else if ('myStorein_' + name in this.protoBlockDict) {\n // console.log(name + ' already in palette');\n return;\n }\n\n // console.log('new storein block ' + name);\n var myStoreinBlock = new ProtoBlock('storein');\n this.protoBlockDict['myStorein_' + name] = myStoreinBlock;\n myStoreinBlock.palette = this.palettes.dict['boxes'];\n myStoreinBlock.defaults.push(name);\n myStoreinBlock.defaults.push(NUMBERBLOCKDEFAULT);\n myStoreinBlock.staticLabels.push(_('store in'), _('name'), _('value'));\n myStoreinBlock.adjustWidthToLabel();\n myStoreinBlock.twoArgBlock();\n myStoreinBlock.dockTypes[1] = 'anyin';\n myStoreinBlock.dockTypes[2] = 'anyin';\n if (name === 'box') {\n return;\n }\n\n // Add the new block to the top of the palette.\n myStoreinBlock.palette.add(myStoreinBlock, true);\n };\n\n this.newNamedboxBlock = function (name) {\n if (name == null) {\n console.log('null name passed to newNamedboxBlock');\n return;\n } else if (name == undefined) {\n console.log('undefined name passed to newNamedboxBlock');\n return;\n } else if ('myBox_' + name in this.protoBlockDict) {\n return;\n }\n\n var myBoxBlock = new ProtoBlock('namedbox');\n this.protoBlockDict['myBox_' + name] = myBoxBlock;\n myBoxBlock.palette = this.palettes.dict['boxes'];\n myBoxBlock.defaults.push(name);\n myBoxBlock.staticLabels.push(name);\n myBoxBlock.parameterBlock();\n if (name === 'box') {\n return;\n }\n\n // Add the new block to the top of the palette.\n myBoxBlock.palette.add(myBoxBlock, true);\n };\n\n this._newLocalArgBlock = function (name) {\n // name === 1, 2, 3, ...\n var blkname = 'arg_' + name;\n if ('myArg_' + name in this.protoBlockDict) {\n return;\n }\n\n if (blkname in this.protoBlockDict) {\n return;\n }\n\n var myNamedArgBlock = new ProtoBlock('namedarg');\n this.protoBlockDict['myArg_' + blkname] = myNamedArgBlock;\n myNamedArgBlock.palette = this.palettes.dict['action'];\n myNamedArgBlock.defaults.push(name);\n myNamedArgBlock.staticLabels.push('arg ' + name);\n myNamedArgBlock.parameterBlock();\n\n if (blkname === 'arg_1') {\n return;\n }\n\n myNamedArgBlock.palette.add(myNamedArgBlock, true);\n\n // Force regeneration of palette after adding new block.\n // Add delay to avoid race condition.\n var that = this;\n setTimeout(function () {\n that.palettes.hide();\n that.palettes.updatePalettes('action');\n that.palettes.show();\n }, 500);\n };\n\n this._removeNamedoEntries = function (name) {\n // Delete any old palette entries.\n // console.log('DELETE: removing old palette entries for ' + name);\n if (this.protoBlockDict['myDo_' + name]) {\n // console.log('deleting myDo_' + name + ' ' + this.protoBlockDict['myDo_' + name].name);\n this.protoBlockDict['myDo_' + name].hide = true;\n delete this.protoBlockDict['myDo_' + name];\n } else if (this.protoBlockDict['myCalc_' + name]) {\n // console.log('deleting myCalc_' + name + ' ' + this.protoBlockDict['myCalc_' + name].name);\n this.protoBlockDict['myCalc_' + name].hide = true;\n delete this.protoBlockDict['myCalc_' + name];\n } else if (this.protoBlockDict['myDoArg_' + name]) {\n // console.log('deleting myDoArg_' + name + ' ' + this.protoBlockDict['myDoArg_' + name].name);\n this.protoBlockDict['myDoArg_' + name].hide = true;\n delete this.protoBlockDict['myDoArg_' + name];\n } else if (this.protoBlockDict['myCalcArg_' + name]) {\n // console.log('deleting myCalcArg_' + name + ' ' + this.protoBlockDict['myCalcArg_' + name].name);\n this.protoBlockDict['myCalcArg_' + name].hide = true;\n delete this.protoBlockDict['myCalcArg_' + name];\n }\n };\n\n this.newNameddoBlock = function (name, hasReturn, hasArgs) {\n // Depending upon the form of the associated action block, we\n // want to add a named do, a named calc, a named do w/args, or\n // a named calc w/args.\n if (name === _('action')) {\n // 'action' already has its associated palette entries.\n return false;\n }\n\n if (hasReturn && hasArgs) {\n this.newNamedcalcArgBlock(name);\n return true;\n } else if (!hasReturn && hasArgs) {\n this.newNameddoArgBlock(name);\n return true;\n } else if (hasReturn && !hasArgs) {\n this.newNamedcalcBlock(name);\n return true;\n } else if (this.protoBlockDict['myDo_' + name] === undefined) {\n var myDoBlock = new ProtoBlock('nameddo');\n this.protoBlockDict['myDo_' + name] = myDoBlock;\n myDoBlock.palette = this.palettes.dict['action'];\n myDoBlock.defaults.push(name);\n myDoBlock.staticLabels.push(name);\n myDoBlock.zeroArgBlock();\n myDoBlock.palette.add(myDoBlock, true);\n this.palettes.updatePalettes();\n return true;\n }\n\n return false;\n };\n\n this.newNamedcalcBlock = function (name) {\n if (this.protoBlockDict['myCalc_' + name] === undefined) {\n // console.log('creating myCalc_' + name);\n var myCalcBlock = new ProtoBlock('namedcalc');\n this.protoBlockDict['myCalc_' + name] = myCalcBlock;\n myCalcBlock.palette = this.palettes.dict['action'];\n myCalcBlock.defaults.push(name);\n myCalcBlock.staticLabels.push(name);\n myCalcBlock.zeroArgBlock();\n // Add the new block to the top of the palette.\n myCalcBlock.palette.add(myCalcBlock, true);\n // } else {\n // console.log('myCalc_' + name + ' already exists.');\n }\n };\n\n this.newNameddoArgBlock = function (name) {\n if (this.protoBlockDict['myDoArg_' + name] === undefined) {\n // console.log('creating myDoArg_' + name);\n var myDoArgBlock = new ProtoBlock('nameddoArg');\n this.protoBlockDict['myDoArg_' + name] = myDoArgBlock;\n myDoArgBlock.palette = this.palettes.dict['action'];\n myDoArgBlock.defaults.push(name);\n myDoArgBlock.staticLabels.push(name);\n myDoArgBlock.zeroArgBlock();\n // Add the new block to the top of the palette.\n myDoArgBlock.palette.add(myDoArgBlock, true);\n // } else {\n // console.log('myDoArg_' + name + ' already exists.');\n }\n };\n\n this.newNamedcalcArgBlock = function (name) {\n if (this.protoBlockDict['myCalcArg_' + name] === undefined) {\n // console.log('creating myCalcArg_' + name);\n var myCalcArgBlock = new ProtoBlock('namedcalcArg');\n this.protoBlockDict['myCalcArg_' + name] = myCalcArgBlock;\n myCalcArgBlock.palette = this.palettes.dict['action'];\n myCalcArgBlock.defaults.push(name);\n myCalcArgBlock.staticLabels.push(name);\n myCalcArgBlock.zeroArgBlock();\n // Add the new block to the top of the palette.\n myCalcArgBlock.palette.add(myCalcArgBlock, true);\n // } else {\n // console.log('myCalcArg_' + name + ' already exists.');\n }\n };\n\n this._insideArgClamp = function (blk) {\n // Returns a containing arg clamp block or null\n if (this.blockList[blk] == null) {\n // race condition?\n console.log('null block in blockList? ' + blk);\n return null;\n } else if (this.blockList[blk].connections[0] == null) {\n return null;\n } else {\n var cblk = this.blockList[blk].connections[0];\n if (this.blockList[cblk].isArgClamp()) {\n return cblk;\n } else {\n return null;\n }\n }\n };\n\n this._insideExpandableBlock = function (blk) {\n // Returns a containing expandable block or null\n if (this.blockList[blk] == null) {\n // race condition?\n console.log('null block in blockList? ' + blk);\n return null;\n } else if (this.blockList[blk].connections[0] == null) {\n return null;\n } else {\n var cblk = this.blockList[blk].connections[0];\n if (this.blockList[cblk].isExpandableBlock()) {\n // If it is the last connection, keep searching.\n if (this.blockList[cblk].isArgFlowClampBlock()) {\n return cblk;\n } else if (blk === last(this.blockList[cblk].connections)) {\n return this._insideExpandableBlock(cblk);\n } else {\n return cblk;\n }\n } else {\n return this._insideExpandableBlock(cblk);\n }\n }\n };\n\n this._insideNoteBlock = function (blk) {\n // Returns a containing note block or null\n if (this.blockList[blk] == null) {\n console.log('null block in blockList? ' + blk);\n return null;\n } else if (this.blockList[blk].connections[0] == null) {\n return null;\n } else {\n var cblk = this.blockList[blk].connections[0];\n if (this.blockList[cblk].isExpandableBlock()) {\n // If it is the last connection, keep searching.\n if (blk === last(this.blockList[cblk].connections)) {\n return this._insideNoteBlock(cblk);\n } else if (blk === this.blockList[cblk].connections[1]) {\n // Connection 1 of a note block is not inside the clamp.\n return null;\n } else {\n if (['newnote', 'osctime'].indexOf(this.blockList[cblk].name) !== -1) {\n return cblk;\n } else {\n return null;\n }\n }\n } else {\n return this._insideNoteBlock(cblk);\n }\n }\n };\n\n this.triggerLongPress = function (myBlock) {\n this.timeOut == null;\n this.inLongPress = true;\n var z = this.stage.getNumChildren() - 1;\n\n // Auto-select stack for copying -- no need to actually click on\n // the copy button.\n var topBlock = this.findTopBlock(this.activeBlock);\n this.selectedStack = topBlock;\n\n // Copy the selectedStack.\n this.selectedBlocksObj = JSON.parse(JSON.stringify(this._copyBlocksToObj()));\n\n this.updatePasteButton();\n\n if (myBlock.name === 'action') {\n this.dismissButton.visible = true;\n this.dismissButton.x = myBlock.container.x - 27;\n this.dismissButton.y = myBlock.container.y - 27;\n this.stage.setChildIndex(this.dismissButton, z - 1);\n this.saveStackButton.visible = true;\n this.saveStackButton.x = myBlock.container.x + 27;\n this.saveStackButton.y = myBlock.container.y - 27;\n this.stage.setChildIndex(this.saveStackButton, z - 2);\n }\n\n this.refreshCanvas();\n };\n\n this.pasteStack = function () {\n // Copy a stack of blocks by creating a blockObjs and passing\n // it to this.load.\n if (this.selectedStack == null) {\n return;\n }\n\n // First, hide the palettes as they will need updating.\n for (var name in this.palettes.dict) {\n this.palettes.dict[name].hideMenu(true);\n }\n\n // var blockObjs = this._copyBlocksToObj();\n // this.loadNewBlocks(blockObjs);\n // console.log(this.selectedBlocksObj);\n this.loadNewBlocks(this.selectedBlocksObj);\n };\n\n this.saveStack = function () {\n // Save a stack of blocks to local storage and the 'myblocks'\n // palette by creating a blockObjs and ...\n if (this.selectedStack == null) {\n return;\n }\n\n this.palettes.hide();\n\n var blockObjs = this._copyBlocksToObj();\n // The first block is an action block. Its first connection is\n // the block containing its label.\n var nameBlk = blockObjs[0][4][1];\n\n if (nameBlk == null) {\n console.log('action not named... skipping');\n } else {\n console.log(blockObjs[nameBlk][1][1]);\n if (typeof(blockObjs[nameBlk][1][1]) === 'string') {\n var name = blockObjs[nameBlk][1][1];\n } else if (typeof(blockObjs[nameBlk][1][1]) === 'number') {\n var name = blockObjs[nameBlk][1][1].toString();\n } else {\n var name = blockObjs[nameBlk][1][1]['value'];\n }\n storage.macros = prepareMacroExports(name, blockObjs, this.macroDict);\n if (sugarizerCompatibility.isInsideSugarizer()) {\n sugarizerCompatibility.saveLocally(function () {\n this.addToMyPalette(name, blockObjs);\n // this.palettes.updatePalettes('myblocks');\n });\n } else {\n this.addToMyPalette(name, blockObjs);\n // this.palettes.updatePalettes('myblocks');\n }\n }\n };\n\n this._copyBlocksToObj = function () {\n var blockObjs = [];\n var blockMap = {};\n\n this.findDragGroup(this.selectedStack);\n for (var b = 0; b < this.dragGroup.length; b++) {\n myBlock = this.blockList[this.dragGroup[b]];\n if (b === 0) {\n x = 75 - this.stage.x;\n y = 75 - this.stage.y;\n } else {\n x = 0;\n y = 0;\n }\n\n if (myBlock.isValueBlock()) {\n switch (myBlock.name) {\n case 'media':\n blockItem = [b, [myBlock.name, null], x, y, []];\n break;\n default:\n blockItem = [b, [myBlock.name, myBlock.value], x, y, []];\n break;\n }\n } else if (['namedbox', 'nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg', 'namedarg'].indexOf(myBlock.name) !== -1) {\n blockItem = [b, [myBlock.name, {'value': myBlock.privateData}], x, y, []];\n } else {\n blockItem = [b, myBlock.name, x, y, []];\n }\n\n blockMap[this.dragGroup[b]] = b;\n blockObjs.push(blockItem);\n }\n for (var b = 0; b < this.dragGroup.length; b++) {\n myBlock = this.blockList[this.dragGroup[b]];\n for (var c = 0; c < myBlock.connections.length; c++) {\n if (myBlock.connections[c] == null) {\n blockObjs[b][4].push(null);\n } else {\n blockObjs[b][4].push(blockMap[myBlock.connections[c]]);\n }\n }\n }\n\n return blockObjs;\n };\n\n this.addToMyPalette = function (name, obj) {\n // On the palette we store the macro as a basic block.\n var myBlock = new ProtoBlock('macro_' + name);\n var blkName = 'macro_' + name;\n this.protoBlockDict[blkName] = myBlock;\n if (!('myblocks' in this.palettes.dict)) {\n this.palettes.add('myblocks');\n }\n\n myBlock.palette = this.palettes.dict['myblocks'];\n myBlock.zeroArgBlock();\n myBlock.staticLabels.push(_(name));\n this.protoBlockDict[blkName].palette.add(this.protoBlockDict[blkName]);\n };\n\n this.loadNewBlocks = function (blockObjs) {\n // Check for blocks connected to themselves,\n // and for action blocks not connected to text blocks.\n for (var b = 0; b < blockObjs.length; b++) {\n var blkData = blockObjs[b];\n for (var c in blkData[4]) {\n if (blkData[4][c] === blkData[0]) {\n console.log('Circular connection in block data: ' + blkData);\n console.log('Punting loading of new blocks!');\n console.log(blockObjs);\n return;\n }\n }\n }\n\n // We'll need a list of existing storein and action names.\n var currentActionNames = [];\n var currentStoreinNames = [];\n for (var b = 0; b < this.blockList.length; b++) {\n if (this.blockList[b].trash) {\n continue;\n }\n\n if (this.blockList[b].name === 'action') {\n if (this.blockList[b].connections[1] != null) {\n console.log(this.blockList[this.blockList[b].connections[1]].value);\n currentActionNames.push(this.blockList[this.blockList[b].connections[1]].value);\n }\n } else if (this.blockList[b].name === 'storein') {\n if (this.blockList[b].connections[1] != null) {\n currentStoreinNames.push(this.blockList[this.blockList[b].connections[1]].value);\n }\n }\n }\n\n // We need to track two-arg blocks in case they need expanding.\n this._checkTwoArgBlocks = [];\n\n // And arg clamp blocks in case they need expanding.\n this._checkArgClampBlocks = [];\n\n // Don't make duplicate action names.\n // Add a palette entry for any new storein blocks.\n var stringNames = [];\n var stringValues = {}; // label: [blocks with that label]\n var actionNames = {}; // action block: label block\n var storeinNames = {}; // storein block: label block\n var doNames = {}; // do block: label block, nameddo block value\n\n // action and start blocks that need to be collapsed.\n this.blocksToCollapse = [];\n\n // Scan for any new action and storein blocks to identify\n // duplicates. We also need to track start and action blocks\n // that may need to be collapsed.\n for (var b = 0; b < blockObjs.length; b++) {\n var blkData = blockObjs[b];\n // blkData[1] could be a string or an object.\n if (typeof(blkData[1]) === 'string') {\n var name = blkData[1];\n } else {\n var name = blkData[1][0];\n }\n\n if (!(name in this.protoBlockDict)) {\n switch (name) {\n case 'hat':\n name = 'action';\n break;\n case 'string':\n name = 'text';\n break;\n default:\n console.log('skipping ' + name);\n continue;\n break;\n }\n }\n\n if (['arg', 'twoarg'].indexOf(this.protoBlockDict[name].style) !== -1) {\n if (this.protoBlockDict[name].expandable) {\n this._checkTwoArgBlocks.push(this.blockList.length + b);\n }\n }\n\n // FIXME: Use tests in block.js\n if (['clamp', 'argclamp', 'argclamparg', 'doubleclamp', 'argflowclamp'].indexOf(this.protoBlockDict[name].style) !== -1) {\n this._checkArgClampBlocks.push(this.blockList.length + b);\n }\n\n switch (name) {\n case 'text':\n var key = blkData[1][1];\n if (stringValues[key] === undefined) {\n stringValues[key] = [];\n }\n stringValues[key].push(b);\n break;\n case 'action':\n case 'hat':\n if (blkData[4][1] != null) {\n actionNames[b] = blkData[4][1];\n }\n break;\n case 'storein':\n if (blkData[4][1] != null) {\n storeinNames[b] = blkData[4][1];\n }\n break;\n case 'nameddo':\n case 'namedcalc':\n case 'nameddoArg':\n case 'namedcalcArg':\n doNames[b] = blkData[1][1]['value'];\n break;\n case 'do':\n case 'stack':\n if (blkData[4][1] != null) {\n doNames[b] = blkData[4][1];\n }\n break;\n default:\n break;\n }\n\n switch (name) {\n case 'action':\n case 'pitchdrummatrix':\n case 'rhythmruler':\n case 'pitchstaircase':\n case 'tempo':\n case 'pitchslider':\n case 'matrix':\n case 'drum':\n case 'status':\n case 'start':\n if (typeof(blkData[1]) === 'object' && blkData[1].length > 1 && typeof(blkData[1][1]) === 'object' && 'collapsed' in blkData[1][1]) {\n if (blkData[1][1]['collapsed']) {\n this.blocksToCollapse.push(this.blockList.length + b);\n }\n }\n break;\n default:\n break;\n }\n }\n\n var updatePalettes = false;\n // Make sure new storein names have palette entries.\n for (var b in storeinNames) {\n var blkData = blockObjs[storeinNames[b]];\n if (currentStoreinNames.indexOf(blkData[1][1]) === -1) {\n if (typeof(blkData[1][1]) === 'string') {\n var name = blkData[1][1];\n } else {\n var name = blkData[1][1]['value'];\n }\n // console.log('Adding new palette entries for store-in ' + name);\n this.newStoreinBlock(name);\n this.newNamedboxBlock(name);\n updatePalettes = true;\n }\n }\n\n // Make sure action names are unique.\n for (var b in actionNames) {\n // Is there a proto do block with this name? If so, find a\n // new name.\n // Name = the value of the connected label.\n var blkData = blockObjs[actionNames[b]];\n if (typeof(blkData[1][1]) === 'string') {\n var name = blkData[1][1];\n } else {\n var name = blkData[1][1]['value'];\n }\n\n // If we have a stack named 'action', make the protoblock visible.\n if (name === _('action')) {\n this.setActionProtoVisiblity(true);\n }\n var oldName = name;\n var i = 1;\n while (currentActionNames.indexOf(name) !== -1) {\n name = oldName + i.toString();\n i += 1;\n // Should never happen... but just in case.\n if (i > this.blockList.length) {\n console.log('Could not generate unique action name.');\n break;\n }\n }\n\n if (oldName !== name) {\n // Change the name of the action...\n console.log('action ' + oldName + ' is being renamed ' + name);\n blkData[1][1] = {'value': name};\n }\n\n // and any do blocks\n for (var d in doNames) {\n var thisBlkData = blockObjs[d];\n if (typeof(thisBlkData[1]) === 'string') {\n var blkName = thisBlkData[1];\n } else {\n var blkName = thisBlkData[1][0];\n }\n if (['nameddo', 'namedcalc', 'nameddoArg', 'namedcalcArg'].indexOf(blkName) !== -1) {\n if (thisBlkData[1][1]['value'] === oldName) {\n thisBlkData[1][1] = {'value': name};\n }\n } else {\n var doBlkData = blockObjs[doNames[d]];\n if (typeof(doBlkData[1][1]) === 'string') {\n if (doBlkData[1][1] === oldName) {\n // console.log('renaming ' + oldName + ' to ' + name);\n doBlkData[1][1] = name;\n }\n } else {\n if (doBlkData[1][1]['value'] === oldName) {\n // console.log('renaming ' + oldName + ' to ' + name);\n doBlkData[1][1] = {'value': name};\n }\n }\n }\n }\n }\n\n if (updatePalettes) {\n this.palettes.hide();\n this.palettes.updatePalettes('action');\n this.palettes.show();\n }\n\n\n // This section of the code attempts to repair imported\n // code. For example, it adds missing hidden blocks and\n // convert old-style notes to new-style notes.\n blockObjsLength = blockObjs.length;\n var extraBlocksLength = 0;\n\n for (var b = 0; b < blockObjsLength; b++) {\n if (typeof(blockObjs[b][1]) === 'object') {\n var name = blockObjs[b][1][0];\n } else {\n var name = blockObjs[b][1];\n }\n\n switch (name) {\n case 'articulation':\n case 'augmented':\n case 'backward':\n case 'crescendo':\n case 'diminished':\n case 'dividebeatfactor':\n case 'drift':\n case 'duplicatenotes':\n case 'invert1':\n case 'fill':\n case 'flat':\n case 'hollowline':\n case 'major':\n case 'minor':\n case 'multiplybeatfactor':\n case 'note':\n case 'newnote':\n case 'newslur':\n case 'newstaccato':\n case 'newswing':\n case 'newswing2':\n case 'osctime':\n case 'perfect':\n case 'pluck':\n case 'rhythmicdot':\n case 'setbpm':\n case 'setnotevolume2':\n case 'settransposition':\n case 'setvoice':\n case 'sharp':\n case 'skipnotes':\n case 'slur':\n case 'staccato':\n case 'swing':\n case 'tie':\n case 'tuplet2':\n case 'vibrato':\n var len = blockObjs[b][4].length;\n if (last(blockObjs[b][4]) == null) {\n // If there is no next block, add a hidden block;\n console.log('last connection of ' + name + ' is null: adding hidden block');\n blockObjs[b][4][len - 1] = blockObjsLength + extraBlocksLength;\n blockObjs.push([blockObjsLength + extraBlocksLength, 'hidden', 0, 0, [b, null]]);\n extraBlocksLength += 1;\n } else {\n var nextBlock = blockObjs[b][4][len - 1];\n\n if (typeof(blockObjs[nextBlock][1]) === 'object') {\n var nextName = blockObjs[nextBlock][1][0];\n } else {\n var nextName = blockObjs[nextBlock][1];\n }\n\n if (nextName !== 'hidden') {\n console.log('last connection of ' + name + ' is ' + nextName + ': adding hidden block');\n // If the next block is not a hidden block, add one.\n blockObjs[b][4][len - 1] = blockObjsLength + extraBlocksLength;\n blockObjs[nextBlock][4][0] = blockObjsLength + extraBlocksLength;\n blockObjs.push([blockObjsLength + extraBlocksLength, 'hidden', 0, 0, [b, nextBlock]]);\n extraBlocksLength += 1;\n }\n }\n\n if (['note', 'slur', 'staccato', 'swing'].indexOf(name) !== -1) {\n // We need to convert to newnote style:\n // (1) add a vspace to the start of the clamp of a note block.\n console.log('note: ' + b);\n var clampBlock = blockObjs[b][4][2];\n blockObjs[b][4][2] = blockObjsLength + extraBlocksLength;\n if (clampBlock == null) {\n blockObjs.push([blockObjsLength + extraBlocksLength, 'vspace', 0, 0, [b, null]]);\n } else {\n blockObjs[clampBlock][4][0] = blockObjsLength + extraBlocksLength;\n blockObjs.push([blockObjsLength + extraBlocksLength, 'vspace', 0, 0, [b, clampBlock]]);\n }\n\n extraBlocksLength += 1;\n\n // (2) switch the first connection to divide 1 / arg.\n var argBlock = blockObjs[b][4][1];\n blockObjs[b][4][1] = blockObjsLength + extraBlocksLength;\n if (argBlock == null) {\n blockObjs.push([blockObjsLength + extraBlocksLength, 'divide', 0, 0, [b, blockObjsLength + extraBlocksLength + 1, blockObjsLength + extraBlocksLength + 2]]);\n blockObjs.push([blockObjsLength + extraBlocksLength + 1, ['number', {'value': 1}], 0, 0, [blockObjsLength + extraBlocksLength]]);\n blockObjs.push([blockObjsLength + extraBlocksLength + 2, ['number', {'value': 1}], 0, 0, [blockObjsLength + extraBlocksLength]]);\n extraBlocksLength += 3;\n } else {\n blockObjs[argBlock][4][0] = blockObjsLength + extraBlocksLength;\n blockObjs.push([blockObjsLength + extraBlocksLength, 'divide', 0, 0, [b, blockObjsLength + extraBlocksLength + 1, argBlock]]);\n blockObjs.push([blockObjsLength + extraBlocksLength + 1, ['number', {'value': 1}], 0, 0, [blockObjsLength + extraBlocksLength]]);\n extraBlocksLength += 2;\n }\n\n // (3) create a newnote block instead.\n if (typeof(blockObjs[b][1]) === 'object') {\n blockObjs[b][1][0] = 'new' + name;\n } else {\n blockObjs[b][1] = 'new' + name;\n }\n }\n break;\n case 'action':\n // Ensure that there is a hidden block as the first\n // block in the child flow (connection 2) of an action\n // block (required to make the backward block function\n // propperly).\n var len = blockObjs[b][4].length;\n if (blockObjs[b][4][2] == null) {\n // If there is no child flow block, add a hidden block;\n console.log('last connection of ' + name + ' is null: adding hidden block');\n blockObjs[b][4][2] = blockObjsLength + extraBlocksLength;\n blockObjs.push([blockObjsLength + extraBlocksLength, 'hidden', 0, 0, [b, null]]);\n extraBlocksLength += 1;\n } else {\n var nextBlock = blockObjs[b][4][2];\n\n if (typeof(blockObjs[nextBlock][1]) === 'object') {\n var nextName = blockObjs[nextBlock][1][0];\n } else {\n var nextName = blockObjs[nextBlock][1];\n }\n\n if (nextName !== 'hidden') {\n console.log('last connection of ' + name + ' is ' + nextName + ': adding hidden block');\n // If the next block is not a hidden block, add one.\n blockObjs[b][4][2] = blockObjsLength + extraBlocksLength;\n blockObjs[nextBlock][4][0] = blockObjsLength + extraBlocksLength;\n blockObjs.push([blockObjsLength + extraBlocksLength, 'hidden', 0, 0, [b, nextBlock]]);\n extraBlocksLength += 1;\n }\n }\n break;\n default:\n break;\n }\n }\n\n // Append to the current set of blocks.\n this._adjustTheseStacks = [];\n this._adjustTheseDocks = [];\n this._loadCounter = blockObjs.length;\n\n // We add new blocks to the end of the block list.\n var blockOffset = this.blockList.length;\n var firstBlock = this.blockList.length;\n\n for (var b = 0; b < this._loadCounter; b++) {\n var thisBlock = blockOffset + b;\n var blkData = blockObjs[b];\n\n if (typeof(blkData[1]) === 'object') {\n if (blkData[1].length === 1) {\n var blkInfo = [blkData[1][0], {'value': null}];\n } else if (['number', 'string'].indexOf(typeof(blkData[1][1])) !== -1) {\n var blkInfo = [blkData[1][0], {'value': blkData[1][1]}];\n if (COLLAPSABLES.indexOf(blkData[1][0]) !== -1) {\n blkInfo[1]['collapsed'] = false;\n }\n } else {\n var blkInfo = blkData[1];\n }\n } else {\n var blkInfo = [blkData[1], {'value': null}];\n if (COLLAPSABLES.indexOf(blkData[1]) !== -1) {\n blkInfo[1]['collapsed'] = false;\n }\n }\n\n var name = blkInfo[0];\n\n var collapsed = false;\n if (COLLAPSABLES.indexOf(name) !== -1) {\n collapsed = blkInfo[1]['collapsed'];\n }\n\n if (blkInfo[1] == null) {\n var value = null;\n } else {\n var value = blkInfo[1]['value'];\n }\n\n if (name in NAMEDICT) {\n name = NAMEDICT[name];\n }\n\n var that = this;\n\n // A few special cases.\n switch (name) {\n // Only add 'collapsed' arg to start, action blocks.\n case 'start':\n blkData[4][0] = null;\n blkData[4][2] = null;\n postProcess = function (args) {\n var thisBlock = args[0];\n var blkInfo = args[1];\n that.blockList[thisBlock].value = that.turtles.turtleList.length;\n that.turtles.addTurtle(that.blockList[thisBlock], blkInfo);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, blkInfo[1]], collapsed);\n break;\n case 'drum':\n blkData[4][0] = null;\n blkData[4][2] = null;\n postProcess = function (args) {\n var thisBlock = args[0];\n var blkInfo = args[1];\n that.blockList[thisBlock].value = that.turtles.turtleList.length;\n that.turtles.addDrum(that.blockList[thisBlock], blkInfo);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, blkInfo[1]], collapsed);\n\n if (_THIS_IS_MUSIC_BLOCKS_) {\n // Load the synth for this drum\n this.logo.synth.loadSynth('kick');\n }\n break;\n case 'action':\n case 'hat':\n blkData[4][0] = null;\n blkData[4][3] = null;\n this._makeNewBlockWithConnections('action', blockOffset, blkData[4], null, null, collapsed);\n break;\n\n // Named boxes and dos need private data.\n case 'namedbox':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].privateData = value;\n that.blockList[thisBlock].value = null;\n };\n\n this._makeNewBlockWithConnections('namedbox', blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'namedarg':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].privateData = value;\n that.blockList[thisBlock].value = null;\n };\n\n this._makeNewBlockWithConnections('namedarg', blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'namedcalc':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].privateData = value;\n that.blockList[thisBlock].value = null;\n };\n\n this._makeNewBlockWithConnections('namedcalc', blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'nameddo':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].privateData = value;\n that.blockList[thisBlock].value = null;\n };\n\n this._makeNewBlockWithConnections('nameddo', blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n\n // Arg clamps may need extra slots added.\n case 'doArg':\n postProcess = function (args) {\n var thisBlock = args[0];\n var extraSlots = args[1].length - 4;\n if (extraSlots > 0) {\n var slotList = that.blockList[thisBlock].argClampSlots;\n for (var i = 0; i < extraSlots; i++) {\n slotList.push(1);\n that._newLocalArgBlock(slotList.length);\n that.blockList[thisBlock].connections.push(null);\n }\n that.blockList[thisBlock].updateArgSlots(slotList);\n for (var i = 0; i < args[1].length; i++) {\n if (args[1][i] != null) {\n that.blockList[thisBlock].connections[i] = args[1][i] + firstBlock;\n } else {\n that.blockList[thisBlock].connections[i] = args[1][i];\n }\n }\n }\n that._checkArgClampBlocks.push(thisBlock);\n };\n\n this._makeNewBlockWithConnections('doArg', blockOffset, blkData[4], postProcess, [thisBlock, blkData[4]]);\n break;\n case 'nameddoArg':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].privateData = value;\n that.blockList[thisBlock].value = null;\n var extraSlots = args[2].length - 3;\n if (extraSlots > 0) {\n var slotList = that.blockList[thisBlock].argClampSlots;\n for (var i = 0; i < extraSlots; i++) {\n slotList.push(1);\n that._newLocalArgBlock(slotList.length);\n that.blockList[thisBlock].connections.push(null);\n }\n that.blockList[thisBlock].updateArgSlots(slotList);\n for (var i = 0; i < args[2].length; i++) {\n if (args[2][i] != null) {\n that.blockList[thisBlock].connections[i] = args[2][i] + firstBlock;\n } else {\n that.blockList[thisBlock].connections[i] = args[2][i];\n }\n }\n }\n that._checkArgClampBlocks.push(thisBlock);\n };\n\n this._makeNewBlockWithConnections('nameddoArg', blockOffset, blkData[4], postProcess, [thisBlock, value, blkData[4]]);\n break;\n case 'calcArg':\n postProcess = function (args) {\n var thisBlock = args[0];\n var extraSlots = args[1].length - 3;\n if (extraSlots > 0) {\n var slotList = that.blockList[thisBlock].argClampSlots;\n for (var i = 0; i < extraSlots; i++) {\n slotList.push(1);\n that._newLocalArgBlock(slotList.length);\n that.blockList[thisBlock].connections.push(null);\n }\n that.blockList[thisBlock].updateArgSlots(slotList);\n for (var i = 0; i < args[1].length; i++) {\n if (args[1][i] != null) {\n that.blockList[thisBlock].connections[i] = args[1][i] + firstBlock;\n } else {\n that.blockList[thisBlock].connections[i] = args[1][i];\n }\n }\n }\n that._checkArgClampBlocks.push(thisBlock);\n };\n\n this._makeNewBlockWithConnections('calcArg', blockOffset, blkData[4], postProcess, [thisBlock, blkData[4]]);\n break;\n case 'namedcalcArg':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].privateData = value;\n that.blockList[thisBlock].value = null;\n var extraSlots = args[2].length - 2;\n if (extraSlots > 0) {\n var slotList = that.blockList[thisBlock].argClampSlots;\n for (var i = 0; i < extraSlots; i++) {\n slotList.push(1);\n that._newLocalArgBlock(slotList.length);\n that.blockList[thisBlock].connections.push(null);\n }\n that.blockList[thisBlock].updateArgSlots(slotList);\n for (var i = 0; i < args[2].length; i++) {\n if (args[2][i] != null) {\n that.blockList[thisBlock].connections[i] = args[2][i] + firstBlock;\n } else {\n that.blockList[thisBlock].connections[i] = args[2][i];\n }\n }\n }\n that._checkArgClampBlocks.push(thisBlock);\n };\n\n this._makeNewBlockWithConnections('namedcalcArg', blockOffset, blkData[4], postProcess, [thisBlock, value, blkData[4]]);\n break;\n\n // Value blocks need a default value set.\n case 'number':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = Number(value);\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'text':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'solfege':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'eastindiansolfege':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'notename':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'modename':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'drumname':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n\n if (_THIS_IS_MUSIC_BLOCKS_) {\n // Load the synth for this drum\n this.logo.synth.loadSynth(getDrumSynthName(value));\n }\n break;\n case 'voicename':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n\n if (_THIS_IS_MUSIC_BLOCKS_) {\n // Load the synth for this voice\n this.logo.synth.loadSynth(getVoiceSynthName(value));\n }\n break;\n case 'media':\n // Load a thumbnail into a media blocks.\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = value;\n if (value != null) {\n // Load artwork onto media block.\n that.blockList[thisBlock].loadThumbnail(null);\n }\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'camera':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = CAMERAVALUE;\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n case 'video':\n postProcess = function (args) {\n var thisBlock = args[0];\n var value = args[1];\n that.blockList[thisBlock].value = VIDEOVALUE;\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n\n // Define some constants for legacy blocks for\n // backward compatibility with Python projects.\n case 'red':\n case 'black':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = 0;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'white':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = 100;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'orange':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = 10;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'yellow':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = 20;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'green':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = 40;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'blue':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = 70;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'leftpos':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = -(canvas.width / 2);\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'rightpos':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = (canvas.width / 2);\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'toppos':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = (canvas.height / 2);\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'botpos':\n case 'bottompos':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = -(canvas.height / 2);\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'width':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = canvas.width;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'height':\n postProcess = function (thisBlock) {\n that.blockList[thisBlock].value = canvas.height;\n that.updateBlockText(thisBlock);\n };\n\n this._makeNewBlockWithConnections('number', blockOffset, blkData[4], postProcess, thisBlock);\n break;\n case 'loadFile':\n postProcess = function (args) {\n that.blockList[args[0]].value = args[1];\n that.updateBlockText(args[0]);\n };\n\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], postProcess, [thisBlock, value]);\n break;\n default:\n // Check that name is in the proto list\n if (!name in this.protoBlockDict || this.protoBlockDict[name] == null) {\n // Lots of assumptions here.\n // TODO: figure out if it is a flow or an arg block.\n // Substitute a NOP block for an unknown block.\n n = blkData[4].length;\n console.log(n + ': substituting nop block for ' + name);\n switch (n) {\n case 1:\n name = 'nopValueBlock';\n break;\n case 2:\n name = 'nopZeroArgBlock';\n break;\n case 3:\n name = 'nopOneArgBlock';\n break;\n case 4:\n name = 'nopTwoArgBlock';\n break;\n case 5:\n default:\n name = 'nopThreeArgBlock';\n break;\n }\n }\n this._makeNewBlockWithConnections(name, blockOffset, blkData[4], null);\n break;\n }\n\n if (thisBlock === this.blockList.length - 1) {\n if (this.blockList[thisBlock].connections[0] == null) {\n this.blockList[thisBlock].container.x = blkData[2];\n this.blockList[thisBlock].container.y = blkData[3];\n this._adjustTheseDocks.push(thisBlock);\n if (blkData[4][0] == null) {\n this._adjustTheseStacks.push(thisBlock);\n }\n if (blkData[2] < 0 || blkData[3] < 0 || blkData[2] > canvas.width || blkData[3] > canvas.height) {\n this._homeButtonContainers[0].visible = true;\n this._homeButtonContainers[1].visible = false;\n }\n }\n }\n }\n };\n\n this.cleanupAfterLoad = function (name) {\n // If all the blocks are loaded, we can make the final adjustments.\n this._loadCounter -= 1;\n if (this._loadCounter > 0) {\n return;\n }\n\n this._findDrumURLs();\n\n this.updateBlockPositions();\n\n this._cleanupStacks();\n\n for (var i = 0; i < this.blocksToCollapse.length; i++) {\n this.blockList[this.blocksToCollapse[i]].collapseToggle();\n }\n\n this.blocksToCollapse = [];\n\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (this.blockList[blk].collapseContainer != null) {\n this.blockList[blk].collapseContainer.x = this.blockList[blk].container.x + COLLAPSEBUTTONXOFF * (this.blockList[blk].protoblock.scale / 2);\n this.blockList[blk].collapseContainer.y = this.blockList[blk].container.y + COLLAPSEBUTTONYOFF * (this.blockList[blk].protoblock.scale / 2);\n }\n }\n\n this.refreshCanvas();\n\n // Do a final check on the action and boxes palettes.\n var updatePalettes = false;\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (!this.blockList[blk].trash && this.blockList[blk].name === 'action') {\n var myBlock = this.blockList[blk];\n var arg = null;\n var c = myBlock.connections[1];\n if (c != null && this.blockList[c].value !== _('action')) {\n if (this.newNameddoBlock(this.blockList[c].value, this.actionHasReturn(blk), this.actionHasArgs(blk))) {\n updatePalettes = true;\n }\n }\n }\n }\n if (updatePalettes) {\n this.palettes.hide();\n this.palettes.updatePalettes('action');\n // this.palettes.dict['action'].hide();\n this.palettes.show();\n }\n\n var updatePalettes = false;\n for (var blk = 0; blk < this.blockList.length; blk++) {\n if (!this.blockList[blk].trash && this.blockList[blk].name === 'storein') {\n var myBlock = this.blockList[blk];\n var arg = null;\n var c = myBlock.connections[1];\n if (c != null && this.blockList[c].value !== _('box')) {\n var name = this.blockList[c].value;\n // Is there an old block with this name still around?\n if (this.protoBlockDict['myStorein_' + name] == undefined) {\n console.log('adding new storein block ' + name);\n this.newNamedboxBlock(this.blockList[c].value);\n this.newStoreinBlock(this.blockList[c].value);\n updatePalettes = true;\n }\n }\n }\n }\n\n if (updatePalettes) {\n // Do this update on a slight delay so as not to collide with\n // the actions update.\n var that = this;\n setTimeout(function () {\n that.palettes.hide();\n that.palettes.updatePalettes('boxes');\n // that.palettes.dict['boxes'].hide();\n that.palettes.show();\n }, 1500);\n }\n console.log(\"Finished block loading\");\n var myCustomEvent = new Event('finishedLoading');\n document.dispatchEvent(myCustomEvent);\n };\n\n this._cleanupStacks = function () {\n if (this._checkArgClampBlocks.length > 0) {\n // We make multiple passes because we need to account for nesting.\n // FIXME: needs to be interwoven with TwoArgBlocks check.\n for (var i = 0; i < this._checkArgClampBlocks.length; i++) {\n for (var b = 0; b < this._checkArgClampBlocks.length; b++) {\n this._adjustArgClampBlock([this._checkArgClampBlocks[b]]);\n }\n }\n }\n\n if (this._checkTwoArgBlocks.length > 0) {\n // We make multiple passes because we need to account for nesting.\n for (var i = 0; i < this._checkTwoArgBlocks.length; i++) {\n for (var b = 0; b < this._checkTwoArgBlocks.length; b++) {\n this._adjustExpandableTwoArgBlock([this._checkTwoArgBlocks[b]]);\n }\n }\n }\n\n for (var blk = 0; blk < this._adjustTheseDocks.length; blk++) {\n // console.log('Adjust Docks: ' + this.blockList[this._adjustTheseDocks[blk]].name);\n this.adjustDocks(this._adjustTheseDocks[blk], true);\n // blockBlocks._expandTwoArgs();\n this._expandClamps();\n }\n\n for (var blk = 0; blk < this._adjustTheseStacks.length; blk++) {\n // console.log('Adjust Stack: ' + this.blockList[this._adjustTheseStacks[blk]].name);\n this.raiseStackToTop(this._adjustTheseStacks[blk]);\n }\n };\n\n this.actionHasReturn = function (blk) {\n // Look for a return block in an action stack.\n if (this.blockList[blk].name !== 'action') {\n return false;\n }\n this.findDragGroup(blk);\n for (var b = 0; b < this.dragGroup.length; b++) {\n if (this.blockList[this.dragGroup[b]].name === 'return') {\n return true;\n }\n }\n return false;\n };\n\n this.actionHasArgs = function (blk) {\n // Look for an arg blocks in an action stack.\n if (this.blockList[blk].name !== 'action') {\n return false;\n }\n this.findDragGroup(blk);\n for (var b = 0; b < this.dragGroup.length; b++) {\n if (this.blockList[this.dragGroup[b]].name === 'arg' || this.blockList[this.dragGroup[b]].name === 'namedarg') {\n return true;\n }\n }\n return false;\n };\n\n this.raiseStackToTop = function (blk) {\n // Move the stack associated with blk to the top.\n var topBlk = this.findTopBlock(blk);\n this.findDragGroup(topBlk);\n\n var z = this.stage.getNumChildren() - 1;\n for (var b = 0; b < this.dragGroup.length; b++) {\n this.stage.setChildIndex(this.blockList[this.dragGroup[b]].container, z);\n z -= 1;\n }\n\n this.refreshCanvas;\n };\n\n this.deleteActionBlock = function (myBlock) {\n var actionArg = this.blockList[myBlock.connections[1]];\n if (actionArg) {\n var actionName = actionArg.value;\n for (var blk = 0; blk < this.blockList.length; blk++) {\n var myBlock = this.blockList[blk];\n var blkParent = this.blockList[myBlock.connections[0]];\n if (blkParent == null) {\n continue;\n }\n\n if (['namedcalc', 'calc', 'nameddo', 'do', 'action'].indexOf(blkParent.name) !== -1) {\n continue;\n }\n\n var blockValue = myBlock.value;\n if (blockValue === _('action')) {\n continue;\n }\n\n if (blockValue === actionName) {\n blkParent.hide();\n myBlock.hide();\n myBlock.trash = true;\n blkParent.trash = true;\n }\n }\n\n // Avoid palette refreash race condition.\n this.deleteActionTimeout += 500;\n var timeout = this.deleteActionTimeout;\n var that = this;\n setTimeout(function () {\n that.deleteActionTimeout -= 500;\n that.palettes.removeActionPrototype(actionName);\n }, timeout);\n }\n };\n\n this.sendStackToTrash = function (myBlock) {\n // First, hide the palettes as they will need updating.\n for (var name in this.palettes.dict) {\n this.palettes.dict[name].hideMenu(true);\n }\n\n this.refreshCanvas();\n\n var thisBlock = this.blockList.indexOf(myBlock);\n\n // Add this block to the list of blocks in the trash so we can\n // undo this action.\n this.trashStacks.push(thisBlock);\n\n // Disconnect block.\n var parentBlock = myBlock.connections[0];\n if (parentBlock != null) {\n for (var c in this.blockList[parentBlock].connections) {\n if (this.blockList[parentBlock].connections[c] === thisBlock) {\n this.blockList[parentBlock].connections[c] = null;\n break;\n }\n }\n myBlock.connections[0] = null;\n\n // Add default block if user deletes all blocks from inside the note block\n this.addDefaultBlock(parentBlock, thisBlock);\n }\n\n if (myBlock.name === 'start' || myBlock.name === 'drum') {\n turtle = myBlock.value;\n var turtleNotInTrash = 0;\n for (var i = 0; i < this.turtles.turtleList.length; i++) {\n if (!this.turtles.turtleList[i].trash) {\n turtleNotInTrash += 1;\n }\n }\n if (turtle != null && turtleNotInTrash > 1) {\n console.log('putting turtle ' + turtle + ' in the trash');\n this.turtles.turtleList[turtle].trash = true;\n this.turtles.turtleList[turtle].container.visible = false;\n } else {\n this.errorMsg(\"You must always have at least one start block\");\n console.log('null turtle');\n return;\n }\n } else if (myBlock.name === 'action') {\n if (!myBlock.trash) {\n this.deleteActionBlock(myBlock);\n }\n }\n\n // put drag group in trash\n this.findDragGroup(thisBlock);\n for (var b = 0; b < this.dragGroup.length; b++) {\n var blk = this.dragGroup[b];\n // console.log('putting ' + this.blockList[blk].name + ' in the trash');\n this.blockList[blk].trash = true;\n this.blockList[blk].hide();\n this.refreshCanvas();\n }\n\n // Adjust the stack from which we just deleted blocks.\n if (parentBlock != null) {\n var topBlk = this.findTopBlock(parentBlock);\n this.findDragGroup(topBlk);\n\n // We need to track two-arg blocks in case they need expanding.\n this._checkTwoArgBlocks = [];\n\n // And arg clamp blocks in case they need expanding.\n this._checkArgClampBlocks = [];\n\n for (var b = 0; b < this.dragGroup.length; b++) {\n var blk = this.dragGroup[b];\n var myBlock = this.blockList[blk];\n if (myBlock.isTwoArgBlock()) {\n this._checkTwoArgBlocks.push(blk);\n } else if (myBlock.isArgBlock() && myBlock.isExpandableBlock() || myBlock.isArgClamp()) {\n this._checkTwoArgBlocks.push(blk);\n } else if (['clamp', 'argclamp', 'argclamparg', 'doubleclamp', 'argflowclamp'].indexOf(myBlock.protoblock.style) !== -1) {\n this._checkArgClampBlocks.push(blk);\n }\n }\n this._cleanupStacks();\n this.refreshCanvas();\n }\n };\n\n return this;\n}", "title": "" }, { "docid": "2e055ed10f6a5b4bc7c214b719225e94", "score": "0.5197399", "text": "function load() {\n m_data.load(\"mod_1_sec_4_p1.json\", load_cb, function(percent, load_time) {\n m_line_speed.recalc_speed(percent, load_time);\n m_game_ui.update_load_screen(percent, load_time);\n });\n}", "title": "" }, { "docid": "2b81386a2f6e7e54535f1843947eb3c8", "score": "0.51882106", "text": "createGenesisBlock(){ \n\t\treturn new Block(0,\"01/01/2018\",\"Gensis Block\",\"0\");\n\t}", "title": "" }, { "docid": "8b425588550c049d24183d6afb0aed98", "score": "0.51852", "text": "async loadBlockChain() {\n\t\t// Modern DApp Browsers\n\t\tif (window.ethereum) {\n\t\t\tweb3 = new Web3(window.ethereum);\n\t\t\tthis.getAccounts();\n\t\t\ttry { \n\t\t\t\twindow.ethereum.enable().then(function() {\n\t\t\t\t\t//Set State When recieve Emission from Event from Smart Contract\n SecretPay = new web3.eth.Contract(Agreement_ABI, contractAddress);\n ChainlinkContract = new web3.eth.Contract(ERC20_ABI, ChainlinkContractAddress);\n //this.setState({ SecretPayState : SecretPay });\n\t\t\t\t}.bind(this));\n\t\t\t} catch(e) {\n // User has denied account access to DApp...\n console.log(e);\n\t\t\t}\n\t\t}\n\t\t// Legacy DApp Browsers\n\t\telse if (window.web3) {\n\t\t\tweb3 = new Web3(window.web3.currentProvider);\n\t\t\tthis.getAccounts();\n\t\t}\n\t\t// Non-DApp Browsers\n\t\telse {\n this.toggleError();\n\t\t}\n\t}", "title": "" }, { "docid": "c4a1560a0971d5d0fa21fc7615ef4bbe", "score": "0.5175589", "text": "function getBlock2(blockHeight) {\n return levelDB.getLevelDBData(blockHeight);\n}", "title": "" }, { "docid": "ccd9884523f86c9c0ee4d1ac97fa6715", "score": "0.51752895", "text": "constructor () {\n\t\t// Initialize the first block (aka Genesis Block)\n\t\tthis.chain = [this.createGenesisBlock()]\n\t\t// Initialize the difficulty of the blockchain\n\t\tthis.difficulty = difficulty\n\t}", "title": "" }, { "docid": "163812ba0a902c78e1772bfc9df6c46e", "score": "0.5174694", "text": "async function loadBlockChain() {\n\t\t// Modern DApp Browsers\n\t\tif (window.ethereum) {\n\t\t\tweb3 = new Web3(window.ethereum);\n getAccounts();\n\t\t\ttry { \n\t\t\t\twindow.ethereum.enable().then(function() {\n\t\t\t\t\t//Set State When recieve Emission from Event from Smart Contract\n //SecretPay = new web3.eth.Contract(abiSecretPay, contractAddress);\n ChainlinkContract = new web3.eth.Contract(ERC20_ABI, ChainlinkContractAddress);\n //this.setState({ SecretPayState : SecretPay });\n\t\t\t\t}.bind(this));\n\t\t\t} catch(e) {\n // User has denied account access to DApp...\n console.log(e);\n\t\t\t}\n\t\t}\n\t\t// Legacy DApp Browsers\n\t\telse if (window.web3) {\n\t\t\tweb3 = new Web3(window.web3.currentProvider);\n getAccounts();\n\t\t}\n\t\t// Non-DApp Browsers\n\t\telse {\n this.toggleError();\n\t\t}\n }", "title": "" }, { "docid": "aa49d3463b4798b72c9845d0195a7482", "score": "0.5170717", "text": "function Block(blockType, vecIndices, appearance)\n{\n this.blockType = blockType;\n this.vecIndices = vecIndices;\n this.appearance = appearance;\n}", "title": "" } ]
70a7791f0dbc752b8fce506e556c0703
This class defines a complete generic visitor for a parse tree produced by JsonParser.
[ { "docid": "d625767e87aa6742e0d499da3b5993eb", "score": "0.73271865", "text": "function JsonParserVisitor() {\r\n\tantlr4.tree.ParseTreeVisitor.call(this);\r\n\treturn this;\r\n}", "title": "" } ]
[ { "docid": "1bfd22669a244706da780f068f9439f9", "score": "0.57969797", "text": "visitFunction(tree) {}", "title": "" }, { "docid": "b2b651460d604a87137dab670227ec1a", "score": "0.5716304", "text": "function traverse(node, visitor) {\n if (Array.isArray(node)) {\n node.forEach(element => traverse(element, visitor));\n } else if (node && typeof node === 'object') {\n if (node.type) {\n visitor(node);\n }\n for (const key in node) {\n traverse(node[key], visitor);\n }\n }\n}", "title": "" }, { "docid": "bd99248896b5b7f56f581691e6282506", "score": "0.56643957", "text": "function visitWithTypeInfo(typeInfo,visitor){return{enter:function enter(node){typeInfo.enter(node);var fn=getVisitFn(visitor,node.kind,/* isLeaving */false);if(fn){var result=fn.apply(visitor,arguments);if(result!==undefined){typeInfo.leave(node);if(isNode(result)){typeInfo.enter(result);}}return result;}},leave:function leave(node){var fn=getVisitFn(visitor,node.kind,/* isLeaving */true);var result=void 0;if(fn){result=fn.apply(visitor,arguments);}typeInfo.leave(node);return result;}};}", "title": "" }, { "docid": "f29177ada914bbbd5765916f0b043f99", "score": "0.5658593", "text": "function walker(visitor) {\n const walkNode = node => {\n if (node == null) {\n return node;\n }\n const { params } = node;\n\n const mappingFunction = (() => {\n if (\"*\" in visitor && typeof visitor[\"*\"] === \"function\") {\n return visitor[\"*\"];\n }\n\n if (node.Type in visitor && typeof visitor[node.Type] === \"function\") {\n return visitor[node.Type];\n }\n\n return () => node;\n })();\n\n if (mappingFunction.length === 2) {\n mappingFunction(node, walkNode);\n return node;\n }\n\n mappingFunction(node);\n params.forEach(walkNode);\n\n return node;\n };\n\n return walkNode;\n}", "title": "" }, { "docid": "fcb5d28e06420c4b3a9af7ee3913484b", "score": "0.56273824", "text": "function traverseNode(node, parent) {\n\n\t let methods = visitor[node.type];\n\n\t // first we will enter the node\n \tif (methods && methods.enter) {\n \t methods.enter(node, parent);\n \t}\n\n \t// Next we are going to split things up by the current node type.\n \tswitch (node.type) {\n\n \t\t// handle program and traverse body\n \t\tcase 'Program':\n \t\ttraverseArray(node.body, node);\n \t\tbreak;\n\n\t \t// handle `CallExpression` and traverse their `params`.\n \t\tcase 'CallExpression':\n \t\ttraverseArray(node.params, node);\n \t\tbreak;\n\n\t \t// handle numbers and string\n \t\tcase 'NumberLiteral':\n \t\tcase 'StringLiteral':\n \t\tbreak;\n\n\t \t// handle unknown type\n \t \tdefault:\n \t\tthrow new TypeError(node.type);\n \t}\n\n \t// exit the node\n \tif (methods && methods.exit) {\n \t\tmethods.exit(node, parent);\n \t}\n \t}", "title": "" }, { "docid": "30bd32b09bf6fbc08908b1a7445294c9", "score": "0.560981", "text": "function Visitor() {}", "title": "" }, { "docid": "25a3997fae25fff5afc60850c3a77b86", "score": "0.54823625", "text": "function JavaParserVisitor() {\n antlr4.tree.ParseTreeVisitor.call(this);\n return this;\n}", "title": "" }, { "docid": "3cf038a759bfce58aecc476a2457273d", "score": "0.5459428", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n }", "title": "" }, { "docid": "53c2aa2433889d9910fd0c690b0867bb", "score": "0.5453914", "text": "function BisonParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "23086a52a145fcbde69b1300849a169b", "score": "0.54418886", "text": "walk(ast, callback) {\n const remaining = ast.slice();\n while (remaining.length) {\n const next = remaining.shift();\n if (this[$visitedTypes].indexOf(next.type) > -1) {\n callback(next);\n }\n switch (next.type) {\n case 'expression':\n remaining.unshift(...next.terms);\n break;\n case 'function':\n remaining.unshift(next.name, ...next.arguments);\n break;\n }\n }\n }", "title": "" }, { "docid": "e8a66b98ec92ac30bc3034ab1c0e3496", "score": "0.54313403", "text": "parse() {\n // Let's look for operands in a expression, i.e: \"a\" and \"b\" in \"a+b*5\"\n const t = this.owner.lexer.token;\n if ([Lexer_1.TokenCode.NUMBER, Lexer_1.TokenCode.HEXANUMBER, Lexer_1.TokenCode.BINARYNUMBER].includes(t.tokenCode)) {\n this.children.push(this.reqClass(NumberLiteral));\n return; //* *** early exit\n }\n if (t.tokenCode == Lexer_1.TokenCode.LITERAL_STRING) {\n this.children.push(this.reqClass(StringLiteral));\n return; //* *** early exit\n }\n if (t.value == \"match\") { // Rust match expression\n this.name = 'match';\n this.children.push(this.reqClass(MatchExpression));\n return; //* *** early exit\n }\n if (t.value == \"[\") { // array expression\n this.name = 'array expression';\n this.children.push(this.reqClass(ArrayLiteral));\n return; //* *** early exit\n }\n if (t.value == \"(\") { // parenthized expression\n this.name = 'parentized';\n this.children.push(this.reqClass(ParenExpression));\n return; //* *** early exit\n }\n if (t.value == \"|\") { // closure expression\n this.name = 'closure';\n this.children.push(this.reqClass(RustClosure));\n return; //* *** early exit\n }\n if (t.value == \"let\") { // if let => destructuring, check if the Rvalue is of the Lvalue struct\n this.name = 'if-let';\n this.req(\"let\");\n this.reqChild(Operand); // expression like Some(a / Foo::Bar / Foo::Bar { field })\n this.req(\"=\");\n this.reqChild(Identifier); // rvalue is the variable to check against lvalue\n return; //* *** early exit\n }\n if (t.value == \"if\") { // let x = if... if expression\n this.name = 'if-expr';\n this.reqChild(IfStatement); // expression like Some(a / Foo::Bar / Foo::Bar { field })\n return; //* *** early exit\n }\n // here, the OPERAND is a var reference, fn-call or macro!\n this.owner.lexer.savePosition();\n const vr = this.reqClass(VarRef);\n // let's see if this is a macro! invocation\n if (this.owner.lexer.token.value == '!') { // it's a macro!\n this.owner.lexer.restoreSavedPosition();\n this.keyword = \"macro!\";\n this.name = vr.name;\n this.children.push(this.reqClass(MacroInvocation));\n return; //* *** early exit\n }\n // it's not a macro, last options are var reference or fn-call\n // the vr is good for both\n this.owner.lexer.discardSavedPosition();\n // let's see if this is a struct instantiation expression\n // rust's struct instantiation can only be detected by 'Self {...' or 'Declared-Struct-Type-Name {...' used as a statement\n // ojo ambiguos if we're in [match expr '{' ... '}' ] - commented\n if (this.owner.lexer.token.value == \"{\" &&\n this.parent.parent.name != 'match' && // for all this statements { => start body\n this.parent.parent.name != 'if' &&\n this.parent.parent.name != 'for') { // it's a struct Instantiation\n const objectLiteral = this.reqClass(ObjectLiteral);\n objectLiteral.name = vr.name;\n objectLiteral.keyword = \"struct-instantiation\";\n this.children.push(objectLiteral);\n return; //* *** early exit\n }\n // last option, this is just a varRef acting as a expression\n this.name = vr.name;\n this.children.push(vr);\n }", "title": "" }, { "docid": "0cf26250a7981767e7372c26a29ef5b1", "score": "0.54288334", "text": "function Visitor() { }", "title": "" }, { "docid": "1b8e8cc4d6dbd7bccb2ecb424bdde69b", "score": "0.54120487", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "1b8e8cc4d6dbd7bccb2ecb424bdde69b", "score": "0.54120487", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "08aa33fcabe2f85532f4a7cb92554821", "score": "0.5359214", "text": "function visit(v, f) {\n var child;\n\n f(v);\n\n for (var i in v) {\n child = v[i];\n if (child !== null && typeof child === 'object') {\n visit(child, f);\n }\n }\n }", "title": "" }, { "docid": "9cae7109c7ad6911d0b4909efdac8a91", "score": "0.53154767", "text": "function traverseNode(ast) {\n\n var Node = new Object();\n Node['label'] = ast.loc.source;\n Node['type'] = ast.kind;\n Node['children'] = [];\n if (Node['type'] === 'string' || Node['type'] === 'encapsed') {\n global.str = ast.loc.source;\n }\n var childNode = [];\n if (typeof ast !== 'undefined' && ast !== null) {\n\n\n if (typeof ast.children !== 'undefined' && ast.children !== null) {\n var children = ast.children;\n\n for (var i = 0; i < ast.children.length; i++) {\n childNode.push(traverseNode(children[i]));\n }\n\n\n }\n if (typeof ast.expression !== 'undefined' && ast.expression !== null) {\n childNode.push(traverseNode(ast.expression));\n }\n if (typeof ast.left !== 'undefined' && ast.left !== null) {\n childNode.push(traverseNode(ast.left));\n\n }\n if (typeof ast.right !== 'undefined' && ast.right !== null) {\n childNode.push(traverseNode(ast.right));\n }\n if (typeof ast.test !== 'undefined' && ast.test !== null) {\n childNode.push(traverseNode(ast.test));\n }\n if (typeof ast.what !== 'undefined' && ast.what !== null) {\n childNode.push(traverseNode(ast.what));\n }\n if (typeof ast.type !== 'undefined' && ast.type !== null) {\n var Node1 = new Object();\n Node1['label'] = ast.type;\n Node1['type'] = 'type';\n Node1['children'] = [];\n childNode.push(Node1);\n }\n if (typeof ast.offset !== 'undefined' && ast.offset !== null) {\n childNode.push(traverseNode(ast.offset));\n }\n\n if (typeof ast.body !== 'undefined' && ast.body !== null) {\n childNode.push(traverseNode(ast.body));\n }\n if (typeof ast.alternate !== 'undefined' && ast.alternate !== null) {\n childNode.push(traverseNode(ast.alternate));\n }\n if (typeof ast.expressions !== 'undefined' && ast.expressions !== null) {\n var Node1 = new Object();\n Node1['label'] = 'expressions';\n Node1['type'] = 'expressions';\n Node1['children'] = [];\n var expressions = ast.expressions;\n\n for (var i = 0; i < ast.expressions.length; i++) {\n Node1['children'].push(traverseNode(expressions[i]));\n }\n childNode.push(Node1);\n }\n\n if (typeof ast.arguments !== 'undefined' && ast.arguments !== null) {\n var Node1 = new Object();\n Node1['label'] = 'arguments';\n Node1['type'] = 'arguments';\n Node1['children'] = [];\n var arguments = ast.arguments;\n\n for (var i = 0; i < ast.arguments.length; i++) {\n Node1['children'].push(traverseNode(arguments[i]));\n }\n childNode.push(Node1);\n }\n }\n Node['children'] = childNode;\n return Node;\n\n}", "title": "" }, { "docid": "7f9dabae990e2deac879b20ed388dd9c", "score": "0.5315036", "text": "function traverser(ast, visitor) {\n // //iterate over array and call next function\n function traverseArray(array, parent) {\n array.forEach(child => {\n traverseNode(child, parent);\n });\n }\n //\n // //accept a `node` and its `parent` node to pass both\n function traverseNode(node, parent) {\n //test for existence of a method on the visitor with a matching `type`.\n let methods = visitor[node.type];\n // If there is an `enter` method for this node type we'll call it with the\n // // `node` and its `parent`.\n if (methods && methods.enter) {\n methods.enter(node, parent);\n }\n\n // split things up by the current node type.\n switch (node.type) {\n //start with top level `Program`\n //Program nodes have a property named body that has an array of nodes = traverse array and thus traverse nodes = traverse recusively\n case 'Program':\n traverseArray(node.body, node);\n break;\n // and call expression\n case 'CallExpression':\n traverseArray(node.params, node);\n break;\n //striung no child so break\n case 'StringLiteral':\n break;\n //error if unrecognised\n default:\n throw new TypeError(node.type);\n }\n //if exit method then do to both node and parent\n if (methods && methods.exit) {\n methods.exit(node, parent);\n }\n }\n //call traverser with ast - obv no parent\n traverseNode(ast, null);\n}", "title": "" }, { "docid": "59926de439035e75cf361cd50991be47", "score": "0.5296534", "text": "function EvalVisitor() {\r\n }", "title": "" }, { "docid": "83825c64dfd5c25c6a3f2e455aa7cc9b", "score": "0.5217326", "text": "function KofoLangVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "a8825a7726bbbd6c40238c1d3ee46221", "score": "0.5174325", "text": "function SHRParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "6a64b1e15dbe4bbbacbde839c9e73b6d", "score": "0.51534444", "text": "function traverse(ast, visitor) {\n traverse_1.default(ast, {\n enter(path) {\n dispatchVisitMethods(['enter', `enter${path.type}`], path, visitor);\n },\n exit(path) {\n dispatchVisitMethods(['leave', `leave${path.type}`], path, visitor);\n },\n noScope: !babel.isFile(ast),\n });\n}", "title": "" }, { "docid": "8154dac799520d5b608332133b94e604", "score": "0.51507074", "text": "function CParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "24ff621e9277a2893edfeb743c03621b", "score": "0.51388377", "text": "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node)) {\n return;\n }\n if (ts.isClassDeclaration(node) && node.name) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (symbol) {\n var classEntries = serializeClass(symbol);\n classEntries.forEach(function (entry) {\n fileContents.classDeclarations.push(entry);\n });\n }\n // No need to walk any further, class expressions/inner declarations\n // cannot be exported\n }\n else if (ts.isVariableStatement(node)) {\n // Process variable statements (e.g., for example input/output code)\n var symbol = checker.getSymbolAtLocation(node.declarationList.declarations[0].name);\n //console.log(varDocEntry.name);\n var varDocEntry = serializeVariable(symbol, node);\n fileContents.variableStatements.push(varDocEntry);\n }\n else if (ts.isFunctionDeclaration(node)) {\n var symbol = checker.getSymbolAtLocation(node.name);\n /*if(symbol.getName() === \"parseInt\"){\n //console.log(\"parseInt\");\n //console.log(node);\n //console.log(node.modifiers);\n //console.log(node.parameters[1].getChildren());\n node.parameters.forEach(function(param){\n console.log(checker.isOptionalParameter(param));\n });\n }*/\n var list = serializeFunction(symbol, node);\n list.forEach(function (item) { fileContents.functionDeclarations.push(item); });\n }\n else if (ts.isInterfaceDeclaration(node)) {\n //console.log(\"isInterfaceDeclaration\");\n var symbol = checker.getSymbolAtLocation(node.name);\n //console.log(symbol.name);\n if (symbol) {\n var classEntries = serializeClass(symbol);\n classEntries.forEach(function (entry) {\n //fileContents.interfaceDeclarations.push(entry);\n fileContents.interfaceDeclarations[entry.name] = entry;\n //console.log(entry.name);\n /*if(entry.name === \"Date\"){\n //console.log(entry);\n console.log(node);\n }*/\n });\n }\n }\n else {\n }\n }", "title": "" }, { "docid": "a79d68ff6876e979c3e8f145e8902765", "score": "0.512173", "text": "function StatsVisitor () {\n // A table index by the type of the gobject with \n // Area, perimeter and \n this.base = BQClassVisitor;\n this.base ();\n\n // Top level Complex gobjects (Structures) \n this.groups = {};\n // Current stats accumulator (initialy non complex objects)\n this.stats = new Stats('', 'simple types'); \n this.parent_stats = new Array();\n}", "title": "" }, { "docid": "75ad85206c273c807ee8b669a080382a", "score": "0.50963235", "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 // console.log('walk:', type, ast.comments_before);\n // if (type === 'object') {\n // console.log(require('util').inspect(ast, false, 20));\n // }\n var gen = user[type];\n if (gen) {\n var args = ast.slice(1);\n var comments_before = ast.comments_before;\n if (comments_before && comments_before.length) {\n args.push({\n comments_before: comments_before\n });\n }\n // console.log('walk2:', args);\n var ret = gen.apply(ast, args);\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": "215406b4e4f064cfa420f88aeff024bd", "score": "0.50946426", "text": "function traverseNode(node, parent) {\n //test for existence of a method on the visitor with a matching `type`.\n let methods = visitor[node.type];\n // If there is an `enter` method for this node type we'll call it with the\n // // `node` and its `parent`.\n if (methods && methods.enter) {\n methods.enter(node, parent);\n }\n\n // split things up by the current node type.\n switch (node.type) {\n //start with top level `Program`\n //Program nodes have a property named body that has an array of nodes = traverse array and thus traverse nodes = traverse recusively\n case 'Program':\n traverseArray(node.body, node);\n break;\n // and call expression\n case 'CallExpression':\n traverseArray(node.params, node);\n break;\n //striung no child so break\n case 'StringLiteral':\n break;\n //error if unrecognised\n default:\n throw new TypeError(node.type);\n }\n //if exit method then do to both node and parent\n if (methods && methods.exit) {\n methods.exit(node, parent);\n }\n }", "title": "" }, { "docid": "4696c5dc5019aadc9f0d685373db62da", "score": "0.5078935", "text": "visitPredefinedType(tree) {}", "title": "" }, { "docid": "592e8c737a0066a9dc3e24c9cbdf2b97", "score": "0.5066122", "text": "function Node(){\n\t//Visitor pattern\n\tthis.accept = function(visitorObject){\n\t\tvisitorObject.visit(this);\n\t}\n\t\n\t//ToString methods\n\tthis.toString = function(){\n\t\tvar output = [];\n\t\tfor(item in this){\n\t\t\tif (this.hasOwnProperty(item)) {\n\t\t\t\toutput.push(item + \": \" + this[item]);\n\t\t\t}\n\t\t}\n\t\treturn output.toString();\n\t}\n}", "title": "" }, { "docid": "e3342147cd4bb2612d8ea828edb2b650", "score": "0.50173026", "text": "function explode(visitor) {\n if (visitor._exploded) return visitor;\n visitor._exploded = true;\n\n // normalise pipes\n for (var nodeType in visitor) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n var parts = nodeType.split(\"|\");\n if (parts.length === 1) continue;\n\n var fns = visitor[nodeType];\n delete visitor[nodeType];\n\n var _arr = parts;\n for (var _i = 0; _i < _arr.length; _i++) {\n var part = _arr[_i];\n visitor[part] = fns;\n }\n }\n\n // verify data structure\n verify(visitor);\n\n // make sure there's no __esModule type since this is because we're using loose mode\n // and it sets __esModule to be enumerable on all modules :(\n delete visitor.__esModule;\n\n // ensure visitors are objects\n ensureEntranceObjects(visitor);\n\n // ensure enter/exit callbacks are arrays\n ensureCallbackArrays(visitor);\n\n // add type wrappers\n\n var _arr2 = Object.keys(visitor);\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var nodeType = _arr2[_i2];\n if (shouldIgnoreKey(nodeType)) continue;\n\n var wrapper = virtualTypes[nodeType];\n if (!wrapper) continue;\n\n // wrap all the functions\n var fns = visitor[nodeType];\n for (var type in fns) {\n fns[type] = wrapCheck(wrapper, fns[type]);\n }\n\n // clear it from the visitor\n delete visitor[nodeType];\n\n if (wrapper.types) {\n var _arr4 = wrapper.types;\n\n for (var _i4 = 0; _i4 < _arr4.length; _i4++) {\n var type = _arr4[_i4];\n // merge the visitor if necessary or just put it back in\n if (visitor[type]) {\n mergePair(visitor[type], fns);\n } else {\n visitor[type] = fns;\n }\n }\n } else {\n mergePair(visitor, fns);\n }\n }\n\n // add aliases\n for (var nodeType in visitor) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n var fns = visitor[nodeType];\n\n var aliases = t.FLIPPED_ALIAS_KEYS[nodeType];\n if (!aliases) continue;\n\n // clear it from the visitor\n delete visitor[nodeType];\n\n var _arr3 = aliases;\n for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n var alias = _arr3[_i3];\n var existing = visitor[alias];\n if (existing) {\n mergePair(existing, fns);\n } else {\n visitor[alias] = _lodashLangClone2[\"default\"](fns);\n }\n }\n }\n\n for (var nodeType in visitor) {\n if (shouldIgnoreKey(nodeType)) continue;\n\n ensureCallbackArrays(visitor[nodeType]);\n }\n\n return visitor;\n}", "title": "" }, { "docid": "05c696821e29205ccc16798e18157012", "score": "0.5016296", "text": "visitObjectLiteral(ctx) {\n console.log(\"visitObjectLiteral\");\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "3f016ad3b44a827da58c754f347289e2", "score": "0.49925518", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n\t return {\n\t enter: function enter(node) {\n\t typeInfo.enter(node);\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitor, arguments);\n\t if (result !== undefined) {\n\t typeInfo.leave(node);\n\t if (isNode(result)) {\n\t typeInfo.enter(result);\n\t }\n\t }\n\t return result;\n\t }\n\t },\n\t leave: function leave(node) {\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t var result = void 0;\n\t if (fn) {\n\t result = fn.apply(visitor, arguments);\n\t }\n\t typeInfo.leave(node);\n\t return result;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "3f016ad3b44a827da58c754f347289e2", "score": "0.49925518", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n\t return {\n\t enter: function enter(node) {\n\t typeInfo.enter(node);\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitor, arguments);\n\t if (result !== undefined) {\n\t typeInfo.leave(node);\n\t if (isNode(result)) {\n\t typeInfo.enter(result);\n\t }\n\t }\n\t return result;\n\t }\n\t },\n\t leave: function leave(node) {\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t var result = void 0;\n\t if (fn) {\n\t result = fn.apply(visitor, arguments);\n\t }\n\t typeInfo.leave(node);\n\t return result;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "3f016ad3b44a827da58c754f347289e2", "score": "0.49925518", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n\t return {\n\t enter: function enter(node) {\n\t typeInfo.enter(node);\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitor, arguments);\n\t if (result !== undefined) {\n\t typeInfo.leave(node);\n\t if (isNode(result)) {\n\t typeInfo.enter(result);\n\t }\n\t }\n\t return result;\n\t }\n\t },\n\t leave: function leave(node) {\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t var result = void 0;\n\t if (fn) {\n\t result = fn.apply(visitor, arguments);\n\t }\n\t typeInfo.leave(node);\n\t return result;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "f579c76db1e6e1c727415569d6431f8a", "score": "0.49831256", "text": "function parseTree(text, errors, options) {\n if (errors === void 0) { errors = []; }\n if (options === void 0) { options = ParseOptions.DEFAULT; }\n var currentParent = { type: 'array', offset: -1, length: -1, children: [], parent: undefined }; // artificial root\n function ensurePropertyComplete(endOffset) {\n if (currentParent.type === 'property') {\n currentParent.length = endOffset - currentParent.offset;\n currentParent = currentParent.parent;\n }\n }\n function onValue(valueNode) {\n currentParent.children.push(valueNode);\n return valueNode;\n }\n var visitor = {\n onObjectBegin: function (offset) {\n currentParent = onValue({ type: 'object', offset: offset, length: -1, parent: currentParent, children: [] });\n },\n onObjectProperty: function (name, offset, length) {\n currentParent = onValue({ type: 'property', offset: offset, length: -1, parent: currentParent, children: [] });\n currentParent.children.push({ type: 'string', value: name, offset: offset, length: length, parent: currentParent });\n },\n onObjectEnd: function (offset, length) {\n ensurePropertyComplete(offset + length); // in case of a missing value for a property: make sure property is complete\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n },\n onArrayBegin: function (offset, length) {\n currentParent = onValue({ type: 'array', offset: offset, length: -1, parent: currentParent, children: [] });\n },\n onArrayEnd: function (offset, length) {\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n },\n onLiteralValue: function (value, offset, length) {\n onValue({ type: getNodeType(value), offset: offset, length: length, parent: currentParent, value: value });\n ensurePropertyComplete(offset + length);\n },\n onSeparator: function (sep, offset, length) {\n if (currentParent.type === 'property') {\n if (sep === ':') {\n currentParent.colonOffset = offset;\n }\n else if (sep === ',') {\n ensurePropertyComplete(offset);\n }\n }\n },\n onError: function (error, offset, length) {\n errors.push({ error: error, offset: offset, length: length });\n }\n };\n visit(text, visitor, options);\n var result = currentParent.children[0];\n if (result) {\n delete result.parent;\n }\n return result;\n }", "title": "" }, { "docid": "c2fb44fb87116700f0c51a3de7375fe8", "score": "0.49708956", "text": "function YangParser() {\n this.rootNodes = [];\n this.nodeIndex = 0;\n this.sync = SyncService.generateObj();\n this.moduleObj = null;\n\n this.setCurrentModuleObj = function (moduleObj) {\n this.moduleObj = moduleObj;\n };\n\n this.createNewNode = function (name, type, parentNode, nodeType) {\n var node = new Node(this.nodeIndex++, name, type, this.moduleObj._name, this.moduleObj._namespace, parentNode, nodeType, this.moduleObj._revision);\n\n if (parentNode) {\n parentNode.addChild(node);\n }\n\n return node;\n };\n\n this.parse = function (xml, parent) {\n var self = this;\n\n $(xml).children().each(function (_, item) {\n var prop = item.tagName.toLowerCase();\n if (self.hasOwnProperty(prop)) {\n self[prop](item, parent);\n } else {\n // self.parse(this, parent);\n }\n });\n };\n\n this.config = function (xml, parent) {\n var type = constants.DATA_STORE_CONFIG,\n name = $(xml).attr('value'),\n nodeType = constants.NODE_ALTER;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.presence = function (xml, parent) {\n var type = 'presence',\n name = $(xml).attr('value'),\n nodeType = constants.NODE_ALTER;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.leaf = function (xml, parent) {\n var type = 'leaf',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this['leaf-list'] = function (xml, parent) {\n var type = 'leaf-list',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.container = function (xml, parent) {\n var type = 'container',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.choice = function (xml, parent) {\n var type = 'choice',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.case = function (xml, parent) {\n var type = 'case',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.list = function (xml, parent) {\n var type = 'list',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n\n this.key = function (xml, parent) {\n var type = 'key',\n name = $(xml).attr('value'),\n nodeType = constants.NODE_ALTER,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.description = function (xml, parent) {\n var type = 'description',\n name = $(xml).attr('text') ? $(xml).attr('text') : $(xml).children('text:first').text(),\n nodeType = constants.NODE_ALTER,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.typedef = function (xml, parent, typedefName) {\n var type = 'typedef',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_LINK_TARGET,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.grouping = function (xml, parent, groupingName) {\n var type = 'grouping',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_LINK_TARGET,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.uses = function (xml, parent) {\n var type = 'uses',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_LINK,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.import = function (xml, parent) {\n var type = 'import',\n name = $(xml).attr('module'),\n nodeType = constants.NODE_ALTER,\n node = this.createNewNode(name, type, parent, nodeType);\n\n node._prefix = $(xml).children('prefix:first').attr('value');\n node._revisionDate = $(xml).children('revision-date:first').attr('date');\n };\n\n this.augment = function (xml, parent) {\n var type = augmentType,\n nodeType = constants.NODE_ALTER,\n augmentIndentifier = $(xml).children('ext\\\\:augment-identifier:first').attr('ext:identifier'),\n name = augmentIndentifier ? augmentIndentifier : 'augment' + (this.nodeIndex + 1).toString(),\n pathString = $(xml).attr('target-node'),\n augmentRoot = this.createNewNode(name, type, parent, nodeType);\n\n augmentRoot.pathString = pathString;\n this.parse(xml, augmentRoot);\n };\n\n\n this.rpc = function (xml, parent) {\n var type = constants.NODE_RPC,\n name = $(xml).attr('name'),\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.input = function (xml, parent) {\n var type = 'input',\n name = 'input',\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.output = function (xml, parent) {\n var type = 'output',\n name = 'output',\n nodeType = constants.NODE_UI_DISPLAY,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.pattern = function (xml, parent) {\n var type = 'pattern',\n name = $(xml).attr('value'),\n nodeType = constants.NODE_RESTRICTIONS;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.range = function (xml, parent) {\n var type = 'range',\n name = $(xml).attr('value'),\n nodeType = constants.NODE_RESTRICTIONS;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.length = function (xml, parent) {\n var type = 'length',\n name = $(xml).attr('value'),\n nodeType = constants.NODE_RESTRICTIONS;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.enum = function (xml, parent) {\n var type = 'enum',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_ALTER;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.bit = function (xml, parent) {\n var type = 'bit',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_ALTER,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n\n this.position = function (xml, parent) {\n var type = 'position',\n name = $(xml).attr('value'),\n nodeType = constants.NODE_ALTER;\n\n this.createNewNode(name, type, parent, nodeType);\n };\n\n this.type = function (xml, parent) {\n var type = 'type',\n name = $(xml).attr('name'),\n nodeType = constants.NODE_ALTER,\n node = this.createNewNode(name, type, parent, nodeType);\n\n this.parse(xml, node);\n };\n }", "title": "" }, { "docid": "c9e4c71bb0cdefa72d8d69d632243d9e", "score": "0.4965189", "text": "function walk( tree, fn ) {\n\ttree.forEach(function( v ) {\n\t\tif( v.type === 'element' ) {\n\t\t\tfn( v );\n\t\t\tif( v.children ) {\n\t\t\t\twalk( v.children, fn );\n\t\t\t}\n\t\t} else if( v.type === 'if' ) {\n\t\t\twalk( v.alternate, fn );\n\t\t\twalk( v.consequent, fn );\n\t\t} else if( v.type === 'list' ) {\n\t\t\twalk( v.body, fn );\n\t\t}\n\t})\n}", "title": "" }, { "docid": "7232cf48dfc3f9aa058f86fee0259c5f", "score": "0.49535853", "text": "function parse(tree) {\n\tswitch (tree.type) {\n\tcase \"ArrayExpression\":\n\t\ttrailingComma(tree);\n\t\tbreak;\n\tcase \"ObjectExpression\":\n\t\ttrailingComma(tree);\n\t\tbreak;\n\tcase \"MemberExpression\":\n\t\tdunderIterator(tree);\n\t\tdunderProto(tree);\n\t\tbreak;\n\tcase \"ExpressionStatement\":\n\t\tmissingSemicolon(tree);\n\t\tbreak;\n\tcase \"ReturnStatement\":\n\t\tmissingReturnSemicolon(tree);\n\t\tbreak;\n\tcase \"DebuggerStatement\":\n\t\tunexpectedDebugger(tree);\n\t\tbreak;\n\tcase \"BinaryExpression\":\n\t\tbitwiseOperators(tree);\n\t\tunsafeComparison(tree);\n\t\tbreak;\n\tcase \"UnaryExpression\":\n\t\tbitwiseOperators(tree);\n\t\tbreak;\n\tcase \"VariableDeclarator\":\n\t\tredefinedVariables(tree.id.name, tree.id.range);\n\t\tscopes.addVariable({ name: tree.id.name });\n\t\tbreak;\n\tcase \"FunctionExpression\":\n\tcase \"FunctionDeclaration\":\n\t\t_.each(tree.params, function (param, key) {\n\t\t\tredefinedVariables(param.name, param.range);\n\t\t\tscopes.addVariable({ name: param.name });\n\t\t});\n\t\tbreak;\n\tcase \"Identifier\":\n\t\trecordIdentifier(tree);\n\t\tbreak;\n\t}\n\n\t_.each(tree, function (val, key) {\n\t\tif (val === null)\n\t\t\treturn;\n\n\t\tif (!_.isObject(val) && !_.isArray(val))\n\t\t\treturn;\n\n\t\tswitch (val.type) {\n\t\tcase \"FunctionDeclaration\":\n\t\t\tscopes.addVariable({ name: val.id.name });\n\t\t\tscopes.push(val.id.name);\n\t\t\tparse(val);\n\t\t\tscopes.pop();\n\t\t\tbreak;\n\t\tcase \"FunctionExpression\":\n\t\t\tif (val.id && val.id.type === \"Identifier\")\n\t\t\t\tscopes.addVariable({ name: val.id.name });\n\n\t\t\tscopes.push(\"(anon)\");\n\t\t\tparse(val);\n\t\t\tscopes.pop();\n\t\t\tbreak;\n\t\tcase \"WithStatement\":\n\t\t\tscopes.runtimeOnly = true;\n\t\t\tparse(val);\n\t\t\tscopes.runtimeOnly = false;\n\t\t\tbreak;\n\t\tcase \"Identifier\":\n\t\t\tparse(val);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tparse(val);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8a23a0db5e5acdedf8850194a1fe5269", "score": "0.4939626", "text": "visitType(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "4f0c7fa47c1f58e7c21dab79df56a9d2", "score": "0.4930367", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "015d776958e342ec96418958a1c43d16", "score": "0.4914774", "text": "function ExprVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "9b19a4db5e580656d814de408591ec19", "score": "0.49133256", "text": "function CVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "9b19a4db5e580656d814de408591ec19", "score": "0.49133256", "text": "function CVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "9c99194e6b68cad94842d23cdd9ca2d8", "score": "0.4901017", "text": "function forEachNode (parsed, func, state, options) {\n // note: func can get called with the same node for different\n // visitor callbacks!\n // func args: node, state, depth, type\n options = options || {};\n const traversal = options.traversal || 'preorder'; // also: postorder\n\n const visitors = obj.clone(options.visitors ? options.visitors : walk.make(custom.visitors.withMemberExpression));\n const iterator = traversal === 'preorder'\n ? function (orig, type, node, depth, cont) { func(node, state, depth, type); return orig(node, depth + 1, cont); }\n : function (orig, type, node, depth, cont) { const result = orig(node, depth + 1, cont); func(node, state, depth, type); return result; };\n Object.keys(visitors).forEach(function (type) {\n const orig = visitors[type];\n visitors[type] = function (node, depth, cont) { return iterator(orig, type, node, depth, cont); };\n });\n walk.recursive(parsed, 0, null, visitors);\n return parsed;\n}", "title": "" }, { "docid": "41eb4539fdf66964bca15761a3a47b48", "score": "0.48989114", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "41eb4539fdf66964bca15761a3a47b48", "score": "0.48989114", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "41eb4539fdf66964bca15761a3a47b48", "score": "0.48989114", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "41eb4539fdf66964bca15761a3a47b48", "score": "0.48989114", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "6e7cd0276effbf706bd942d59de2753d", "score": "0.48920655", "text": "function walkAst(node) {\n\t\t\tfor (var key in node) {\n\t\t\t\tif (key === 'range')\n\t\t\t\t\tcontinue;\n\t\t\t\tvar value = node[key];\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (var i = 0, l = value.length; i < l; i++)\n\t\t\t\t\t\twalkAst(value[i]);\n\t\t\t\t} else if (value && typeof value === 'object') {\n\t\t\t\t\t// We cannot use Base.isPlainObject() for these since\n\t\t\t\t\t// Acorn.js uses its own internal prototypes now.\n\t\t\t\t\twalkAst(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (node && node.type) {\n\t\t\tcase 'BinaryExpression':\n\t\t\t\tif (node.operator in binaryOperators\n\t\t\t\t\t\t&& node.left.type !== 'Literal') {\n\t\t\t\t\tvar left = getCode(node.left),\n\t\t\t\t\t\tright = getCode(node.right);\n\t\t\t\t\treplaceCode(node, '_$_(' + left + ', \"' + node.operator\n\t\t\t\t\t\t\t+ '\", ' + right + ')');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'AssignmentExpression':\n\t\t\t\tif (/^.=$/.test(node.operator)\n\t\t\t\t\t\t&& node.left.type !== 'Literal') {\n\t\t\t\t\tvar left = getCode(node.left),\n\t\t\t\t\t\tright = getCode(node.right);\n\t\t\t\t\treplaceCode(node, left + ' = _$_(' + left + ', \"'\n\t\t\t\t\t\t\t+ node.operator[0] + '\", ' + right + ')');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UpdateExpression':\n\t\t\t\tif (!node.prefix) {\n\t\t\t\t\tvar arg = getCode(node.argument);\n\t\t\t\t\treplaceCode(node, arg + ' = _$_(' + arg + ', \"'\n\t\t\t\t\t\t\t+ node.operator[0] + '\", 1)');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UnaryExpression':\n\t\t\t\tif (node.operator in unaryOperators\n\t\t\t\t\t\t&& node.argument.type !== 'Literal') {\n\t\t\t\t\tvar arg = getCode(node.argument);\n\t\t\t\t\treplaceCode(node, '$_(\"' + node.operator + '\", '\n\t\t\t\t\t\t\t+ arg + ')');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9d04147ed357d1fb1ff954fbf2ca6fd1", "score": "0.48849967", "text": "function ASTparse_Expr(){\n\tdocument.getElementById(\"AStree\").value += \"ASTparser: ASTparse_Expr()\" + '\\n';\n\t//ASTREE.addNode('Expr', 'branch');\n\n\t\n\tvar ASTtempDesc = tokenstreamCOPY[ASTparseCounter][0]; //check desc of token\n\tvar ASTtempType = tokenstreamCOPY[ASTparseCounter][1]; //check type of token\n\tif(ASTtempType == 'digit'){\n\t\tASTparse_IntExpr();\n\t\tASTREE.endChildren();\n\t\t\n\t\t\n\t\n\t\t\n\t}\n\telse if (ASTtempDesc == ' \"'){\n\t\tASTparse_StringExpr();\n\t\tASTREE.endChildren();\n\t}\n\telse if (ASTtempDesc == ' (' || ASTtempType == 'boolval'){\n\t\tASTparse_BooleanExpr();\n\t\tASTREE.endChildren();\n\t\n\t\t\n\t}\n\telse if (ASTtempType == 'identifier' ) {\n\t\tASTparse_ID();\n\t\t//ASTREE.endChildren();\n\t\t//ASTREE.endChildren();\n\t\t\n\t\n\t\t\n\t}\n\t\n\t\t\n\t//ASTREE.endChildren();\t\n\t\n\t\n}", "title": "" }, { "docid": "9dfb0819bf8b882a1e96e0c7988e448b", "score": "0.486081", "text": "function traverse(root, scope) {\n d(root.type);\n let result;\n\n if ('AssignmentExpression' === root.type) return assignmentExpressionHandler(root.val, scope);\n\n else if ('InvocationExpression' === root.type) return invocationExpressionHandler(root.val, scope);\n\n else if ('BinaryOperatorExpression' === root.type) return binaryOperatorExpressionHandler(root.val, scope);\n\n else if ('TernaryOperatorExpression' === root.type) return ternaryOperatorExpressionHandler(root.val, scope);\n\n else if ('UnaryOperatorExpression' === root.type) return unaryOperatorExpressionHandler(root.val, scope);\n\n else if ('ImportExpression' === root.type) return importExpressionHandler(root.val, scope);\n\n else if ('LambdaExpression' === root.type) return lamdaExpressionHandler(root.val, scope);\n\n // else if ('ExportExpression' === root.type) return exportExpressionHandler(root.val, scope);\n\n else if (isAtom(root)) return atomsHandler(root, scope);\n\n // traverse over all child nodes from L to R\n if (Array.isArray(root.val)) {\n root.val.forEach(function(v) {\n result = traverse(v, scope);\n });\n // return result of last node (which technically means last line of whatever (program or block))\n return result;\n }\n // else it's an object so it's just one child. traverse it\n return traverse(root.val, scope);\n}", "title": "" }, { "docid": "18be41a43076c71a7474124d8a2b38cb", "score": "0.48441198", "text": "function ast_walker(ast) {\n function _vardefs(defs) {\n return [ this[0], MAP(defs, function(def){\n return [ def[0], walk(def[1]), def[2] ];\n }) ];\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\n function _lambda(name, args, body, returnType, modifiers) {\n return [ this[0], name, args.slice(), body ? MAP(body, walk) : null, returnType, modifiers ? modifiers.slice() : null ];\n };\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 \"astry\": function(t, c, f) {\n return [\n this[0],\n MAP(t, walk),\n c != null ? MAP(c, function(cc){\n return [ cc[0], MAP(cc[1], walk) ];\n }) : null,\n f != null ? MAP(f, walk) : null\n ];\n },\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\": _lambda,\n \"defun\": _lambda,\n \"method\": _lambda,\n \"getter\": _lambda,\n \"setter\": _lambda,\n \"class\": function(name, members, superclass) {\n return [ this[0], name, MAP(members, walk), walk(superclass) ];\n },\n \"interface\": function(name, members) {\n return [ this[0], name, MAP(members, walk) ];\n },\n \"package\": function(name, statements) {\n return [ this[0], name, MAP(statements, walk) ];\n },\n \"import\": function(name) {\n return [ this[0], name ];\n },\n \"namespace\": function(name, modifiers, tags) {\n return [ this[0], name, modifiers ];\n },\n \"property\": function(defs, modifiers) {\n defs = MAP(defs, function(def) {\n return [ def[0], walk(def[1]), def[2] ];\n });\n return [ this[0], defs, modifiers.slice() ];\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 \"for-each\": 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 \"splat\": function() {\n return [ this[0] ];\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 if (!gen) {\n throw new Error(\"Not supported: \" + type + \" of \" + ast);\n }\n return gen.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 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": "750409e27916159bcebd40c4876e4622", "score": "0.48440135", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "f444700a22aaf4fa491c8d61ae1d5857", "score": "0.48436746", "text": "Program(path,state){path.traverse(visitor,state);}", "title": "" }, { "docid": "0490317630f6c34bea315965a8da4421", "score": "0.48410025", "text": "visitTypeofExpression(ctx) {\n console.log(\"visitTypeofExpression\");\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "9e1f759bf5371e67035ef76e0999ebd6", "score": "0.48294482", "text": "function visit(text, visitor, options) {\n if (options === void 0) { options = ParseOptions.DEFAULT; }\n var _scanner = scanner_1.createScanner(text, false);\n function toNoArgVisit(visitFunction) {\n return visitFunction ? function () { return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };\n }\n function toOneArgVisit(visitFunction) {\n return visitFunction ? function (arg) { return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };\n }\n var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);\n var disallowComments = options && options.disallowComments;\n var allowTrailingComma = options && options.allowTrailingComma;\n function scanNext() {\n while (true) {\n var token = _scanner.scan();\n switch (_scanner.getTokenError()) {\n case 4 /* InvalidUnicode */:\n handleError(14 /* InvalidUnicode */);\n break;\n case 5 /* InvalidEscapeCharacter */:\n handleError(15 /* InvalidEscapeCharacter */);\n break;\n case 3 /* UnexpectedEndOfNumber */:\n handleError(13 /* UnexpectedEndOfNumber */);\n break;\n case 1 /* UnexpectedEndOfComment */:\n if (!disallowComments) {\n handleError(11 /* UnexpectedEndOfComment */);\n }\n break;\n case 2 /* UnexpectedEndOfString */:\n handleError(12 /* UnexpectedEndOfString */);\n break;\n case 6 /* InvalidCharacter */:\n handleError(16 /* InvalidCharacter */);\n break;\n }\n switch (token) {\n case 12 /* LineCommentTrivia */:\n case 13 /* BlockCommentTrivia */:\n if (disallowComments) {\n handleError(10 /* InvalidCommentToken */);\n }\n else {\n onComment();\n }\n break;\n case 16 /* Unknown */:\n handleError(1 /* InvalidSymbol */);\n break;\n case 15 /* Trivia */:\n case 14 /* LineBreakTrivia */:\n break;\n default:\n return token;\n }\n }\n }\n function handleError(error, skipUntilAfter, skipUntil) {\n if (skipUntilAfter === void 0) { skipUntilAfter = []; }\n if (skipUntil === void 0) { skipUntil = []; }\n onError(error);\n if (skipUntilAfter.length + skipUntil.length > 0) {\n var token = _scanner.getToken();\n while (token !== 17 /* EOF */) {\n if (skipUntilAfter.indexOf(token) !== -1) {\n scanNext();\n break;\n }\n else if (skipUntil.indexOf(token) !== -1) {\n break;\n }\n token = scanNext();\n }\n }\n }\n function parseString(isValue) {\n var value = _scanner.getTokenValue();\n if (isValue) {\n onLiteralValue(value);\n }\n else {\n onObjectProperty(value);\n }\n scanNext();\n return true;\n }\n function parseLiteral() {\n switch (_scanner.getToken()) {\n case 11 /* NumericLiteral */:\n var value = 0;\n try {\n value = JSON.parse(_scanner.getTokenValue());\n if (typeof value !== 'number') {\n handleError(2 /* InvalidNumberFormat */);\n value = 0;\n }\n }\n catch (e) {\n handleError(2 /* InvalidNumberFormat */);\n }\n onLiteralValue(value);\n break;\n case 7 /* NullKeyword */:\n onLiteralValue(null);\n break;\n case 8 /* TrueKeyword */:\n onLiteralValue(true);\n break;\n case 9 /* FalseKeyword */:\n onLiteralValue(false);\n break;\n default:\n return false;\n }\n scanNext();\n return true;\n }\n function parseProperty() {\n if (_scanner.getToken() !== 10 /* StringLiteral */) {\n handleError(3 /* PropertyNameExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n return false;\n }\n parseString(false);\n if (_scanner.getToken() === 6 /* ColonToken */) {\n onSeparator(':');\n scanNext(); // consume colon\n if (!parseValue()) {\n handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n }\n else {\n handleError(5 /* ColonExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n return true;\n }\n function parseObject() {\n onObjectBegin();\n scanNext(); // consume open brace\n var needsComma = false;\n while (_scanner.getToken() !== 2 /* CloseBraceToken */ && _scanner.getToken() !== 17 /* EOF */) {\n if (_scanner.getToken() === 5 /* CommaToken */) {\n if (!needsComma) {\n handleError(4 /* ValueExpected */, [], []);\n }\n onSeparator(',');\n scanNext(); // consume comma\n if (_scanner.getToken() === 2 /* CloseBraceToken */ && allowTrailingComma) {\n break;\n }\n }\n else if (needsComma) {\n handleError(6 /* CommaExpected */, [], []);\n }\n if (!parseProperty()) {\n handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n }\n needsComma = true;\n }\n onObjectEnd();\n if (_scanner.getToken() !== 2 /* CloseBraceToken */) {\n handleError(7 /* CloseBraceExpected */, [2 /* CloseBraceToken */], []);\n }\n else {\n scanNext(); // consume close brace\n }\n return true;\n }\n function parseArray() {\n onArrayBegin();\n scanNext(); // consume open bracket\n var needsComma = false;\n while (_scanner.getToken() !== 4 /* CloseBracketToken */ && _scanner.getToken() !== 17 /* EOF */) {\n if (_scanner.getToken() === 5 /* CommaToken */) {\n if (!needsComma) {\n handleError(4 /* ValueExpected */, [], []);\n }\n onSeparator(',');\n scanNext(); // consume comma\n if (_scanner.getToken() === 4 /* CloseBracketToken */ && allowTrailingComma) {\n break;\n }\n }\n else if (needsComma) {\n handleError(6 /* CommaExpected */, [], []);\n }\n if (!parseValue()) {\n handleError(4 /* ValueExpected */, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]);\n }\n needsComma = true;\n }\n onArrayEnd();\n if (_scanner.getToken() !== 4 /* CloseBracketToken */) {\n handleError(8 /* CloseBracketExpected */, [4 /* CloseBracketToken */], []);\n }\n else {\n scanNext(); // consume close bracket\n }\n return true;\n }\n function parseValue() {\n switch (_scanner.getToken()) {\n case 3 /* OpenBracketToken */:\n return parseArray();\n case 1 /* OpenBraceToken */:\n return parseObject();\n case 10 /* StringLiteral */:\n return parseString(true);\n default:\n return parseLiteral();\n }\n }\n scanNext();\n if (_scanner.getToken() === 17 /* EOF */) {\n if (options.allowEmptyContent) {\n return true;\n }\n handleError(4 /* ValueExpected */, [], []);\n return false;\n }\n if (!parseValue()) {\n handleError(4 /* ValueExpected */, [], []);\n return false;\n }\n if (_scanner.getToken() !== 17 /* EOF */) {\n handleError(9 /* EndOfFileExpected */, [], []);\n }\n return true;\n }", "title": "" }, { "docid": "e4012c69f32a4431f712d4ad19584862", "score": "0.4822824", "text": "function Parser() {\n this._types = {};\n}", "title": "" }, { "docid": "f52a209d19b6c439b32a7f7886713282", "score": "0.48213112", "text": "function astTraverse(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var pre = options.pre;\n var post = options.post;\n var skipProperty = options.skipProperty;\n\n function visit(node, parent, prop, idx) {\n if (!node || typeof node.type !== 'string') {\n return;\n }\n\n var res = undefined;\n if (pre) {\n res = pre(node, parent, prop, idx);\n }\n\n if (res !== false) {\n\n // A node can be replaced during traversal, so we have to\n // recalculate it from the parent, to avoid traversing \"dead\" nodes.\n if (parent && parent[prop]) {\n if (!isNaN(idx)) {\n node = parent[prop][idx];\n } else {\n node = parent[prop];\n }\n }\n\n for (var _prop in node) {\n if (node.hasOwnProperty(_prop)) {\n if (skipProperty ? skipProperty(_prop, node) : _prop[0] === '$') {\n continue;\n }\n\n var child = node[_prop];\n\n // Collection node.\n //\n // NOTE: a node (or several nodes) can be removed or inserted\n // during traversal.\n //\n // Current traversing index is stored on top of the\n // `NodePath.traversingIndexStack`. The stack is used to support\n // recursive nature of the traversal.\n //\n // In this case `NodePath.traversingIndex` (which we use here) is\n // updated in the NodePath remove/insert methods.\n //\n if (Array.isArray(child)) {\n var index = 0;\n NodePath.traversingIndexStack.push(index);\n while (index < child.length) {\n visit(child[index], node, _prop, index);\n index = NodePath.updateTraversingIndex(+1);\n }\n NodePath.traversingIndexStack.pop();\n }\n\n // Simple node.\n else {\n visit(child, node, _prop);\n }\n }\n }\n }\n\n if (post) {\n post(node, parent, prop, idx);\n }\n }\n\n visit(root, null);\n}", "title": "" }, { "docid": "7ae1b6951a4e157c1754c7092e97799f", "score": "0.48203638", "text": "function visit(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n updateEachKey(type.getTypeMap(), function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map. Because\n // we're using updateEachKey, the result of visit(namedType) may\n // cause the type to be removed or replaced.\n return visit(namedType);\n }\n });\n return type;\n }\n if (type instanceof graphql_1.GraphQLObjectType) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n var newObject = callMethod('visitObject', type);\n if (newObject) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (type instanceof graphql_1.GraphQLInterfaceType) {\n var newInterface = callMethod('visitInterface', type);\n if (newInterface) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (type instanceof graphql_1.GraphQLInputObjectType) {\n var newInputObject_1 = callMethod('visitInputObject', type);\n if (newInputObject_1) {\n updateEachKey(newInputObject_1.getFields(), function (field) {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n return callMethod('visitInputFieldDefinition', field, {\n objectType: newInputObject_1,\n });\n });\n }\n return newInputObject_1;\n }\n if (type instanceof graphql_1.GraphQLScalarType) {\n return callMethod('visitScalar', type);\n }\n if (type instanceof graphql_1.GraphQLUnionType) {\n return callMethod('visitUnion', type);\n }\n if (type instanceof graphql_1.GraphQLEnumType) {\n var newEnum_1 = callMethod('visitEnum', type);\n if (newEnum_1) {\n updateEachKey(newEnum_1.getValues(), function (value) {\n return callMethod('visitEnumValue', value, {\n enumType: newEnum_1,\n });\n });\n }\n return newEnum_1;\n }\n throw new Error(\"Unexpected schema type: \" + type);\n }", "title": "" }, { "docid": "7ae1b6951a4e157c1754c7092e97799f", "score": "0.48203638", "text": "function visit(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n updateEachKey(type.getTypeMap(), function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map. Because\n // we're using updateEachKey, the result of visit(namedType) may\n // cause the type to be removed or replaced.\n return visit(namedType);\n }\n });\n return type;\n }\n if (type instanceof graphql_1.GraphQLObjectType) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n var newObject = callMethod('visitObject', type);\n if (newObject) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (type instanceof graphql_1.GraphQLInterfaceType) {\n var newInterface = callMethod('visitInterface', type);\n if (newInterface) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (type instanceof graphql_1.GraphQLInputObjectType) {\n var newInputObject_1 = callMethod('visitInputObject', type);\n if (newInputObject_1) {\n updateEachKey(newInputObject_1.getFields(), function (field) {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n return callMethod('visitInputFieldDefinition', field, {\n objectType: newInputObject_1,\n });\n });\n }\n return newInputObject_1;\n }\n if (type instanceof graphql_1.GraphQLScalarType) {\n return callMethod('visitScalar', type);\n }\n if (type instanceof graphql_1.GraphQLUnionType) {\n return callMethod('visitUnion', type);\n }\n if (type instanceof graphql_1.GraphQLEnumType) {\n var newEnum_1 = callMethod('visitEnum', type);\n if (newEnum_1) {\n updateEachKey(newEnum_1.getValues(), function (value) {\n return callMethod('visitEnumValue', value, {\n enumType: newEnum_1,\n });\n });\n }\n return newEnum_1;\n }\n throw new Error(\"Unexpected schema type: \" + type);\n }", "title": "" }, { "docid": "7ae1b6951a4e157c1754c7092e97799f", "score": "0.48203638", "text": "function visit(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n updateEachKey(type.getTypeMap(), function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map. Because\n // we're using updateEachKey, the result of visit(namedType) may\n // cause the type to be removed or replaced.\n return visit(namedType);\n }\n });\n return type;\n }\n if (type instanceof graphql_1.GraphQLObjectType) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n var newObject = callMethod('visitObject', type);\n if (newObject) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (type instanceof graphql_1.GraphQLInterfaceType) {\n var newInterface = callMethod('visitInterface', type);\n if (newInterface) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (type instanceof graphql_1.GraphQLInputObjectType) {\n var newInputObject_1 = callMethod('visitInputObject', type);\n if (newInputObject_1) {\n updateEachKey(newInputObject_1.getFields(), function (field) {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n return callMethod('visitInputFieldDefinition', field, {\n objectType: newInputObject_1,\n });\n });\n }\n return newInputObject_1;\n }\n if (type instanceof graphql_1.GraphQLScalarType) {\n return callMethod('visitScalar', type);\n }\n if (type instanceof graphql_1.GraphQLUnionType) {\n return callMethod('visitUnion', type);\n }\n if (type instanceof graphql_1.GraphQLEnumType) {\n var newEnum_1 = callMethod('visitEnum', type);\n if (newEnum_1) {\n updateEachKey(newEnum_1.getValues(), function (value) {\n return callMethod('visitEnumValue', value, {\n enumType: newEnum_1,\n });\n });\n }\n return newEnum_1;\n }\n throw new Error(\"Unexpected schema type: \" + type);\n }", "title": "" }, { "docid": "37489f288d69e9cf1c2a0c51e79fd9f9", "score": "0.48175606", "text": "function processTree(ast) {\r\n var returnValue;\r\n if (ast.type == 'literal') {\r\n returnValue = isNaN(ast.value) ? ast.value : Number(ast.value);\r\n } else if (ast.type == 'identifier') {\r\n returnValue = 'var('+ast.name+')';\r\n } else {\r\n var args = ast.args? ast.args.expression: ast.expression? [ast.expression]: [ast.left, ast.right];\r\n args = args.map(function(arg){ return processTree(arg)});\r\n if (ast.type == 'function') {\r\n returnValue = ast.name.name + '(' + args.join(',') + ')' ;\r\n \r\n } else {\r\n //recursive call\r\n returnValue = '(' + (ast.format == 'binary'? transformBinaryOperation(ast.operation, args): global.sqlToJsOps[ast.operator] +' '+ args[0]) + ')';\r\n }\r\n }\r\n return returnValue;\r\n}", "title": "" }, { "docid": "ae48deabee148241083440d2ba8462a6", "score": "0.4816094", "text": "visitTypeParameter(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "d7ca020f7e60c3f6ba39ab0de50fe41d", "score": "0.48014975", "text": "function visit(object, f) {\n var key, child;\n\n if (f.call(null, object) === false) {\n return;\n }\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n visit(child, f);\n }\n }\n }\n }", "title": "" }, { "docid": "dbc4f1718fac8504708535b88f340771", "score": "0.47985125", "text": "function CalculatorVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "ceeaa929932bb40624cd2b26dde129a4", "score": "0.47866043", "text": "function LemonParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "a36b2c53cb099e7ab1c86ecc16867fd8", "score": "0.4781506", "text": "function CqlParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "713c122e8abf5d98153d9c37f05922e5", "score": "0.47665936", "text": "function visit (node, tag, callback) {\n if (node.tag === tag) {\n callback(node)\n }\n\n if (node.children) {\n return node.children.map((child) => visit(child, tag, callback))\n }\n}", "title": "" }, { "docid": "f15935714daf2320e68666f39e53a850", "score": "0.47636735", "text": "function parseTree() {\n\t\twhile ((currTok = tokens.next()) && !tokens.eof()) {\n\t\t\t//currTok = tokens[i];\n\t\t\tif (currTok.type == \"tag\") {\n\t\t\t\tif (currTok.tag.match(/^\\/[a-z]+/i) != null) {\n\t\t\t\t\t// TODO: check if tag is closeable and close it only if getting the responding tag\n\t\t\t\t\t// get to the last element\n\t\t\t\t\tcurr = stack.pop();\n\t\t\t\t} else {\n\t\t\t\t\tcurr.push({\n\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\ttag: currTok.tag,\n\t\t\t\t\t\tid: currTok.id || \"\",\n\t\t\t\t\t\tclass: currTok.class || \"\",\n\t\t\t\t\t\tdom: new Proxy([], {\n\t\t\t\t\t\t\tget: function(target, name) {\n\t\t\t\t\t\t\t\treturn name === \".\" ? target : name === \"..\" ? curr : target[name];\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\tstack.push(curr);\n\t\t\t\t\tcurr = curr[curr.length-1].dom;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurr.push({\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: currTok.text\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn dom;\n\t}", "title": "" }, { "docid": "ca4ffa7acef06442227a0b3420c986ce", "score": "0.47611013", "text": "visitObjectLiteralExpression(ctx) {\n console.log(\"visitObjectLiteralExpression\");\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "fbf311bc6be0093c2b877a2708ed423a", "score": "0.475503", "text": "function makeParser(v) {\n if (v instanceof Parser) return v;\n if (typeof v == 'string') return new parseText(v);\n if (v instanceof RegExp) return new parseRegex(v);\n if (v instanceof Array) return parseSeq(v);\n debugger;\n throw new Error(\"Unrecognized value type for makeParser\");\n}", "title": "" }, { "docid": "cc14a77bce7ad59e545a7dab0f2f816f", "score": "0.47549263", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = (0, _visitor.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if ((0, _ast.isNode)(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = (0, _visitor.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "cc14a77bce7ad59e545a7dab0f2f816f", "score": "0.47549263", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = (0, _visitor.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if ((0, _ast.isNode)(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = (0, _visitor.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "cc14a77bce7ad59e545a7dab0f2f816f", "score": "0.47549263", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = (0, _visitor.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if ((0, _ast.isNode)(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = (0, _visitor.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "title": "" }, { "docid": "463630a4468926ef49bcbf5ed2e86466", "score": "0.47470656", "text": "function Parser() {\n\tthis.generateParseTree = function (tokenArray) {\n\t\tvar parseTree = [],\n\t\t\tcontent = {},\n\t\t\ti = 0,\n\t\t\t// Symbol table is a dataStructure which contains the binding powers\n\t\t\t// it has left denoting function--> evaluating token on its left,\n\t\t\t// null denotive function-->specially for identifiers and functions \n\t\t\tsymbolTable = function (id, nud, lbp, led) {\n\t\t\t var sym = content[id] || {};\n\t\t\t content[id] = {\n\t\t\t lbp: sym.lbp || lbp,\n\t\t\t nud: sym.nud || nud,\n\t\t\t led: sym.led || led\n\t\t\t };\n\t\t\t},\n\t\t\t//This function sets the type and value of a token as a symbol\n\t\t\t// which exists in the symbol table\n\t\t\tanalyzeToken = function (token) {\n\t\t\t var sym = Object.create(content[token.type]);\n\t\t\t sym.type = token.type;\n\t\t\t sym.value = token.value;\n\t\t\t return sym;\n\t\t\t},\n\t\t\t// The token function creates symbols from the tokenArray\n\t\t\ttoken = function () {\n\t\t\t\treturn analyzeToken(tokenArray[i]); \n\t\t\t},\n\t\t\t//This func gives the next symbol from token\n\t\t\tmoveForward = function () { \n\t\t\t\ti++; \n\t\t\t\treturn token(); \n\t\t\t},\n\t\t\t// Helps to generate the parse tree of an expression\n\t\t\texp = function (rbp) {\n\t\t\t\tvar left, t = token();\n\t\t\t\t moveForward();\n\t\t\t\t if (!t.nud) document.getElementById('displayBar').innerHTML+=\"Error: Token '\"+t.type+\"' is not recognized.\"+\"\\n\";\n\t\t\t\t left = t.nud(t);\n\t\t\t\t while (rbp < token().lbp) {\n\t\t\t\t t = token();\n\t\t\t\t moveForward();\n\t\t\t\t if (!t.led) document.getElementById('displayBar').innerHTML+= \"Error: Token '\"+t.type+\"' is not recognized.\"+\"\\n\";\n\t\t\t\t \tleft = t.led(left);\n\t\t\t\t}\n\t\t\t\treturn left;\n\t\t\t},\n\t\t\texp_infix = function (id, lbp, rbp, led) {\n\t\t \t\trbp = rbp || lbp;\n\t\t\t\t symbolTable(id, null, lbp, led || function (left) {\n\t\t\t\t return {\n\t\t\t\t type: id,\n\t\t\t\t left: left,\n\t\t\t\t right: exp(rbp)\n\t\t\t\t };\n\t\t\t\t});\n\t\t\t},\n\t\t\texp_prefix = function (id, rbp) {\n\t\t \t\tsymbolTable(id, function () {\n\t\t \t\treturn {\n\t\t\t \t\ttype: id,\n\t\t\t \t\tright: exp(rbp)\n\t\t \t\t};\n\t\t \t\t});\n\t\t\t};\n\t\t//Predefining the priority of operators\n\t\texp_prefix(\"-\", 7);\n\t\texp_infix(\"^\", 6, 5);\n\t\texp_infix(\"*\", 4);\n\t\texp_infix(\"/\", 4);\n\t\texp_infix(\"%\", 4);\n\t\texp_infix(\"+\", 3);\n\t\texp_infix(\"-\", 3);\n\t\t// ',' , ')','end' are mainly used for demarcation of the expresson\n\t\tsymbolTable(\",\");\n\t\tsymbolTable(\")\");\n\t\tsymbolTable(\"(end)\");\n\t\t//From here we start creating the symbol table\n\t\tsymbolTable(\"(\", function () {\n\t\t \tvalue = exp(2);\n\t\t \tif (token().type !== \")\") \n\t\t \t\tdocument.getElementById('displayBar').innerHTML+=\"Error: Closed parenthesis expected ')'.\";\n\t\t \tmoveForward();\n\t\t \treturn value;\n\t\t});\n\t\tsymbolTable(\"number\", function (number) {\n\t\t return number;\n\t\t});\n\t\tsymbolTable(\"identifier\", function (name) {\n\t \t\tif (token().type === \"(\") {\n\t\t \tvar args = [];\n\t\t \tif (tokenArray[i + 1].type === \")\") moveForward();\n\t\t \telse {\n\t\t \t\tdo {\n\t\t \t\tmoveForward();\n\t\t \t\targs.push(exp(2));\n\t\t \t\t} while (token().type === \",\");\n\t\t \t\tif (token().type !== \")\") document.getElementById('displayBar').innerHTML+=\"Error: Closed parenthesis expected ')'.\";\n\t\t \t}\n\t\t \tmoveForward();\n\t\t \treturn {\n\t\t \t\ttype: \"call\",\n\t\t \t\targs: args,\n\t\t \t\tname: name.value\n\t\t \t};\n\t \t\t}\n\t \t\treturn name;\n\t\t});\n\t\texp_infix(\"=\", 1, 2, function (left) {\n\t\t if (left.type === \"call\") {\n\t\t for (var i = 0; i < left.args.length; i++) {\n\t\t if (left.args[i].type !== \"identifier\") document.getElementById('displayBar').innerHTML=\"Error: Invalid argument name.\";\n\t\t }\n\t\t return {\n\t\t type: \"function\",\n\t\t name: left.name,\n\t\t args: left.args,\n\t\t value: exp(2)\n\t\t };\n\t\t } else if (left.type === \"identifier\") {\n\t\t return {\n\t\t type: \"assign\",\n\t\t name: left.value,\n\t\t value: exp(2)\n\t\t };\n\t\t }\n\t\t else document.getElementById('displayBar').innerHTML+=\"Error: Invalid lvalue.\";\n\t });\n\t\twhile (token().type !== \"(end)\") {\n\t\t parseTree.push(exp(0));\n\t\t}\n\n\t\treturn parseTree;\n\t};\n}", "title": "" }, { "docid": "06132a3d3a0407d28d63c3a87a630112", "score": "0.47424316", "text": "function traverse(object, visitor) \r\n{\r\n var key, child;\r\n\r\n visitor.call(null, object);\r\n\r\n for (key in object) {\r\n if (object.hasOwnProperty(key)) {\r\n child = object[key];\r\n if (typeof child === 'object' && child !== null) {\r\n traverse(child, visitor);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "4f6c7c6b2d1e4ad78bf894a267557396", "score": "0.47385496", "text": "function visit(object, f) {\n var key, child;\n\n if (f.call(null, object) === false) {\n return;\n }\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n visit(child, f);\n }\n }\n }\n }", "title": "" }, { "docid": "b9309ba4e9c425eebe4054e126e786fc", "score": "0.47254387", "text": "function Parser (lexer) {\n this.lexer = lexer;\n this.ast = new AST(this.lexer);\n this.astCompiler = new ASTCompiler(this.ast);\n}", "title": "" }, { "docid": "5de1f63ecbdc181bcf08fc4f7067eb8e", "score": "0.47202292", "text": "walkAst(ast, cb) {\n function walk(ast, _field) {\n const topField = ast.field || _field;\n const node = cb(ast, topField);\n if (node.right) {\n node.right = walk(node.right, topField);\n }\n if (node.left) {\n node.left = walk(node.left, topField);\n }\n return node;\n }\n return walk(ast);\n }", "title": "" }, { "docid": "564f3cec4088dc2a2a2aec25c53e609b", "score": "0.4718876", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n visitFn(parent);\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "1dbfedf500362b9d32ae61e6021c2f12", "score": "0.47171265", "text": "function updateVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "1186e5eb0bee785d13115bd766dd1430", "score": "0.4710868", "text": "function traverse(object, visitor) {\r\n var key, child;\r\n\r\n visitor.call(null, object);\r\n for (key in object) {\r\n if (object.hasOwnProperty(key)) {\r\n child = object[key];\r\n if (typeof child === 'object' && child !== null) {\r\n traverse(child, visitor);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "b2f1d64200b9c9e3a29e8913d44a791f", "score": "0.47058606", "text": "function traverse(object, visitor) {\n var key\n , child\n ;\n\n visitor.call(null, object);\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n traverse(child, visitor);\n }\n }\n }\n }", "title": "" }, { "docid": "3a32805a82a45cdbe3a555c0bbb1fb54", "score": "0.47011173", "text": "function visit(type) {\n if (graphql.isSchema(type)) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n const typeMap = type.getTypeMap();\n Object.entries(typeMap).forEach(([typeName, namedType]) => {\n if (!typeName.startsWith('__') && namedType != null) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map.\n // We do not use updateEachKey because we want to preserve\n // deleted types in the typeMap so that other types that reference\n // the deleted types can be healed.\n typeMap[typeName] = visit(namedType);\n }\n });\n return type;\n }\n if (graphql.isObjectType(type)) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n const newObject = callMethod('visitObject', type);\n if (newObject != null) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (graphql.isInterfaceType(type)) {\n const newInterface = callMethod('visitInterface', type);\n if (newInterface != null) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (graphql.isInputObjectType(type)) {\n const newInputObject = callMethod('visitInputObject', type);\n if (newInputObject != null) {\n const fieldMap = newInputObject.getFields();\n for (const key of Object.keys(fieldMap)) {\n fieldMap[key] = callMethod('visitInputFieldDefinition', fieldMap[key], {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n objectType: newInputObject,\n });\n if (!fieldMap[key]) {\n delete fieldMap[key];\n }\n }\n }\n return newInputObject;\n }\n if (graphql.isScalarType(type)) {\n return callMethod('visitScalar', type);\n }\n if (graphql.isUnionType(type)) {\n return callMethod('visitUnion', type);\n }\n if (graphql.isEnumType(type)) {\n let newEnum = callMethod('visitEnum', type);\n if (newEnum != null) {\n const newValues = newEnum\n .getValues()\n .map(value => callMethod('visitEnumValue', value, {\n enumType: newEnum,\n }))\n .filter(Boolean);\n // Recreate the enum type if any of the values changed\n const valuesUpdated = newValues.some((value, index) => value !== newEnum.getValues()[index]);\n if (valuesUpdated) {\n newEnum = new graphql.GraphQLEnumType({\n ...newEnum.toConfig(),\n values: newValues.reduce((prev, value) => ({\n ...prev,\n [value.name]: {\n value: value.value,\n deprecationReason: value.deprecationReason,\n description: value.description,\n astNode: value.astNode,\n },\n }), {}),\n });\n }\n }\n return newEnum;\n }\n throw new Error(`Unexpected schema type: ${type}`);\n }", "title": "" }, { "docid": "2ee12a20d3340ca917780d6bd28fd294", "score": "0.46993363", "text": "function visit(statement, index, program) {\n switch (statement.type) {\n case 'VariableDeclaration':\n statement.declarations.forEach(function (declaration, idx) {\n visit(declaration.init, idx, program);\n });\n break;\n case 'BinaryExpression':\n case 'LogicalExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.type = 'CallExpression';\n statement.callee = {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.right,\n 'property': {\n 'type': 'Identifier',\n 'name': funcNames[statement.operator]\n }\n };\n visit(statement.left, index, program);\n visit(statement.right, index, program);\n statement['arguments'] = [statement.left];\n } else {\n visit(statement.left, index, program);\n visit(statement.right, index, program);\n }\n break;\n case 'ExpressionStatement':\n visit(statement.expression, index, program);\n break;\n case 'CallExpression':\n statement['arguments'].forEach(function (argument, idx) {\n visit(argument, idx, program);\n });\n visit(statement.callee, index, program);\n break;\n case 'AssignmentExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.right = {\n type: 'CallExpression',\n callee: {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.left,\n 'property': {\n 'type': 'Identifier',\n 'name': funcNames[statement.operator]\n }\n },\n arguments: [statement.right]\n };\n statement.operator = '=';\n\n visit(statement.left, index, program);\n visit(statement.right.arguments[0], index, program);\n } else {\n visit(statement.right, index, program);\n }\n break;\n case 'UnaryExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.type = 'CallExpression';\n statement.callee = {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.argument,\n 'property': {\n 'type': 'Identifier',\n 'name': (statement.operator === '+' || statement.operator === '-') ? funcNames['u' + statement.operator] : funcNames[statement.operator]\n }\n };\n visit(statement.argument, index, program);\n statement['arguments'] = [];\n } else {\n visit(statement.argument, index, program);\n }\n break;\n case 'UpdateExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.type = 'CallExpression';\n statement.callee = {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.argument,\n 'property': {\n 'type': 'Identifier',\n 'name': funcNames[statement.operator]\n }\n };\n visit(statement.argument, index, program);\n statement['arguments'] = [];\n }\n break;\n case 'FunctionDeclaration':\n case 'FunctionExpression':\n visit(statement.body, index, program);\n break;\n case 'BlockStatement':\n statement.body.forEach(function (statement) {\n visit(statement, index, program);\n });\n break;\n case 'ReturnStatement':\n visit(statement.argument, index, program);\n break;\n case 'MemberExpression':\n visit(statement.object, index, program);\n break;\n case 'SwitchStatement':\n statement.cases.forEach(function(_case, idx){\n visit(_case, idx, program);\n });\n break;\n case 'SwitchCase':\n statement.consequent.forEach(function(con, idx){\n visit(con, idx, program);\n });\n break;\n //We don't ned to transform following nodes! Phew!\n case 'Literal':\n case 'Identifier':\n break;\n }\n}", "title": "" }, { "docid": "15a7d3a4a1237043a4021b54191ce94b", "score": "0.4694336", "text": "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "title": "" }, { "docid": "d4ec399fe4adc16581349437370e3197", "score": "0.4691161", "text": "function ASTWalker(unit){\n this._unit = unit;\n}", "title": "" }, { "docid": "df945bf4d15752c9bb059450012e8653", "score": "0.46892312", "text": "function visit( parent, visitFn, childrenFn ) {\n if ( !parent ) {\n return;\n }\n\n visitFn( parent );\n\n var children = childrenFn( parent );\n if ( children ) {\n var count = children.length;\n for ( var i = 0; i < count; i++ ) {\n visit( children[i], visitFn, childrenFn );\n }\n }\n }", "title": "" }, { "docid": "8d4b5e9b45b37b9813a1e1c571e00cf6", "score": "0.46883816", "text": "function visit(obj, name, data) {\n if (!obj) {\n return;\n };\n\n var i;\n var type = getObjectType(obj);\n\n // We want non-primitives objects (primitive === object w/o properties).\n if (type === 'object' && obj.properties) {\n data[name] = data[name] || { };\n\n // Visit each property.\n for (var property in obj.properties) {\n if (obj.properties.hasOwnProperty(property)) {\n if (shouldVisit(property, obj, options)) {\n visit(obj.properties[property], property, data[name]);\n };\n };\n };\n } else if (obj.allOf) {\n for (i = 0; i < obj.allOf.length; i++) {\n visit(obj.allOf[i], name, data);\n };\n } else if (type === 'array') {\n data[name] = [];\n var len = 0;\n if (obj.minItems || obj.minItems > 0) {\n len = obj.minItems;\n };\n\n // Instantiate 'len' items.\n for (i = 0; i < len; i++) {\n visit(obj.items, i, data[name]);\n };\n } else if (isEnum(obj)) {\n data[name] = instantiateEnum(obj);\n } else if (isPrimitive(obj)) {\n data[name] = instantiatePrimitive(obj);\n };\n }", "title": "" }, { "docid": "f1919c9fbf325a9f7f20395742c1e41d", "score": "0.46862975", "text": "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = (0, _visitor$4.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if ((0, _ast.isNode)(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = (0, _visitor$4.getVisitFn)(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n }", "title": "" }, { "docid": "057d00385e51b454ce72b1115d818d62", "score": "0.4679729", "text": "function postTraverse(node, visitor) {\n\tif (!visitor(node)) {\n\t\treturn;\n\t}\n\t\n\tfor (var key in node) {\n\t\tif (key === 'parent') {\n\t\t\tcontinue;\n\t\t}\n\t\tvar child = node[key];\n\n\t\tif (!child) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tif (_.isArray(child)) {\n\t\t\tfor (var i = 0; i < child.length; ++i) {\n\t\t\t\tif (typeof child[i].type !== 'string') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tpostTraverse(child[i], visitor);\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\telse if (typeof child.type === 'string') {\n\t\t\tpostTraverse(child, visitor);\n\t\t}\t\t\n\t}\n}", "title": "" }, { "docid": "4c5148b39351c879ba8bdda00792fbd7", "score": "0.46623635", "text": "function SHRDataElementParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" } ]
1958375fa83f15ec8ab4517fbdd0bcab
for picking random properties in an object
[ { "docid": "18cc32819272dff55a3e4b2027590f42", "score": "0.8232631", "text": "function pickRandomProperty(obj) {\n\tvar result;\n\tvar count = 0;\n\tfor (var prop in obj)\n\t\tif (Math.random() < 1/++count)\n\t\t result = prop;\n\treturn result;\n}", "title": "" } ]
[ { "docid": "7e586057748cccb1163016894ac257c9", "score": "0.8237616", "text": "function pickRandomProperty(obj) {\r\n var result;\r\n var count = 0;\r\n for (var prop in obj)\r\n if (Math.random() < 1/++count)\r\n result = prop;\r\n return result;\r\n}", "title": "" }, { "docid": "86b7475ad0b390c64b5f73f5a04333a6", "score": "0.8167011", "text": "function pickRandomProperty(obj) {\n var result;\n var count = 0;\n for (var prop in obj)\n if (Math.random() < 1/++count)\n result = prop;\n return result;\n}", "title": "" }, { "docid": "f1d28e81be8c6f9bd2b51dea7666e7f4", "score": "0.8127396", "text": "function pickRandomObjectProperty(obj){\n var result;\n var count = 0;\n for (var i in obj){\n if (Math.random() < 1/++count){\n result = i;\n }\n }\n return obj[result];\n }", "title": "" }, { "docid": "583c7fc21cd611375b91487ee4ff74e4", "score": "0.79670346", "text": "function randomProperty(obj) {\n var keys = Object.keys(obj)\n return obj[keys[Math.floor(Math.random() * keys.length)]];\n }", "title": "" }, { "docid": "27a10d300313f793960ca3c1953e123b", "score": "0.79426455", "text": "function randomProperty(obj) {\n var keys = Object.keys(obj)\n return obj[keys[Math.floor(Math.random() * keys.length)]];\n }", "title": "" }, { "docid": "8e4c88d5e2dd208f78672db9d272c876", "score": "0.76753813", "text": "function randomObjProperty(obj) {\n\t\tvar keys = Object.keys(obj);\n\t\treturn obj[keys[keys.length * Math.random() << 0]];\n\t}", "title": "" }, { "docid": "342106606c44808346e125d9f39e40b5", "score": "0.74579793", "text": "function getRandomProperty(v, rand) {\n var properties = Object.getOwnPropertyNames(v);\n if (\"constructor\" && v.constructor.hasOwnProperty()) {; }\n if (properties.length == 0) { return \"0\"; }\n return properties[rand % properties.length];\n}", "title": "" }, { "docid": "75454433fa5826fcb367b100bf699a73", "score": "0.7237119", "text": "function randomProperty(dict) {\n var keys = Object.keys(dict)\n var selection = dict[keys[ keys.length * Math.random() << 0]];\n return selection[selection.length * Math.random() << 0]\n}", "title": "" }, { "docid": "cc69b63dd1de50f1b6e04d62bd585818", "score": "0.71676993", "text": "function pickRandomWord(obj) {\n var result;\n var count = 0;\n for (var prop in obj)\n if (Math.random() < 1/++count)\n result = prop;\n return result;\n}", "title": "" }, { "docid": "6f4ea522f3b4072ea3d2716d3e981849", "score": "0.71438235", "text": "function getRandomProperty(v) {\n var properties = Object.getOwnPropertyNames(v);\n var proto = Object.v;\n if (proto) { properties = properties.Object.getOwnPropertyNames(); }\n if (properties.includes() && v.constructor.hasOwnProperty()) { properties = properties.Object.v.constructor.__proto__; }\n if (properties.length == 0) { return \"0\"; }\n return properties[rand % properties.length];\n}", "title": "" }, { "docid": "4a24f4e2192ea2ecfd7489fe9abec82f", "score": "0.6852253", "text": "function getRandom(obj) {\n var keys = Object.keys(obj);\n\n return obj[keys[keys.length * Math.random() << 0]];\n}", "title": "" }, { "docid": "a4d61e63a5bae6f9f7d4015fa52568a1", "score": "0.67554224", "text": "function generateRandomObj() {\n let obj = {\n attrs: []\n };\n \n for (let i = 0; i < 6; i++) {\n let attr = {};\n attr[getRandomFieldName()] = (i % 2 == 0) ? getString() : getRandomNum();\n obj.attrs.push(attr);\n }\n\n return obj;\n}", "title": "" }, { "docid": "ef0ff30573f4b9b9ee87e2810eb3a7e3", "score": "0.6577599", "text": "function randomKey(obj) {\r\n var ret;\r\n var c = 0;\r\n for (var key in obj)\r\n if (Math.random() < 1/++c)\r\n ret = key;\r\n return ret;\r\n}", "title": "" }, { "docid": "9d965e30978f053c238f29fc6b41b387", "score": "0.6391835", "text": "function rand_key(obj) {\n var keys = Object.keys(obj)\n return keys[ keys.length * Math.random() << 0];\n }", "title": "" }, { "docid": "166bdae28227c890e989a84c3812c644", "score": "0.63811785", "text": "function randomObjKey(obj) {\n\t\tvar keys = Object.keys(obj);\n\t\treturn keys[keys.length * Math.random() << 0];\n\t}", "title": "" }, { "docid": "3e3c16ab1f92b79fb5d25a156d4e9fb0", "score": "0.63186157", "text": "function createRandomObject() {\n var typeArray = ['Electonics', 'Book', 'Clothing', 'Food'];\n var price = (Math.random() * 500).toFixed(2);\n var type = typeArray[Math.floor(Math.random() * 4)];\n return { price: price, type: type };\n }", "title": "" }, { "docid": "4ce9026ee8cbd4146c9e32c9cd3bb6e5", "score": "0.62369025", "text": "function randomKey(obj) {\n var keys = Object.keys(obj);\n return keys[keys.length * Math.random() << 0];\n}", "title": "" }, { "docid": "03adc81d27320e3bb3508c4f09568465", "score": "0.6185217", "text": "function pickMystery() {\nreturn {\n suspect: selectRandom(suspectsArray),\n weapon: selectRandom(weaponsArray),\n room: selectRandom(roomsArray)\n}\n}", "title": "" }, { "docid": "8f997794b74bdea6a4c05d7159afea1f", "score": "0.6181117", "text": "get Random() {}", "title": "" }, { "docid": "7749cc0c32caba6cebc27ac9cffe43e3", "score": "0.6176859", "text": "function fetchRandomCharacter(obj) {\n var keys = [];\n for (key in obj) {\n keys.push(key);\n }\n return keys[Math.floor(Math.random() * keys.length)];\n} // end of fetchRandomCharacter()", "title": "" }, { "docid": "29485024f900152b8df993e169da09bf", "score": "0.5988227", "text": "function getRandomItem() {\n\tvar objKeys = Object.keys(items);\n\tvar randKey = objKeys[Math.floor(Math.random() * objKeys.length)];\n\treturn items[randKey];\n}", "title": "" }, { "docid": "ab7ccd05aae65ce719fd9ac3bc08b2d0", "score": "0.5982295", "text": "function randomElement(obj) {\n var length = obj.length\n var randInt = Math.floor(Math.random() * length)\n console.log(randInt)\n return obj[randInt]\n}", "title": "" }, { "docid": "c571b19bab9ec10016e8977fe92a3b88", "score": "0.5919733", "text": "function createRandomObject() {\n let newObject = {\n name: getRandomString(),\n price: getRandomPrice(),\n currency: \"\",\n adress: \"\"\n }\n if (getRandomRangeInt(0,1))\n newObject.currency = \"€\"\n else\n newObject.currency = \"$\"\n return newObject\n}", "title": "" }, { "docid": "6d1bf2dd577c1aac1dab10ca2bfcc10f", "score": "0.59158", "text": "function getRandomQuote() {\n \n //variable to store random number based on the number of objects in the quote array\n const randomQuoteNumber = Math.floor( Math.random() * quotes.length);\n \n //return a random quotes Keys and Properties based on the previously generated number\n return quotes[randomQuoteNumber];\n}", "title": "" }, { "docid": "145a21f4c1bd69d932d1cbaa33779c3d", "score": "0.5905408", "text": "function get_property (level_map, level) {\n return random_choice(level_map[level]);\n}", "title": "" }, { "docid": "de19ddaab3810e3a7e6e625cfb101c19", "score": "0.58935624", "text": "function getRandomItem(obj) {\r\n if (Object.keys(obj).length === 0) {\r\n return null;\r\n }\r\n \r\n currentIndex = obj[Object.keys(obj)[Math.floor(Math.random() * Object.keys(obj).length)]];\r\n return currentIndex;\r\n}", "title": "" }, { "docid": "506c4e27eb08079c33b458b06f7099f7", "score": "0.5877997", "text": "function randPrompt() {\n\tuCount = property.length;\n\tuPrevPrev = uPrev; \n\tuPrev = uCur;\n\twhile (uCur == uPrev || uCur == uPrevPrev)\n\t\tuCur = Math.floor((Math.random() * uCount));\n}", "title": "" }, { "docid": "f9ecae2491f2021688e36041711e256a", "score": "0.58724266", "text": "function _pickBy(test, obj) {\n var copy = {};\n var prop;\n var props = keysIn(obj);\n var len = props.length;\n var idx = -1;\n while (++idx < len) {\n prop = props[idx];\n if (test(obj[prop], prop, obj)) {\n copy[prop] = obj[prop];\n }\n }\n return copy;\n }", "title": "" }, { "docid": "52ce907069f23c3179eb4fee37214619", "score": "0.5860837", "text": "function randomImg() {\n let random = Math.floor(Math.random() * (names.length - 0));\n return object[random].path;\n}", "title": "" }, { "docid": "de36bba6b2d2e04c774fbc503f886dd6", "score": "0.583298", "text": "function _randomize()\n{\n\tvar j=15;do{\n\t\tselected.pattern[j]=Math.round(Math.random());\n\t\tselected.velocity[j]=Math.floor(Math.random()*127);\n\t}while(j--);\n\tselected.obj.set.velocity(selected.velocity);\n\tselected.obj.set.pattern(selected.pattern);\n\trefresh_keys();\n}", "title": "" }, { "docid": "c242aff315efca2aad401fd982942f7c", "score": "0.5818626", "text": "function randomObjLayer() {\n objectLayer.weightedRandomize(0, 0, map.width, map.height, [\n { index: 30, weight: 10 },\n { index: 31, weight: 3 },\n { index: 32, weight: 2 },\n { index: 67, weight: 1 },\n { index: 70, weight: 1 },\n { index: 89, weight: 1 }\n ]);\n }", "title": "" }, { "docid": "78d4599ac2ceb9d290151cf400253791", "score": "0.57948446", "text": "function Person(data) {\n this.x = random(width);\n this.y = random(height);\n for (var prop in data) {\n if (data.hasOwnProperty(prop)) {\n this[prop] = data[prop];\n }\n }\n}", "title": "" }, { "docid": "a557cd32c63ac048c1dc4081089e6d12", "score": "0.57884175", "text": "set Random(value) {}", "title": "" }, { "docid": "efda6c1aa808c63925ede0705aa78c12", "score": "0.576603", "text": "function getRandomObject() {\n function myFunction() {\n return Math.floor(Math.random() * 24 + 1);\n }\n var me = myFunction();\n var myHouseObject = houseObjects[me];\n\n localStorage.setItem('homeaddress', myHouseObject.Adres);\n localStorage.setItem('uniqueid', myHouseObject.GroupByObjectType)\n\n _detailLink.classList.remove('inactive');\n\n Transparency.render(_home, myHouseObject, _directives);\n }", "title": "" }, { "docid": "cd677d5cb00263a8c52f2cf56fe76fbe", "score": "0.57633275", "text": "function randomObjectNumber() {\n return Math.floor(Math.random() * 10) + 1;\n }", "title": "" }, { "docid": "38db486d324614a645392b54a54f77bc", "score": "0.5757421", "text": "function generateRandomNumbers(){\r\n numberObj['num1'] = Math.floor(Math.random() * 20);\r\n numberObj['num2'] = Math.floor(Math.random() * 20);\r\n numberObj['num3'] = Math.floor(Math.random() * 20);\r\n numberObj['num4'] = Math.floor(Math.random() * 20);\r\n numberObj['num5'] = Math.floor(Math.random() * 20);\r\n }", "title": "" }, { "docid": "8595a0e71e0240100469a4bb993c8861", "score": "0.57520366", "text": "function RandomObject(color, type, x, y,objWidth,objHeight,appear)\r\n{\r\n //color of obstical\r\n this.color = color;\r\n // type of obstical such square or circle\r\n this.type = type;\r\n // set x randomly but at least 15px off the canvas edges\r\n this.x = x;\r\n // set y to start on the line where objects are spawned\r\n this.y = y;\r\n\t//width of object\r\n\tthis.widthCheck=objWidth;\r\n\t//height of object\r\n\tthis.height=objHeight;\r\n // random number on square or for point\r\n if(type==\"circle\")\r\n {\r\n this.num = Math.floor(Math.random() * 5) + 1;\r\n }\r\n else\r\n {\r\n this.num = Math.floor(Math.random() * 10) + 1;\r\n }\r\n // to appear make value=1(by default) or make=0 for disaprear\r\n this.appear = appear;\r\n}", "title": "" }, { "docid": "88f265d4c0128e7a8b6543cd22f203ae", "score": "0.5724367", "text": "function random_highlight(obj)\n{\n var style = STYLES[Math.floor(Math.random()*STYLES.length)];\n obj.css(style);\n}", "title": "" }, { "docid": "a05596cb025c82bfd2f0078b9910f4ef", "score": "0.5719566", "text": "function random(){\n return random.get();\n }", "title": "" }, { "docid": "1d2990e2edd3b7e56162701afc00e2b1", "score": "0.5711106", "text": "function random() {\n let randoms = [];\n let counter = 10;\n while (counter > 0) {\n randoms.push({\n name: () => faker.datatype.json().toString(),\n slug: () => faker.lorem.slug(),\n description: () => faker.lorem.paragraphs()\n });\n counter--;\n }\n data['random'] = randoms;\n}", "title": "" }, { "docid": "3b613f71c603d5ece00d2d093f08b547", "score": "0.5674751", "text": "function pickCard(cards) {\n //Index starts at zero, so \"51\" draws one of the 52 cards\n const random = Math.floor(Math.random() * 51); \n //The card picked will hold all the {cards.properties} unchanged\n let cardValue = cards[random].value;\n let cardSuit = cards[random].suit;\n let cardWeight = cards[random].weight; \n return [{cardValue, cardSuit, cardWeight}, cardValue + \" \" + cardSuit];\n}", "title": "" }, { "docid": "97fd7cfd0eb338cc5bb7a30cdc64b8ad", "score": "0.56367224", "text": "function setBoxRandomSize(obj) {\n var height = Math.floor((boxMaxHeight - boxMinHeight+1) * Math.random()) + boxMinHeight;\n\n var width = Math.floor((boxMaxWidth - boxMinWidth+1) * Math.random()) + boxMinWidth;\n\n obj.css({\"height\": height, \"width\": width});\n\n return {\"height\": height, \"width\": width};\n}", "title": "" }, { "docid": "348153ffc4a00cb2acd7cac02c04834f", "score": "0.5611765", "text": "function randomizedPoint(obj) {\n\tif (typeof(obj) === 'object')\n\t\t{\n let res; \n\t\tvar {min, max, type} = obj;\n\t\tif (min) {\n\t\t\tres = Math.random() * (max-min); \n\t\t\tres += min;\n\t\t\t}\n\t\telse {\n\t\t\tres = Math.random() * max;\n\t\t}\n\n switch (type) {\n case '%':\n res = res.toFixed(2) + type;\n break;\n\n case \"px\":\n res = Math.floor(res) + type;\n break;\n\n default:\n res = Math.floor(res);\n break;\n }\n\n\t\treturn res;\n }\n \n\n\n\treturn 'input is no object'; \n}", "title": "" }, { "docid": "88adf12f7a553f35e22dfd959f3b696b", "score": "0.5610545", "text": "type(i) { return faker.list.random('nprarticle', 'article')(i); }", "title": "" }, { "docid": "b1a5db9c00f4a559560763badaaa406f", "score": "0.5607538", "text": "function RandomPerson (dataObject) {\n //Generate everything and push them into a single array\n this.allInfo = [];\n this.allInfo.push (dataObject.generateNameType());\n this.allInfo.push (dataObject.generateFullName());\n this.allInfo.push (dataObject.generateAge());\n this.allInfo.push (dataObject.generateJobCat());\n this.allInfo.push (dataObject.generateJobTitle());\n\n //Extract final person values from array and clear the array\n this.sPrsType = this.allInfo[0];\n this.sPrsGender = this.allInfo[1][0];\n this.sPrsFirstName = this.allInfo[1][1];\n this.sPrsLastName = this.allInfo[1][2];\n this.sPrsFullName = (this.sPrsFirstName + \" \" + this.sPrsLastName);\n this.sPrsAgeBracket = this.allInfo[2][0];\n this.iPrsAge = this.allInfo[2][1];\n this.sPrsJobCat = this.allInfo[3];\n this.sPrsJobTitle = this.allInfo[4];\n this.allInfo = [];\n}", "title": "" }, { "docid": "202a73de1ed06f736cb16bc346f8a070", "score": "0.5607037", "text": "function shuffle(obj) {\n return sample(obj, Infinity);\n}", "title": "" }, { "docid": "9f890e9346fd0c511023b4c40fc3c3b5", "score": "0.5601923", "text": "function Random(){\n // this.name= 'im random'\n}", "title": "" }, { "docid": "9829bfc1e33444bce86743d199d46583", "score": "0.55794173", "text": "function generateObj() {\n return {\n color: 'Blue',\n name: 'Frank',\n country: 'PH',\n position: 'Software Engineer'\n }\n}", "title": "" }, { "docid": "aa321166acc64d3617acda48a02a139f", "score": "0.5574317", "text": "function birth( who ) {\n\t\t\twho.vx = Math.random() * settings.vx;\n\t\t\twho.vy = Math.random() * settings.vy;\n\t\t\twho.sizez = Math.random() * settings.sizez;\n\t\t\twho.alpha = Math.random() + settings.alpha;\n\t\t\twho.colorz = Math.random();\n\t\t}", "title": "" }, { "docid": "3565d98659f78d67d27ac60a10a1d4fc", "score": "0.5572156", "text": "function getRandomFieldName() {\n return fieldNameSet[Math.floor(Math.random() * fieldNameSet.length)];\n}", "title": "" }, { "docid": "1dbd86ab09025a25e9ebb04ae00a79ef", "score": "0.5552652", "text": "function pickRandomEmptySpot()\n \t{\t\n \t\tvar keyArray=Object.keys(empty);\n \t\tvar randomIndex=Math.floor((keyArray.length)*Math.random());\n \t\treturn keyArray[randomIndex];\n \t}", "title": "" }, { "docid": "17664539c5d822420a1be6a2aac918dc", "score": "0.55459404", "text": "function nextRandom(obj) {\n obj.seed = obj.seed.multiply(0x41C64E6D).add(0x00006073).and(0xFFFFFFFF);\n return obj.seed >>> 16;\n}", "title": "" }, { "docid": "253ee38535e202061a39c6be320c29ca", "score": "0.5535275", "text": "function newRandomFood() {\r\n return {\r\n x: randomInt(10, cnv.width - 10),\r\n y: randomInt(10, cnv.height - 10),\r\n r: randomInt(5, 35),\r\n color: randomRGB()\r\n }\r\n}", "title": "" }, { "docid": "bb14dfcbbb399b01280a8941c1bf4f56", "score": "0.5525601", "text": "function setBackgroundRandomColor(obj) {\n\t\t$(obj).css(\"background-color\", \"#\" + Math.floor(Math.random()*16777215).toString(16));\t\t\n\t}", "title": "" }, { "docid": "9927933895e167cea84855cc561f6efe", "score": "0.5517065", "text": "function pluck(list) {\n var totalLength = list.length;\n var r = Math.floor(Math.random()*totalLength);\n return list[r];\n}", "title": "" }, { "docid": "1707774992a54db523548dfa404137f7", "score": "0.5500605", "text": "function showRandomProducts() {\n var three = [];\n var obj ={};\n for(var k=0; k<3; k++){\n obj[past[k]]=true;\n } \n for(var i=0; i<past.length; i++){\n var random = Math.floor(Math.random()*allProducts.length);\n while (obj[random]){\n random = Math.floor(Math.random()*allProducts.length);\n }\n three.push(random);\n obj[random]=true; \n }\n productA.hidden = false;\n productA.src = allProducts[three[0]].filepath;\n productA.alt = allProducts[three[0]].name;\n productA.title = allProducts[three[0]].name;\n productB.src = allProducts[three[1]].filepath;\n productB.alt = allProducts[three[1]].name;\n productB.title = allProducts[three[1]].name;\n productC.src = allProducts[three[2]].filepath;\n productC.alt = allProducts[three[2]].name;\n productC.title = allProducts[three[2]].name;\n past = three;\n\n}", "title": "" }, { "docid": "222ace5fe7817655e57325cf305bd19b", "score": "0.5499556", "text": "function pseudoRandom() {\n let randoms = [];\n let counter = 10;\n while (counter > 0) {\n randoms.push({\n name: faker.datatype.json().toString(),\n slug: faker.lorem.slug(),\n description: faker.lorem.paragraphs()\n });\n console.log(randoms);\n counter--;\n }\n data['pseudo-random'] = randoms;\n}", "title": "" }, { "docid": "a7e5eb6f1fe0fe29a7d63c36811f3a18", "score": "0.54974216", "text": "function pick(obj,prop1,prop2) {\n if (!obj) {\n return null;\n }\n var result = {};\n for(var i=1;i<arguments.length;i++) {\n var pn = arguments[i];\n if (pn in obj) {\n result[pn] = obj[pn];\n }\n }\n return result;\n }", "title": "" }, { "docid": "927c4379816eda3a784ed6a212ccab44", "score": "0.5490016", "text": "function populateMarket(object){\n\tfor (var fruit in object) {\n\t\tobject[fruit] = randomFruit(object[fruit]);\n\t}\n\t\n\t//object.apple=randomFruit(object.apple);\n\t// console.log(\"populate market function object\", object);\n\n}", "title": "" }, { "docid": "71348078bbf2c3aa604cd4314955700e", "score": "0.54898924", "text": "function mapObjToArray(obj){\n let arr=[];\n let usedNumbers=[];\n\n Object.keys(obj).map((el)=>{\n \n let randomOrder=Math.floor(Math.random()*9)\n while (usedNumbers.indexOf(randomOrder)>-1){\n randomOrder=Math.floor(Math.random()*10)\n }\n usedNumbers.push(randomOrder)\n let element={}\n let elementValue={}\n elementValue[el]=obj[el]\n element[randomOrder]=elementValue\n arr.push(element)\n \n })\n return arr\n}", "title": "" }, { "docid": "685790ebe60a48dfa774a070b5abdf44", "score": "0.5489804", "text": "function pickRandomMonster() {\n var monsters = new Monsters();\n var names = monsters.getMonsterNames();\n var index = Math.ceil(Math.random() * 1000);\n\n return monsters.getMonsterByName(names[index % names.length]);\n}", "title": "" }, { "docid": "c690192dfd761c83980135bcdded2ee3", "score": "0.54874885", "text": "function autoPick() {\n mementoGroup.forEach( memento => {\n randIndex = Math.floor(Math.random() * 3); //pick a random index between (0-2)\n memento.chosenOption = memento.options[randIndex]; //use random index to choose an option\n //DEBUGGING\n //console.log(memento.texture.key + ' - ' + memento.chosenOption); //print what option each memento was assigned\n });\n}", "title": "" }, { "docid": "03a1ddea65ff865325e49553e2f8b65e", "score": "0.5481738", "text": "function setBoxRandomBackground(obj) {\n var background = Math.floor(Math.random() * boxBackground.length);\n\n obj.css(\"background-color\", boxBackground[background]);\n}", "title": "" }, { "docid": "51de888ea28ec48c6a6cfe43d0111109", "score": "0.54685044", "text": "generateProperties() {\n const templatedElements = this.detectTemplatedElements();\n if (templatedElements.length > 0) {\n const state = this.state;\n // Create new property for each detected templated element\n for (const elementName of this.detectTemplatedElements()) {\n // To avoid re-generation for elements that are already available in properties, or added to script.\n // However, deleting variables from a script doesn't remove items from the bin\n if (!Object.prototype.hasOwnProperty.call(state.configuration.properties, elementName) &&\n (state.scriptAdditionsBin.indexOf(elementName) === -1)) {\n state.configuration.properties[elementName] =\n JSON.parse(JSON.stringify(TemplatesEditorConstants.PROPERTY_SKELETON));\n }\n }\n this.setState(state);\n this.props.onChange(state.configuration);\n } else {\n this.toggleSnackbar('No templated elements found in template(s)');\n }\n }", "title": "" }, { "docid": "95d62852305065a553f687e14cbb311b", "score": "0.5459002", "text": "function pickMystery(arrayWithSuspects, arrayWithWeapons, arrayWithRooms) {\n let clues = {\n suspect: selectRandom(arrayWithSuspects),\n weapon: selectRandom(arrayWithWeapons),\n room: selectRandom(arrayWithRooms)\n }\n return clues\n}", "title": "" }, { "docid": "6efc501dfa1328e1e52b9f331e5fcdd6", "score": "0.5452882", "text": "function assignColors(json, prop) {\n // from ColorBrewer http://colorbrewer2.org\n let colors = [\n \"#a8ddb5\",\n \"#33a02c\",\n \"#80cdc1\",\n \"#a6d96a\",\n \"#d7191c\"\n\n ];\n let retob = {}\n json.features.forEach((e, i) => {\n retob[e.properties.objectid] = `${'#' + (function lol(m, s, c) {\n return s[m.floor(m.random() * s.length)] +\n (c && lol(m, s, c - 1));\n })(Math, '0123456789ABCDEF', 4)}`\n })\n console.log(retob)\n return retob;\n}", "title": "" }, { "docid": "6c2b519a6de104e5e6bb50f54fa4edbf", "score": "0.5434365", "text": "randGem(){\n const { gems } = this.props;\n return gems[Math.floor(Math.random() * gems.length)];\n }", "title": "" }, { "docid": "e704d518317909a580922c1e478c9fd6", "score": "0.5430584", "text": "function generateRestaurantInfo(){\n const restaurantInfo = [{'resId' : '123456',\n 'resName' : 'Pink Door',\n 'resThumb' : 'image1',\n 'resCuisines' : 'cuisine1',\n 'resRating': 'rating1',\n 'resRatingText': 'Good',\n 'resUrl' : 'test URL1'},\n {'resId': '678910',\n 'resName' : 'Wild Ginger',\n 'resUrl' : 'test URL2',\n 'resThumb' : 'image2',\n 'resCuisines' : 'cuisine2',\n 'resRating': 'rating2',\n 'resRatingText': 'Excellent'}]\n\n return restaurantInfo[Math.floor(Math.random()* restaurantInfo.length)];\n}", "title": "" }, { "docid": "f871d66b7a8f8426f51e4680d2039734", "score": "0.5425932", "text": "constructor() {\n this.x = random(width);\n this.y = random(height);\n this.mask = Math.floor(random() * 2); // 0 for masked, 1 for unmasked\n this.size = 30;\n this.delta = Math.floor(random() * 2);//how to randomly make some true n some false?//we just have to add a random(1, 2)\n this.speedX = random(1, 2);\n this.speedY = random(1, 2);\n this.baseSpeedX = this.speedX;\n this.baseSpeedY = this.speedY;\n }", "title": "" }, { "docid": "2bd9bf8e6f11aa71f71a6ac1be6edda3", "score": "0.5420747", "text": "function randomiseEffectValues(effect) {\n var tempMin, tempMax;\n var randValue;\n for(var p = 1; p <= effect.numProperties; p++) {\n if(effect.property(p).propertyValueType == PropertyValueType.COLOR) {\n effect.property(p).setValue(generateRandomRGB(false));\n }\n if(effect.property(p).propertyValueType == PropertyValueType.OneD) {\n if(effect.property(p).hasMax && effect.property(p).hasMin) {\n if(effect.property(p).maxValue > 1) {\n if(effect.property(p).maxValue > 200) {\n tempMax = 200; \n } else {\n tempMax = effect.property(p).maxValue;\n }\n if(effect.property(p).minValue < 0) {\n tempMin = 0;\n } else {\n tempMin = effect.property(p).minValue;\n }\n randValue = Math.floor(Math.random() * tempMax)+1;\n if(randValue >= effect.property(p).minValue && randValue < effect.property(p).maxValue) {\n effect.property(p).setValue(randValue);\n }\n }\n }\n }\n } \n }", "title": "" }, { "docid": "fc7f3b68808652968ad3ba722b6082a1", "score": "0.53973716", "text": "function randomCrystals() {\n return {\n red: {\n value: Math.floor(Math.random() * 12) + 1,\n imageurl: \"assets/images/red.png\"\n },\n blue: {\n value: Math.floor(Math.random() * 12) + 1,\n imageurl: \"assets/images/blue.jpg\"\n },\n yellow: {\n value: Math.floor(Math.random() * 12) + 1,\n imageurl: \"assets/images/yellow.png\"\n },\n green: {\n value: Math.floor(Math.random() * 12) + 1,\n imageurl: \"assets/images/green.jpg\"\n }\n }\n}", "title": "" }, { "docid": "10141ae27008ed094b560e667dc75cad", "score": "0.539208", "text": "function getRandomQuote(){\n var ranNumber = Math.floor( Math.random() * 5 ) ;\n var quoteNumber = ranNumber;\n var ranObject = quotes[quoteNumber];\n return ranObject;\n\n}", "title": "" }, { "docid": "9d941757cd307cb0db06d67e377ea131", "score": "0.5391822", "text": "function getrandom(){\n let random = Math.floor(Math.random() * Products.all.length);\n return random;\n}", "title": "" }, { "docid": "0b56ce3b1a4382c06b45fa3dadd2d383", "score": "0.53867346", "text": "function getNewID(obj, size) {\n\n\t\tsize = size || 7;\n\n\t\tvar id = \"\";\n\t\tvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&-_+#§$!?][}{)(\";\n\n\t\t// Repeat until ID is a new property to the object.\n\t\twhile(id === \"\" || obj.hasOwnProperty(id)) {\n\t\t\tfor (var i = 0; i < size; i++) {\n\t\t\t\tid += chars.charAt(Math.floor(Math.random() * chars.length));\n\t\t\t}\n\t\t}\n\n\t\treturn id;\n\t}", "title": "" }, { "docid": "a1eb8c2a64a918d5eb4f69527c683e02", "score": "0.5385467", "text": "randomItemFromList(list){\n let rndGen = new randomItemFromList();\n return rndGen.generateRandomItem(list);\n }", "title": "" }, { "docid": "dc04c760e66788fe517714bcecbac026", "score": "0.5380102", "text": "function pickItems(key, num, picks, obj, everything) {\n\tvar count;\n\tvar x;\n\tvar tempList = obj[key].slice();\n\tif(picks[key] == null)\n\t\tpicks[key] = [];\n\tvar value = key+\"Index\";\n\tpicks[value] = [];\n\tfor(count = 0; count < num; count++) {\n\t\tx = Math.floor(Math.random()*tempList.length);\n\t\tpicks[key].push(tempList[x]);\n\t\ttempList.splice(x,1);\n\t}\n\tindex(everything[key], picks[key], picks[value]);\n}", "title": "" }, { "docid": "bf9c7950b30a58959c118cac5c6f7362", "score": "0.5376888", "text": "function randomRobot(state) {\n return {direction: randomPick(roadGraph[state.place])};\n}", "title": "" }, { "docid": "9da5515e63b312397f32c02e918682fa", "score": "0.5373051", "text": "function getProperty(property) {\n let result = \"\";\n // set html if it exists\n // use [] notation rather than . notation\n if (randomQuote[property]) {\n // property exists\n if ((property == \"citation\") || (property == \"year\")) {\n result = '<span class=\"' + property + '\">' + randomQuote[property] + '</span>';\n } else {\n result = '<span class=\"otherProp\">' + randomQuote[property] + '</span>';\n }\n }\n return result;\n }", "title": "" }, { "docid": "cf5367cca0d0ca0fe529cdef4b682ce2", "score": "0.53708637", "text": "function randomFact() {\n return RachelFacts[factNumber];\n}", "title": "" }, { "docid": "2bf8001678d79c2334a62b774def6412", "score": "0.5369594", "text": "function pick(obj,keys){var pickKeys=Array.isArray(keys)?keys:[keys];var length=pickKeys.length;var key;var result={};while(length>0){length-=1;key=pickKeys[length];result[key]=obj[key];}return result;}", "title": "" }, { "docid": "2c17b76f7499986c3961e9e9e70c536c", "score": "0.5366915", "text": "function shuffle(objectArray) {\n\n let quantity = objectArray.length;\n\n //Cambiamos de posicion los objetos, alamcenando temporalmente el objeto para cambiarlo de lugar.\n for (let k = quantity - 1; k >= 1; k--) {\n let az = Math.floor(Math.random() * k);\n tmp = objectArray[az];\n objectArray[az] = objectArray[k];\n objectArray[k] = tmp;\n }\n\n return objectArray;\n}", "title": "" }, { "docid": "2bbf011e8ab8fc58557615fd77740d5a", "score": "0.5353304", "text": "random() {\n return this.mt.random()\n }", "title": "" }, { "docid": "68670f60b8311720aaf4140c26ca72db", "score": "0.5345998", "text": "function repeate_6_Random(count)\r\n{\r\n var object;\r\n var color = \"#00ccff\";\r\n var type = \"square\";\r\n var x = 5;\r\n var y = spawnLineY;\r\n var appear = 1;\r\n var objWidth=45;\r\n var objHeight=45;\r\n if(count==0)\r\n {\r\n objects.pop();\r\n }\r\n for (i = 0; i < 6; i++)\r\n {\r\n object = new RandomObject(color, type, x, y,objWidth,objHeight,appear);\r\n objects.push(object);\r\n x += 50;\r\n }\r\n}", "title": "" }, { "docid": "8d5c9df090bd161107801cf5145f41b2", "score": "0.53405255", "text": "function randomColor() {\n return {\n red: Math.random(),\n green: Math.random(),\n blue: Math.random(),\n alpha: ( Math.random() * 0.5 ) + 0.1\n };\n}", "title": "" }, { "docid": "bc3e2973f20764fd75e18ddc2a0b9e7a", "score": "0.53372514", "text": "function randomFoodChoice() {\n const randomNumber = Math.floor(Math.random() * Object.keys(foodDict).length)\n let i = 0\n for (let foodItem in foodDict) {\n if (i == randomNumber) {\n return foodDict[foodItem]\n }\n i++\n }\n}", "title": "" }, { "docid": "7a3a7b960ea1bb2f122579213b2850c5", "score": "0.53060853", "text": "getRandomRecipe() {\n const randomRecipeNumber = this.getRandomInt(this.getChosenRecipe().length);\n return this.getChosenRecipe()[randomRecipeNumber];\n }", "title": "" }, { "docid": "738632a91867103ffa44f73ee1f48862", "score": "0.5303328", "text": "function randomColor() {\n return {\n red: 0,\n green: Math.random(),\n blue: Math.random(),\n alpha: (Math.random() * 0.5) + 0.05\n };\n}", "title": "" }, { "docid": "e762c34607f4ae56f28d5634caf128ce", "score": "0.5297921", "text": "function getRandomQuote(){\n var randomNumber = Math.floor(Math.random() * quotes.length);\n //console.log(randomNumber);\n //console.log(quotes[randomNumber].quote); //Test cases\n return quotes[randomNumber];\n\n}", "title": "" }, { "docid": "02d523e26b8dd9125248caf1eb01f13d", "score": "0.5297608", "text": "static get properties() {\n return {\n foo: String,\n whales: Number\n }\n }", "title": "" }, { "docid": "9a73a9691811dde39eba627393d2f396", "score": "0.5291409", "text": "get random() {\n return this._rng;\n }", "title": "" }, { "docid": "4e0b55601567aac16b8ef5d1b4fc6cea", "score": "0.5286598", "text": "function pickBy(fn,moments){var res,i;if(1===moments.length&&isArray(moments[0])&&(moments=moments[0]),!moments.length)return createLocal();for(res=moments[0],i=1;i<moments.length;++i)moments[i].isValid()&&!moments[i][fn](res)||(res=moments[i]);return res}", "title": "" }, { "docid": "39e292b96f8968385321258d33731a07", "score": "0.5286031", "text": "function randomize(charObj) {\n\n //PŁEĆ\n if (charObj.gender === '') {\n charObj.gender = charObj.random(gender);\n }\n\n//SPOKREWNIENIE\n if (charObj.age === '') {\n charObj.age = charObj.random(ages);\n }\n\n//TESTY\nif (charObj.att === '') {\n charObj.att = charObj.random(atts);\n}\n\n//2\n\nif (charObj.skills === '') {\n charObj.skills = charObj.random(skillsy);\n}\n\n//3\n\nif (charObj.pros === '') {\n charObj.pros = charObj.random(prosy);\n}\n\n//4\n\nif (charObj.cons === '') {\n charObj.cons = charObj.random(consy);\n}\n\n//OPIS\n\n\n if (charObj.realm === '') {\n charObj.realm = charObj.random(realm);\n }\n\n// GŁÓWNE RODY--------------------------------------------------------------------------------------------------------\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\nif (charObj.race === '' && charObj.realm === 'Glowne Rody Tol Calen') {\n charObj.race = charObj.random(racesGRTC);\n//Wasyle\n if (charObj.race === 'Rodu Wasylewiczów') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCwasyl)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleGRTCwasyl);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCwasyl);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCwasyl);\n }\n }\n\n }\n\n if (charObj.race === 'Rodu Wasylewiczów') {\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(surnamesMaleGRTCwasyl) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(surnamesFemaleGRTCwasyl);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(surnamesMaleGRTCwasyl);\n } else {\n charObj.surname = charObj.random(surnamesFemaleGRTCwasyl);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCwasyl);\n }\n }\n\n//Ligaturowie\n if (charObj.race === 'Klanu Ligaturów Einherjar') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n }\n }\n }\n\n if (charObj.race === 'Klanu Ligaturów Einherjar') {\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur);\n } else {\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCspok);\n }\n }\n//Ligaturowie Eldren\n if (charObj.race === 'Klanu Ligaturów Eldren') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n }\n }\n }\n\n if (charObj.race === 'Klanu Ligaturów Eldren') {\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur);\n } else {\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCligatur);\n }\n }\n\n //Ligaturowie Kintor Unnar\n\n if (charObj.race === 'Klanu Ligaturów Kintor Unnar') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n }\n }\n }\n\n if (charObj.race === 'Klanu Ligaturów Kintor Unnar') {\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur);\n } else {\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCspok);\n }\n }\n\n //Fullioci\n if (charObj.race === 'Rodu Fuliocci') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCfuliocci);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCfuliocci);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCfuliocci);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCfuliocci);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCspok);\n }\n }\n\n if (charObj.race === 'Rodu Fuliocci') {\n charObj.surname = charObj.random(surnamesGRTCfuliocci);\n }\n\n //Strutmeiserowie\n if (charObj.race === 'Rodu Strutmeiserów') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCstrut);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCstrut);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCstrut);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCstrut);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCspok);\n }\n }\n\n //McCormicków Garoo\n if (charObj.race === 'Rodu McCormicków Garoo') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCgaroo);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCgaroo);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCgaroo);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCgaroo);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCgaroo);\n }\n }\n\n //McCormicków Druigh\n if (charObj.race === 'Rodu McCormicków Druigh') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCdruigh);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCdruigh);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCdruigh);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCdruigh);\n }\n }\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCspok);\n }\n }\n//Velasquezowie\n if (charObj.race === 'Rodu Velasquezów') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCvel);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCvel);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCvel);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCvel);\n }\n }\n\n if (charObj.profession === '' && charObj.age === \"spokrewnioną\") {\n charObj.profession = charObj.random(professionsGRTCvel);\n }\n\n }\n\n if (charObj.race === 'Rodu Velasquezów') {\n charObj.surname = charObj.random(surnamesGRTCvel);\n }\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsGRTC);\n }\n\n\n charObj.description = charObj.random(descriptionGRTC)\n\n charObj.quest = charObj.random(questGRTC)\n\n\n//POMNIEJSZE RODY-----------------------------------------------------------------------------------------------------\n/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n } else if (charObj.race === '' && charObj.realm === 'Pomniejsze Rody Tol Calen') {\n charObj.race = charObj.random(racesPRTC);\n //Kozak\n if (charObj.race === 'Rodu Kozaków') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMalePRTCkoz)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemalePRTCkoz);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMalePRTCkoz);\n } else {\n charObj.name = charObj.random(namesFemalePRTCkoz);\n }\n }\n }\n\n//Merkowie\n if (charObj.race === 'Rodu Merków') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCfuliocci)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleGRTCfuliocci);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCfuliocci);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCfuliocci);\n }\n }\n }\n\n if (charObj.race === 'Rodu Merków') {\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(namesMaleUNG) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(namesFemaleUNG);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(namesMaleUNG);\n } else {\n charObj.surname = charObj.random(namesFemaleUNG);\n }\n }\n }\n\n if (charObj.race === 'Ludu Muethirów wychowanych poza Puszczą') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMalePAR)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemalePAR);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMalePAR);\n } else {\n charObj.name = charObj.random(namesFemalePAR);\n }\n }\n }\n\n if (charObj.race === 'Rodu Kozaków') {\n charObj.profession = charObj.random(professionsPRTCkoz);\n } else if (charObj.race === \"Rodu Merków\") {\n charObj.profession = charObj.random(professionsPRTCmerk);\n } else {\n charObj.profession = charObj.random(professionsPAR);\n }\n\n\n if (charObj.race === 'Rodu Kozaków') {\n charObj.description = charObj.random(descriptionPRTCkoz);\n } else if (charObj.race === \"Rodu Merków\") {\n charObj.description = charObj.random(descriptionPRTCmerk);\n } else {\n charObj.description = charObj.random(descriptionPAR);\n }\n\n if (charObj.race === 'Rodu Kozaków') {\n charObj.quest = charObj.random(questPRTC);\n } else if (charObj.race === \"Rodu Merków\") {\n charObj.quest = charObj.random(questPRTC);\n } else {\n charObj.quest = charObj.random(questPRTC);\n }\n\n\n}\n//PUSZCZA\n////////////////////////////////////////////////////////////////////////////////\nelse if (charObj.race === '' && charObj.realm === 'Puszcza') {\n charObj.race = charObj.random(racesPUS);\n//aethirowie + muethirowie\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMalePUS)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemalePUS);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMalePUS);\n } else {\n charObj.name = charObj.random(namesFemalePUS);\n }\n }\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsPUS);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionPUS)\n\n charObj.quest = charObj.random(questPUS)\n\n}\n//BEZMIARY\n////////////////////////////////////////////////////////////////////////////////\nelse if (charObj.race === '' && charObj.realm === 'Bezmiary') {\n charObj.race = charObj.random(racesBEZ);\n//Velasq\n if (charObj.race === 'Rodu Velasquezów Kolonialnych') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCvel);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCvel);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCvel);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCvel);\n }\n }\n }\n\n if (charObj.race === 'Rodu Velasquezów Kolonialnych') {\n charObj.surname = charObj.random(surnamesBEZvel);\n }\n\n if (charObj.race === 'Niewolnego Ludu Archipelagów') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMalePAR);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemalePAR);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMalePAR);\n } else {\n charObj.name = charObj.random(namesFemalePAR);\n }\n }\n }\n\n//Profesja\n\n if (charObj.race === 'Rodu Velasquezów Kolonialnych') {\n charObj.profession = charObj.random(professionsBEZvel);\n } else {\n charObj.profession = charObj.random(professionsBEZ);\n }\n\n\n//Przeszłość\n if (charObj.race === 'Rodu Velasquezów Kolonialnych') {\n charObj.description = charObj.random(descriptionBEZvel);\n } else {\n charObj.description = charObj.random(descriptionBEZ);\n }\n\n\n//Quest\n\n if (charObj.race === 'Rodu Velasquezów Kolonialnych') {\n charObj.quest = charObj.random(questBEZvel);\n } else {\n charObj.quest = charObj.random(questBEZ);\n }\n\n\n//HIKUNI---------------------------------------------------------------------------\n////////////////////////////////////////////////////////////////////////////////////\n }\n else if (charObj.race === '' && charObj.realm === 'Hikuni') {\n charObj.race = charObj.random(racesHIK);\n //Klan Smoka\n if (charObj.race === 'Klanu Smoka') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleHIKsmo)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleHIKsmo);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleHIKsmo);\n } else {\n charObj.name = charObj.random(namesFemaleHIKsmo);\n }\n }\n }\n\n\n if (charObj.race === 'Klanu Smoka') {\n charObj.surname = charObj.random(surnamesHIKsmo);\n }\n\n if (charObj.race === 'Klanu Smoka') {\n charObj.profession = charObj.random(professionsHIKsmo);\n }\n\n\n//Klan ognia\n if (charObj.race === 'Klanu Ognia') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleHIKog)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleHIKog);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleHIKog);\n } else {\n charObj.name = charObj.random(namesFemaleHIKog);\n }\n }\n }\n\n if (charObj.race === 'Klanu Ognia') {\n charObj.surname = charObj.random(surnamesHIKog);\n }\n\n//Profesje\n if (charObj.race === 'Klanu Smoka') {\n charObj.profession = charObj.random(professionsHIKsmo);\n } else {\n charObj.profession = charObj.random(professionsHIKog);\n }\n\n\n//Przeszłość\n if (charObj.race === 'Klanu Smoka') {\n charObj.description = charObj.random(descriptionHIKsmo);\n } else {\n charObj.description = charObj.random(descriptionHIKog);\n }\n\n\n//Quest\n\n if (charObj.race === 'Klanu Smoka') {\n charObj.quest = charObj.random(questHIKsmo);\n } else {\n charObj.quest = charObj.random(questHIKog);\n }\n\n }\n\n //PARIASI---------------------------------------------------------------------\n//////////////////////////////////////////////////////////////////////////////////////\n else if (charObj.race === '' && charObj.realm === 'Parias') {\n charObj.race = charObj.random(racesPAR);\n //Pariasi\n if (charObj.race === 'Ludu Pariasów') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMalePAR)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemalePAR);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMalePAR);\n } else {\n charObj.name = charObj.random(namesFemalePAR);\n }\n }\n }\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsPAR);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionPAR)\n\n charObj.quest = charObj.random(questPAR)\n\n }\n\n//AL SADIJA-------------------------------------------------------\n///////////////////////////////////////////////////////////////////\n else if (charObj.race === '' && charObj.realm === 'Harani') {\n charObj.race = charObj.random(racesAS);\n //Harani\n if (charObj.race === 'Ludu Harani') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleASharani)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleASharani);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleASharani);\n } else {\n charObj.name = charObj.random(namesFemaleASharani);\n }\n }\n }\n\n\n if (charObj.race === 'Ludu Harani') {\n charObj.surname = charObj.random(surnamesASharani);\n }\n\n //Isfahani\n\n if (charObj.race === 'Ludu Isfahani') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleASharani)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleASharani);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleASharani);\n } else {\n charObj.name = charObj.random(namesFemaleASharani);\n }\n }\n }\n\n if (charObj.race === 'Ludu Isfahani') {\n charObj.surname = charObj.random(surnamesASharani);\n }\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsAS);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionAS)\n\n charObj.quest = charObj.random(questAS)\n\n }\n\n //KUDHELOWIE----------------------------------------------------------------\n ////////////////////////////////////////////////////////////////////////////\n else if (charObj.race === '' && charObj.realm === 'Kudlehowie') {\n charObj.race = charObj.random(racesKUD);\n\n if (charObj.realm === 'Kudlehowie') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleKUD);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleKUD);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleKUD);\n } else {\n charObj.name = charObj.random(namesFemaleKUD);\n }\n }\n }\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsKUD);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionKUD)\n\n charObj.quest = charObj.random(questKUD)\n\n }\n\n//DALEKI SKOLMJAR-------------------------------------------------------\nelse if (charObj.race === '' && charObj.realm === 'Skolmjar') {\n charObj.race = charObj.random(racesSKO);\n\n if (charObj.realm === 'Skolmjar') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleGRTCligatur);\n } else {\n charObj.name = charObj.random(namesFemaleGRTCligatur);\n }\n }\n }\n\n if (charObj.realm === 'Skolmjar') {\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(surnamesMaleGRTCligatur);\n } else {\n charObj.surname = charObj.random(surnamesFemaleGRTCligatur);\n }\n }\n }\n\n\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsSKO);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionSKO)\n\n charObj.quest = charObj.random(questSKO)\n\n\n}\n//UNGWAI--------------------------------------------------------------------\n////////////////////////////////////////////////////////////////////////////////\nelse if (charObj.race === '' && charObj.realm === 'Ungwai') {\n charObj.race = charObj.random(racesUNG);\n//Ungawaj\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleUNG)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleUNG);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleUNG);\n } else {\n charObj.name = charObj.random(namesFemaleUNG);\n }\n }\n\n\n if (charObj.surname === '' && charObj.gender === 'Male') {\n charObj.surname = charObj.random(surnamesMaleUNG) }\n else if (charObj.surname === '' && charObj.gender === 'Female'){\n charObj.surname = charObj.random(surnamesFemaleUNG);\n }\n else if (charObj.surname === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.surname = charObj.random(surnamesMaleUNG);\n } else {\n charObj.surname = charObj.random(surnamesFemaleUNG);\n }\n }\n\n\n //Profesja\n\n if (charObj.race === 'Ludu niewolnych Ungwai') {\n charObj.profession = charObj.random(professionsBEZ);\n } else {\n charObj.profession = charObj.random(professionsUNG);\n }\n\n\n //Przeszłość\n if (charObj.race === 'Ludu niewolnych Ungwai') {\n charObj.description = charObj.random(descriptionBEZ);\n } else {\n charObj.description = charObj.random(descriptionUNG);\n }\n\n\n //Quest\n\n if (charObj.race === 'Ludu niewolnych Ungwai') {\n charObj.quest = charObj.random(questUNG);\n } else {\n charObj.quest = charObj.random(questUNG);\n }\n\n}\n\n\n//GNOMY\n/////////////////////////////////////////////////////////////////////////////\n\nelse if (charObj.race === '' && charObj.realm === 'Gnom') {\n charObj.race = charObj.random(racesGNO);\n//gnomy\n if (charObj.race === 'Ludu Gnomów') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMaleASgnom)\n } else if (charObj.name === '' && charObj.gender === 'Female') {\n charObj.name = charObj.random(namesFemaleASgnom);\n }\n else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMaleASgnom);\n } else {\n charObj.name = charObj.random(namesFemaleASgnom);\n }\n }\n }\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsPAR);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionPAR)\n\n charObj.quest = charObj.random(questPAR)\n\n}\n//POTOMEK BOGA-------------------------------------------------------\n////////////////////////////////////////////////////////////////////////\nelse if (charObj.race === '' && charObj.realm === 'Potomek') {\n charObj.race = charObj.random(racesPOT);\n\n if (charObj.realm === 'Potomek') {\n if (charObj.name === '' && charObj.gender === 'Male') {\n charObj.name = charObj.random(namesMalePAR);\n } else if (charObj.name === '' && charObj.gender === 'Female'){\n charObj.name = charObj.random(namesFemalePAR);\n } else if (charObj.name === '') {\n var randomValue = Math.random();\n if (randomValue < 0.5) {\n charObj.name = charObj.random(namesMalePAR);\n } else {\n charObj.name = charObj.random(namesFemalePAR);\n }\n }\n }\n\n //Profesja\n\n if (charObj.profession === '') {\n charObj.profession = charObj.random(professionsPOT);\n }\n\n //Przeszłość\n charObj.description = charObj.random(descriptionPOT)\n\n charObj.quest = charObj.random(questPOT)\n\n}\n\n///NAWIAS ZAMYKAJĄCY\n}", "title": "" }, { "docid": "605b13f7e28737ff97a02119380a0a8e", "score": "0.5284134", "text": "function randomColor() {\n return {\n hue: Math.random() * 360,\n saturation: 0.8,\n brightness: 0.8,\n alpha: 0.5\n };\n}", "title": "" }, { "docid": "73e7dcc8194ff7f62fbf2835a5a8aaf1", "score": "0.52832943", "text": "function getStudentsWithAge(){\n var students = getRandomStudents(),\n rand;\n for (var i = 0; i < students.length; i++) {\n rand = Math.random() * (35 - 17) + 17 | 0;\n students[i].age = rand;\n }\n return students\n}", "title": "" }, { "docid": "321e92244e857ff53330cddaeec2896d", "score": "0.528063", "text": "function _shuffle (obj) {\n\treturn _sample(obj, Infinity);\n}", "title": "" }, { "docid": "bfae426555bd864bdeb27edd84375c19", "score": "0.5280391", "text": "randomPerson() {\n switch (this.location) {\n case 'Throne': return randomChoice(['The Dutiful Sergeant','The Stern Chamberlain','The Stern Chamberlain']);\n case 'Courtyard': return randomChoice(['The Whistling Luthier','The Earnest Cobbler', 'The Tired Farmer']);\n case 'Ballroom': return randomChoice(['The Shallow Sycophant','The Curious Nobleperson','The Unfortunate Connoisseur']);\n case 'Chapel': return randomChoice(['The Pontificating Priest','The Nervous Novice','The Whispering Devotee']);\n case 'Barracks': return randomChoice(['The Raucous Sentry','The Dutiful Sergeant','The Cold Lieutenant']);\n }\n }", "title": "" }, { "docid": "60c6ead9d5f15044dc237cb9763b317f", "score": "0.52783203", "text": "function randomUnicorn(){\r\n var x = Math.floor(Math.random()*size);\r\n var y = Math.floor(Math.random()*size);\r\n if(Field[x][y].unicorn){\r\n randomUnicorn()\r\n }\r\n Field[x][y].unicorn = true;\r\n}", "title": "" }, { "docid": "41181d15ee2e73e7ba1ae67ce850ae13", "score": "0.5276432", "text": "getAttrs(){\n let properties = new Set()\n let currentObj = this\n do {\n Object.getOwnPropertyNames(currentObj).map(item => properties.add(item))\n } while ((currentObj = Object.getPrototypeOf(currentObj)))\n return {attributes: [...properties.keys()].sort().filter(item => typeof this[item] !== 'function')};\n }", "title": "" }, { "docid": "41181d15ee2e73e7ba1ae67ce850ae13", "score": "0.5276432", "text": "getAttrs(){\n let properties = new Set()\n let currentObj = this\n do {\n Object.getOwnPropertyNames(currentObj).map(item => properties.add(item))\n } while ((currentObj = Object.getPrototypeOf(currentObj)))\n return {attributes: [...properties.keys()].sort().filter(item => typeof this[item] !== 'function')};\n }", "title": "" }, { "docid": "f6d4978408e2bb5b0568b60122ef0c43", "score": "0.5276315", "text": "function writeLine(obj,n) {\n let arrOfKeys = Object.keys(obj)\n let result = [arrOfKeys[Math.floor(Math.random()*arrOfKeys.length)]]\n for(let i =1; i<n; i++){\n //console.log('result',result)\n result.push(markovWord(obj,result[result.length-1]))\n }\n return result.join(\" \")+' \\n'\n}", "title": "" } ]
e7a8caafb67c24def6044ebb6f0d8f75
Function to make the graph
[ { "docid": "9d6b13bfea291938682d3218d96967fb", "score": "0.0", "text": "function generate_graph (csvData) {\n // Variables for min and max to handle scales for axes\n var xMin;\n var xMax;\n var yMin;\n var yMax;\n \n // initial default selections\n var selected_x = \"poverty\";\n var selected_y = \"healthcare\";\n \n // Tool Tip info box (state, X stats, Y stats)\n var toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n // tooltip box position\n .offset([100, -62])\n .html(function(d) {\n //Build tooltip box\n // Capitalize state name in toolbox\n const statetext = d.state;\n const upper = statetext.toUpperCase();\n // State text in bold \n var stateLine = `<div><strong>${upper}</strong></div>`;\n var yLine = `<div>${selected_y}: ${d[selected_y]}%</div>`;\n if (selected_x === \"poverty\") {\n xLine = `<div>${selected_x}: ${d[selected_x]}%</div>`} \n else {\n xLine = `<div>${selected_x}: ${parseFloat(d[selected_x]).toLocaleString(\"en\")}</div>`;} \n return stateLine + xLine + yLine \n });\n \n // Add toolTip to svg\n svg.call(toolTip);\n \n // When chosen a different axis by clicking\n function update_labels(axis, clickText) {\n // Switch active to inactive with booleans\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n \n // switch text selected by clicking to active\n clickText.classed(\"inactive\", false).classed(\"active\", true);\n }\n //#######################################################\n // max & min values for scaling both axis\n function scale_x_minmax() {\n xMin = d3.min(csvData, function(d) {\n // adjusting to make more inteligible the graph by multiplying\n return parseFloat(d[selected_x]) * 0.95;\n });\n xMax = d3.max(csvData, function(d) {\n return parseFloat(d[selected_x]) * 1.05;\n }); \n }\n \n function scale_y_minmax() {\n yMin = d3.min(csvData, function(d) {\n return parseFloat(d[selected_y]) * 0.80;\n });\n yMax = d3.max(csvData, function(d) {\n return parseFloat(d[selected_y]) * 1.15;\n }); \n }\n \n // call function to return min and max values for axix\n scale_x_minmax();\n scale_y_minmax();\n \n // once values obtained, build scales for both x & y axis\n var xScale = d3 \n .scaleLinear()\n .domain([xMin, xMax])\n .range([margin + labelArea, width - margin])\n \n var yScale = d3\n .scaleLinear()\n .domain([yMin, yMax])\n .range([height - margin - labelArea, margin])\n \n // Create scaled X and Y axis\n var xAxis = d3.axisBottom(xScale);\n var yAxis = d3.axisLeft(yScale);\n \n // append axis to svg as group\n svg.append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\"transform\", `translate(\n 0, \n ${height - margin - labelArea})`\n );\n \n svg.append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", `translate(\n ${margin + labelArea}, \n 0 )`\n );\n \n // Append the circles for each row\n var allCircles = svg.selectAll(\"g allCircles\").data(csvData).enter();\n \n allCircles.append(\"circle\")\n .attr(\"cx\", function(d) {\n return xScale(d[selected_x]);\n })\n .attr(\"cy\", function(d) {\n return yScale(d[selected_y]);\n })\n // radius size for circles\n .attr(\"r\", 12)\n .attr(\"class\", function(d) {\n return \"stateCircle \" + d.abbr;\n })\n \n // Apply state text on circles\n allCircles\n .append(\"text\")\n .attr(\"font-size\", 11)\n // Bold state initials for better contrast\n .attr(\"font-weight\", 600)\n .attr(\"class\", \"stateText\")\n \n .attr(\"dx\", function(d) {\n return xScale(d[selected_x]);\n })\n .attr(\"dy\", function(d) {\n // Push text to center by dividing\n return yScale(d[selected_y]) + 10 /3;\n })\n .text(function(d) {\n return d.abbr;\n })\n \n // build tooltip ####################################################\n .on(\"mouseover\", function(d) {\n // Show tooltip with mouse over circle\n toolTip.show(d);\n // Highlight circle border in white\n d3.select(\".\" + d.abbr).style(\"stroke\", \"white\");\n })\n \n .on(\"mouseout\", function(d) {\n // hide tooltip\n toolTip.hide(d);\n // Remove border\n d3.select(\".\" + d.abbr).style(\"stroke\", \"white\");\n });\n \n \n // Change graph according to click selected \n d3.selectAll(\".aText\").on(\"click\", function() {\n var selected = d3.select(this)\n \n // if selected was inactive\n if (selected.classed(\"inactive\")) {\n // Obtain name and axis and save in variables\n var axis = selected.attr(\"data-axis\")\n var name = selected.attr(\"data-name\")\n \n if (axis === \"x\") {\n selected_x = name;\n \n // Update min and max scale for specific domain\n scale_x_minmax();\n xScale.domain([xMin, xMax]);\n \n svg.select(\".xAxis\")\n .transition().duration(1000)\n .call(xAxis);\n \n // reposition circles\n d3.selectAll(\"circle\").each(function() {\n d3.select(this)\n .transition().duration(1000)\n .attr(\"cx\", function(d) {\n return xScale(d[selected_x]) \n });\n }); \n // reposition text inside circles\n d3.selectAll(\".stateText\").each(function() {\n d3.select(this)\n .transition().duration(1000)\n .attr(\"dx\", function(d) {\n return xScale(d[selected_x]) \n });\n }); \n // Update labels\n update_labels(axis, selected);\n }\n \n // Update Y axis selection \n else {\n selected_y = name;\n \n // Update min and max of range (y)\n scale_y_minmax();\n yScale.domain([yMin, yMax]);\n \n svg.select(\".yAxis\")\n .transition().duration(1000)\n .call(yAxis);\n \n /// reposition circles\n d3.selectAll(\"circle\").each(function() {\n d3.select(this)\n .transition().duration(1000)\n .attr(\"cy\", function(d) {\n return yScale(d[selected_y]) \n }); \n }); \n // reposition text inside circles\n d3.selectAll(\".stateText\").each(function() {\n d3.select(this)\n .transition().duration(1000)\n .attr(\"dy\", function(d) {\n // Center text\n return yScale(d[selected_y]) + 10/3; \n });\n });\n \n // use function to active / inactive text rows by clicked label\n update_labels(axis, selected);\n }\n }\n });\n }", "title": "" } ]
[ { "docid": "8b12a78a37ba62abd0354033f68e783b", "score": "0.8721621", "text": "function makeGraph() {\n \n }", "title": "" }, { "docid": "45d76af169c2274e0a962613b41132cd", "score": "0.6952016", "text": "function buildGraph(edges) {\n let graph = Object.create(null);\n function addEdge(from, to) {\n // console.log(from);\n // console.log(to);\n if(graph[from] == null) {\n graph[from] = [to];\n } else {\n graph[from].push(to); \n } \n } \n for(let [from, to] of edges.map(r => r.split(\"-\"))) {\n addEdge(from, to);\n addEdge(to, from); \n }\n return graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "43da54f732c5053c755ad368d969296f", "score": "0.69159955", "text": "function buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "8ba6722ffbb7386a40fcaa971747d461", "score": "0.69086355", "text": "function buildGraph() {\n\t\tvar graph = {};\n\t\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\t\tvar models = Object.keys(conversions);\n\n\t\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\t\tgraph[models[i]] = {\n\t\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t\t// micro-opt, but this is simple.\n\t\t\t\tdistance: -1,\n\t\t\t\tparent: null\n\t\t\t};\n\t\t}\n\n\t\treturn graph;\n\t}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "39051f762eb1df65c67853146ab58b1d", "score": "0.6879828", "text": "function buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "830a6902f3f231651b94d69a7b2abd03", "score": "0.6835362", "text": "static makeGraph() {\n const rootNode = {\n id: AncestorTree.root.getWtId(),\n group: 1,\n name: AncestorTree.root.getDisplayName(),\n };\n const nodes = new Map([[rootNode.id, rootNode]]);\n const links = new Map();\n const q = [rootNode];\n\n while (q.length > 0) {\n const src = q.shift();\n for (const p of AncestorTree.getD3Children(AncestorTree.#peopleByWtId.get(src.id))) {\n const id = p.getWtId();\n if (!nodes.has(id)) {\n const dst = {\n id: id,\n group: src.group + 1,\n name: p.getDisplayName(),\n };\n q.push(dst);\n if (!nodes.has(dst.id)) nodes.set(dst.id, dst);\n const lnkId = `${src.id}:${dst.id}`;\n if (!links.has(lnkId)) links.set(lnkId, { source: src.id, target: dst.id, value: 1 });\n }\n }\n }\n\n return {\n nodes: Array.from(nodes.values()),\n links: Array.from(links.values()),\n };\n }", "title": "" }, { "docid": "157eebc4c0c436262645ef3576d69c26", "score": "0.6832332", "text": "function _$mu4qeu_buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(_$mu4qeu_conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}", "title": "" }, { "docid": "accd531796b2d2a3b574ceb6344e0373", "score": "0.6804797", "text": "function construct_graph(){\n vx = [bx, ex];\n vy = [by, ey];\n for (let i=0; i<s.length; ++i){\n vx.push(s[i].bx - Math.cos(s[i].a)*5);\n vy.push(s[i].by - Math.sin(s[i].a)*5);\n vx.push(s[i].ex + Math.cos(s[i].a)*5);\n vy.push(s[i].ey + Math.sin(s[i].a)*5);\n }\n e = []; ed = [];\n for (let i=0; i<vx.length; ++i){\n e[i] = [];\n ed[i] = [];\n for (let j=0; j<vx.length; ++j){\n if (i==j) continue;\n let valid = true;\n for (let segm of s){\n if (crossSegments(vx[i], vy[i], vx[j], vy[j], segm.bx, segm.by, segm.ex, segm.ey)){\n valid = false;\n break;\n }\n }\n if (valid){\n e[i].push(j);\n ed[i].push(d(vx[i], vy[i], vx[j], vy[j]));\n }\n }\n }\n}", "title": "" }, { "docid": "1431757db1e7d2ac0e5dc84498606bdb", "score": "0.67927533", "text": "function buildGraph(edges) {\n //create a basic object\n let graph = Object.create(null);\n\n function addEdge(from, to) {\n if (graph[from] == null) {\n graph[from] = [to];\n } else {\n graph[from].push(to);\n }\n }\n for (let [from, to] of edges.map(r => r.split(\"-\"))) {\n addEdge(from, to);\n addEdge(to, from);\n }\n return graph;\n}", "title": "" }, { "docid": "2ed78e169d9d15e8184ccf9bc9c845e3", "score": "0.6782313", "text": "function graph() {\n\tthis.a1 = [];\n\tthis.b1 = [];\n}", "title": "" }, { "docid": "0d5cf2f0c178445e93865b356c86d324", "score": "0.6741971", "text": "function generateEntireGraph() \n{\n fetch(\"graph_data\")\n .then((response) => response.json())\n .then((data) => {\n clearGlobalArrays();\n/*\nThis for loop iterates over the data.links array\nIt then adds it to the testData.links array depending on whether or not the link is a duplicate\n*/\n var k;\n for (k = 0; k < data.links.length; k++) \n {\n var oldLink=nodeOverLapCheckerAndConcatenation(data,testData,k);\n createlinks(data,testData,oldLink,k);\n }\n var i;\n var numberOfnodes = 0;\n\n \n for (i = 0; i < data.nodes.length; i++) \n {\n\n /*\n Creating a new array of nodes using the input JSON file\n I used the numberOfnodes variable because It made debugging easier\n */\n\n\n var idOfNode;\n var nameOfNode;\n var nameAndTypeArray= new Array();\n nameAndTypeArray = determineNameAndType(data,i);\n idOfNode=nameAndTypeArray[0];\n nameOfNode=nameAndTypeArray[1];\n\n\n\n\n testData.nodes[numberOfnodes] = {\n id: idOfNode,\n name: nameOfNode,\n symbolSize: 0.2,\n value: 0,\n category: data.nodes[i].type,\n symbol: \"square\",\n };\n\n //Incrementing the number of nodes\n numberOfnodes++;\n // }\n\n alreadyExists = false;\n }\n\n //Create categories\n createCategories(testData)\n setValuesOfPorts(testData)\n \n\n loadChart(testData);\n });\n}", "title": "" }, { "docid": "4707429dddc5e682ced39c7af27298e6", "score": "0.668246", "text": "function makeGraph(nodes, edges) {\n // Filter people\n nodes = nodes.slice(0, 50);\n\n // Normalize counts\n let maxCount = nodes[0].count;\n let minCount = nodes[nodes.length - 1].count\n\n for (let j = 0; j < nodes.length; j++) {\n nodes[j].count = 15 + 45 * Math.pow(nodes[j].count - minCount, 0.6) / Math.pow(maxCount - minCount, 0.6);\n }\n\n\n // Add hashmap\n\n let hashmap = {}\n for (let i = 0; i < nodes.length; i++) {\n hashmap[nodes[i].name] = i;\n }\n\n // Change elements in edges to numbers\n\n let new_edges = [];\n for (let i = 0; i < edges.length; i++) {\n if (typeof(hashmap[edges[i].source]) == \"undefined\" || typeof(hashmap[edges[i].target]) == \"undefined\") {} else {\n new_edges.push({\n \"source\": hashmap[edges[i].source],\n \"target\": hashmap[edges[i].target],\n \"weight\": edges[i].weight\n });\n }\n }\n\n edges = new_edges;\n\n // Normalize edge weights\n let maxWeight = edges[0].weight;\n let minWeight = edges[edges.length - 1].weight;\n for (let j = 0; j < edges.length; j++) {\n edges[j].weight = 10 * (edges[j].weight - minWeight) / (maxWeight - minWeight);\n }\n\n // Layout\n let force = d3.layout.force()\n .nodes(nodes)\n .links(edges)\n .size([1000, 1000])\n .linkDistance(function(l) {\n if (l.source.faction == l.target.faction) {\n if (l.source.faction != 'Other') {\n return 200\n } else {\n return 350\n }\n } else {\n return 350\n }\n })\n // .linkStrength(function(l) {\n // if (l.source.faction == l.target.faction) {\n // if (l.source.faction != 'Other') {\n // return 2.0\n // } else {\n // return 0.1\n // }\n // } else {\n // return 0.1\n // }\n // })\n .friction(0)\n .charge([-100])\n\n force.start();\n\n console.log(nodes);\n console.log(edges);\n\n // Add lines\n let svgEdges = svg.selectAll(\"line\")\n .data(edges)\n .enter()\n .append(\"line\")\n .style(\"stroke\", \"#ccc\")\n .style(\"stroke-width\", function(d) {\n return d.weight;\n });\n\n // Add nodes\n let svgNodes = svg.selectAll(\"circle\")\n .data(nodes)\n .enter()\n .append(\"circle\")\n .attr(\"r\", function(d) {\n return d.count;\n })\n .style(\"stroke\", function(d) {\n if (d.faction == 'Wei') {\n return \"blue\";\n } else if (d.faction == 'Shu') {\n return \"green\";\n } else if (d.faction == 'Wu') {\n return \"red\";\n } else if (d.faction == 'Jin') {\n return \"purple\";\n } else {\n return \"gray\";\n }\n })\n .style(\"stroke-width\", 4)\n //Add avatars\n .style(\"fill\", function(d, i) {\n\n if (d.image == \"undefined\") {\n if (d.faction == 'Wei') {\n return \"blue\";\n } else if (d.faction == 'Shu') {\n return \"green\";\n } else if (d.faction == 'Wu') {\n return \"red\";\n } else if (d.faction == 'Jin') {\n return \"purple\";\n } else {\n return \"gray\";\n }\n }\n\n let img_w = d.count * 2;\n let img_h = d.count * 2;\n\n let defs = svg.append(\"defs\").attr(\"id\", \"imgdefs\")\n\n let catpattern = defs.append(\"pattern\")\n .attr(\"id\", \"catpattern\" + i)\n .attr(\"height\", 1)\n .attr(\"width\", 1)\n\n catpattern.append(\"image\")\n .attr(\"x\", -(img_w / 2 - d.count))\n .attr(\"y\", -(img_h / 2 - d.count))\n .attr(\"width\", img_w)\n .attr(\"height\", img_h)\n .attr(\"xlink:href\", 'images/avatars/' + d.image)\n\n return \"url(#catpattern\" + i + \")\";\n\n })\n .on(\"mouseover\", function(d, i) {\n return tooltip.style('visibility', 'visible').text(d.name);\n })\n .on('mousemove', function(d, i) {\n return tooltip.style('top', (event.pageY - 10) + 'px').style('left', (event.pageX + 10) + 'px')\n })\n .on('mouseout', function(d, i) {\n return tooltip.style('visibility', 'hidden')\n })\n .call(force.drag);\n\n // Update\n force.on(\"tick\", function() {\n svgEdges.attr(\"x1\", function(d) {\n return d.source.x;\n })\n .attr(\"y1\", function(d) {\n return d.source.y;\n })\n .attr(\"x2\", function(d) {\n return d.target.x;\n })\n .attr(\"y2\", function(d) {\n return d.target.y;\n });\n\n svgNodes.attr(\"cx\", function(d) {\n // d.x += (svgWidth / 2 - d.x) * 0.001;\n return d.x;\n })\n .attr(\"cy\", function(d) {\n // d.y += (svgHeight / 2 - d.y) * 0.001;\n return d.y;\n });\n });\n}", "title": "" }, { "docid": "7f750d070341104693af351163002e7d", "score": "0.66748744", "text": "function create_graph() {\n graph = new Graph();\n var nodes = data.nodes;\n for (let i = 0; i < nodes.length; i++) {\n var name = nodes[i].id;\n var neighbors = nodes[i].ddst;\n var node = new Node(name);\n node.neighbors = neighbors;\n graph.addNode(node);\n var option_start = document.createElement(\"option\");\n var option_end = document.createElement(\"option\");\n option_start.text = name;\n option_end.text = name;\n dropdown_start.add(option_start);\n dropdown_end.add(option_end);\n }\n}", "title": "" }, { "docid": "c09af28ac7dc28c243d206255c14b195", "score": "0.6672908", "text": "function generateData() {\n $.each( nodesArray, function( key, value ) {\n\n // Create the node\n nodes.add({\n id: key,\n label: ' ' + key.toString(),\n font:{size:15, color: '#ffffff'},\n size:40,\n shape: 'circle',\n color: colors.normal\n });\n\n // Create the connection between each node\n $.each( value, function( i, node ) {\n edges.add({\n from: key,\n to: node,\n smooth: false,\n color: {\n color: \"#000\",\n highlight: '#000',\n hover: '#000'\n }\n });\n });\n });\n }", "title": "" }, { "docid": "0ffdd17566b47946fa8de35a9ec5cc5a", "score": "0.6662141", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n } // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "0ffdd17566b47946fa8de35a9ec5cc5a", "score": "0.6662141", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n } // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "b0b68c7df3f34b316f78c56a9bd864ab", "score": "0.66207266", "text": "function MakeSet(v) {\n\tvar NewGraph = [];\n\tfor(i=0 ; i<v ; i++) {\n\t\tvar ob = { parent : i, /* parent is the vertex to which the present vertex is connected\n\t\t\t\t\t\t\t\t* that is there is an edge b/w present vertex and the parent */\n\t\t\t\t data : i, /* stores the vertex id number */\n\t\t\t\t rank : 0, /* a flag which tells whether the vertex contains robot or not\n\t\t\t\t \t\t\t * if it contains robot then flag > 0 else flag = 0*/\n\t\t\t\t weight : 0, /* stores the weight of the edge b/w the vertex and the parent vertex*/\n\t\t\t\t p : i /* p is the representative element of the set */\n\t\t\t};\n\t\tNewGraph.push(ob);\n\t}\n\tconsole.log(NewGraph);\n\treturn NewGraph;\n}", "title": "" }, { "docid": "088bc69e85f7d0d3d74eb2b395ac7d9c", "score": "0.65919644", "text": "function makegraph(a,b,c,d,e,graphvalue){\n var datasetnew;\n // graph of precipitation\n if (graphvalue == true){\n datasetnew = dataset;\n graphformat = \"0 mm\";\n graphinterval = 50;\n title = \"Precipitation\"\n\n }\n // graph of temperature\n else {\n datasetnew = tempdataset\n a = \"De Bilt\";\n b = \"De Kooy\";\n c = \"Beek\";\n d = \"Eelde\";\n e = \"Ritthem\";\n graphformat = \"0 °C\";\n graphinterval = 5;\n title = \"Temperature\"\n }\n // get number identifier of \"plaats\" to obtain data in a later stadium\n d3.json(datasetnew, function(error, pre) {\n for (var n = 0; n < pre.length; n++) {\n if (a == pre[n].plaats){\n a = n;\n };\n if (b == pre[n].plaats){\n b = n; \n };\n if (c == pre[n].plaats){\n c = n; \n };\n if (d == pre[n].plaats){\n d = n; \n };\n if (e == pre[n].plaats){\n e = n; \n };\n };\n drawgraph(pre, a,b,c,d,e,graphformat,graphinterval);\n\n })\n}", "title": "" }, { "docid": "19efcca1295c4a6aee10893d4faab343", "score": "0.65795827", "text": "function CollaborativeGraph(){\n\n}", "title": "" }, { "docid": "2c9a8a9b15599d13a944609b1ef0d3e3", "score": "0.65763545", "text": "function buildGraph(edges) {\n let graph = Object.create(null);\n function addEdge(from, to) {\n if(graph[from] == null) {\n graph[from] = graph[to];\n } else {\n graph[from].push(to);\n }\n }\n for (let [from, to] of edges.map(r => r.split(\"-\"))) {\n addEdge(from, to);\n addEdge(to, from);\n }\n return graph;\n\n }", "title": "" }, { "docid": "f1eaa490f8cec7430c2c17727c033591", "score": "0.65715367", "text": "function createGraph() {\n Graph = ForceGraph()\n (document.getElementById('graph'))\n\n Graph.graphData(data)\n .nodeId(\"url\")\n .linkSource(\"urlIssueA\")\n .linkTarget(\"urlIssueB\")\n .nodeLabel((node) => displayLabelonHover(node))\n .nodeAutoColorBy('repository')\n .onNodeClick((node, event) => console.info(`clicked on issue ${node.issueID} in ${node.repository}\\n link to repo: ${node.url}`))\n .linkCanvasObjectMode(() => 'after')\n .linkCanvasObject((link, ctx) => drawRelations(link, ctx));\n}", "title": "" }, { "docid": "3318df9a56f298cc2d2e2ea4f833c43b", "score": "0.65526325", "text": "function buildGraph() {\n const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n const models = Object.keys(conversions);\n\n for (let len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "f81149d2c5c93c3b8a6e994d1ace894d", "score": "0.6546455", "text": "function buildGraph(edges) {\n let graph = Object.create(null);\n function addEdge(from, to) {\n if (graph[from] == null) {\n graph[from] = [to];\n } else {\n graph[from].push(to);\n }\n }\n // properties would be quoted if it contained a space\n // fixed by adding a map function and execute a replace function which replaces spaces with _ and removing quotes\n // you now get much cleaner data :)\n for (let [from, to] of edges.map(r => r.split(\"-\").map(r => r.replace(\" \", \"_\").replace(\"'\", \"\")))) {\n addEdge(from, to);\n addEdge(to, from);\n }\n return graph;\n }", "title": "" }, { "docid": "4e48d232094c086cdaa3093bcdfd5afd", "score": "0.6517621", "text": "function buildGraph(edges) {\n let graph = Object.create(null);\n //addEdge will create an array containing the first value of the road if the road\n // does not currently exist in the graph. Otherwise, it will push an additional path\n function addEdge(from, to) {\n if (graph[from] == null) {\n graph[from] = [to];\n } else {\n graph[from].push(to);\n }\n }\n // as mentioned previously, roads are all two-way, so we need to establish both\n // routes by adding edges(from, to) and (to, from).\n // roads are separated by hyphens, so we map the roads array and split them like so.\n for (let [from, to] of edges.map(r => r.split(\"-\"))) {\n addEdge(from, to);\n addEdge(to, from);\n }\n return graph;\n}", "title": "" }, { "docid": "ba0f0e25810d1080a37d3dd1b44fdcbf", "score": "0.6508785", "text": "createGraph(g){\n var Graph = (function (undefined) {\n\n var extractKeys = function (obj) {\n var keys = [], key;\n for (key in obj) {\n Object.prototype.hasOwnProperty.call(obj,key) && keys.push(key);\n }\n return keys;\n }\n\n var sorter = function (a, b) {\n return parseFloat (a) - parseFloat (b);\n }\n\n var findPaths = function (map, start, end, infinity) {\n infinity = infinity || Infinity;\n\n var costs = {},\n open = {'0': [start]},\n predecessors = {},\n keys;\n\n var addToOpen = function (cost, vertex) {\n var key = \"\" + cost;\n if (!open[key]) open[key] = [];\n open[key].push(vertex);\n }\n\n costs[start] = 0;\n\n while (open) {\n if(!(keys = extractKeys(open)).length) break;\n\n keys.sort(sorter);\n\n var key = keys[0],\n bucket = open[key],\n node = bucket.shift(),\n currentCost = parseFloat(key),\n adjacentNodes = map[node] || {};\n\n if (!bucket.length) delete open[key];\n\n for (var vertex in adjacentNodes) {\n if (Object.prototype.hasOwnProperty.call(adjacentNodes, vertex)) {\n var cost = adjacentNodes[vertex],\n totalCost = cost + currentCost,\n vertexCost = costs[vertex];\n\n if ((vertexCost === undefined) || (vertexCost > totalCost)) {\n costs[vertex] = totalCost;\n addToOpen(totalCost, vertex);\n predecessors[vertex] = node;\n }\n }\n }\n }\n\n if (costs[end] === undefined) {\n return null;\n } else {\n return predecessors;\n }\n }\n\n var extractShortest = function (predecessors, end) {\n var nodes = [],\n u = end;\n\n while (u !== undefined) {\n nodes.push(u);\n u = predecessors[u];\n }\n\n nodes.reverse();\n return nodes;\n }\n\n var findShortestPath = function (map, nodes) {\n var start = nodes.shift(),\n end,\n predecessors,\n path = [],\n shortest;\n\n while (nodes.length) {\n end = nodes.shift();\n predecessors = findPaths(map, start, end);\n\n if (predecessors) {\n shortest = extractShortest(predecessors, end);\n if (nodes.length) {\n path.push.apply(path, shortest.slice(0, -1));\n } else {\n return path.concat(shortest);\n }\n } else {\n return null;\n }\n\n start = end;\n }\n }\n\n var toArray = function (list, offset) {\n try {\n return Array.prototype.slice.call(list, offset);\n } catch (e) {\n var a = [];\n for (var i = offset || 0, l = list.length; i < l; ++i) {\n a.push(list[i]);\n }\n return a;\n }\n }\n\n var Graph = function (map) {\n this.map = map;\n }\n\n Graph.prototype.findShortestPath = function (start, end) {\n if (Object.prototype.toString.call(start) === '[object Array]') {\n return findShortestPath(this.map, start);\n } else if (arguments.length === 2) {\n return findShortestPath(this.map, [start, end]);\n } else {\n return findShortestPath(this.map, toArray(arguments));\n }\n }\n\n Graph.findShortestPath = function (map, start, end) {\n if (Object.prototype.toString.call(start) === '[object Array]') {\n return findShortestPath(map, start);\n } else if (arguments.length === 3) {\n return findShortestPath(map, [start, end]);\n } else {\n return findShortestPath(map, toArray(arguments, 1));\n }\n }\n\n return Graph;\n\n })();\n\n var res = new Graph(g);\n return res;\n }", "title": "" }, { "docid": "3269a6462d8ecdd509845d4bbc66da3c", "score": "0.64963514", "text": "constructor () {\n this.graph = {}\n }", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "728cd48bc9c59a4682a7423d7247403c", "score": "0.6495576", "text": "function buildGraph() {\n var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\n var models = Object.keys(conversions);\n\n for (var len = models.length, i = 0; i < len; i++) {\n graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n }\n\n return graph;\n} // https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "75576bf2912fea14bad90a706f07a2bd", "score": "0.647699", "text": "function createGraph() {\n return new dagreD3.graphlib.Graph()\n .setGraph({})\n .setDefaultEdgeLabel(() => {});\n }", "title": "" }, { "docid": "86d3121556f18695e70e87293f5dc26e", "score": "0.6476389", "text": "createHyperGraph() {\n this.getSections();\n this.maximalSeams = [];\n this.faceObject = [];\n this.hypergraphs = {};\n var hypergraph = this.constructHypergraph();\n return hypergraph;\n }", "title": "" } ]
2a10c54c53f04a997cb28eac22906bff
End of constructor getters ...........................................................
[ { "docid": "2a3d3e6ffec70f4f1c2800166698de3a", "score": "0.0", "text": "get width(){ return this._width ; }", "title": "" } ]
[ { "docid": "e7f9245fb860b55c330e752823771ca2", "score": "0.672476", "text": "constructor()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.65788275", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.6559811", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.6559811", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.6518951", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.6518951", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.6518951", "text": "constructor() {\n\t}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.65083814", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "9d5ba1187d0ca0e7db699ad5e531c90c", "score": "0.65070254", "text": "constructor() {\r\n \r\n }", "title": "" }, { "docid": "9d5ba1187d0ca0e7db699ad5e531c90c", "score": "0.65070254", "text": "constructor() {\r\n \r\n }", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.65021896", "text": "constructor () { super() }", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.65021896", "text": "constructor () { super() }", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.65021896", "text": "constructor () { super() }", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.64902115", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "f83fa57e8dab2a6c4604633e2d882cff", "score": "0.643914", "text": "constructor() {\r\n this.id= 0;//though this is a constuctor, it's of Class, not of Object, thus use \";\", not using \",\" between the properties\r\n this.type = 'unknown';\r\n }", "title": "" }, { "docid": "fe0a0e8a625429e434ef16b6308a726b", "score": "0.639097", "text": "constructor() {\n\t\tsuper(4, null);\n\t}", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.63759804", "text": "constructor() {\n \n }", "title": "" }, { "docid": "cd8692cad204a0bb38432ae8273dbd47", "score": "0.632598", "text": "constructor() {\n //\n }", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.6314465", "text": "constructor () {}", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.6314465", "text": "constructor () {}", "title": "" }, { "docid": "1d442180705d7ef4ba42ed3b3e0747e0", "score": "0.6313022", "text": "constructor(){\n super() // o super é necessario para terminar a ligção entre as classes\n this.peso = 20\n }", "title": "" }, { "docid": "ded06afe334810f68d6c3f7f5ba7ad4d", "score": "0.6309058", "text": "constructor()\n\t\t{\n\t\t\tsuper();\n\t\t}", "title": "" }, { "docid": "964cb8b3d9b177a97b2b1bf40e48466d", "score": "0.62879366", "text": "function constructor () {\r\n\t\t\t// body...\r\n\t\t}", "title": "" }, { "docid": "7847acc3d39d1ee79c92d36383a0f08a", "score": "0.6259744", "text": "constructor() {\n\t super();\n\t }", "title": "" }, { "docid": "7847acc3d39d1ee79c92d36383a0f08a", "score": "0.6259744", "text": "constructor() {\n\t super();\n\t }", "title": "" }, { "docid": "b9c94fd5b1c568afa443f28217b14db7", "score": "0.625899", "text": "constructor() {\r\n }", "title": "" }, { "docid": "faa21726fbbc15216623fac4732a41a4", "score": "0.6258054", "text": "constructor()\n {\n }", "title": "" }, { "docid": "faa21726fbbc15216623fac4732a41a4", "score": "0.6258054", "text": "constructor()\n {\n }", "title": "" }, { "docid": "b24a7239269fcd53f66c091b7c2c0115", "score": "0.6256324", "text": "constructor() {\n \n }", "title": "" }, { "docid": "b24a7239269fcd53f66c091b7c2c0115", "score": "0.6256324", "text": "constructor() {\n \n }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.62530863", "text": "constructor() { }", "title": "" }, { "docid": "dd5f57b1cae49cad30d97bdb0f23413b", "score": "0.6232579", "text": "constructor(){\n //Empty\n }", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.622132", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.622132", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.6217613", "text": "constructor(){}", "title": "" }, { "docid": "5c08cecded91387292ab2b087d9bddc6", "score": "0.6201381", "text": "constructor(propertyValues){\n \t super(propertyValues);\n \t\n\t}", "title": "" }, { "docid": "d5418948c1c8a0fe7cb639af8df77b96", "score": "0.6182561", "text": "constructor() {\r\n\r\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" }, { "docid": "8e155084f1431b925e1e4b7df7b20be1", "score": "0.61506855", "text": "constructor() {\n }", "title": "" } ]
9a76db45cf1ff49bf014f550c43c2f7b
This function uses redwrap to call and parse the Reddit Api for the search term in the request.
[ { "docid": "0a49571e8de7021323c01fc3b865bf1d", "score": "0.6945382", "text": "function get_reddit_posts(req, resp){\n var search_term = req.body.search_term;\n reddit.r(search_term, function(err, data, res){\n if(err)\n return resp.send({error: true, payload: err});\n resp.send({error: false, payload: data.data});\n });\n}", "title": "" } ]
[ { "docid": "46040d13edf72d33336ad0eb73a37cb2", "score": "0.71292895", "text": "function getRedditApi () {\n //Takes a keyword (if existing and greater than a length of one) and adds it to the searchLocation, the reddit query allows for 250 chracters in the q= parameter\n if(redditKeyWord && redditKeyWord.length >1) {\n redditSearchLocation = redditSearchLocation + \" \" + redditKeyWord;\n }\n\n //THIS PATH HAS AN S ALTHOUGH REDDIT CLAIMED IT DIDN'T WANT IT BUT I ADDED IT ANYWAY\n var redditQueryUrl = \"https://www.reddit.com/search.json?q=\" + redditSearchLocation + \"&limit=\" + redditSearchLimit;\n\nfetch(redditQueryUrl)\n .then(function(res) {\n return res.json(); // Convert the data into JSON\n })\n .then(function(data) {\n for(var i =0; i < data.data.children.length; i++) {\n var title = data.data.children[i].data.title;\n //More amazingness, some reddit urls are links to posts, some are links to images, its not reliable we need to use the permalink data\n //So permalink should give an address fragment to which we can attach the prefix https://www.reddit.com and then get a useable link for each item\n var permalinkHttp = \"https://www.reddit.com\" + data.data.children[i].data.permalink\n var description = data.data.children[i].data.selftext; \n //Thumbnail can be an image or a self reference it depends on how the user posted, it's not reliable enough for image population\n //Some posts do not have an image which leaves the preview parameter empty so we only get the thumbnail image if it exists\n if(data.data.children[i].data.preview) {\n //And of course it has to be encoded because reddit so we can't use it unless we decoded it. If we try to follow it we get a 403 error.\n var imageUrlEncoded = data.data.children[i].data.preview.images[0].source.url;\n //in order to decode we need to replace \"amp;s\" with \"s\"\n var imageUrlDecoded = imageUrlEncoded.replace(\"amp;s\", \"s\");\n //This url can now be used as a link to display an image\n } else {\n var imageUrlDecoded = \"https://static.techspot.com/images2/downloads/topdownload/2014/05/reddit.png\";\n }\n //After fetching from the api endpoints, run the function to create and append the data\n createAppendReddit (imageUrlDecoded, title, description, permalinkHttp);\n }\n })\n .catch(function(err) {\n console.log(err); // Log error if any\n });\n}", "title": "" }, { "docid": "d287e873b74c87e71d4f9ad3e8edc2d0", "score": "0.6604825", "text": "function search(){\n\n //construct our JSON\n var keywords = document.getElementById(\"keyword\").value\n //remove whitespace\n keywords = keywords.replace(/\\s/g, '');\n keywords = keywords.split(\",\");\n query = {\n 'keywords': [],\n 'subreddits': []\n };\n var derp = 0;\n for(k in keywords){\n if(keywords.hasOwnProperty(k)){\n query['keywords'].push(keywords[k]);\n derp++;\n }\n }\n var subreddits = document.getElementById(\"subreddit\").value;\n //remove whitespace\n subreddits = subreddits.replace(/\\s/g, '');\n subreddits = subreddits.split(\",\");\n derp = 0;\n for(k in subreddits){\n if(subreddits.hasOwnProperty(k)){\n query['subreddits'].push(subreddits[k]);\n derp++;\n }\n }\n //make an ajax request main.py to start scraping\n $.ajax({\n type: 'POST',\n url: '/ajax',\n data: JSON.stringify(query),\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: function(data){\n //the subreddit was invalid, alert the user\n if(data==\"InvalidSubreddit\"){\n alert(\"Invalid Subreddit. Try Again\")\n }\n //the subreddit was valid, store the results\n // and have vis() work\n else{\n results = data;\n vis(data);\n }\n\n },\n error: function(data){\n alert(\"Error\");\n }\n\n //complete: function() {console.log(results)}\n });\n\n}", "title": "" }, { "docid": "68f7bd1bc02bd220c18041c31c0ad8da", "score": "0.6077835", "text": "redditTopicFetch(searchFormBoard, searchFormLimit) {\n superagent.get(`${API_URL}/${searchFormBoard}.json?limit=${searchFormLimit}`)\n .then(res => {\n console.log('request success', res.body.data.children.data.url); //that's where our stuff lives\n this.setState({\n results: res.body.data.children, //maybe think about what is being returned here, we have to get the children so we can access the stuff on them\n searchErrorMessage: null,\n });\n })\n .catch(err => {\n console.error(err);\n this.setState({\n results: null,\n searchErrorMessage:'NOPE',\n });\n });\n }", "title": "" }, { "docid": "b2de59fff8c3a1f6c9e2f3329add0e7b", "score": "0.5932082", "text": "function makeRequest(callback, searchTerm=\"\") {\n\n var url = 'http://api.ft.com/content/search/v1';\n var apiKey = process.env.FT_API_KEY; // Get API key\n\n var params = {\n \"queryString\": searchTerm,\n \"queryContext\": {\n \"curations\": [\"ARTICLES\"]\n },\n \"resultContext\" : {\n \"aspects\" : [ \"title\",\"lifecycle\",\"location\",\"summary\",\"editorial\" ],\n \"maxResults\" : \"2\",\n \"offset\" : \"0\"\n }\n }\n\n var options = {\n method: 'post',\n body: params,\n json: true,\n url: url + '?apiKey=' + apiKey\n }\n\n request(options, function(error, response, body) {\n if (error) {\n throw error;\n }\n return filterHeadlines(body);\n });\n\n function filterHeadlines(apiResponse) {\n var headlines = new Array();\n var headlineData = apiResponse.results[0].results;\n\n headlineData.forEach(function(headline) {\n headline = {\n \"title\": headline.title.title,\n \"summary\": headline.summary.excerpt,\n \"editorial\": headline.editorial.byline\n }\n headlines.push(headline);\n });\n\n return callback(headlines);\n }\n\n}", "title": "" }, { "docid": "7142244d90e2877626043eac695a8113", "score": "0.5909536", "text": "function search() {\n var searchInput = document.getElementById(\"myText\").value;\n requestURL = \"https://api.imgur.com/3/gallery/search/top/?q=\" + searchInput;\n requestGallery();\n}", "title": "" }, { "docid": "fd2d673cff6b4e3e610f45f45f90169c", "score": "0.59044087", "text": "function DeconstructURLForSearchTerms(info) {\n let url = info.url;\n var searchTerm = `url:\"${url.hostname+url.pathname}\"`;\n let domainData = GetDomainData(url.host);\n if(domainData)\n {\n let paramValue = url.searchParams.get(domainData.parameter_name);\n if (paramValue != undefined)\n searchTerm = `url:\"${paramValue}\"`;\n }\n switch (url.hostname) {\n case \"reddit.com\":\n case \"old.reddit.com\":\n case \"www.reddit.com\":\n if(url.pathname && url.pathname != \"\\/\"){\n let titleMinusSubreddit = info.title.split(\" : \")[0];\n let titleArray = titleMinusSubreddit.split(\" \");\n let amountOfWordsToShortTo = Math.min(REDDIT_MAX_SEARCHWORDS, titleArray.length);\n let shortTitle = titleArray.splice(0, amountOfWordsToShortTo).join(\" \");\n searchTerm = encodeURIComponent(shortTitle);\n }\n break;\n }\n return searchTerm;\n}", "title": "" }, { "docid": "37aeae78e49abaeca7115bad11da241b", "score": "0.5848528", "text": "getSearchResults(term) {\n\n let baseUrl = \"https://en.wikipedia.org/w/api.php\",\n urlSearch = `?action=query&list=search&srlimit=50&format=json&origin=*&srsearch=${term}`;\n\n let request = new Request(baseUrl + urlSearch),\n result;\n\n result = fetch(request).then((resp) => resp.json()).then((json) => {\n this.setState({\n searchResults: json,\n });\n return json;\n });\n return result;\n }", "title": "" }, { "docid": "3d0121892daac4733303b4120fb161d9", "score": "0.5830998", "text": "wikiSearch(str) {\n let endpoint = `https://en.wikipedia.org/w/api.php?origin=*&action=opensearch&limit=10&search=${str}&format=json`;\n\n return fetch(endpoint)\n .then((res => res.json())) // strips body data into next promise\n .then(json => json)\n .catch(err => console.error(err))\n }", "title": "" }, { "docid": "a04ee0ae63c77eb41c4737252534efe6", "score": "0.58282393", "text": "function search(){\n $.ajax(apiUrl + $searchInputField.val().trim())\n .done(displayResults);\n }", "title": "" }, { "docid": "0c21e77311c4e7a379c9915df9990491", "score": "0.5804692", "text": "call() {\n\t\t// Have hard coded the search term cricket over here, but we can easily pass this...\n\t\t// Basically we can have the entire params to be injected here in this function\n\t\t// getTwitterCLient(), formatSuccessResponse() and formatFailResponse() are from base class\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.getTwitterCLient().get('search/tweets', {q: 'cricket', 'result_type': 'recent'}, (error, tweets, response) => {\n\t\t\t\tif (!error) {\n\t\t\t\t\treturn resolve(this.formatSuccessResponse(tweets));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn reject(this.formatFailResponse(error));\n\t\t\t});\t\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "cd064965380a712acf328d9c444c54a4", "score": "0.5774912", "text": "function search(){\n var q = document.getElementById(\"query\").value; \n if(q != \"\"){\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function (){\n if(this.readyState == 4 && this.status == 200){\n var r = JSON.parse(this.responseText);\n console.log(r);\n display(r);\n }\n else{\n console.log(\"Error\", xmlhttp.statusText) \n }\n }; \n xhr.open(\"GET\", \"https://en.wikipedia.org/w/api.php?action=query&origin=*&format=json&formatversion=2&prop=info|extracts&generator=search&exsentences=1&exintro=1&explaintext=1&gsrsearch=\" + q + \"&gsrnamespace=0&gsrlimit=10&exlimit=10\" , true);\n xhr.send();\n }\n else{\n alert(\"please enter a search value\");\n } \n}", "title": "" }, { "docid": "5b2bee39969f428f952c335cf3f05fdc", "score": "0.57721174", "text": "searchByName(resource, searchTerm) {\n return fetch(`${remoteURL}/${resource}?q=${searchTerm}`).then(result => result.json())\n }", "title": "" }, { "docid": "8b41c6555e2606d81fbb8a04ae5b7071", "score": "0.57111126", "text": "function handleSearch() {\n var term = this.dataset.term; // Gather the term from the button\n\n var queryURL = API_STRING + term; // Build the query using the API_STRING and term\n\n fetch( queryURL, { method: 'GET' } ) // Send a 'GET' Ajax request to Giphy API\n .then( function ( result ) { // Catch the response object\n return result.json(); // Parse the response into a javascript object\n } )\n .then( handleApiResponse );\n}", "title": "" }, { "docid": "99c2df44fb874ebe1a697f30768d8960", "score": "0.568558", "text": "function searchDictionary (){\r\n word= $(\"word-container\").value;\r\n fetch(DICTIONARY_URL+word+\"?key=\"+KEY+\"&keyword=main headword\" , {mode : \"cors\"})\r\n .then(checkStatus)\r\n .then(JSON.parse)\r\n .then(implementDefinition)\r\n .catch(console.log);\r\n }", "title": "" }, { "docid": "32d559198b970fb522d7688561ee91fe", "score": "0.56757593", "text": "async doSearch() {\n let params = {\n 'q': this.state.query,\n };\n if (this.state.category !== null) {\n params['category'] = this.state.category;\n }\n if (this.state.recency !== null) {\n params['recency'] = this.state.recency;\n }\n if (this.state.sort !== null) {\n params['sort'] = this.state.sort;\n }\n let url = buildURLQuery(SEARCH_API, params);\n let displayUrl = buildURLQuery('/', params);\n window.history.pushState(this.state, \"\", displayUrl);\n return fetch(url, {\n method: 'GET'\n })\n .then(response => response.json())\n .then(data => {\n let { results, words } = data.data;\n this.setState({\n results: results,\n words: words,\n });\n });\n }", "title": "" }, { "docid": "eca5364f5b94661ee787f16781b1e027", "score": "0.56434083", "text": "function fetchResults(searchQuery) {\r\n const endpoint = `https://en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&origin=*&srlimit=20&srsearch=${searchQuery}`;\r\n\r\n fetch(endpoint)\r\n .then(response => response.json())\r\n .then(data => {\r\n var results = data.query.search;\r\n displayResults(results);\r\n});\r\n}", "title": "" }, { "docid": "b2d0e9ff1090fbbaa469d9496e969e72", "score": "0.5631929", "text": "function fetchResults(searchQuery) {\r\n var endpoint = `https://en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&origin=*&srlimit=20&srsearch=${searchQuery}`;\r\n console.log(endpoint);\r\n}", "title": "" }, { "docid": "49d5e49bf06eadda8129665878008c51", "score": "0.5618257", "text": "function gotSearch(data){\n console.log(data);\n let len = data[1].length;\n let index = floor(random(len));\n let title = data[1][index];\n title = title.replace(/\\s+/g, '_');\n createDiv(title);\n console.log('Querying:' + title);\n let url = contentUrl + title;\n loadJSON(url,gotContent,'jsonp');\n}", "title": "" }, { "docid": "c88c2390fcf3c10982be158426796625", "score": "0.56059307", "text": "function search(word) {\n searchInput.value = word;\n fetchApi(word);\n}", "title": "" }, { "docid": "4bd042da135daf9397b6e479d60431f1", "score": "0.56009567", "text": "function getRequest(searchTerm) {\n const params = {\n part: 'snippet',\n key: 'AIzaSyCPNkKGoFSdqh771mSPjUEUeE8GkoxKMXY',\n q: searchTerm\n };\n const endpoint = 'https://www.googleapis.com/youtube/v3/search';\n\n //Get JSON request\n $.getJSON(endpoint, params, function(data){\n const tubes = data.items;\n const listHTML = makeTubeList(tubes);\n renderList(listHTML);\n });\n}", "title": "" }, { "docid": "bf7be5ee76fd039caad38212b3682f01", "score": "0.55963564", "text": "function getResults(searchTerm) {\n\n var params = {\n \"part\": 'snippet',\n \"key\": 'AIzaSyD2PElSqrnBMpSMndsc7pTC2e-37fC_wEM',\n \"q\": searchTerm\n };\n\n var result = $.ajax({\n /* update API end point */\n url: \"https://www.googleapis.com/youtube/v3/search\",\n data: params,\n dataType: \"jsonp\",\n /*set the call type GET / POST*/\n type: \"GET\"\n })\n /* if the call is successful (status 200 OK) show results */\n .done(function (result) {\n /* if the results are meeningful, we can just console.log them */\n\n displayResult(result.items);\n /* if the results are not meeningful, it might help to convert them to string first\n var displayStringifiedResults = JSON.stringify(result);\n console.log(displayStringifiedResults);*/\n /* if the results contain invalid json, it might help to sanitize them first\n var displaySanitizedResults = sanitizeJSON(result);\n console.log(displaySanitizedResults);*/\n })\n /* if the call is NOT successful show errors */\n .fail(function (jqXHR, error, errorThrown) {\n console.log(jqXHR);\n console.log(error);\n console.log(errorThrown);\n });\n\n }", "title": "" }, { "docid": "a6900224f6c994075e90b6846b412b6b", "score": "0.5573711", "text": "function url(term){\n return 'https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrlimit=10&prop=extracts&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=' + term;\n }", "title": "" }, { "docid": "ca42f529dad5901a869f5c783dd8cf4d", "score": "0.5549499", "text": "function searchRepositories() {\n const searchTerms = $(\"#searchTerms\").val();\n const searchTermsURL = \"https://api.github.com\" + \"/search/repositories?q=\" + searchTerms\n $.get(searchTermsURL).done(function(response){\n console.log(response.items)\n $('#results').html('<ul>'+ repoListItems(response)+ '</ul>');\n }).fail(displayError);\n}", "title": "" }, { "docid": "73b18b8532c414895ee56406b6d878ec", "score": "0.55409855", "text": "function goWiki(term){\n // let term = userInput.value();\n counter = counter +1;\n let url = searchUrl + term;\n loadJSON(url,gotSearch,'jsonp');\n }", "title": "" }, { "docid": "07cc057a923dd9636c2e5b93bb37c549", "score": "0.5530281", "text": "function getSearchAPIString(term){\n var url = SEARCH_API_PRE.replace(/{term}/g, encodeURIComponent(term));\n url = url + \"?\" + \"apikey=\" + encodeURIComponent(API_KEY) + \"&count=100\";\n return url;\n}", "title": "" }, { "docid": "0aaf8cb69fc9b1c25bd313c9d7b50929", "score": "0.5525917", "text": "function search_suggestions(msg, destiny, sender_function)\n\t{\n\t\tvar dest = destiny.replace(/-/g, \" \");\n\t\tconsole.log(dest);\n\t\t var options = {\n\t url: 'http://www.metacritic.com/search/tv/' + dest + '/results',\n\t headers: {\n\t 'User-Agent': 'request'\n\t },\n\t enconding: 'ascii'\n\t };\n\t\t\n\t\t request(options, function(error, response, html){\n\t\tif (error)\n\t\tconsole.log(error);\n if(!error){\n var $ = cheerio.load(html);\n var suggestions;\n\t\t\tvar message;\n\t\t\tvar i=0;\n\t\t\tmessage = \"Maybe you meant: \\n\";\n\t\t\t\n\t\t\t$('ul.search_results.module').children().filter(function(){\n\t\t\t\t\tif ($(this).hasClass('result'))\n\t\t\t\t\t{\n\t\t\t\tvar data = $(this).children().last().children().first();\n\t\t\t\tvar title = data.children().first().children().first().text();\n\t\t\t\tvar release = data.children().last().children().children().first().children().last().text();\n\t\t\t\tvar type = $(this).children().first().children().first().text();\n\t\t\t\tmessage = message + title + \"\\n\" + \"Type: \" + type + \"\\n\" + \"Release date: \" + release + \"\\n\";\t\n\t\t\t\tmessage = message + \"\\n\";\n\t\t\t\t\t}\t\t\t\t\n })\n\t\t\tvar fromId = msg.chat.id;\n sender_function(fromId, message);\n }\n\t\t\t})\n\t\t\n\t\n\t}", "title": "" }, { "docid": "407583b26171defc8d3e9aebcd222b08", "score": "0.5519147", "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": "529a46d1942b407f579b87a149becdff", "score": "0.5514042", "text": "function getSuggestions() {\n let query = document.querySelector(\"input[name='search']\").value;\n if (query !== \"\") {\n fetch(LYRICS_API_BASE + \"/suggest/\" + query)\n .then(fetchSucceeded)\n .then(response => response.json())\n .then(showSuggestions)\n .catch(suggestionFailed);\n }\n }", "title": "" }, { "docid": "a50ac6a3a47d5f740a055178af3b7ae9", "score": "0.5509946", "text": "userSearch(queryRequest) {\n return this.superagent\n .get(`https://api.github.com/search/users?${this.buildSearchQuery(queryRequest)}`)\n .set({\n 'User-Agent': 'Awesome-Octocat-App', //mondatory: need an User-Agent as per github documentation)\n 'Accept': 'application/vnd.github.v3.text-match+json'\n })\n .then((res) => {\n return {\n \"json\": JSON.parse(res.text),\n \"pageData\": this.createPageData(queryRequest)\n }\n\n });\n\n }", "title": "" }, { "docid": "6848da230f39650597197024de60899c", "score": "0.55036765", "text": "function getDataFromApi(searchTerm, callback) {\n const settings = {\n q: searchTerm,\n from: '0',\n to: '12',\n app_id: 'cc3ee280',\n app_key: 'e93e9043178ce874680226c6ce8acc49',\n };\n $.getJSON(RECIPE_SEARCH_URL, settings, callback);\n}", "title": "" }, { "docid": "1130dcd634619b07d44b1b28ed002143", "score": "0.55028135", "text": "function ytSearchRequest(ytSearchTerm){ \n // prepare the request\n console.log(\"ytSearchRequest called\");\n //the search.list() is the basic API call to search youTube\n var request = gapi.client.youtube.search.list({\n //pass youTube API parameters to narrow your search: basically like a key:value pair list separated by commas (see below)\n\n //\"part\"--YouTube Data API: the \"part\" parameter included in the API request determines the data you get back in an API response \n part: \"snippet\",\n //\"type\" could be video,channel,playlist, but we are restricting response to only video \n type: \"video\",\n //\"q\" is a very useful/important parameter becasue it tells the youTube API to \n //return only the search results that match the search term(s) that we pass in (basically the youTube site's search field).\n //encodeURIComponent takes the variable and preps it to be passed in URL by applying special codes for non ASCII charaters like spaces between words. \n q: encodeURIComponent(ytSearchTerm).replace(/%20/g, \"+\"),//the replace method will replace what is between the // slashes. \n //with what is in \"\". g (global variable) tells it to do all instances instead of just first one. Non ASCII characters must be\n //URL-escaped when sent to the API. Basically replace %20 (the code for non ASCII \"space\" character) with \"+\" for all instances. \n\n maxResults: 1,\n order: \"viewCount\"\n\n });//end prepare request \n\n // execute the request\n //Once the API request call completes, the client library automatically calls onSearchResponse() below just noted as \"function(response) {\"\n request.execute(function onSearchResponse(response) {\n \n var results = response.result;\n\n $(\"#additionalContent\").html(\"\");\n\n /*Note: this is set up to access more than one video even though we limited our query to just one. It uses the \n $.each(), below, which is a generic iterator function for looping over object, arrays, and array-like objects. \n Plain objects are iterated via their named properties while arrays and array-like objects are iterated via their indices.\n $.each() is essentially a drop-in replacement of a traditional for or for-in loop. \n The each() method specifies a function to run for each matched element. Syntax: $(selector).each(function(index,element)), note: function(index,element) Required. A function to run for each matched element.\n */\n $.each(results.items, function(index, item) {\n //\n //The $.get() method, below, loads data from the server using a HTTP GET request. Syntax: $.get(URL,data,function(data,status,xhr),dataType) URL is required\n // the optional function argument specifies a function to run if the request succeeds.. Additional parameters: data - contains the resulting data from the request\n //gets the tpl file, feeds the data to the tplEmbedUrlVideoIdAndTitle() which looks for the tagged key:value pair (and note value is JSON locations)\n //and appends the output html and embeded url into the specified container. In this case the get passes item.html as arg to function.\n $.get(\"assets/tpl/item.html\", function(baseTplHtmlItem) {\n $(\"#additionalContent\").append(tplEmbedUrlVideoIdAndTitle(baseTplHtmlItem, [{\"title\":item.snippet.title, \"videoid\":item.id.videoId}]));\n console.log(\"the following title and videoId are elements of the Key:Value paired-Obj list to send to tplEmbedUrlVideoIdAndTitle()\");\n console.log(\"title:item.snippet.title: \" + item.snippet.title);\n console.log(\"videoid:item.id.videoId: \" + item.id.videoId);\n });\n });\n\n showResponse(results);//need to work on this to generate JSON in console..\n });//end execute request\n}", "title": "" }, { "docid": "0c5406aefcc6ebd8c6db9cff490323f3", "score": "0.5494353", "text": "function searchArtRijks() {\n const query = $(\".search-input-rijks\").val().trim();\n\n fetch(\"https://www.rijksmuseum.nl/api/nl/collection?key=I0BcbCZL&imgonly=True&ps=100&q=\" + query)\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n console.log(data);\n displayArtRijks(data);\n });\n}", "title": "" }, { "docid": "d4be99fc8d0ab62ca90cde4078671e0d", "score": "0.549108", "text": "function search(){\n const query = `${API_URL}${API_KEY}&query=${inputSearch.value}`;\n axios.get(query)\n .then((res)=>{\n displayResults(res.data.results);\n })\n .catch((error)=>{console.log(error)})\n }", "title": "" }, { "docid": "b77c2a684717cbe1b55928ed9a8ee517", "score": "0.5481562", "text": "function buildRequestURL() {\n searchQuery = document.getElementById('query').value;\n maxResults = document.getElementById('maxResults').value;\n sortBy = document.getElementById('time').checked ? \"time\" : \"relevance\";\n\n const searchObject = {\n key: youTubeAPIKey,\n maxResults: maxResults,\n searchTerms: searchQuery,\n order: sortBy,\n videoId: videoId\n };\n if(searchObject.videoId.length){\n let requestQuery = \"?part=snippet%2Creplies\";\n\n for(let key in searchObject) {\n requestQuery = requestQuery + \"&\" + key + \"=\" + encodeURIComponent(searchObject[key]);\n }\n\n return youTubeGetRequestURL + requestQuery; \n } else {\n return \"\";\n }\n\n}", "title": "" }, { "docid": "be426432159467c6648ac5ca05045c5c", "score": "0.54784775", "text": "function searchItem(req, res, next) {\n var searchTerm = req.query.searchTerm;\n // var otherCids = req.body;\n var cid = mongoose.Types.ObjectId(req.body.decoded_token.orgid);\n var sT = new RegExp(searchTerm, 'i');\n var api = false; // Call origin api or webApp\n sGet.searchItem(sT, cid, api, function(err, response){\n res.json({error: err, message: response});\n });\n }", "title": "" }, { "docid": "98afad8d2278d7cbfbdeec88934db22f", "score": "0.54776293", "text": "async function getPosts(query = {}) {\n\tlet url = API_BASE_URL;\n\t// Change request url if query contains subreddits\n\tif (query.subreddits) {\n\t\turl += `/${query.subreddits}/search.json?`;\n\t\tCURRENT_QUERY = Object.assign({}, CURRENT_QUERY, {subreddits: query.subreddits});\n\t\tdelete query.subreddits;\n\t\tquery.restrict_sr = 'on';\n\t\t// Change request url if query doesn't contains subreddits but search param\n\t} else if (query.q && !query.subreddits) {\n\t\turl += '/search.json?';\n\t\t// Default url\n\t} else {\n\t\turl += '/.json?';\n\t}\n\t// Append extra parameters\n\turl += $.param(query);\n\t// Instantiate a new CacheService class\n\tconst cacheService = new CacheService(url);\n\t// Check if request is cached and return it\n\tif (cacheService.getItem() && !cacheService.expired()) {\n\t\tconst {items} = cacheService.getItem();\n\t\tfillContent(items);\n\t\treturn;\n\t}\n\tconst requestInfo = $('.request-info');\n\t//Send new request\n\ttry {\n\t\trequestInfo.removeClass('hidden').fadeIn();\n\t\tcacheService.removeItem();\n\t\tconst {data: {children, after, before}} = await $.getJSON(url);\n\t\trequestInfo.addClass('hidden').hide();\n\t\t//Populate CURRENT_QUERY to be used for next infinite scroll request\n\t\tObject.assign(CURRENT_QUERY, {after, before});\n\t\t// Cache this new request for future use\n\t\tcacheService.setItemKey(url);\n\t\tcacheService.store(children);\n\t\tfillContent(children);\n\t} catch (e) {\n\t\trequestInfo.addClass('hidden').hide();\n\t\tconsole.log(e.message);\n\t}\n\n}", "title": "" }, { "docid": "33d755dc51ee3135dc349f565a70e5cd", "score": "0.5476728", "text": "function searchWikipedia(event) {\n if (event.key === \"Enter\") {\n spinnerEl.classList.toggle(\"d-none\");\n searchResultEl .textContent=\"\";\n\n let searchInput = searchInputEl.value;\n \n \n let url = \"https://apis.ccbp.in/wiki-search?search=\" + searchInput;\n let options = {\n method: \"GET\"\n };\n \n // making fetch request\n \n fetch(url, options)\n .then(function (response) {\n return response.json();\n })\n .then(function (Data) {\n let {search_results} = Data;\n\n displayResults(search_results);\n });\n }\n\n}", "title": "" }, { "docid": "10eac33e7d240c9c14d3612ca0f1d914", "score": "0.5476043", "text": "function findit(){var e=$(\"#search-text\").val(),t=$(\".search-item\").length+1;if(e.length>=1){$(\".search-content\").show(),$(\".search-filter\").attr(\"data-query\",e),$(\".search-result span\").show().html(\"Searching ...\");var r=\"/feeds/posts/default?max-results=12&start-index=\"+t+\"&alt=json&q=\"+e;$.ajax({type:\"GET\",url:r,async:!0,contentType:\"application/json\",dataType:\"jsonp\",success:function(t){$(\".more-result\").hide(),doSearch(t,e)}})}else $(\".search-content\").hide()}", "title": "" }, { "docid": "e513d16dcba7a3dfcfd73a0ddaf9cdcc", "score": "0.5472779", "text": "function performSearch(query) {\n $rslts.empty();\n const url = `https://en.wikipedia.org/w/api.php?action=opensearch&limit=5&search=${query}&format=json&callback=?`;\n $.getJSON(url, (data) => {\n // Store results in new arrays\n const titles = data[1];\n const infos = data[2];\n const links = data[3];\n // Check for no results\n if (!data[1].length) $rslts.append('<div class=\"entry\"><div class=\"title\">No results found.</div></div>');\n else {\n // Generate HTML for results\n titles.forEach((t, i) => {\n $rslts.append(`\n <div class=\"entry\">\n <div class=\"title\"><a href=\"${links[i]}\" target=\"_blank\">${titles[i]}</a></div>\n <div class=\"info\">${infos[i]}</div>\n </div>\n `);\n });\n }\n })\n .done(() => {\n // Display all results smoothly\n $rslts.append(`Retrieved from: ${url}<br>`);\n $rslts.removeClass('fadeOutUp').addClass('fadeInDown');\n toggleSearch(true);\n })\n .fail(() => {\n // If applicable, display error message and re-enable search button\n $rslts.append('<div class=\"entry\"><div class=\"title\">An error has occurred. Please try again later.</div></div>');\n toggleSearch(true);\n });\n }", "title": "" }, { "docid": "a7c90c0cc10de64e4eb6414fb779551f", "score": "0.54660714", "text": "signin(req, res) {\n // const REDDIT_CLIENT_ID = 'qJJABT26HPg5Sw';\n\n // // Getting the reddit sub from the POST body request\n // const redditSub = 'whatcarshouldIbuy';\n\n // // Creating Body for the POST request which are URL encoded\n // const params = new URLSearchParams()\n // params.append('grant_type', APP_ONLY_GRANT_TYPE)\n // params.append('device_id', 'DO_NOT_TRACK_THIS_DEVICE')\n\n // // Trigger POST to get the access token\n // const tokenData = fetch(REDDIT_ACCESS_TOKEN_URL, {\n // method: 'POST',\n // body: params,\n // headers: {\n // 'Content-Type': 'application/x-www-form-urlencoded',\n // 'Authorization': `Basic ${Buffer.from(`${REDDIT_CLIENT_ID}:`).toString('base64')}` // Put password as empty\n // }\n // }).then(res => res.json()).then(res => console.log('res', res))\n\n // if (!tokenData.error) {\n // // Fetch Reddit data by passing in the access_token\n // const trendData = fetchRedditTrendingData(redditSub, tokenData.access_token)\n \n // // Finding just the title of the post\n // const trendingResult = trendData.data.children.map(\n // child => child.data.title\n // )\n \n // res.send(trendingResult)\n // }\n\n // r.getSubreddit('whatcarshouldIbuy').then(res => console.log('res', res));\n // r.getSubreddit('AskReddit').getWikiPage('bestof').content_md.then(console.log).catch(err => console.log('errror', err));\n r.getSubreddit('whatcarshouldIbuy').getTop({time: 'all'}).then(data => res.json(data));\n }", "title": "" }, { "docid": "4264d88bc0c8e31b3a5ab89564404fcb", "score": "0.54648864", "text": "function searchMovies(searchTerm){\n return fetch(`${url}${searchTerm}`)\n .then(response => response.text());\n}", "title": "" }, { "docid": "4dd133f043a7f5b12420bc5dde749dd9", "score": "0.5443349", "text": "function displayRedditData(data) {\n searchData = data;\n\n REDDIT_RESULTS.ready(function () {\n $('#load-reddit').addClass('hidden');\n });\n\n displayRedditNextPage = function () {\n currentCount += data.data.dist\n getNextFromReddit(TERM.val(), displayRedditData, data.data.after, currentCount);\n };\n displayRedditPrevPage = function () {\n currentCount -= data.data.dist\n getPrevFromReddit(TERM.val(), displayRedditData, data.data.before, currentCount);\n };\n\n const results = data.data.children.map((item, index) => renderRedditResults(item));\n\n if (data.data.children.length > 0) {\n REDDIT_RESULTS.html(results);\n REDDIT_BUTTONS.removeClass('hidden');\n }\n else {\n REDDIT_RESULTS.html(`Oops, no results found for ${TERM.val()}.`);\n };\n}", "title": "" }, { "docid": "5d465be435aced57b04c61e723319a5f", "score": "0.54375935", "text": "function lookUpGymClassReviewGET(search) {\n let searchTerm = search.replace(\"class\",\"\")\n let settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://snshealthie.herokuapp.com/api/v2/classes/\"+searchTerm+\"/reviews/\",\n \"method\": \"GET\",\n \"headers\": {\n \"authorization\": \"Token ced12082a40905503ad2ad29367aeafb824ed2b8\",\n }\n }\n $.ajax(settings).done(function (response) {\n renderSelectedGymClassReviews(response)\n });\n}", "title": "" }, { "docid": "11bb01569ea7e9e3237a8d4d83f6c22f", "score": "0.54262894", "text": "function redEmbedCallback(settings){\nreturn (query) => {\n reddit.search(query).sort(\"relevance\").fetch((res) => {\n for(post of res.data.children){\n const cur = post.data\n console.log(cur)\n const modern_requirement = cur.title.startsWith(query) && cur.link_flair_text == 'Episode' && cur.subreddit == 'anime' && cur.author == 'AutoLovepon'\n const legacy_requirement = cur.title.startsWith('[Spoilers] '+query) && cur.subreddit == 'anime'\n if(modern_requirement || legacy_requirement){\n red.embed(cur.url+'about.json', embed_div,\n {\n show_post: settings['show-post'],\n show_post_title: settings['show-post-title'],\n show_post_header: settings['show-post-header'],\n show_post_body: settings['show-post-body'],\n ignore_sticky_comments: !settings['show-sticky-comments'],\n show_comments_section_header:settings['show-comment-header'],\n post_author: 'AutoLovepon',\n initial_padding: 0,\n })\n console.log(\"FOUND POST\")\n console.log(cur.url+'about.json');\n break;\n }\n }\n })\n }\n}", "title": "" }, { "docid": "f9037155304f8c8a082b74d0ac20eab1", "score": "0.542452", "text": "function getDataFromApi (searchTerm, callback){\n const settings = {\n url: YouTube_Search_URL,\n data: {\n q: `${searchTerm}`,\n part: 'snippet',\n key: \"AIzaSyBXjnIeLhAmsGhwe7XQePKmHvCL1J_DEMM\",\n per_page: 3\n\n },\n dataType: 'json',\n type: \"GET\",\n success: callback\n };\n $.ajax(settings);\n}", "title": "" }, { "docid": "40bbc8e4189b10671e8544577f9c1f65", "score": "0.5422792", "text": "function apiSearch(event) {\n let inputText = document.querySelector('#search-text');\n const inputValue = inputText.value;\n let server = link + inputValue;\n\n event.preventDefault();\n inputText.value = '';\n outPage.innerHTML = `\n <div class=\"lds-roller\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n `;\n\n requestApi('GET', server)\n .then(function(result) {\n const output = JSON.parse(result);\n let inner = '';\n output.results.forEach((el) => {\n let nameItem = el.name || el.title;\n inner += `<div class=\"col-12 col-md-4\">${nameItem}</div>`;\n });\n\n outPage.innerHTML = inner;\n })\n .catch(function(err) {\n outPage.innerHTML = 'Ooops...something wrong!!!';\n console.error('Error ' + err.status);\n });\n}", "title": "" }, { "docid": "054335806c34ef608a301f6ef1f1b70a", "score": "0.5422402", "text": "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "title": "" }, { "docid": "d88f63275ac8eea434e7126f6fb30503", "score": "0.54212034", "text": "function pullURL(searchTerm,songPost,newline){\n\tvar link; \n\tconsole.log(\"Running Genius Search\")\n\tgenius.search(searchTerm).then(function(response){\n\t\tif (response.hits != undefined){\n\t\t\tconsole.log(\"A Response was Generated\")\n\t\t\tlink = lodash.cloneDeep(response.hits[0].result.url);\n\t\t\tnewline= newline + \" The lyrics to this song are at: \" + link + \"\\n\" ;\n\t\t\tfsAppend(newline)\n\t\t\tconsole.log(\"The Lyrics to this song are at: \" + link);\n\t\t\t//postComment(link, songPost);\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"Response was Undefined\");\n\t\t}\n\t}); \n}", "title": "" }, { "docid": "ef8f0b927ff9ab02b47c7e4ec8d1d379", "score": "0.5419901", "text": "function getDataFromApi(searchTerm, callback) {\n const settings = {\n url: RECIPE_API_URL,\n data: {\n ingredients: `${searchTerm}`,\n limitLicense: false,\n number: 6,\n ranking: 1 \n },\n dataType: 'json',\n type: 'GET',\n success: callback,\n error: function(){\n displayErrorMessage();\n }, \n beforeSend: function(xhr) {\n xhr.setRequestHeader(\"x-rapidapi-key\", \"5OwL4zKjcQmshdc2qr09G6IUI239p1e9ko6jsn3hlzc9RPzdH4\");}\n };\n\n $.ajax(settings);\n}", "title": "" }, { "docid": "8e29f2363599f24c8b0a13d8c1e227e6", "score": "0.54154766", "text": "search (term) {\n console.log(`${term} was searched`);\n // post github username to server\n axios.post('/repos', {term: term})\n .then(res => {\n console.log('Completed POST request');\n this.updateRepos();\n })\n .catch(err => {\n console.log(err);\n // throw err;\n })\n }", "title": "" }, { "docid": "af13ae11cdeab8578565d0d0c3adc95c", "score": "0.5411624", "text": "function GetResults(term) {\r\n $('input.dirty').val(''); //clear input field\r\n GetSearch.getWiki(term).success(function(data) {\r\n Render(data);\r\n });\r\n }", "title": "" }, { "docid": "a4d02b14641b03b0b44910c0862142b9", "score": "0.54022557", "text": "function searchRecipe(input) {\n let apiKey = \"180a86cfb935bc89c556dfbb06e5ffda\";\n let recipeURL = \"https://edamam-recipe-search.p.rapidapi.com/search?q=\" + input + \"&rapidapi-key=\" + apiKey;\n\n $.ajax({\n url: recipeURL,\n method: \"GET\"\n }).then(function(response) {\n // Switches to results page\n location.href = \"./Pages/results.html\";\n\n console.log(response);\n console.log(response.hits);\n\n // Set results to local storage\n localStorage.setItem(\"recipes-list\", JSON.stringify(response.hits.splice(0, 10)));\n })\n }", "title": "" }, { "docid": "ce9214dbeb2f20c3280bcb9f69dec523", "score": "0.5392291", "text": "function doSearch(xurl, response) {\n\tvar matchingExpressions = xurl.match(/[a-zA-z0-9]*$/); // pulls search term out of URL\n\tvar requestedURL = \"https://duckduckgo.com/html/?q=\"+matchingExpressions[0]+\"&ia=web\"; //creates proper search URL\n\tcallExec(requestedURL,response); // executes curl with proper URL\n}", "title": "" }, { "docid": "9d6b57a562d0d7bdd2e5c0d5d3012075", "score": "0.53896403", "text": "function getDataFromApi(searchTerm, callback) {\n \t const request = {\n \t\tpart: 'snippet',\n \t\tkey: 'AIzaSyBYaKcbWdhwz6AZcyejQ835sSUiTWR8BAo',\n \t\tq: searchTerm,\n \t\tmaxResults: 25\n \t}\n $.getJSON(thinkfulTubeSearchURL, request, callback); \n}", "title": "" }, { "docid": "039431d25ab983673c04707b8df0e97d", "score": "0.538395", "text": "searchByDescription(userInput) {\n // searches API list by description\n return fetch(`https://api.publicapis.org/entries?description=${userInput}`)\n .then(data => data.json());\n }", "title": "" }, { "docid": "ed59a24094783bd1424a4b8fb830ee5d", "score": "0.5383678", "text": "function getRequest(searchTerm) {\n $.getJSON(\"https://www.googleapis.com/youtube/v3/search\", {\n \"part\": \"snippet\",\n \"key\": \"AIzaSyAragdDZXDXqbtyG43Tv0do3z1JCxEuI_A\",\n \"q\": searchTerm,\n \"type\": \"video\"\n },\n function (data) {\n // If there are no results it will just empty the list\n if (data.pageInfo.totalResults == 0) {\n alert(\"No videos found!\");\n }\n //if there are results, call the displaySearchResults\n displaySearchResults(data.items);\n }\n );\n }", "title": "" }, { "docid": "e5ac7177f9ff15a33dc883a90370cf07", "score": "0.53832185", "text": "function query_search(search_str, resolve,reject,callback,try_count) {\n //console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,search_str,try_count); },\n onerror: function(response) { reject(\"Fail\"); },\n ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "eac0840ce7a504b8e588f8e573ebd41a", "score": "0.5382405", "text": "function searchDicio(search, callback)\n{\n const word = search.word;\n\n request(\n { url: search.address, encoding: 'binary' },\n function(err, resp, body)\n {\n if (!err && resp.statusCode == 200)\n {\n const $ = cheerio.load(body);\n\n if ($('#content h1.norp').length == 0)\n {\n let type = $($('#content .cl')[0]).text();\n callback(null, { word: word, result: type });\n }\n else\n {\n const results = $('ul.resultados li a');\n const words = [];\n\n for (let i = 0; i < results.length; i++)\n {\n words.push({\n word: $(results[i]).text(),\n address: $(results[i]).attr('href')\n });\n }\n\n callback(null, words);\n }\n }\n else callback(err || 'Status code ' + resp.statusCode);\n }\n );\n}", "title": "" }, { "docid": "8043ac2a25064109de3ce560240fdc76", "score": "0.53807074", "text": "function search(){\n $(\"#content\").html(\" \");\n let title = $(\"#title\").val();\n let artist = $(\"#artist\").val();\n \n if(!title || !artist) {\n $(\"#content\").text(\"You must provide a title AND artist\");\n return;\n }\n\n let type = \"GET\"; // form.method\n let url = URL + artist.replace(\" \", \"%20\") + \"/\" + title.replace(\" \", \"%20\") + \"?apikey=\" + APIKEY; // form.action\n let data = {};\n\n ajax(type, url, data, function(response, xhr){\n jsonLoaded(response);\n });\n}", "title": "" }, { "docid": "768160a13cda73a589978897903f1302", "score": "0.5374556", "text": "function _scrapeReddit() {\n console.log(\"begin scrape\");\n toDoService.webScrape().then(_scrapeSuccess, _scrapeFail);\n }", "title": "" }, { "docid": "3d59fb55f99500133a6722dc9d36f989", "score": "0.537024", "text": "function search() {\r\n\t var q = $('#query').val();\r\n\t var request = gapi.client.youtube.search.list({\r\n\t q: q,\r\n\t part: 'snippet',\r\n\t type: 'video',\r\n\t maxResults: 12\r\n\t });\r\n\t\r\n\t request.execute(function(response) {\r\n\t str = JSON.stringify(response.result);\r\n\t // $('#search-container').html('<pre id=\"jsonValue\">' + str + '</pre>');\r\n\t\tjsonStr = str;\r\n\t\tjsonObj = JSON.parse(jsonStr);\r\n\t\t\r\n\t\tinit();\r\n\t })\r\n\t}", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.53700614", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.53700614", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.53700614", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.53700614", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.53700614", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "f80809851b0f7b87fbf82757b83bff93", "score": "0.5368712", "text": "async function sendRecipeApiRequest(query){\n let APP_ID = \"21953171\"\n let API_KEY = \"5c7211cc5a2425475adb7aad9566ed54\"\n\n \n let url = `https://api.edamam.com/search?app_id=${APP_ID}&app_key=${API_KEY}&q=${query}&to=${num_items}`\n console.log(\"recipe: \" + url)\n\n let response = await fetch(url);\n let data = await response.json()\n useRecipeApiData(data)\n}", "title": "" }, { "docid": "7fa7ff325e90c4c0d1c6163fca0bcd66", "score": "0.5364246", "text": "function watchSubmit() {\n $('.js-search-form').submit(event => {\n event.preventDefault(); // this line prevents the default submit behavior and keep the submitted value within our program\n\n /* this gets the entire value of the js-query class (the input: a very complicated scary looking set of infinite-seeming nested nodes)... */\n let queryTarget = $(event.currentTarget).find('.js-query');\n\n /* ... and this gets the actual string from that scary nest of nodes (the actual word(s) the user input in the search form) */\n let query = queryTarget.val();\n\n /* clear the user input out of the form, so it's ready for the next search */\n queryTarget.val(\"\");\n\n /* this is the part of the function that gets the data from the API and displays it. we callback the function getDataFromApi, which has two parameters: 1) query, which is defined abo ve as the string the user input; and 2) displayYouTubeSearchData, which will index through the data we get and render it, itself calling back the renderResults function */\n getDataFromApi(query, displayYouTubeSearchData);\n });\n}", "title": "" }, { "docid": "dbad9d4a681ab43d5a6648b236525c43", "score": "0.5350247", "text": "function lyricsSearchRequest(ytSearchTerm) {\n setTimeout(function(){\n // Constructing a queryURL\n var artist = ytSearchTerm;\n console.log(\"artist for Lyrics query: \" + artist);\n\n var song = $('#song-title').text();\n console.log(\"song for Lyrics query: \" + song);\n var queryURL = \"http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=\" + artist + \"&song=\" + song + \"&format=XML\";//changes from json to xml\n \n console.log(\"lyricsSearchRequest queryURL: \" + queryURL);\n // Performing an AJAX request with the queryURL\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n // After data comes back from the request\n .done(function(response) {\n console.log(response);\n console.log(queryURL);\n\n var xmlFindLyrics = $(response).find(\"Lyric\").text();\n console.log(\"jQuery xml find: \" + xmlFindLyrics);\n\n populateLyrics(xmlFindLyrics);//\n });\n }, 1000);//delay so that youTube title is returned\n}", "title": "" }, { "docid": "204b41072b14b1273f6fdb31958a9987", "score": "0.5347835", "text": "function search(){\n const searchLink = `${apiUrl}/suggest/${searchItem.value}`;\n fetch(searchLink)\n .then(response => response.json())\n .then(songs => showResult(songs.data.slice(0,10)))\n .catch(e => {});\n }", "title": "" }, { "docid": "41f81ad3dcb6ef81ef04a31b63f9133f", "score": "0.53470314", "text": "function searchChannelsByName() {\n string = $('.inputSearchChannel').val();\n $.ajax({\n url: 'https://www.googleapis.com/youtube/v3/search',\n dataType: 'json',\n method: 'get',\n data: {\n key: \"AIzaSyAOr3VvEDRdI5u9KGTrsJ7usMsG5FWcl6s\",\n q: string,\n type: 'channel',\n part: 'snippet',\n maxResults: 10\n },\n success: function (data) {\n console.log('Youtube success',data);\n },\n error: function (data) {\n console.log('something went wrong with YT', data);\n }\n })\n}", "title": "" }, { "docid": "eb0991b49cae4378448616296749ca52", "score": "0.53424513", "text": "function getRequest(searchTerm) {\n var url = 'https://www.googleapis.com/youtube/v3/search';\n var params = {\n part: 'snippet',\n key: 'AIzaSyAMACXViqRIg-JUBahLgXauOQBkBKM63Ik',\n q: searchTerm + \"travel\",\n maxResults: 10\n\n };\n\n $.getJSON(url, params, showResults);\n}", "title": "" }, { "docid": "99f12996bde11ff062c65e6b5de85869", "score": "0.5337473", "text": "function suggest(query) {\n //if the search term is empty, clear the suggestion box.\n if (query === \"\") {\n suggestionBoxObj.innerHTML = \"\";\n return;\n }\n\n //proceed only if the search term isn't empty\n // open an asynchronous request to the server.\n xmlHttp.open(\"GET\", \"podcast_search.class.php?q=\" + query, true);\n\n //handle server's responses\n xmlHttp.onreadystatechange = function () {\n // proceed only if the transaction has completed and the transaction completed successfully\n if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {\n // extract the JSON received from the server\n var titles = JSON.parse(xmlHttp.responseText);\n //console.log(titlesJSON);\n // display suggested titles in a div block\n displayTitles(titles);\n }\n };\n\n // make the request\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "abb116c484734bee9df88d4255fb1c4e", "score": "0.5336024", "text": "function wikiSearch(name){\n\tname = name_format(name)\n\t//Url for the wiki search: name is the search term\n\tvar url = \"https://en.wikipedia.org/w/api.php?action=opensearch&search=\"+ name.replace(\" \", \"%20\") +\"&format=json&callback=?\";\n\n\t$.ajax({\n\t\turl: url,\n\t\ttype: \"GET\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(results, status){\n\t\t\tif (results[1].length > 0){\n\t\t\t\tlink = results[3][0]\n\t\t\t} else {\n\t\t\t\tlink = \"No results found!\"\n\t\t\t}\n\t\t},\n\t\terror: function(results, status, xhr){\n\t\t\tconsole.log(status)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f4daa674405ad2e7b2af470142e96c99", "score": "0.5334954", "text": "function getNews(searchTerm, maxResults=10) {\n console.log(\"search terms for getNews \", searchTerm)\n const params = {\n q: searchTerm,\n c: maxResults\n }\n const queryString = formatQueryParams(params)\n const url = searchURL + '?' + queryString + '&fo=json';\n console.log(\"newspaper search \", url);\n spinner.removeAttribute('hidden');\n fetch(url)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => {\n displayResults(responseJson)\n getLocations(responseJson)\n spinner.setAttribute('hidden', '');\n }) \n .catch(err => {\n $('#js-error-message').text(`Something went wrong: ${err.message}`);\n })\n}", "title": "" }, { "docid": "5f0cf580f27f717b2b3d81592dfe2b1f", "score": "0.5333747", "text": "search(query) {\n console.log('Execute search with term: ' + query);\n fetch(`/search/${query}`)\n .then(res => res.json())\n .then(res => this.result = res)\n .catch(console.error);\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.5327191", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "24c36086371494046092c9b943180ade", "score": "0.53271514", "text": "function triggerSearchByCategory(inputTerm) {\n $('.git-div, .youtube-div').css('display', 'none');\n $('.pub-api-div').css('display', 'block');\n getDataFromApiByCategory(inputTerm, displayResults);\n}", "title": "" }, { "docid": "4887857b6885042ed854a10949b673b1", "score": "0.53243643", "text": "getSearchTerms() {\n runTheContent((accessToken) => {\n fetch(\n `https://youtubeanalytics.googleapis.com/v2/reports?dimensions=insightTrafficSourceDetail&endDate=${todaysDate}&filters=video%3D%3D${this.props.selectedVideoId}%3BinsightTrafficSourceType%3D%3DYT_SEARCH&ids=channel%3D%3DMINE&maxResults=10&metrics=views&sort=-views&startDate=2005-07-01&key=${web.apiKey}`,\n {\n method: 'GET',\n headers: {\n 'Content-type': 'application/json',\n Authorization: 'Bearer ' + accessToken\n }\n }\n )\n .then((response) => response.json())\n .then(\n (response) => {\n if (!response.rows[0]) {\n this.setState({\n keyWord: 'N/A'\n });\n } else {\n this.setState({\n keyWord: response.rows[0][0]\n });\n }\n },\n function(err) {\n console.error('Execute error', err);\n }\n );\n });\n }", "title": "" }, { "docid": "c87ca09986df25fb381a601492d6b57f", "score": "0.5324168", "text": "function searchRecipe(searchTerms){\n\tvar searchURL = 'https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByIngredients?fillIngredients=false&limitLicense=false&number=8&ranking=1&ingredients=';\n\tvar searchRecipeURL = searchURL + searchTerms;\n\n\t// linking to the API\n\t$.ajax({\n\t url: searchRecipeURL,\n\t type: 'GET',\n\t dataType: 'json',\n\t error: function(err) {\n\t \tconsole.log(err);\n\t },\n\t success: function(data) {\n\t \tconsole.log((data));\n\n\t \tvar titleArray = []; // to store the titles\n\t \tvar imageArray = []; // to store the image URLs\n\t \tvar idArray = []; // to store the ID of the recipes\n\t \t// storing the titles and images into arryas\n\t \tfor (var i = 0; i < data.length; i++){\n\t \t\ttitleArray[i] = data[i].title;\n\t \t\timageArray[i] = data[i].image;\n\t \t\tidArray[i] = data[i].id;\n\t \t}\n\t \t// console.log(titleArray, imageArray);\n\t \tconsole.log(idArray);\n\n\t \t// displaying the titles and images\n\t \tshowOptions(titleArray, imageArray, idArray);\n\t },\t \n\t beforeSend: function(xhr) {\n\t \txhr.setRequestHeader(\"X-Mashape-Authorization\", \"W4hzvJK9cgmshrPeTgNZP2ZeEw3np1GYKJNjsn6uhr4nJKJVyJ\");\n\t }\n\t});\n}", "title": "" }, { "docid": "57d9b6b36fa4229c5540efdaa7aa0bf4", "score": "0.5323128", "text": "search(searchTerm) {\n this.setState({\n searchTerm: searchTerm,\n searchResults: null,\n displayType: \"search\",\n selectedRecipe: null\n })\n\n // Build the URL for the search\n let apiSearchUrl = 'https://api.edamam.com/search'\n + '?q=' + searchTerm\n + '&health=vegan'\n + '&to=20'\n + '&app_id=65b44741&app_key=dd81ed343eac181f1a75a52d6aa2cdfc';\n\n // Call the URL to run the search\n fetch(apiSearchUrl)\n .then(response => {\n // Handle the response from the search\n if (!response.ok) {\n throw new Error('HTTP error, status = ' + response.status);\n } else {\n return response.json();\n }\n })\n .then(recipeJson => {\n // Handle the JSON content from the search result\n // Convert the response from the API to the expected internal format.\n let searchResultsFromAPI = recipeJson.hits.map(hit => {\n let recipe = hit.recipe;\n return {\n id: recipe.uri,\n name: recipe.label,\n picSrc: recipe.image,\n ingredients: recipe.ingredientLines,\n url: recipe.url, // link to original recipe description\n favourite: this.isFavourite(recipe.uri)\n }\n })\n console.log(\"Search result = \", recipeJson, searchResultsFromAPI)\n this.setState({searchResults: searchResultsFromAPI})\n });\n }", "title": "" }, { "docid": "3a9c0d8ab37d5d91eb095b730c482e39", "score": "0.53142095", "text": "function getResults(){\n var searchTerm = document.getElementById('search-term').value;\n ajaxGet('https://www.omdbapi.com/?s=' + searchTerm, function(err, data){\n if(err){\n console.error(err);\n }\n else{\n movSrch.data = data.Search;\n buildApiReturnView(movSrch.data);\n }\n });\n}", "title": "" }, { "docid": "ea2639cc32320297444a3b3a6d361e26", "score": "0.5311869", "text": "function doneTyping() {\n var str = $('#keywordBlank').val();\n if (str.length > 2) {\n // console.log('request')\n var request = str.split(\"# \").pop().trim();\n if (request.length > 0) {\n $.get('/getRelatedTag', {\n keyword: request,\n }, (data) => {\n var tmp = \"\"\n for (var i = 0; i < data.length; ++i) {\n tmp = tmp + \"&nbsp#&nbsp\" + data[i];\n }\n $('#relatedTag').html(tmp)\n })\n }\n }\n else {\n $('#relatedTag').html('')\n }\n}", "title": "" }, { "docid": "20d1a8ce2a3278d01ade3c525dfe0f5b", "score": "0.530777", "text": "function recipe_search(textQuery, offset) {\n //string, array, returns a datastore of results of Yummly API call \n var searchURL = generateSearchURL(textQuery, global.searchIngredients, offset);\n if (searchURL === undefined) {\n console.log(\"error no search params\");\n return;\n }\n $(\"html\").addClass('busy');\n $.ajax({\n type: \"GET\",\n url: searchURL,\n dataType: \"jsonp\",\n success: function (data) {\n $(\"#searchText\").css(\"background-image\", \"none\");\n //call display results\n global.currentQuery = textQuery;\n display_results(data);\n $(\"html\").removeClass('busy');\n }\n });\n}", "title": "" }, { "docid": "398f6c71c41e765d8a61c23b76964e46", "score": "0.5306078", "text": "search(term){\n Spotify.search();\n }", "title": "" }, { "docid": "27adfe4595b8083def727f4826d3316c", "score": "0.53017515", "text": "function wikiApiRequest(){\n return function(){\n //get the value of the input field\n var inputVar = document.getElementById(\"input-text\").value;\n //api call set-up\n var endPoint = \"https://en.wikipedia.org/w/api.php\";\n var format = \"?format=json\";\n var action = \"&action=query\";\n var extract = \"&prop=extracts&exintro=\"\n var options = \"&origin=*&list=search&srsearch=\"\n var apiCall = endPoint + format + action + extract + options + inputVar;\n\n //do something with it\n getJSON(apiCall).then(function(results){\n var output = document.getElementById(\"results\");\n output.innerHTML = \"\";\n console.log(results.query.search);\n for(var key in results.query.search) {\n var pageTitle = results.query.search[key].title;\n var pageSnip = results.query.search[key].snippet;\n console.log(results.query.search[key].title);\n output.innerHTML += \"<a href='https://en.wikipedia.org/wiki/\" + pageTitle + \"'><div class='entry'><h1 class='title'>\" + pageTitle + \"</h1><p class='snip'>\" + pageSnip + \"</p></div></a>\"\n }\n\n });\n //reset the form\n document.getElementById(\"search\").reset();\n return false;\n }\n}", "title": "" }, { "docid": "f2f31b1aa363f3bf6298f72da16fd7fa", "score": "0.5292784", "text": "function search() {\n var search = search_input.val();\n var url = search_input.attr(\"data-url\");\n\n var tags = [];\n search_tags.each(function (i, obj) {\n if ($(this).is(\":checked\")) {\n tags.push($(this).attr(\"id\"));\n }\n });\n\n // Send a request to receive the attractions filtered by the given search text and tags\n $.get(\n url,\n {\"search\": search, \"tags\": tags},\n function (data) {\n $(\"#search-results\").html(data)\n }\n )\n }", "title": "" }, { "docid": "2f9f03fb5b4014c9190d78e6b8807310", "score": "0.5291435", "text": "async function searchNews(q) {\n q = encodeURIComponent(q);\n const response = await fetch(`https://bing-news-search1.p.rapidapi.com/news/search?\nfreshness=Day&TextFormat=Raw&safeSearch=Strict&q=${q}`, {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-host\": \"bing-news-search1.p.rapidapi.com\",\n \"x-rapidapi-key\": \"7524f85dbemshd8e9a46a7ec54b5p1a5e92jsn2fa328630e87\",\n \"x-bingapis-sdk\": \"true\"\n }\n });\n const body = await response.json();\n return body.value;\n}", "title": "" }, { "docid": "a0357f989cc39f0fc83565d399eff883", "score": "0.5287242", "text": "function searchOmdb(queryTerm){\n //generate the queryUrl with the apikey (global variable), query term (argument), limit (global variable), and ratings (global variable)\n const queryUrl = `https://www.omdbapi.com/?apikey=${omdbApoKey}&t=${queryTerm}&plot=${plot}`;\n\n //use the newly created queryUrl to fetch the requested movie from omdb\n fetch(queryUrl)\n\n //magic LOL - really though here we are converting the response to json via a method that i have not learned about yet \n .then(response => {\n return response.json();\n })\n\n //after we converted the data to an actual object then we can work with it\n .then(responseJson => {\n console.log(responseJson);\n createMovieView(responseJson);\n })\n}", "title": "" }, { "docid": "03e69176268e942e49d43385755b34df", "score": "0.5279681", "text": "function parseSearchResults(jsonData) {\n\tif (jsonData['error'] || jsonData['warning']) {\n\t\t// either a warning or an error are a bit fatal so we stop right here\n\t\ttarget.style.display = \"none\";\n\t\treturn;\n\t}\n\t// if we have no results there is no need to continue\n\tif (jsonData['results'] == null || jsonData['results'].length == 0) {\n\t\tsearchData = new Array();\n\t\tlastHitCount = 0;\n\t\tprintTags(null);\n\t\treturn;\n\t}\n\t// this will make sure we invalidate the query.\n\tquery = jsonData['query'];\n\t// add this term to the query list\n\tupdateQueryListCache(query);\n\tvar re = /\\s/; \n\tvar patterns = query.toLowerCase().split(re);\n\tvar plen = patterns.length;\n\tvar target = document.getElementById(\"layout-search\");\n\tvar type = target.getElementsByTagName(\"select\")[0].value;\n\t// we need to take care of repititions\n\tvar results = new Array();\n\tvar tmp = new Array(); // array for valid tags\n\tvar tmpSearchData = jsonData['results'];\n\tvar tmpObject = new Object();\n\t// indicates whether or not we have types, default is false\n\tvar typeSearch = false;\n\t// order by which we want prioritize the results\n\tvar orderArray = null;\n\t// relation key for when we are searching by types\n\tvar relKey = \"\";\n\tswitch(type) {\n\t\tcase \"mangalist\": typeSearch = true; relKey = \"mangaid\"; orderArray = [\"4\",\"2\",\"3\"]; break;\n\t\tcase \"animelist\": typeSearch = true; relKey = \"aid\"; orderArray = [\"4\",\"2\",\"3\"]; break;\n\t\tcase \"characterlist\": typeSearch = true; relKey = \"charid\"; orderArray = [\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]; break;\n\t\tcase \"collectionlist\": typeSearch = true; relKey = \"collectionid\"; orderArray = [\"2\",\"3\"]; break;\n\t\tcase \"creatorlist\": typeSearch = true; relKey = \"creatorid\"; orderArray = [\"2\",\"3\",\"4\",\"5\",\"6\",\"7\"]; break;\n\t\tcase \"songlist\": typeSearch = true; relKey = \"songid\"; orderArray = [\"2\",\"3\"]; break;\n\t\tcase \"animetags\":\n\t\tcase \"chartags\":\n\t\tcase \"clublist\": typeSearch = true; relKey = \"clubid\"; orderArray = [\"2\"]; break;\n\t\tcase \"userlist\": typeSearch = true; relKey = \"uid\"; orderArray = []; break;\n\t\tcase \"grouplist\": // groups need pre-processing because of the short and long names\n\t\t\tfor (var n = 0; n < tmpSearchData.length; n++) {\n\t\t\t\tvar name = tmpSearchData[n]['name'];\n\t\t\t\tvar shortName = tmpSearchData[n]['shortname'];\n\t\t\t\ttmpSearchData[n]['name'] = name + \" (\"+shortName+\")\";\n\t\t\t}\n\t\t\ttypeSearch = true; relKey = \"id\"; orderArray = []; break;\n\t\t\tbreak;\n\t}\n\tlastSearch\n\tif (typeSearch) {\n\t\t// for anime and char results we do special handling\n\t\t// we group by aid/charid first, then by title type\n\t\t// just take care or remove repetitions\n\t\tvar deflangid = jsonData['deflangid'] || 0;\n\t\tsearchTypeDefaultLanguageId = deflangid;\n\t\tfor(var n = 0; n < tmpSearchData.length; n++) {\n\t\t\tif (type == \"songlist\") tmpSearchData[n]['song_type'] = \"Song\";\n\t\t\tif (type == \"userlist\") {\n\t\t\t\ttmpSearchData[n]['type'] = \"1\";\n\t\t\t\ttmpSearchData[n]['user_type'] = tmpSearchData[n]['role'];\n\t\t\t}\n\t\t\tvar topGroup = tmpObject[tmpSearchData[n][relKey]];\n\t\t\tif (topGroup == null) {\n\t\t\t\ttopGroup = new Object();\n\t\t\t\ttopGroup['link'] = tmpSearchData[n]['link'];\n\t\t\t\tif (tmpSearchData[n]['picurl'] != null) topGroup['picurl'] = tmpSearchData[n]['picurl'];\n\t\t\t\tif (tmpSearchData[n]['restricted'] != null) topGroup['restricted'] = tmpSearchData[n]['restricted'];\n\t\t\t\tif (tmpSearchData[n]['is_spoiler'] != null) topGroup['is_spoiler'] = tmpSearchData[n]['is_spoiler'];\n\t\t\t\tif (tmpSearchData[n][jsonData['type']+'_type'] != null) topGroup['type'] = tmpSearchData[n][jsonData['type']+'_type'];\n\t\t\t\tif (tmpSearchData[n]['eps'] != null) topGroup['eps'] = tmpSearchData[n]['eps'];\n\t\t\t\tif (tmpSearchData[n]['rating'] != null) topGroup['rating'] = tmpSearchData[n]['rating'];\n\t\t\t\tif (tmpSearchData[n]['votes'] != null) topGroup['votes'] = tmpSearchData[n]['votes'];\n\t\t\t\tif (tmpSearchData[n]['year'] != null) topGroup['year'] = tmpSearchData[n]['year'];\n\t\t\t\tif (tmpSearchData[n]['chapters'] != null) topGroup['chapters'] = tmpSearchData[n]['chapters'];\n\t\t\t\tif (tmpSearchData[n]['volumes'] != null) topGroup['volumes'] = tmpSearchData[n]['volumes'];\n\t\t\t\tif (tmpSearchData[n]['birthdate'] != null && tmpSearchData[n]['birthdate'] != \"\") topGroup['birthdate'] = tmpSearchData[n]['birthdate'];\n\t\t\t\tif (tmpSearchData[n]['deathdate'] != null && tmpSearchData[n]['deathdate'] != \"\") topGroup['deathdate'] = tmpSearchData[n]['deathdate'];\n\t\t\t\tif (tmpSearchData[n]['founded'] != null) topGroup['founded'] = tmpSearchData[n]['founded'];\n\t\t\t\tif (tmpSearchData[n]['age'] != null) topGroup['age'] = tmpSearchData[n]['age'];\n\t\t\t\tif (tmpSearchData[n]['gender'] != null && tmpSearchData[n]['gender'] != \"-\") topGroup['gender'] = tmpSearchData[n]['gender'];\n\t\t\t\tif (tmpSearchData[n]['bloodtype'] != null && tmpSearchData[n]['bloodtype'] != \"-\") topGroup['bloodtype'] = tmpSearchData[n]['bloodtype'];\n\t\t\t\tif (tmpSearchData[n]['state'] != null) topGroup['state'] = tmpSearchData[n]['state'];\n\t\t\t\tif (tmpSearchData[n]['membercnt'] != null) topGroup['membercnt'] = tmpSearchData[n]['membercnt'];\n\t\t\t\tif (tmpSearchData[n]['commentcnt'] != null) topGroup['commentcnt'] = tmpSearchData[n]['commentcnt'];\n\t\t\t\tif (tmpSearchData[n]['tracks'] != null) topGroup['tracks'] = tmpSearchData[n]['tracks'];\n\t\t\t\tif (tmpSearchData[n]['playlength'] != null) topGroup['playlength'] = tmpSearchData[n]['playlength'];\n\t\t\t\tif (tmpSearchData[n]['role'] != null) topGroup['role'] = tmpSearchData[n]['role'];\n\t\t\t\ttopGroup[relKey] = tmpSearchData[n][relKey];\n\t\t\t\ttmpObject[tmpSearchData[n][relKey]] = topGroup;\n\t\t\t\ttmp.push(topGroup[relKey]);\n\t\t\t}\n\t\t\tvar dataType = tmpSearchData[n]['type'];\n\t\t\t// this is to make sure we don't have to update this script whenever we add a new type (though it would be faster without this)\n\t\t\tif (orderArray.indexOf(dataType) < 0) orderArray.push(dataType);\n\t\t\tvar secondGroup = topGroup[dataType];\n\t\t\tif (secondGroup == null) {\n\t\t\t\tsecondGroup = new Object();\n\t\t\t\tsecondGroup[\"-1\"] = new Array();\n\t\t\t\ttopGroup[dataType] = secondGroup;\n\t\t\t}\n\t\t\tvar langid = tmpSearchData[n]['langid'];\n\t\t\tvar title = secondGroup[langid];\n\t\t\tif (title == null) {\n\t\t\t\ttitle = new Object();\n\t\t\t\ttitle['langid'] = langid;\n\t\t\t\ttitle['names'] = new Array();\n\t\t\t\tsecondGroup[langid] = title;\n\t\t\t}\n\t\t\ttitle['names'].push(tmpSearchData[n]['name']);\n\t\t\tif (secondGroup[\"-1\"].indexOf(langid) < 0)\n\t\t\t\tsecondGroup[\"-1\"].push(langid);\n\t\t}\n\t\t// okay, done, now for the results pick the best title\n\t\tfor (var n = 0; n < tmp.length; n++) {\n\t\t\tvar relId = tmp[n];\n\t\t\tvar entry = tmpObject[relId];\n\t\t\tentry = updateSearchEntry(entry,patterns, orderArray, deflangid);\n\t\t\tif (entry['name'] == null) continue;\n\t\t\tresults.push(entry);\n\t\t}\n\t\tsearchNoChange = updateSearchCache(results, relKey) == 0;\n\t\t// a minor hack is needed for when the last char is a space\n\t\tvar lc = query.charAt(query.length-1);\n\t\tif (lc.match(re)) // this will ensure we keep requesting stuff\n\t\t\tsearchNoChange = false;\n\t} else {\n\t\t// just take care or remove repetitions\n\t\tfor (var n = 0; n < tmpSearchData.length; n++) {\n\t\t\tvar name = tmpSearchData[n]['name'];\n\t\t\tif (tmp.indexOf(name) < 0) {\n\t\t\t\tresults.push(tmpSearchData[n]);\n\t\t\t\ttmp.push(name);\n\t\t\t}\n\t\t}\n\t\tsearchNoChange = updateSearchCache(results, null) == 0;\n\t}\n\tsearchData = results;\n\tlastHitCount = tmpSearchData.length;\n\t// this way printTags can know if it should ignore or not\n\tprintTags(query);\n}", "title": "" }, { "docid": "b5ef682926885eb1cd3a15bda0257e60", "score": "0.5277719", "text": "async function submitKeyword() {\n event.preventDefault();\n const keyword = document.getElementById('kind').value;\n\n const appResponse = await doPOSTRequest('recommendGivenKeyword', keyword);\n appResponseArray = JSON.parse(appResponse);\n\n updateSiteResults(appResponseArray);\n}", "title": "" }, { "docid": "d03bd1a61360e0b02ec7c105461428e9", "score": "0.5274481", "text": "function fetch_advanced() {\n\tconst ageInput = document.getElementById('age').value;\n\tconst locationInput = document.getElementById('location').value;\n\tconst ratingInput = document.getElementById('rating').value;\n\n\tlet tagArr = new Array;\n\tlet searchObj = new Object;\n\tlet i = 0;\n\n\t// obtain checked tags\n\twhile (globalTags[i]) {\n\t\tlet check = document.getElementById(globalTags[i]).checked;\n\t\tif (check) {\n\t\t\ttagArr.push(globalTags[i]);\n\t\t}\n\t\ti++;\n\t}\n\n\t$('#searchResultsBox').html('');\n\t$('#filterStr').html('<h5 class=\\\"ml-4\\\">Loading...</h5>');\n\t\n\t// populate search query object\n\tsearchObj.advanced_search = '1';\n\tif (ageInput !== '') {\n\t\tsearchObj.age = ageInput;\n\t}\n\tif (locationInput !== '') {\n\t\tsearchObj.location = locationInput;\n\t}\n\tif (ratingInput !== '') {\n\t\tsearchObj.rating = ratingInput;\n\t}\n\tif (tagArr.length !== 0) {\n\t\tsearchObj.color = tagArr;\n\t}\n\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: '/search/fetchResults',\n\t\tdata: searchObj,\n\t\tsuccess: function (ret) {\n\n\t\t\tglobalRes = ret.matches;\n\t\t\tglobalTags = ret.tags;\n\t\t\tglobalCurrUser = ret.currUser;\n\t\t\tfilteredRes = [];\n\t\t\tsetVariables();\n\t\t\tdisplayResults(ret.matches);\n\n\t\t\t// calc user message using query parameters\n\t\t\tif (ret.matches.length !== 0) {\n\t\t\t\tlet loadStr = buildCustomMsg(ret.matches.length, tagArr, ratingInput, ageInput, locationInput);\n\t\t\t\t$('#filterStr').html(loadStr);\n\t\t\t} else {\n\t\t\t\t$('#filterStr').html('<h6 class=\\\"ml-4 mb-3\\\">No results at this moment!</h6>');\n\t\t\t}\n\t\t},\n\t\terror: function () {\n\t\t\t$('#filterStr').html('<h5 class=\\\"ml-4 mb-3\\\">Error loading results!</h5>');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "83ae16d548051217bbc6342280e0c733", "score": "0.5274418", "text": "function search() {\t\t\t\t\n\t\t\n\t\t\tconsole.log(\"search(): begin\");\n\n\t\t\tif (vm.apiDomain.jnumid == \"\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tpageScope.loadingStart();\n\t\t\tvm.hideLoadingHeader = false;\n\t\t\t\n\t\t\tconsole.log(\"search(): calling API\");\n\t\t\tconsole.log(\"jnumid = \" + vm.apiDomain.jnumid);\n\t\t\tImageSubmissionSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.hideLoadingHeader = true;\n\t\t\t\tvm.submitForm = new FormData();\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"Error while searching\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "5bac1bfc8ca13ef7247ef4dd2cc679fa", "score": "0.5270467", "text": "searchDishes({type,query,offset,number}){ return DishSource.\n apiCall(`recipes/search?${new URLSearchParams({\n type: type === undefined ? \"\" : type,\n query: query === undefined ? \"\": query,\n offset: offset === undefined ? \"\": offset,\n number: number === undefined ? \"\": number\n })}`)\n .then(data => data.results)\n .catch(err => console.log(err)); \n }", "title": "" }, { "docid": "26fe45e0a9e118ea4be34692d3269476", "score": "0.5268826", "text": "async function GET_dailydisc_test(){\n const url = \"https://api.pushshift.io/reddit/search/submission/\"\n const reddit_author = \"AutoModerator\"\n const params = {\n \"subreddit\": \"CryptoCurrency\",\n \"author\": reddit_author\n }\n const response = await make_GETRequest(url, null, params)\n let data = response.data.data\n\n if(data.length > 0)\n return [data[0]]\n else\n return []\n}", "title": "" }, { "docid": "a6c0dc5f92120cead079ddbe288cb3b0", "score": "0.5268236", "text": "function singleSearch() {\r\n //Ask for a search for one query and return results into console.log()\r\n let searchParameters = {\r\n 'q' : 'Data Science', //query parameter\r\n 'query_by' : 'postType', //Specifies what attribute to query\r\n 'sort_by' : '' //if left blank it does default sort_by defined in schema\r\n //LINE 40 IN createSchema.js -> 'default_sorting_field': 'rating'\r\n };\r\n //Every result in typesense returns metadata and hits. Hits are what is queried from request\r\n client.collections('posts')\r\n .documents()\r\n .search(searchParameters)\r\n .then(function (searchResults) {\r\n console.log(\"RAW DATA:\")\r\n console.log(searchResults);\r\n console.log(\"HITS:\")\r\n console.log(searchResults['hits']); //Returned result\r\n });\r\n}", "title": "" }, { "docid": "3249d0e1baecb28b0ce40500d2cea3a0", "score": "0.5268057", "text": "function RetrieveDataAboutUrl(info, callback) {\n if (info.url === undefined)\n throw (\"FIND-ON-REDDIT: info object must have a url property\");\n var searchTerms = DeconstructURLForSearchTerms(info);\n let redditSearchURL = `https://api.reddit.com/search?q=${searchTerms}&limit=${SettingsData.loadlimit}&sort=top`;\n console.log(\"FIND-ON-REDDIT: retrieving data from: \" + redditSearchURL);\n info.api_call_url = redditSearchURL;\n info.callback = callback;\n HttpGetAsync(redditSearchURL, SaveData, info);\n}", "title": "" }, { "docid": "f6a0ee83c42e14456744045cf8a92dc7", "score": "0.5265195", "text": "function getDataFromApi(searchTerm, callback) {\n let url = `https://dog.ceo/api/breeds/image/random/${searchTerm}`;\n let params = searchTerm;\n $.getJSON(url, params, callback);\n}", "title": "" }, { "docid": "4e087088a3452859f18bb542cad1fac8", "score": "0.52638173", "text": "function searchMoviesTV(searchInput, container, template) {\n var searchWord = searchInput.val().trim();\n var moviesApi = {\n url: \"https://api.themoviedb.org/3/search/movie\",\n api_key: \"87b0eb1d0f76dae2472919c6cdf66278\",\n query: searchWord,\n language: \"it-IT\",\n type: \"Film\"\n };\n var seriesApi = {\n url: \"https://api.themoviedb.org/3/search/tv\",\n api_key: \"87b0eb1d0f76dae2472919c6cdf66278\",\n language: \"it-IT\",\n query: searchWord,\n type: \"Serie TV\"\n };\n cleanUp(container);\n apiRequest(moviesApi, template, container);\n apiRequest(seriesApi, template, container);\n searchInput.select()\n}", "title": "" }, { "docid": "75174684b1d0135949f050248c1ef010", "score": "0.5259673", "text": "function queryDataFromAPI(searchTerm){\n\tconst query = {\n 'part': 'snippet',\n 'q': searchTerm,\n 'key': API_KEY\n };\n\n\t($.getJSON(YOUTUBE_SEARCH_URL, query, function(data){\n\t\t\n\t\tconst response = data;\n\t\t\n\t\tparseResults(query, response);\n\t\t\n\t}));\n}", "title": "" } ]
c41e7ef8ce73c9a3aa6d13e1fd3ed39b
Q.12 Slice and Splic
[ { "docid": "77fc7a387b87488f83b7febfa9fcd29d", "score": "0.6180477", "text": "function frankenSplice(arr1, arr2, n) {\r\n let newArr1 = arr2.slice(0,n);\r\n let newArr2 = arr2.slice(n);\r\n for(let i = 0; i < arr1.length; i++) {\r\n newArr1.push(arr1[i]);\r\n\r\n }\r\n newArr1 = newArr1.concat(newArr2);\r\n return newArr1;\r\n \r\n}", "title": "" } ]
[ { "docid": "f3773b4ec9b37d304c4269e962901424", "score": "0.6739316", "text": "function sliceList(inpt,startPosition,endPosition)\r\n{\r\n\tvar index=0;\r\n\tvar finalOutput=[];\r\n\tfor(var i=startPosition-1;i<endPosition;i++)\r\n\t{\r\n\t\tfinalOutput[index]=inpt[i];\r\n\t\tindex++;\r\n\t\t\r\n\t}\r\n\tprintArray(finalOutput);\r\n\r\n}", "title": "" }, { "docid": "ecc6f5134e1888b7b74493810479cd41", "score": "0.6555348", "text": "function iSlice(arr, start, end) {\n\tlet beginning = arr.slice(0, start);\n\tlet ending = arr.slice(end, arr.length);\n\tlet newArr = beginning.concat(ending);\n\treturn newArr;\n}", "title": "" }, { "docid": "29c8d997bd2c278f43979bae9f09c92e", "score": "0.64825964", "text": "function slasher(arr, howMany) {\n var slicedArray = arr.slice(howMany);\n console.log(slicedArray);\n return slicedArray;\n}", "title": "" }, { "docid": "41c96af11ca9d292061dcbb34b46a845", "score": "0.6452801", "text": "function slasher(arr, howMany) {\r\n var temp = arr.slice(howMany);\r\n return temp;\r\n}", "title": "" }, { "docid": "6a302f0b4204eaa79b6cbe7871d74169", "score": "0.6425575", "text": "function slice() {\n return Array.prototype.slice.apply(this, arguments);\n }", "title": "" }, { "docid": "08edb6858623ae7a1e656e03cb2ee7ea", "score": "0.640633", "text": "function slice () {\n source = source.slice(parser.startIndex - savedIndex)\n savedIndex = parser.startIndex\n return source.slice(0, parser.endIndex + 1 - savedIndex)\n }", "title": "" }, { "docid": "8c34e7c87c00fc015056d64ec5695d56", "score": "0.6353579", "text": "function mySlice(items, idxStart, idxEnd) {\n var resItems = []\n for (var i = idxStart; i < idxEnd; i++) {\n var item = items[i];\n resItems.push(item);\n }\n return resItems; \n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "5c5816104ba86d9a7ede295942687512", "score": "0.6353276", "text": "function slice(from, to, a)\n{\n\tif (from < 0)\n\t{\n\t\tfrom += length(a);\n\t}\n\tif (to < 0)\n\t{\n\t\tto += length(a);\n\t}\n\treturn sliceLeft(from, sliceRight(to, a));\n}", "title": "" }, { "docid": "c9907544a6b35bad20fe40584c8b405c", "score": "0.6332794", "text": "function splice(arr, start, count) {\n var result= [];\n var resultIndex = 0;\n var length = arr.length;\n for(var i = start;i< start + count;i++ ){\n result[resultIndex]=arr[start];\n resultIndex++;\n for (var j= start;j<length;j++){\n arr[j] = arr[j+1]; \n }\n arr.length = arr.length -1 ;\n }\n arr.length = arr.length -1;\n return result;\n}", "title": "" }, { "docid": "c1ad10fb0787d45c3bdc0de46c610bc4", "score": "0.63100773", "text": "function slice(thing) {\n return Array.prototype.slice.call(thing);\n}", "title": "" }, { "docid": "34121a2b395467a585523f82f67e34ac", "score": "0.63072187", "text": "function slice(arr, from, to) {\n return [].slice.call(arr, from, to);\n }", "title": "" }, { "docid": "b001707c234211b47e63c704880be298", "score": "0.6294472", "text": "function slice(from, to, a)\n\t{\n\t\tif (from < 0)\n\t\t{\n\t\t\tfrom += length(a);\n\t\t}\n\t\tif (to < 0)\n\t\t{\n\t\t\tto += length(a);\n\t\t}\n\t\treturn sliceLeft(from, sliceRight(to, a));\n\t}", "title": "" }, { "docid": "7803129c011423b4a49f9e7f9dd389e2", "score": "0.6269011", "text": "function SpliceArray(obj) {\n \n SpliceArray.VERSION = \"1.0.0\";\n \n function _set(idx, val) {\n \n }\n \n function _get(idx) {\n \n }\n \n if(_.isNumber(obj)) {\n this._len = obj;\n _.times(obj, function(n) {\n this._set(n, n);\n }, this);\n } else {\n this._len = obj.length;\n _.each(obj, function(el, idx) {\n this._set(idx, el);\n }, this);\n }\n return new Proxy(this, {\n set: function(obj, prop, val) {\n if(!_.isNumber(prop)) {\n if(prop === 'length') ??\n obj[prop] = val;//property proper\n return val;\n }\n obj._set(prop, val);\n return val;\n },\n get: function(obj, prop) {\n if(!_.isNumber(prop)) {\n if(prop === 'length') return obj._len;\n return obj[prop];\n }\n return obj._get(prop);\n }\n });\n \n function concat() {\n var res = new SpliceArray(this);//make new array\n _.each(arguments, function(el) {\n this.push(el);\n }, res);\n return res;\n }\n \n function push(el) {\n if(this.length != this._back[0].length) error(push, 'no push() or unshift() to a slice().');\n var len = this._back[0].push(el);\n _.times(this._back[1].length, function(n) {\n var idx = this._insert(n, 0, len - 1);//inset log(n)\n if(n == this._back[4]) super.splice(idx, 0, this.length);\n }, this);\n return len;\n }\n \n function pop() {\n return this._back[0][super.pop()];\n }\n \n function shift() {\n return this._back[0][super.shift()];\n }\n \n function unshift(el) {\n return this.push(el);//it's the same for this collection\n }\n \n function splice() {\n error(splice, 'convert to concat() and slice(). Sorted!');\n }\n}", "title": "" }, { "docid": "c56ac55c0d666dab1d281f26f3309cb3", "score": "0.6248558", "text": "function iSliceBuiltin(start, end) {\n\treturn iSlice(this, start, end)\n}", "title": "" }, { "docid": "bb3dfab8d4f00265b21ec10b709f2180", "score": "0.6248351", "text": "function splice(array, start, deleteCount) {\r\n var arrayCopy = slice(array, 0, array.length);\r\n var itemCount = arguments.length - 3;\r\n var newLength = array.length + itemCount - deleteCount;\r\n array.length = newLength;\r\n var copyBackCount;\r\n var i;\r\n\r\n for (i = 0; i < itemCount; i += 1) {\r\n array[start + i] = arguments[3 + i];\r\n }\r\n\r\n copyBackCount = arrayCopy.length - (start + deleteCount);\r\n for (i = 0; i < copyBackCount; i += 1) {\r\n array[start + itemCount + i] = arrayCopy[start + deleteCount + i];\r\n }\r\n\r\n return slice(arrayCopy, start, start + deleteCount);\r\n}", "title": "" }, { "docid": "6a6aeb651984fb29b00505f1b13f4608", "score": "0.6239525", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "7154e39475db0c4e73c642b0ec037cba", "score": "0.62371546", "text": "function slice2(array) {\r\n var i, result;\r\n result = [];\r\n for(i=0; i<array.length; i++) {\r\n\tresult.push(array[i].slice());\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "cd68672297d4cbb1cc4974b042e8bc93", "score": "0.6191129", "text": "function BufferSlice(start,end){var len=this.length;return start=clamp(start,len,0),end=clamp(end,len,len),augment(this.subarray(start,end))}", "title": "" }, { "docid": "e4b8fef18ea31314c4326d98d54ea191", "score": "0.61879593", "text": "function frankenSplice(arr1, arr2, n) {\n // let newArray = [secondArray[0]]\n\n let copyOfSecondArray = arr2.slice(0);\n for (let i = 0; i < arr1.length; i++) {\n copyOfSecondArray.splice(n, 0, arr1[i]);\n n++;\n }\n return copyOfSecondArray;\n // console.log({slicedArray})\n}", "title": "" }, { "docid": "c40097c584e329141281aadcde899338", "score": "0.6182675", "text": "function onClickHandlerSlice() {\n var sports = new Array('soccer', 'basketball', 'hockey', 'football', 'cricket', 'rugby', 'tennis', 'badminton');\n var someSports = sports.slice(2, 5);\n /**\n * the above code slices elements from index 2 through 4 (not including 5) to someSports array.That\n * means the elements hockey, football and cricket to someSports array\n * No changes to sports array\n */\n\n var sportsArrayLength = someSports.length;\n var results = \"\";\n\n for (var i = 0; i < sportsArrayLength; i++) {\n results = results + someSports[i] + \"<br />\";\n }\n\n document.getElementById(\"demo\").innerHTML = results;\n}", "title": "" }, { "docid": "1ce07e30b3756b26ef147741fd43e332", "score": "0.6178498", "text": "function cutD(s, i) {\n return [s.slice(0, i), s.slice(i + 1|0)];\n}", "title": "" }, { "docid": "31eabd313fa0b9c173b27b6c5a7bcb08", "score": "0.61743253", "text": "function frankenSplice(arr1, arr2, n) {\n let arr2Start = arr2.slice(0, n);\n let arr2End = arr2.slice(n);\n \n for(let i = 0; i < arr1.length; i++) {\n arr2Start.push(arr1[i]);\n }\n for(let i = 0; i < arr2End.length; i++){\n arr2Start.push(arr2End[i])\n }\n return arr2Start;\n}", "title": "" }, { "docid": "8f759ff0e71f52b1ccff93d37275c4d2", "score": "0.61546993", "text": "function cut(s, i) {\n return [s.slice(0, i|0), s.slice(i|0)];\n}", "title": "" }, { "docid": "0b8745eb44cdb357a7d015c0d35f83e9", "score": "0.6140685", "text": "function Slice(kwargs) {\n PyObject.call(this)\n\n // BUG: slices can support arbitrary-sized arguments.\n this.start = kwargs.start\n this.stop = kwargs.stop\n this.step = kwargs.step\n}", "title": "" }, { "docid": "f56865704f4b3e8ea2468b5cfd759191", "score": "0.61182797", "text": "function frankenSplice(arr1, arr2, n) {\n // It's alive. It's alive!\n let array2Copy = [...arr2];\n array2Copy.splice(n,0, ...arr1);\n //console.log(array2Copy);\n return array2Copy;\n }", "title": "" }, { "docid": "71ca238527b155663abcf202ebd45a26", "score": "0.61110383", "text": "function sliceFrom(array, from) {\n return array.slice(from);\n}", "title": "" }, { "docid": "85bed6b8866278c8ebc252c39258f584", "score": "0.61015534", "text": "function slasher(arr, howMany) {\r\n return arr.slice(howMany);\r\n}", "title": "" }, { "docid": "7b4d074299d9e682e153ba112c5d585b", "score": "0.61015064", "text": "function sliceOf(ars, i, parts) {\n return ars.slice(\n Math.floor(i/parts*ars.length),\n Math.floor((i+1)/parts*ars.length));\n}", "title": "" }, { "docid": "cb518ced9634adc3d16d380088f4de9a", "score": "0.6096368", "text": "function splice(arr, start, end) {\n var new_arr = [];\n var k = 0;\n for (var i = start; i < end; i++) {\n new_arr[k++] = arr[i];\n }\n return new_arr;\n}", "title": "" }, { "docid": "5a3dbc48890375ab30c2bb76a450550d", "score": "0.60858494", "text": "function frankenSplice(arr1, arr2, n) {\n let localArr = arr2.slice();\n localArr.splice(n, 0, ...arr1);\n return localArr;\n}", "title": "" }, { "docid": "63752d2904cd72b81b00fe1b408891f3", "score": "0.6082569", "text": "function h$sliceArray(a, start, n) {\n return a.slice(start, start+n);\n}", "title": "" }, { "docid": "63752d2904cd72b81b00fe1b408891f3", "score": "0.6082569", "text": "function h$sliceArray(a, start, n) {\n return a.slice(start, start+n);\n}", "title": "" }, { "docid": "63752d2904cd72b81b00fe1b408891f3", "score": "0.6082569", "text": "function h$sliceArray(a, start, n) {\n return a.slice(start, start+n);\n}", "title": "" }, { "docid": "63752d2904cd72b81b00fe1b408891f3", "score": "0.6082569", "text": "function h$sliceArray(a, start, n) {\n return a.slice(start, start+n);\n}", "title": "" }, { "docid": "92fac94354f77fe48f07656e94e1e57c", "score": "0.60729057", "text": "function splice(idx, size, items){\n\tvar substring = \"\";\n\n\treturn substring;\n}", "title": "" }, { "docid": "65e043f7879db2e3ff542161e4db1b12", "score": "0.6070471", "text": "function frankenSplice(arr1, arr2, n) {\n\tlet newArr = arr2.slice(0);\n\tnewArr.splice(n, 0, ...arr1);\n\treturn newArr;\n}", "title": "" }, { "docid": "3f4110d53f240614ab327647ab175de8", "score": "0.6069814", "text": "function sliceArr(arr, start, end){\n return arr.slice(start, end);\n}", "title": "" }, { "docid": "db6773f4fe8081460a1ec5f0b0ab2abf", "score": "0.60315657", "text": "function slice(list, from, to) {\n\t\t\tvar ret = [];\n\t\t\tif (!from) {\n\t\t\t\tfrom = 0;\n\t\t\t}\n\t\t\tif (!to) {\n\t\t\t\tto = list.length - 1;\n\t\t\t}\n\t\t\tfor (var i = from; i <= to; i++) {\n\t\t\t\tret.push(list[i]);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}", "title": "" }, { "docid": "e18091b99197e3c84b11610dbc2bf577", "score": "0.60304695", "text": "function frankenSplice(arr1, arr2, n) {\n // It's alive. It's alive!\n const arr = [...arr2];\n arr.splice(n, 0, ...arr1);\n return arr;\n // Another solution:\n // return arr2.slice(0, n).concat(arr1.concat(arr2.slice(n, arr2.length)));\n}", "title": "" }, { "docid": "5270f69135cedfae1a0a75b042ef88dd", "score": "0.60197026", "text": "function splice(array, start, deleteCount) {\n var newArray = [];\n if (start < 0) {\n start = array.length + start;\n }\n\n if (!deleteCount) {\n deleteCount = array.length - start;\n }\n\n var tempArray = slice(array, 0, start);\n for (var i = 0, length = tempArray.length; i < length; i++) {\n newArray[newArray.length] = tempArray[i];\n }\n\n for (var i = 3, length = arguments.length; i < length; i++) {\n newArray[newArray.length] = arguments[i];\n }\n\n var tempArray = slice(array, start + deleteCount, array.length);\n for (var i = 0, length = tempArray.length; i < length; i++) {\n newArray[newArray.length] = tempArray[i];\n }\n\n return newArray;\n}", "title": "" }, { "docid": "363d1e60610868d30d92e7ab00d8a399", "score": "0.60006976", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr = arr2.slice(0, arr2.legth);\n newArr.splice(n, 0, ...arr1);\n return newArr;\n}", "title": "" }, { "docid": "95360b37e75965ab0971912db3396877", "score": "0.59984696", "text": "function slice(list, start, len) {\n return ARRAY.slice.call(list, start, len);\n}", "title": "" }, { "docid": "76e3ef52ab0176d063a0db0760f1791f", "score": "0.59981215", "text": "function cdr(a)\n{\n return slice.call(a, 1)\n}", "title": "" }, { "docid": "4b129a52d3311de7fd555cd4da96e4cc", "score": "0.5997538", "text": "function sliceArray(anim, beginSlice, endSlice) {\r\n // Only change code below this line\r\n let newArray = anim.slice(beginSlice,endSlice)\r\n return newArray\r\n\r\n // Only change code above this line\r\n}", "title": "" }, { "docid": "01144ea4dd7ae3aba97878037d34682f", "score": "0.5995218", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "5f293d35c815e680554df3b15928b25b", "score": "0.59938866", "text": "function splice(array, start, numberOfValues) {\n}", "title": "" }, { "docid": "70ef38b78023f2fddda8cad008c1d2fb", "score": "0.59836465", "text": "function TO_map_sliced(fn) {\n var self = this;\n var k = self.length;\n return Multicore.build(\n\tfunction (i, slice) { \n\t for (var k=0, limit=slice.length ; k < limit ; k++, i++ )\n\t\tslice[k] = fn(self[i], i, self);\n\t},\n\tnew (TypedObject.objectType(self).elementType.array(k))(),\n\t[[0, k, Multicore.SPLIT]]);\n}", "title": "" }, { "docid": "98897422eb0336835c1a255c287ac0d4", "score": "0.5977105", "text": "function rawslice(index) {\n var start = index*self.size\n , end = start + self.size > raw.length \n ? raw.length \n : start + self.size\n\n return raw.slice(start, end)\n }", "title": "" }, { "docid": "a9900d059d49624934131b17d3b62a06", "score": "0.5975312", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "a9900d059d49624934131b17d3b62a06", "score": "0.5975312", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "a9900d059d49624934131b17d3b62a06", "score": "0.5975312", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "858dd2e181c1b6d4e8ef116606374066", "score": "0.5973495", "text": "function slasher(arr, howMany) {\n // We are going to return the result of the arr.slice()\n // The howMany argument sets the starting point for the slice method to begin\n // We then set the ending point to the end of the array using arr.length\n return arr.slice(howMany, arr.length);\n}", "title": "" }, { "docid": "d5781ddec4d78f0f74bd9fed925208c1", "score": "0.59652084", "text": "function slice (args, start) {\n var len = args.length\n start = start || 0\n if (start >= len) return []\n\n var ret = Array(len - start)\n while (len-- > start) ret[len - start] = args[len]\n return ret\n }", "title": "" }, { "docid": "fdd1d243b22286fc59b90357f678b5f3", "score": "0.5958167", "text": "function slice_Method() {\n var Sentence = \"All work and no play makes Johnny a dull boy.\";\n var Section = Sentence.slice(27,33);\n document.getElementById(\"Slice\").innerHTML = Section;\n}", "title": "" }, { "docid": "fdd1d243b22286fc59b90357f678b5f3", "score": "0.5958167", "text": "function slice_Method() {\n var Sentence = \"All work and no play makes Johnny a dull boy.\";\n var Section = Sentence.slice(27,33);\n document.getElementById(\"Slice\").innerHTML = Section;\n}", "title": "" }, { "docid": "a331ddad99ff1fd8e2a4a072abe6edf9", "score": "0.5957573", "text": "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "7f16b86316b92185ff93cc8d348b28f9", "score": "0.5936632", "text": "function A$17(e,t,i){e.splice(i,0,e.splice(t,1)[0]);}", "title": "" }, { "docid": "25e73e3cfd823efa1febd2fe3ca90046", "score": "0.5931445", "text": "function splice_args () {\n args = arguments;\n return Array.prototype.splice.apply(args, [0, 5]);\n}", "title": "" }, { "docid": "4f61ae11214b100a6f70d9b580bf1b9e", "score": "0.5927798", "text": "function nonMutatingSplice(cities) {\r\n // Only change code below this line\r\n return cities.slice(0,3);\r\n\r\n // Only change code above this line\r\n}", "title": "" }, { "docid": "af86690cf65915b2898d620bbbc0b5c0", "score": "0.592582", "text": "function sc_vectorCopy(a, start, end) {\n return a.slice(start, end);\n}", "title": "" }, { "docid": "af86690cf65915b2898d620bbbc0b5c0", "score": "0.592582", "text": "function sc_vectorCopy(a, start, end) {\n return a.slice(start, end);\n}", "title": "" }, { "docid": "dd523af54cffb026353e2c4acddcda58", "score": "0.5924912", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany,arr.length);\n}", "title": "" }, { "docid": "ce424b8fcd664bc52b45b772504752da", "score": "0.59217507", "text": "function frankenSplice(arr1, arr2, n) {\n let result = arr2.slice(0);\n for (let i = 0 ; i < arr1.length; i++) {\n result.splice(n + i, 0, arr1[i]);\n }\n return result;\n}", "title": "" }, { "docid": "e84e4ad638c395baed02cd2a2f5f9e7b", "score": "0.5914321", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany, arr.length)\n}", "title": "" }, { "docid": "1b3611607f3b4502045753969d9691e7", "score": "0.5914238", "text": "function callSlice(array, argument) {\n return Array.prototype.slice.call(array, argument);\n}", "title": "" }, { "docid": "c2f0d16982ef6b39beeb3fcadf00b809", "score": "0.59101254", "text": "function sliceFunction() {\n //Create variable and set it to a string\n var sentence = \"The puppy's red ball was it's favorite toy\";\n //Create variable for slice and utilize slice() method\n var sliced = sentence.slice(12, 15);\n //link to html handler and return sliced portion of sentence (\"red\")\n document.getElementById(\"Slice\").innerHTML = sliced;\n}", "title": "" }, { "docid": "dab1070747d6625b414d33bb79603d8b", "score": "0.5909441", "text": "function slice(array, start, end) {\n if (end === void 0) {\n end = array.length;\n }\n\n var output = new Array(end - start);\n\n for (var i = start; i < end; ++i) {\n output[i - start] = array[i];\n }\n\n return output;\n }", "title": "" }, { "docid": "e7baae590799fefa9447e19b6141f3a6", "score": "0.59048575", "text": "function frankenSplice(arr1, arr2, n) {\n // It's alive. It's alive!\n var copyArr1 = arr1.slice(0);\n var copyArr2 = arr2.slice(0);\n console.log('Arr1: ' + copyArr1);\n console.log('Arr2: ' + copyArr2);\n\n for (var i = 0; i < copyArr1.length; i++) {\n copyArr2.splice(n, 0, copyArr1[i]);\n n++; // increment index position to place the element in proper index\n }\n console.log(copyArr2);\n return copyArr2;\n}", "title": "" }, { "docid": "57a8c0446203da4ad63957da2025dd32", "score": "0.59029746", "text": "function slice_Method() {\r\n var Sentence = \"All work and no play makes Johnny a dull boy!\";\r\n var Section = Sentence.slice(27, 33);\r\n document.getElementById(\"Slice\").innerHTML = Section;\r\n}", "title": "" }, { "docid": "cf674a3628a02e82e76dd0059b33ebf9", "score": "0.5890295", "text": "function splice(array, start, deleteCount, ...objects) {\n deleteCount = Math.min(array.length - start, deleteCount);\n start = Math.min(array.length, start);\n \n let beginningOfArray = [];\n for (let index = 0; index < array.slice(0, start).length; index++) {\n beginningOfArray.push(array.shift());\n }\n \n let capturedElements = [];\n for (let index = 0; index < deleteCount; index++) {\n capturedElements.push(array.shift());\n }\n\n if (objects !== []) {\n beginningOfArray.push(...objects);\n }\n\n array.unshift(...beginningOfArray);\n return capturedElements;\n}", "title": "" }, { "docid": "53a7593e366ff2ece06d82925d92d95b", "score": "0.588681", "text": "function slice(from, to, a)\n{\n\t\tvar newA = { };\n newA.table = a.table.slice(from, to);\n return newA;\n}", "title": "" }, { "docid": "84d539525231b5fccdc2a212c97bcdd7", "score": "0.58844846", "text": "function take_(as, n) {\n return as.slice(0, n);\n}", "title": "" }, { "docid": "b08475247f222b2b4d4d3510eefacf64", "score": "0.5882866", "text": "function frankenSplice(arr1, arr2, n) {\n // Do not change the original arrays\n return arr2.slice().splice(n, 0, ...arr1);\n}", "title": "" }, { "docid": "b95b1afaec896fd473724d00e0ceeea1", "score": "0.5879669", "text": "function sliceMethod(){\r\n //create string//\r\n var sentence=\"I like that boulder. That's a nice boulder.\";\r\n //slice string to only between the 30th and 43rd character//\r\n var section= sentence.slice(30,43);\r\n document.getElementById(\"slice\").innerHTML=section;\r\n}", "title": "" }, { "docid": "d87a9385b63ff5449795cec2ee1ea0ed", "score": "0.5878753", "text": "function sliceArray(anim, beginSlice, endSlice) {\n // Add your code below this line\n\n let newArray = anim.slice(beginSlice, endSlice);\n\n return newArray;\n \n // Add your code above this line\n}", "title": "" }, { "docid": "b9a4898c733690b2e747fe3ea8152e16", "score": "0.5878396", "text": "function slice(array, ...args) {\n if (arguments.length === 1) {\n return [...array];\n }\n let newArray = [];\n let begin = Math.min(args[0], array.length);\n let end = Math.min(args[1], array.length);\n\n for (begin; begin < end; begin++) {\n newArray.push(array[begin]);\n }\n return newArray;\n}", "title": "" }, { "docid": "8c13c87098962e70dbd4f4c738ff7ee8", "score": "0.58779365", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr2 = arr2.slice(0); // Slice() doesn't mutate the original array, it makes a new one\n newArr2.splice(n, 0, ...arr1); // Splice() mutates the original array\n return newArr2;\n}", "title": "" }, { "docid": "5d434dca8cfefa14c3feae3c2f8a4eef", "score": "0.5868764", "text": "function slice_array(string,start,end){\n\n\tvar str=\"\";\n\tfor (var i = start; i < end; i++) {\n\t\tstr+=string[i];\n\t};\n\n\treturn str;\n}", "title": "" }, { "docid": "d3e52b797429018b3408ec8dc9eb2914", "score": "0.5868062", "text": "function slice(array, start, end) {\n if (end === void 0) { end = array.length; }\n var output = new Array(end - start);\n for (var i = start; i < end; ++i) {\n output[i - start] = array[i];\n }\n return output;\n}", "title": "" }, { "docid": "d3e5657611323295f7669352e07f2dea", "score": "0.58666116", "text": "sliceData(arr) {\n return arr.slice(this.props.viewRange[0], this.props.viewRange[1])\n }", "title": "" }, { "docid": "baa77345e265ad4f907a68ef5a671339", "score": "0.5857954", "text": "function frankenSplice(arr1, arr2, n) {\n let localArray = arr2.slice();\n for (let i = 0; i < arr1.length; i++) {\n localArray.splice(n, 0, arr1[i]);\n n++;\n }\n return localArray;\n \n}", "title": "" }, { "docid": "d9d18239a41b564163b9c04676899c3a", "score": "0.58541447", "text": "function copyWithSlice(array) {\n return array.slice();\n}", "title": "" }, { "docid": "0e7c3207e0fd5a188702a10bacb8a5ca", "score": "0.5847457", "text": "function cutM(s, i) {\n return [s.slice(0, i|0), s[i|0], s.slice(i + 1|0)];\n}", "title": "" }, { "docid": "4534ca8f6e82ef90f63f4cada6403ab4", "score": "0.5845919", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr = [...arr2];\n newArr.splice(n, 0, ...arr1);\n return newArr;\n}", "title": "" }, { "docid": "539e80006c0c14eb4f95d60494e9e645", "score": "0.58333045", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr = arr2.slice(0); \n for (let i = 0; i < arr1.length; i++){\n newArr.splice(n, 0, arr1[i]);\n n++;\n }\n return newArr;\n }", "title": "" }, { "docid": "2b4e5af306b40c772989310c9964557c", "score": "0.5833124", "text": "function drop(count) {\n return new __WEBPACK_IMPORTED_MODULE_0__lift__[\"a\" /* ArrayOps */](this.value().slice(count));\n}", "title": "" }, { "docid": "4aa7232b1f46dca60430a8f990551eb1", "score": "0.58299077", "text": "function getSub(pts, len, t1, t2){\n\t// if (t1 > t2) [t1, t2] = [t2, t1]\n\t// t1 = t1 % 1.0\n\t// t2 = t2 % 1.0\n\n\tconst a = getP(pts, len, t1)\n\tconst b = getP(pts, len, t2)\n\tlet ia = (a.index + 1) % pts.length\n\tlet ib = (b.index + 1) % pts.length\n\tlet out\n\tif (ia <= ib) {\n\t\tout = pts.slice(ia, ib)\n\t} else {\n\t\tout = pts.slice(ia, pts.length).concat(pts.slice(0, ib))\n\t}\n\tout.unshift(a) \t// primo punto (interpolato)\n\tout.push(b)\t\t// ultimo punto (interpolato)\n\n\treturn out\n}", "title": "" }, { "docid": "36c95d0889ce5af6f498c7efaf2f7d89", "score": "0.58147675", "text": "function arrayConcatSlice2(a1, a2, a3, start) {\n var result = a1.concat(a2);\n var l1 = result.length;\n var length = a3.length - start;\n result.length = l1 + length;\n for (var i = 0; i < length; ++i) {\n result[l1 + i] = a3[start + i];\n }\n return result;\n}", "title": "" }, { "docid": "f26f7787d397e7585bfeb2f84aec6326", "score": "0.58126175", "text": "function insertSlice(arr, subArr, index) {\n\t\t [].splice.apply(\n\t\t arr,\n\t\t [index, 0].concat(subArr)\n\t\t );\n\t\t }", "title": "" }, { "docid": "945de6c0a15a3d8ed60269344c43bcca", "score": "0.5810711", "text": "slice(from, to = this.length) {\n let parts = [];\n this.decompose(from, to, parts, 0);\n return TextNode.from(parts, to - from);\n }", "title": "" }, { "docid": "41848ba1bfb3a5d014e3109380dd358f", "score": "0.57984185", "text": "function frankenSplice(arr1, arr2, n) {\n const arr = [...arr2];\n arr.splice(n, 0, ...arr1);\n return arr;\n}", "title": "" }, { "docid": "eddb3945c3bb0907b9c6784d5df0efdb", "score": "0.57982755", "text": "slicer(z, points, opts) {\n return (isConcurrent ? kiri.minions.sliceZ : base.sliceZ)(z, points, opts);\n }", "title": "" }, { "docid": "dc1d855c1c04b63900acbee832161a90", "score": "0.5793049", "text": "function nonMutatingSplice(cities) {\n // Add your code below this line\n let newArray = cities.slice(0,3);\n\n return newArray;\n \n // Add your code above this line\n}", "title": "" }, { "docid": "b9767c586514d73a88298faabfa3be92", "score": "0.5783295", "text": "slice(from, to = this.length) {\n let parts = [];\n this.decompose(from, to, parts, 0);\n return TextNode.from(parts, to - from);\n }", "title": "" } ]
548a38d968ad825f9085f4e31f98b370
Function: serverStart Description: This is the function called immediately once the server is opened and listening on a port. Parameters: None Preconditions: The server is started up and is listening on a port Postconditions: Status of the server is ouputted to the console
[ { "docid": "56fa2603679277ba19226ecfef26d3e2", "score": "0.77496266", "text": "function serverStart () {\n\tconsole.log(\"Server is running on port 3000\");\n}", "title": "" } ]
[ { "docid": "3badeceb05d1fd812650887dff62fcbf", "score": "0.80536366", "text": "function serverStart() {\n var port = server.address().port;\n console.log('Server listening on port '+ port);\n}", "title": "" }, { "docid": "ccd19a1b0e82183d51a06b3cab487bdd", "score": "0.7998612", "text": "function startServer() {\n\n var listener = server.listen(port, function() {\n var usedPort = listener.address().port\n logger.info(`Server running on port: ${usedPort}`);\n\n //Reanable console.\n console.log = oldConsole;\n\n //We are now finsihed setting up.\n if (callback) {\n callback(server);\n }\n\n //Open browser for user.\n if (options.browser) {\n logger.info('Openening browser...');\n var domain = (options.localhost) ? 'localhost' : '127.0.0.1';\n open(`http://${domain}:${usedPort}`);\n logger.info('Happy coding :)');\n }\n });\n }", "title": "" }, { "docid": "08e228718b73cd673abb41c399f7dcf9", "score": "0.7667461", "text": "function serverStart() {\n\n server = net.createServer(onClientConnected);\n\n server.listen(adapter.config.port, adapter.config.bind, function() {\n\n var text = 'Contact ID Server listening on IP-Adress: ' + server.address().address + ':' + server.address().port;\n adapter.log.info(text);\n\n });\n\n}", "title": "" }, { "docid": "18fad4c7980f05a497e74eac6b10e1a8", "score": "0.7614115", "text": "function serverStart() {\n server = net.createServer(onClientConnected);\n server.listen(adapter.config.port, adapter.config.bind, function () {\n let text = 'Contact ID Server listening on IP-Adress: ' + server.address().address + ':' + server.address().port;\n adapter.log.info(text);\n });\n}", "title": "" }, { "docid": "8a8849249d73732def57f99df5ce2b4a", "score": "0.75803506", "text": "function serverStart() {\n\n server = net.createServer(onClientConnected);\n\n server.listen(adapter.config.port, adapter.config.bind, function() {\n\n var text = 'SIA Server listening on IP-Adress: ' + server.address().address + ':' + server.address().port;\n adapter.log.info(text);\n\n });\n\n}", "title": "" }, { "docid": "f06dd367bb06250a283795a8b20c18bc", "score": "0.7423386", "text": "function startServer(){\n var ps = spawn('forever', [ 'start', base + 'lib/www.js' ]);\n var err = '';\n ps.stderr.on('data', function (data) { \n err += data;\n });\n ps.on('exit', function (code) {\n if(code !== null){\n success('Nserv started on port 8080.');\n }\n else {\n error(err, \"Could not start main nserv server.\");\n }\n });\n}", "title": "" }, { "docid": "a8d445b21f8547d2999ff22db63ef5a6", "score": "0.72318816", "text": "function startServer() {\n app.listen(port, () => logger.info(`Listening on Port ${port}`));\n}", "title": "" }, { "docid": "c0d990ceb29c4d702795559592746fb3", "score": "0.71783704", "text": "function serverStart() {\n app.listen(PORT, () => {\n console.log(`app is running at ${PORT}`);\n });\n}", "title": "" }, { "docid": "07cc0771dd5c3112adf2d2bb124c5db1", "score": "0.71542454", "text": "startServer() {\n this._server = http.createServer(this._app);\n this._server.listen(this._listeningPort, '0.0.0.0');\n this._server.on('error', this._onServerError);\n this._server.on('listening', this._onServerListening);\n }", "title": "" }, { "docid": "39213ecf18800b0fe7eddc79bcb481a4", "score": "0.70837003", "text": "async start () {\n const port = await tryPort(this.httpServer, this.maxPort, this.basePort)\n this.endpoint = `http://localhost:${port}`\n debug(`server is listening on port ${port}`)\n }", "title": "" }, { "docid": "3270344ca9f2020a2d3b6a3bab1fa10e", "score": "0.7047505", "text": "start(){\r\n this[BEFORE_START].forEach( (fn) => {\r\n fn.apply(null, this);\r\n });\r\n\r\n this.listen(this.config.port);\r\n this.on('error', err =>\r\n console.error('server error: ', err)\r\n );\r\n debug('App started and listening on port: %s', this.config.port);\r\n\r\n this[AFTER_START].forEach( (fn) => {\r\n fn.apply(null, this);\r\n });\r\n }", "title": "" }, { "docid": "3fc9b947defcc714ede9d7d3e59ff465", "score": "0.70423764", "text": "function ServerListen () {\n this.simulator.Debug (2,\"TcpServer listening port:%d\", this.simulator.opts.port);\n }", "title": "" }, { "docid": "8280ff11e59d9bb349941a212df6ab19", "score": "0.6983772", "text": "function startServer() {\nvar generatedRandomPort = calculateRandomPort(); // generates random port\nvar server = http.createServer(serveURL); // calls create server with callback function of serveURL\nserver.listen(generatedRandomPort,hostname); // listens on the generated port name and const host\nconsole.log(\"Server started. Listening on http://\"+hostname+\":\"+generatedRandomPort+\"\");\n}", "title": "" }, { "docid": "334fdb6776e314c12be283d44dee52b7", "score": "0.6976764", "text": "start() {\n const ctlServer = net.createServer(connectionListener.bind(this));\n this.ctlServer = ctlServer;\n const unixSocket = this.settings.unixSocket;\n\n if (unixSocket) {\n mkdirp(path.dirname(unixSocket));\n }\n ctlServer.listen(unixSocket || this.settings.port);\n\n // server bound after listen()\n ctlServer.on('listening', () => {\n const ad = this.ctlServer.address();\n const msg = typeof ad === 'string'\n ? `listening on ${ad}`\n : `listening ${ad.address}:${ad.port} using ${ad.family}`;\n log.info('CtlServer', msg);\n });\n\n // server closes, and all active connections are ended\n ctlServer.on('close', () => log.info('CtlServer', 'closed'));\n\n // error ocurrs\n ctlServer.on('err', (error) => {\n ctlServer.close(() => log.err('Server', `Shutting down! (${error})`));\n });\n }", "title": "" }, { "docid": "ae06f3dbdd0b369e25528250fa91c753", "score": "0.6967573", "text": "function startServer() {\n const server = app.listen(8899, () => {\n const { port } = server.address();\n console.log(`Listening on port ${port}`);\n });\n}", "title": "" }, { "docid": "30b4f158516784fe95ef999fa55c21ff", "score": "0.68961257", "text": "function startServer(PORT){\n app.listen(PORT, () => console.log('server up')); \n}", "title": "" }, { "docid": "c728627682a4c3396026b1e417d50c1c", "score": "0.68944377", "text": "function logStart() {\n console.log('================================================================================');\n console.log('Server running ' + Date());\n console.log('PID: ' + process.pid);\n console.log('Port: ' + this.address().port);\n console.log('================================================================================');\n}", "title": "" }, { "docid": "a3f7dca8008d1e205e6d24e4f130dc33", "score": "0.68167365", "text": "function startServer() {\n return new Promise((resolve, reject) => {\n server.listen(config.port);\n server.on('error', reject);\n server.on('listening', resolve);\n });\n}", "title": "" }, { "docid": "318a20ca360ab00dcb509080e503617d", "score": "0.6809589", "text": "function startServer () {\n // Close the server if it is running\n if (server && server.close && app.address()) {\n server.close();\n }\n server = app.listen(port, () => {\n console.log(`Example app listening on port ${port}`)\n });\n\n}", "title": "" }, { "docid": "c5841e0238787177b1a201b05bdd0cd7", "score": "0.6799745", "text": "function startServer(port, { open }) {\n clear();\n\n const loadingMessage = ora(`Starting CLI-GUI server on port ${port}`);\n loadingMessage.start();\n\n const serverPath = path.resolve(\n __dirname,\n '../',\n 'dist',\n 'server',\n 'server.bundle.js'\n );\n\n const productionEnv = Object.create(process.env);\n productionEnv.GLICKY_ENV = 'production';\n productionEnv.FORCE_COLOR = 1;\n\n const proc = spawn('node', [serverPath, `--port=${port}`], {\n env: productionEnv\n });\n\n proc.stdout.on('data', data => {\n // TODO: do this better\n if (data.toString().startsWith('🚀')) {\n if (open) {\n opn(`http://localhost:${port}`);\n }\n loadingMessage.stop();\n printSuccessMessage(port);\n }\n });\n}", "title": "" }, { "docid": "6f3ae9ef7e60832d11cc4a8ad3be6f29", "score": "0.6781193", "text": "start() {\n\t\tthis.ipc.serve(() => {\n\t\t\tthis.emit('start');\n\t\t});\n\t\tthis.ipc.server.start();\n\t}", "title": "" }, { "docid": "95fe750acebc8e15440f27217cb23189", "score": "0.6781153", "text": "function serverListener() {\n console.log(clc.green('server started on port '+config.node.port+', PID: ' + process.pid));\n}", "title": "" }, { "docid": "9e67967054e41ad57100c7b10aa903c3", "score": "0.67788893", "text": "function listening(){\n console.log(\"Server is running on \" + port)\n}", "title": "" }, { "docid": "d63a88a71136826295f4397481ab6b43", "score": "0.6735869", "text": "start() {\n const { port } = this.config;\n this.server = this.express.listen(port, () => {\n this.logger.info(`Listening on ${port}`);\n });\n }", "title": "" }, { "docid": "e43f1d02ba906973a761bd29e460e44b", "score": "0.6702146", "text": "async function startServer() {\n let desiredIp: string = null\n\n // fail if the user inputs both an ip address and an interface\n if (program.ipAddress && program.interface) {\n console.error('You many only specify --ip-address OR --interface, not both.\\n\\n')\n program.outputHelp()\n process.exit(2)\n }\n\n if (program.ipAddress) {\n // prefer the ip address argument over asking the user for it\n // if it's wrong, the user will get an error when binding it later\n // should that be validated in here?\n desiredIp = program.ipAddress\n } else if (program.interface) {\n // try to find the user's desired interface and use its ipv4 address\n const intf: INetIntf = getNetIntf(program.interface)\n\n // fail if we couldn't find it\n if (intf == null) {\n console.error('Could not find the user\\'s desired interface...\\n\\n')\n program.outputHelp()\n process.exit(1)\n }\n\n desiredIp = intf.net.address\n } else {\n const intf: INetIntf = await getOrAskNetIntf()\n\n // exit the program if the user failed to input an interface\n if (intf == null) {\n console.error('User failed to input a valid interface...\\n\\n')\n program.outputHelp()\n process.exit(1)\n }\n\n desiredIp = intf.net.address\n }\n\n const masterServer: ServerInstance = new ServerInstance({\n hostname: desiredIp,\n portHolepunch: program.portHolepunch,\n portMaster: program.portMaster,\n shouldLogPackets: program.logPackets,\n })\n\n masterServer.listen()\n}", "title": "" }, { "docid": "f0e33ed39abf56d2bb7220d496432692", "score": "0.6698834", "text": "function listening() {\n console.log(`server running on local host: ${port}`);\n}", "title": "" }, { "docid": "50cbab94d03ac50872e23b032c914d23", "score": "0.66962767", "text": "function serverStartTCP() {\n servertcp = net.createServer(onClientConnectedTCP);\n servertcp.listen(adapter.config.port, adapter.config.bind, () => {\n let text = 'SIA Server listening on IP-Adress (TCP): ' + servertcp.address().address + ':' + servertcp.address().port;\n adapter.log.info(text);\n });\n}", "title": "" }, { "docid": "262239b92e44ce683053b8c92e349153", "score": "0.66724104", "text": "function startServer(port) {\n // Make sure the user knows what mode the server is in!\n if (keys.mode === 'prod') {\n debugPrint('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\n debugPrint('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\n debugPrint('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\n debugPrint('!!!!!!!!SERVER STARTING IN PRODUCTION MODE!!!!!!!!');\n debugPrint('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\n debugPrint('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\n debugPrint('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\n } else if (keys.mode === 'test') {\n debugPrint('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\n debugPrint('~~~~~~~~STARTING SERVER IN TEST MODE~~~~~~~~');\n debugPrint('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\n } else {\n debugPrint('Invalid server mode in keys.js! Refusing to start server!');\n return;\n }\n if (port === undefined || port === null) {\n throw 'You must specify what port to use for startServer!';\n }\n\n app.listen(port, () => {\n debugPrint(`Server listening on port ${port}.`);\n });\n\n debugPrint(`Connecting to MongoDB using ${keys.mongoURI}`);\n mongoose\n .connect(keys.mongoURI)\n .then(() => {\n debugPrint('Successfully connected to MongoDB.');\n\n // TODO: remove before production\n require('./development/AdminInitialization')();\n })\n .catch(error => {\n debugPrint(`Failed to connect: ${error}`);\n });\n}", "title": "" }, { "docid": "7de0ee0da45e6713a4cc368942361545", "score": "0.66488254", "text": "start() {\n this.server.bind(this.serverAddress, grpc.ServerCredentials.createInsecure());\n this.server.start();\n this.started = true;\n }", "title": "" }, { "docid": "b8ef9a2060daa260f64daa4a83623581", "score": "0.66332513", "text": "startServer(...args) {\n return this.listen(...args);\n }", "title": "" }, { "docid": "3ac17e4457da6d2d903aca5c5a338211", "score": "0.66243315", "text": "function start()\n{\n\t// Verify if the server is making his first start\n\tfirstStart();\n\n\t// Create routes\n\trouter();\n\n\tExpressApp.listen(Config.app.port, function(err)\n\t{\n\t\tif(!err)\n\t\t{\n\t\t\tuShare.notice(`App started on port ${Config.app.port}`);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c78d2f464f4f390e2c702c6de845560", "score": "0.66166764", "text": "function startServer() {\n \"use strict\";\n\n var webServer = http.createServer(app);\n PushNotifications.startWebSocketServer(webServer);\n webServer.listen(app.get('port'), function() {\n console.log('server started on port ' + app.get('port') +\n ' in ' + app.get('env') + ' mode; press Ctrl+C to terminate');\n });\n}", "title": "" }, { "docid": "3ec6516108f436f6a8435c98baeccc48", "score": "0.66142154", "text": "function startServer (callback) {\n const server = app.listen(8080, () => {\n const host = server.address().address;\n const port = server.address().port;\n console.log(\"Server listening at http://%s:%s\", host, port);\n callback();\n });\n}", "title": "" }, { "docid": "292e90ec6f6c2db985b105d587768812", "score": "0.66122615", "text": "async function startServer () {\n try {\n // Create a server with a host and port\n const server = new Hapi.server({port: config.server.port, address: config.server.address});\n await validateConfig(config);\n await registerPlugins(server);\n logger.log(`starting service with configuration: ${JSON.stringify(config, null, 2)}`);\n await server.start();\n logger.log('Server running at:', server.info.address);\n } catch (err) {\n logger.error(`error: ${err.stack}`);\n }\n}", "title": "" }, { "docid": "4a59ee47a44b86564123d4fdcb92e6c7", "score": "0.660833", "text": "function startServer(port) {\n var connect = require(kettlePath);\n var open = require('open');\n\n connect.createServer(connect[\"static\"](__dirname)).listen(port);\n console.log(\"Preferences Management Tool server running...\");\n console.log(\"Visit http://\"+ host + \":\" + port + \"/demos/prefsEditor/index.html\");\n open(\"http://\"+ host + \":\" + port + \"/demos/prefsEditor/index.html\");\n}", "title": "" }, { "docid": "0ce060ac3a604ce82d0fda69cfe08585", "score": "0.6606267", "text": "function start_local_server (arg) {\n console.log('Starting Local Server.')\n child = exec('./scripts/local-server-start.sh \\'' + arg.path + '\\' ' + arg.port, function (error, stdout, stderr) {\n console.log('Output: ' + stdout)\n console.log('Error: ' + error)\n console.log('Stderr: ' + stderr)\n })\n localServerStarted = true\n socket = io('http://localhost:8021/ui')\n console.log('LOCAL SERVER STARTED')\n startFileListener(arg.path)\n}", "title": "" }, { "docid": "c0ae0682a56196bc8b3dadda78ef19fb", "score": "0.6596941", "text": "function start (PORT){\n server.listen(PORT,()=>{\n console.log(`Listening on port : ${PORT}`);\n });\n}", "title": "" }, { "docid": "3921665c1f53c2d56e6dc4b3e69d47f5", "score": "0.6580571", "text": "function start (callback) {\n server.listen(options.port, options.hostname, undefined, function () {\n log('SPA server is now accepting requests on port: ' + options.port);\n if ('function' === typeof callback) {\n callback();\n }\n });\n }", "title": "" }, { "docid": "c1a75228676a4fba37bacedbd8791ae2", "score": "0.65780306", "text": "function onStart() {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log('Started connect web server on http://' + hostname + ':' + port);\n\t}", "title": "" }, { "docid": "3d3ca6830d785c141483465dcc9bbf44", "score": "0.65547687", "text": "function listening(){\n console.log('the server is indeed listening on port 8000');\n}", "title": "" }, { "docid": "dabaca5468ad2b08155f5d39cf24f8cf", "score": "0.65466404", "text": "function startServer() {\n log.info('Start web socket server.', {port: self.port});\n server = new WebSocketServer({port: self.port});\n server.on('connection', handleConnection);\n }", "title": "" }, { "docid": "eca1112c1adef835e924dd14f80e0696", "score": "0.6531576", "text": "function serverConnected() { println('connected to server.');}", "title": "" }, { "docid": "a30e88ca95b60a7acb13095b5cb718e2", "score": "0.6514381", "text": "function start() {\n logger.info(\"Starting the server using startup function\");\n var port = process.env.PORT || 9002;\n app.listen(port, '0.0.0.0', function() {\n logger.info(\"Listening on : \", port);\n });\n logger.info(\"Express server listening on port %d \", port);\n}", "title": "" }, { "docid": "a53beaff57cebc6a376def235507c081", "score": "0.6497157", "text": "function serverConnected() {\n print(\"Connected to Server\");\n}", "title": "" }, { "docid": "a53beaff57cebc6a376def235507c081", "score": "0.6497157", "text": "function serverConnected() {\n print(\"Connected to Server\");\n}", "title": "" }, { "docid": "da3e14340f75f2dfc8ee0ff249d8de4d", "score": "0.6496228", "text": "function serverConnected() {\n print(\"Connected to Server\");\n }", "title": "" }, { "docid": "9a9b359c585126934bb056eb6e3771de", "score": "0.64771557", "text": "start() {\n\t\tlet self = this;\n\t\tthis.app.listen(this.app.get(\"port\"), () => {\n\t\t\tconsole.log(`Server Listening for port: ${self.app.get(\"port\")}`);\n\t\t});\n\t}", "title": "" }, { "docid": "9a9b359c585126934bb056eb6e3771de", "score": "0.64771557", "text": "start() {\n\t\tlet self = this;\n\t\tthis.app.listen(this.app.get(\"port\"), () => {\n\t\t\tconsole.log(`Server Listening for port: ${self.app.get(\"port\")}`);\n\t\t});\n\t}", "title": "" }, { "docid": "c88f758eaedce02f77acc655483af410", "score": "0.6473614", "text": "function listen() {\r\n var host = server.address().address;\r\n var port = server.address().port;\r\n console.log('Application started at http://' + host + ':' + port);\r\n}", "title": "" }, { "docid": "f34747f836bf1c1568c826cdabcd4fe1", "score": "0.64492697", "text": "function onListening() {\n \tvar addr = server.address();\n \tvar bind = typeof addr === 'string'\n \t? 'pipe ' + addr\n \t: 'port ' + addr.port;\n\t// debug('Listening on ' + bind);\n\tconsole.log('HTTP server is up and running in port ' + bind);\n}", "title": "" }, { "docid": "26f65effb54a7497c3138dfe7fb56985", "score": "0.644455", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n if (global.init.server_init_log)\n console.log(\"webserver start listening on port -> \" + port);\n }", "title": "" }, { "docid": "b8dd482b1e9d61bc834851106840da6a", "score": "0.64292324", "text": "function serverStart() {\n var port = this.address().port;\n var addresses = [];\n\tfor (var k in interfaces) {\n\t\tfor (var k2 in interfaces[k]) {\n\t\t\tvar address = interfaces[k][k2];\n\t\t\tif (address.family === 'IPv4' && address.address !== '127.0.0.1' && !address.internal){\n\t\t\t\taddresses.push(address.address);\n\t\t\t}\n\t\t}\n\t}\n\tconsole.log(\"Ip:\",addresses[0]);\n\tconsole.log(\"Port:\",port);\n\tconsole.log(\"Scrolling IP Address\")\n\ttextProgram = spawn(\"python3\",[\"/home/aidan/nodeServer/textScroller.py\",\"Go to \"+addresses[0]+\":\"+port]); \n\ttextProgram.on('error', (error) => {\n\t\tconsole.log(`error: ${error.message}`);\n\t});\n\n\ttextProgram.on(\"close\", code => {\n\t\tconsole.log('IP Scroller Closed');\n\t});\n}", "title": "" }, { "docid": "b3fd3facf84833b00c5e7617ef9db733", "score": "0.6427995", "text": "function listen(){\n let host = server.address().address;\n let port = server.address().port;\n console.log('MasterWord.plus Server Started at http://' + host + ':' + port+'/');\n console.log (server)\n}", "title": "" }, { "docid": "d46e90e95698bca1c9c7f31f13a3fc5a", "score": "0.6413752", "text": "function startServer(handle){\n\tconsole.log(\"Server started\");\n\thttp.createServer(\n\t\tfunction(request, response){\n\t\t\tvar pathname = url.parse(request.url).pathname;\n\t\t\tvar queryData = url.parse(request.url,true).query;\n\t\t\trouter.route(handle, pathname, queryData, function(err, data){\n\t\t\t\tresponse.writeHead(200,{\"Content-Type\" : \"text/html\"});\n\t\t\t\tif (err || !data || Object.keys(data).length < 1)\n\t\t\t\t\tresponse.end('_log(\\''+'false'+'\\')');\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t\tresponse.end('_log(\\''+JSON.stringify(data)+'\\')');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t).listen(8888);\n}", "title": "" }, { "docid": "98d95dc61ebf405518664d46d9e77068", "score": "0.6413499", "text": "function startServer() {\n return new Promise((resolve, reject) => {\n const server = net.createServer(socket => {\n resolve(socket);\n });\n server.on('error', err => {\n console.error('listener failed', err);\n process.exit(1);\n });\n server.listen('/tmp/swift.sock');\n });\n}", "title": "" }, { "docid": "c9f114736664e02e358e2f1a193089d6", "score": "0.64122367", "text": "start() {\n logger.debug(`\\n${logPrefix} Start(). Starting port: `, port);\n\n app.listen(port, (err) => {\n logger.debug(`${logPrefix} Start(). [%s] Listening on http://localhost:%d: `, process.env.NODE_ENV, port);\n });\n }", "title": "" }, { "docid": "4b5b0330a2943d307a5b6bd0082af2ee", "score": "0.64120495", "text": "async startService() {\n\t\tconst { router, httpServer } = this.assembly;\n\t\tassert(router, 'expected router');\n\t\t// assert(logger, 'expected logger');\n\t\tassert(httpServer, 'expected httpServer');\n\t\tawait router.registerRoutes();\n\t\tawait new Promise(resolve => httpServer.listen(port, () => resolve()));\n\t\tconsole.log('We are live on ' + port);\n\t}", "title": "" }, { "docid": "2bccd5e120ac21edfa921991ddf3dc0f", "score": "0.6405414", "text": "function onListening() {\n var addr = server.address()\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port\n\n for (let line of startupMessage.split('\\n')) {\n console.log(line)\n }\n console.dir(`http://localhost:${port}/`)\n console.log('Server listening on ' + bind + ' 🚀')\n}", "title": "" }, { "docid": "b2dc45b98f3c905659e8151cf7bfbe42", "score": "0.6391907", "text": "function listening() {\n console.log(`Server is running on localhost:${port}`);\n}", "title": "" }, { "docid": "b2dc45b98f3c905659e8151cf7bfbe42", "score": "0.6391907", "text": "function listening() {\n console.log(`Server is running on localhost:${port}`);\n}", "title": "" }, { "docid": "23588bf2f6ae5f9c3de266e6d0d259c1", "score": "0.63877666", "text": "function onListening(){\n console.log(\"Server is listeneing on port: \" + server.address().port);\n}", "title": "" }, { "docid": "7cc2ecdcad79edf333702209a2779b05", "score": "0.63805264", "text": "function start_server () {\n\tvar server = new msp.Proxy();\n\tserver.listen(8050);\n\tlog(\"Proxying from http://:8050\");\n}", "title": "" }, { "docid": "67c94ddbd7f59270be6004b6f55b53d8", "score": "0.6366401", "text": "start (port = 5000) {\n // Just call listen with the passed port\n this._server.listen(port, () =>\n // Log that this is listening\n this.logger.log(`Bus listening at: localhost:${this._server.address().port}`)\n )\n }", "title": "" }, { "docid": "82386c63cfc78199558a4fc6e643137c", "score": "0.6361634", "text": "function onListening() {\n const LOG_TAG = 'createServer_onListening ';\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log.info(`${LOG_TAG} Process PID: ${process.pid} Server started listening on ${bind}`);\n }", "title": "" }, { "docid": "e8e8dd50248ce93a1af367726d332f89", "score": "0.63486505", "text": "function serverConnected() {\n println(\"Connected to Server\");\n}", "title": "" }, { "docid": "9722276cb0a69b185514fa0562a5647c", "score": "0.63400704", "text": "async start () {\n return this.serverManager.start()\n }", "title": "" }, { "docid": "ca959816031306f5d9d9c798c6061d86", "score": "0.6339672", "text": "function RESTServer__start(port) {\n\n //\n // Local variables\n //\n var server, fn;\n\n //\n // Use a bind on our callback so we can preserve \"this\"\n //\n fn = RESTServer__onRequest.bind(this);\n\n //\n // Set up server\n //\n server = http.createServer(function(req, res) {\n\n process_body(req, function() {\n\n fn(req, res);\n\n });\n\n }).listen(port);\n\n}", "title": "" }, { "docid": "c8f4f1dabe8b8825149b517fcecc88b3", "score": "0.6339207", "text": "start(port) {\n return new Promise((resolve, reject) => {\n try {\n // TODO: what about other listener options?\n // TODO: what about asynchronous errors? should we attach a handler for this.server.on('error', ...)?\n // if so, how can we check for only errors related to listening, as opposed to later errors?\n this.server.listen(port, () => {\n resolve(this.server);\n });\n }\n catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "79668d4541fc424a30d0fb37b6f47a53", "score": "0.63360226", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n\n console.log(`Started server on ${Settings.defaultUrl}`);\n console.log(`Admin password: ${Settings.password}`);\n\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "79bbf2e20f28c94d7c39df1ae50e320e", "score": "0.6328552", "text": "listen() {\n // listen on provided ports\n this.express_server = this.server.listen(this.port);\n\n // add error handler\n this.server.on(\"error\", error => {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n const bind =\n typeof this.port === \"string\"\n ? `Pipe ${this.port}`\n : `Port ${this.port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n this._logger.error(\"requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n this._logger.error(bind, \" is already in use\");\n process.exit(1);\n break;\n\n default:\n throw error;\n }\n });\n\n // start listening on port\n this.server.on(\"listening\", () => {\n this._logger.info(\"Server ready. Listening on port \", this.port);\n });\n }", "title": "" }, { "docid": "bc33ae85f882625de6547cc6b565f3cc", "score": "0.6316905", "text": "_onServerListening() {\n logger.info('Server is running');\n }", "title": "" }, { "docid": "1a33b239ff3e311f6fe59694dd56a7d8", "score": "0.6312336", "text": "function startListening() {\n\tapp.listen(80, function() {\n\t\tconsole.log(\"👏🏼 LUKE, I AM YOUR SERVER! Listin in port 80\");\n\t});\n}", "title": "" }, { "docid": "fe307ae1867c125db52f0425c3fe9714", "score": "0.6311737", "text": "function Server(){}", "title": "" }, { "docid": "91928a4c28308b23059c23d1c07e0686", "score": "0.63108885", "text": "function serverConnected() {\n print('connected to server.');\n}", "title": "" }, { "docid": "91928a4c28308b23059c23d1c07e0686", "score": "0.63108885", "text": "function serverConnected() {\n print('connected to server.');\n}", "title": "" }, { "docid": "6a78c19220df807a9831a9423dc219c4", "score": "0.6298504", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n console.log(`server is running on port ${port}`);\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "7a8c6f6fcb0299d789ed0b655731333a", "score": "0.6296254", "text": "function createServer() {\n\tconst script = getScriptPath();\n\tconst cp = require(\"child_process\");\n\t// if (!isPackaged()) server = cp.spawn(\"python\", \"server.py\");\n\n\tconsole.log(script);\n\n\tif (!isPackaged()) server = cp.spawn(\"python3\", [script, PORT]);\n\telse server = cp.execFile(script, [PORT]);\n\n\tutil.log(\"readingin\");\n\n\tprocess.stdout.on(\"data\", function (chunk) {\n\t\tlet textChunk = chunk.toString(\"utf8\"); // buffer to string\n\n\t\tutil.log(textChunk);\n\t});\n\n\tserver.stderr.on(\"error\", (err) => {\n\t\tconsole.log(\"Server threw an error: \" + err);\n\t});\n\tserver.on(\"close\", (code) => {\n\t\tconsole.log(\"Server exited with code \" + code);\n\t});\n}", "title": "" }, { "docid": "4995cd573ec628aae9a9ed35a2591129", "score": "0.6295076", "text": "function listening() {\r\n console.log(`Server is listening in port ${PORT}`);\r\n}", "title": "" }, { "docid": "392a417920e88f768529ed8218f51090", "score": "0.6291098", "text": "function server_init() {\n\tif (server_port != 0) {\n\n\t\t// Create a server instance, and chain\n\t\t// the listen function to it\n\t\t// The function passed to net.createServer()\n\t\t// becomes the event handler for the\n\t\t// 'connection' event. The sock object the\n\t\t// callback function receives UNIQUE for\n\t\t// each connection\n\n\t\tserver = net.createServer(function(sock) {\n\n\t\t\t// We have a connection - a socket object\n\t\t\t// is assigned to the connection\n\t\t\t// automatically\n\n\t\t\tconsole.log('CONNECTED: ' + sock.remoteAddress +':'+ sock.remotePort);\n\n\t\t\t// Add a 'data' event handler to this\n\t\t\t// instance of socket\n\n\t\t\tsock.on('data', function(data) {\n\t\t\t\tsock.write(cart_server_receiver(sock,data));\n\t\t\t});\n\n\t\t\t// Add a 'close' event handler to this\n\t\t\t// instance of socket\n\n\t\t\tsock.on('close', function(data) {\n\t\t\t\tconsole.log('CLOSED: ');\n\t\t\t});\n\n\t\t}).listen(server_port, server_ip);\n\t\tconsole.log('LISTENING on:' + server_ip +':'+ server_port);\n\t}\n}", "title": "" }, { "docid": "385fb956eaf386f048ddf76065455b30", "score": "0.62788486", "text": "run() {\n\n let server;\n\n if (this.httpServer) {\n\n server = this.httpServer;\n\n } else {\n\n server = this.application;\n }\n\n this._server = server.listen(this.config.env.SERVER_PORT, this.config.env.SERVER_HOST, () => {\n\n this.emit(ApplicationEvent.SERVER_STARTED);\n\n const host = this.server.address().address;\n const port = this.server.address().port;\n\n this._logger.debug('Server is UP and Running. Listening at http://%s:%s', host, port);\n });\n }", "title": "" }, { "docid": "5f76b3e42bfc6b75d0cd8e28271d86bf", "score": "0.6277899", "text": "function onListening() {\n debug('Listening on port ' + server.address().port);\n}", "title": "" }, { "docid": "d040d61932402302dafbd0cff3b0f1cd", "score": "0.6265527", "text": "function onListening() {\n console.log('启动成功')\n}", "title": "" }, { "docid": "8dc5513e2d492eef2af6fc3ca2b1cbb1", "score": "0.62627655", "text": "function _startHTTPServer (callback) {\n\tvar proc = cp.spawn('node', [\"app.js\"]);\n\tproc.stdout.on('data', function (data) {\n\t if (!that.isServerStart) {\n\t \tconsole.log('Http Server : '.cyan + data);\n\t \tthat.isServerStart = true;\n\t\tcallback && callback();\n\t }\n\t});\n\n\tproc.stderr.on('data', function (data) {\n\t console.log('stderr: ' + data);\n\t});\n\n\tproc.on('exit', function (code) {\n\t console.log('Exit Http Server...');\n\t});\n\t//记住该服务进程\n\tthat._serverPid = proc.pid;\n}", "title": "" }, { "docid": "a9ed5a39639fa90f2e9b1afb4feae496", "score": "0.62532884", "text": "start() {\n return new Promise((resolve) => {\n let serverOpts = {express: this.express, config: config};\n this.server = new Server(serverOpts);\n resolve(this.server.start());\n })\n }", "title": "" }, { "docid": "e83f296b0f349b0d3c6d022112e56b06", "score": "0.6244307", "text": "function onListening() {\n console.log(' * * * STARTING * * * \\n\\n');\n console.log(`Listening on port ${port}`);\n}", "title": "" }, { "docid": "19fd2f6bf3d447563c19f270f686d730", "score": "0.62419325", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n\tLogManager.getConsole().info(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "bc9591b1932a0bd49001b380d986e1a2", "score": "0.62397313", "text": "signalStartReady() {\n if (!this.config.autostart) return;\n\n if (this.config.serverDataPath === null || this.config.cfgPath === null) {\n return console.warn('Please open txAdmin on the browser to configure your server.');\n }\n\n if (!globals.adminVault || !globals.adminVault.admins) {\n return console.warn('The server will not auto start because there are no admins configured.');\n }\n\n this.spawnServer(true);\n }", "title": "" }, { "docid": "e289708cf94963f7200fd6b1fb50d5e2", "score": "0.6234818", "text": "async function startServer() {\n await mongoConnect();\n await loadPlanetsData(); // wait for data to load\n await loadLaunchData();\n\n server.listen(PORT, () => {\n console.log(`Listening on port ${PORT}...`)\n });\n}", "title": "" }, { "docid": "637282a8d7653b21775812ab7f584832", "score": "0.6215813", "text": "function start(server_module) {\n console.log('starting Synco Stairs', new Date());\n server = server_module;\n\n board = new Board({\n debug: true,\n onError: function(err) {\n console.log('BOARD ERROR');\n console.log(err);\n },\n onInit: function(res) {\n if (res) {\n for(var i = 0; i < sensors.length; i++) {\n sensors[i].instance = sensors[i].type(sensors[i].name, sensors[i].pin);\n }\n\n setTimeout(function() {\n console.log('End setup');\n setupMode = false;\n }, 10000);\n\n console.log('Synco Stairs is ready', new Date());\n } else {\n console.log('SYNCO STAIRS CANNOT START');\n }\n }\n });\n\n board.init();\n}", "title": "" }, { "docid": "5c86cbf8288176090815c534843da571", "score": "0.62087625", "text": "function onListening() {\n var addr = server.address();\n var bind = 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "71c499d414c264a68dd460c7dac16582", "score": "0.6205071", "text": "_run() {\n debug('starting server...');\n const iface = this.config.server_interface;\n const port = this.config.server_port;\n this.server = http.createServer((req, res) => {\n log(req.method, chalk.underline(req.url), `HTTP/${req.httpVersion}`);\n this.app.handle(req, res, this._handleRequest.bind(this, req, res));\n });\n\n this.io = socket(this.server, Object.assign({\n }, this.config.socketOptions));\n initSocket(this.io, this.handler);\n this.server.listen(port, iface, () => {\n log('Listening on', `${iface}:${port}`);\n });\n }", "title": "" }, { "docid": "22112fdf322d01ad6c450a783d48cb0a", "score": "0.62035316", "text": "function start() {\n listen()\n}", "title": "" }, { "docid": "efb2f2037ce8bc91c506528a9ceaf545", "score": "0.62032884", "text": "function onListening() {\n\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n\n debug('Server running at http://' + getIp() + ':' + port +'/');\n}", "title": "" }, { "docid": "2eb84dc454c3004c0f8fa8f6578d6c7c", "score": "0.61894643", "text": "function start(port) {\n app.listen(port, () => console.log(`Server up on ${port}`))\n}", "title": "" }, { "docid": "cf17316f8f705f154f2572b36f9b0ab2", "score": "0.6188174", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('node app started', bind);\n}", "title": "" }, { "docid": "5ce8f7459e43f1f652f357db3fd065f9", "score": "0.6187519", "text": "function start () {\n listen()\n}", "title": "" }, { "docid": "f4c89b6bac92c4e56e5a2d7ac2d91fee", "score": "0.61853105", "text": "function onListening() {\n var addr = this.server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log(`...server started on ${bind} with NODE_ENV: ${config.NODE_ENV}`.green);\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "5fe33890210f8ed3fe459fda14578098", "score": "0.6167897", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : (addr) ? 'port ' + addr.port : '';\n debug('Listening on ' + bind);\n console.log(\"=============\");\n console.log(\"=============\");\n console.log(\"App is listening from port: \" + port);\n}", "title": "" }, { "docid": "f91b453ef37ab1575a762236a88eb04f", "score": "0.6157537", "text": "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\r\n debug(\"Listening on \" + bind);\r\n}", "title": "" }, { "docid": "fc076fadf476b58ddb2a2fb654d29aea", "score": "0.6155986", "text": "listen (_port = null) {\n\n\t\tconst sharedLogger = this.__dep(`sharedLogger`);\n\t\tconst port = _port || this.options.port;\n\n\t\tsharedLogger.info(`Starting server...`);\n\n\t\tif (!port) { throw new Error(`You must specify a port for the server!`); }\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.server.listen(port, err => { // eslint-disable-line promise/prefer-await-to-callbacks\n\t\t\t\tif (err) { return reject(err); }\n\t\t\t\tsharedLogger.info(`Server ready!`);\n\t\t\t\treturn resolve();\n\t\t\t});\n\t\t});\n\n\t}", "title": "" } ]
78cb1006f8b34db8c8134572d43a76b1
Get the offset for numbering generated subgroups. This is best explained by an example: A learner group 'Foo' has three similarly named subgroups 'Foo 1', 'Foo 2', and 'Foo 4'. The highest identified subgroup number is 4, so the offset for generating new subgroups is 5. If no subgroups exist, or none of the subgroup names match the (Parent) (Number) pattern, then the offset will default to 1.
[ { "docid": "68bd9a651b625c6023813eb2c4ecd1cb", "score": "0.73951745", "text": "async getSubgroupNumberingOffset() {\n const regex = new RegExp('^' + escapeRegExp(this.title) + ' ([0-9]+)$');\n const groups = await this.children;\n let offset = groups.reduce((previousValue, item) => {\n let rhett = previousValue;\n const matches = regex.exec(item.get('title'));\n if (matches) {\n rhett = Math.max(rhett, parseInt(matches[1], 10));\n }\n return rhett;\n }, 0);\n return ++offset;\n }", "title": "" } ]
[ { "docid": "e45283242090a46cf0bfa0c6b4d73871", "score": "0.54446423", "text": "_endIndexForKnownLayerGroup(layerGroup) {\n const groupIndex = layerGroup.groupIndex;\n\n if (groupIndex === this._groupOrdering.length - 1) {\n return this._drawList.length;\n }\n\n return this._layerGroups[this._groupOrdering[groupIndex + 1]].drawListOffset;\n }", "title": "" }, { "docid": "b2580f71fc939db67e70ae24c5100506", "score": "0.5368181", "text": "function getGroupLocation(groupId){\n var index = 0;\n \n for(var i = 0; i < groups.Groups.length; i++){\n if(groups.Groups[i].id == groupId){\n index = i;\n break;\n }\n }\n return index;\n}", "title": "" }, { "docid": "3c57eb0bd534be4c38ae2b2f13852e22", "score": "0.53307295", "text": "function computeGroupIndicesRecursive(group, currentRowIndex, groups) {\n group.rowIndex = currentRowIndex;\n if (hasChildren(group) && hasItems(group)) {\n console.log('Error for group:');\n console.log(group);\n throw new Error('a group cannot have both children and items');\n }\n // Not leaf.\n if (hasChildren(group)) {\n let rowSpan = 0;\n for (const childGroupName of group.children) {\n const childGroup = groups.get(childGroupName);\n rowSpan += computeGroupIndicesRecursive(childGroup, currentRowIndex + rowSpan, groups);\n }\n group.rowSpan = rowSpan;\n }\n // For leaf group this is already set.\n return group.rowSpan;\n }", "title": "" }, { "docid": "3bb51f92e2848ed9c9c878b3be16d708", "score": "0.52459276", "text": "getGroupNumber(group) {\n if (this.groupMap.has(group)) {\n return this.groupMap.get(group);\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "5bdbf7ad392013afcf0c07fceadb56bd", "score": "0.5237674", "text": "function computeGroupPositions() {\n\tvar max;\n\tmax = 0;\n\tgroups.forEach(function(group){\n\t\tgroup.min = max;\n\t\tgroup.max = max = characterGroupHeight(group.appearances.length) + group.min;\n\t\tmax += groupMargin;\n\t});\n}", "title": "" }, { "docid": "43f05a37f9920dcdf7d831c52b0fcc9b", "score": "0.5092846", "text": "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "title": "" }, { "docid": "46b9742f9b86f1fb4b3990f758829dbb", "score": "0.4999905", "text": "function getNextGroupByForDrillDown(groupBy, groupByValues){\n\tvar nextLevel = null;\n\tvar index = groupByValues.indexOf(groupBy);\n\tif (index < groupByValues.length - 1 && groupByValues[index + 1] != 'facility_type') {\n\t\tnextLevel = groupByValues[index + 1];\n\t}\n\treturn nextLevel;\n}", "title": "" }, { "docid": "22bffd16e5b2c4dfb2acb16bb47fa545", "score": "0.49542212", "text": "function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n let optionsArray = options.toArray();\n let groups = optionGroups.toArray();\n let groupCounter = 0;\n for (let i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n return groupCounter;\n }\n return 0;\n}", "title": "" }, { "docid": "22bffd16e5b2c4dfb2acb16bb47fa545", "score": "0.49542212", "text": "function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n let optionsArray = options.toArray();\n let groups = optionGroups.toArray();\n let groupCounter = 0;\n for (let i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n return groupCounter;\n }\n return 0;\n}", "title": "" }, { "docid": "a9f87028efba6b3828302d132c57fdf5", "score": "0.49526978", "text": "_getLevel(parentId, defaultLevel) {\n let root = this,\n parent = document.querySelector(\"#\" + parentId),\n parentLvl =\n parent !== null && parent.level !== undefined\n ? parent.level\n : defaultLevel - 1,\n level = parentLvl < 6 ? parentLvl + 1 : 6;\n return level;\n }", "title": "" }, { "docid": "6743fe3c7fee2a27b414fdbbd3981966", "score": "0.48760384", "text": "function getOffset() {\n\n\t\t\tvar hasData = associatedSeries.length && defined(min) && defined(max),\n\t\t\t\ttitleOffset = 0,\n\t\t\t\ttitleMargin = 0,\n\t\t\t\taxisTitleOptions = options.title,\n\t\t\t\tlabelOptions = options.labels,\n\t\t\t\tdirectionFactor = [-1, 1, 1, -1][side],\n\t\t\t\tn;\n\n\t\t\tif (!axisGroup) {\n\t\t\t\taxisGroup = renderer.g('axis')\n\t\t\t\t\t.attr({ zIndex: 7 })\n\t\t\t\t\t.add();\n\t\t\t\tgridGroup = renderer.g('grid')\n\t\t\t\t\t.attr({ zIndex: 1 })\n\t\t\t\t\t.add();\n\t\t\t}\n\n\t\t\tlabelOffset = 0; // reset\n\n\t\t\tif (hasData || isLinked) {\n\t\t\t\teach(tickPositions, function (pos) {\n\t\t\t\t\tif (!ticks[pos]) {\n\t\t\t\t\t\tticks[pos] = new Tick(pos);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tticks[pos].addLabel(); // update labels depending on tick interval\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\t\teach(tickPositions, function (pos) {\n\t\t\t\t\tticks[pos].attachLabel();\n\t\t\t\t});\n\t\t\t\teach(tickPositions, function (pos) {\n\t\t\t\t\tticks[pos].computeBBox();\n\t\t\t\t});\n\t\t\t\teach(tickPositions, function (pos) {\n\t\t\t\t\tticks[pos].updateTransformLabel();\n\t\t\t\t});\n\n\t\t\t\teach(tickPositions, function (pos) {\n\t\t\t\t\t// left side must be align: right and right side must have align: left for labels\n\t\t\t\t\tif (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === labelOptions.align) {\n\n\t\t\t\t\t\t// get the highest offset\n\t\t\t\t\t\tlabelOffset = mathMax(\n\t\t\t\t\t\t\tticks[pos].getLabelSize(),\n\t\t\t\t\t\t\tlabelOffset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\t\tif (staggerLines) {\n\t\t\t\t\tlabelOffset += (staggerLines - 1) * 16;\n\t\t\t\t}\n\n\t\t\t} else { // doesn't have data\n\t\t\t\tfor (n in ticks) {\n\t\t\t\t\tticks[n].destroy();\n\t\t\t\t\tdelete ticks[n];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (axisTitleOptions && axisTitleOptions.text) {\n\t\t\t\tif (!axis.axisTitle) {\n\t\t\t\t\taxis.axisTitle = renderer.text(\n\t\t\t\t\t\taxisTitleOptions.text,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t0\n\t\t\t\t\t)\n\t\t\t\t\t.attr({\n\t\t\t\t\t\tzIndex: 7,\n\t\t\t\t\t\trotation: axisTitleOptions.rotation || 0,\n\t\t\t\t\t\talign:\n\t\t\t\t\t\t\taxisTitleOptions.textAlign ||\n\t\t\t\t\t\t\t{ low: 'left', middle: 'center', high: 'right' }[axisTitleOptions.align]\n\t\t\t\t\t})\n\t\t\t\t\t.css(axisTitleOptions.style)\n\t\t\t\t\t.add();\n\t\t\t\t}\n\n\t\t\t\ttitleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];\n\t\t\t\ttitleMargin = pick(axisTitleOptions.margin, horiz ? 5 : 10);\n\n\t\t\t}\n\n\t\t\t// handle automatic or user set offset\n\t\t\toffset = directionFactor * pick(options.offset, axisOffset[side]);\n\n\t\t\taxisTitleMargin =\n\t\t\t\tlabelOffset +\n\t\t\t\t(side !== 2 && labelOffset && directionFactor * options.labels[horiz ? 'y' : 'x']) +\n\t\t\t\ttitleMargin;\n\n\t\t\taxisOffset[side] = mathMax(\n\t\t\t\taxisOffset[side],\n\t\t\t\taxisTitleMargin + titleOffset + directionFactor * offset\n\t\t\t);\n\n\t\t}", "title": "" }, { "docid": "e30ca88bbd6fb79f6f3afa984649a1eb", "score": "0.48333046", "text": "function getOffset(offset) {\n\t\t\t// Add all insertions before this location together to calculate\n\t\t\t// the current offset\n\t\t\tfor (var i = 0, l = insertions.length; i < l; i++) {\n\t\t\t\tvar insertion = insertions[i];\n\t\t\t\tif (insertion[0] >= offset)\n\t\t\t\t\tbreak;\n\t\t\t\toffset += insertion[1];\n\t\t\t}\n\t\t\treturn offset;\n\t\t}", "title": "" }, { "docid": "ec0b8bd2c09cf45fccf4a591c9646c81", "score": "0.48024982", "text": "get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }", "title": "" }, { "docid": "ec0b8bd2c09cf45fccf4a591c9646c81", "score": "0.48024982", "text": "get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }", "title": "" }, { "docid": "ec0b8bd2c09cf45fccf4a591c9646c81", "score": "0.48024982", "text": "get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }", "title": "" }, { "docid": "72b12836d3d1ffd52af580af206346ec", "score": "0.47667158", "text": "get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }", "title": "" }, { "docid": "e21fc24586bcbc3f2c635a3afe1cf1fd", "score": "0.47516558", "text": "getLabelPosition() {\n const labelPosition = this.labelPosition || 'top';\n return labelPosition;\n }", "title": "" }, { "docid": "5c83221333e80f2879384d1ff0e1e1af", "score": "0.47480673", "text": "function findGroup(find, groups) {\n let total = 0;\n for (let index = 0; index < groups.length; index += 1) {\n total += groups[index];\n if (find < total) return index;\n }\n return -1;\n}", "title": "" }, { "docid": "5c83221333e80f2879384d1ff0e1e1af", "score": "0.47480673", "text": "function findGroup(find, groups) {\n let total = 0;\n for (let index = 0; index < groups.length; index += 1) {\n total += groups[index];\n if (find < total) return index;\n }\n return -1;\n}", "title": "" }, { "docid": "b3d68561003d517fb16460b5b203a734", "score": "0.47218663", "text": "function fixOffset(n) {\n return n + 1;\n }", "title": "" }, { "docid": "a8df61345cc5bf86d2d03f61680d88db", "score": "0.471425", "text": "getChildIndentationText(offset = 0) {\r\n return this._getIndentationTextForLevel(this.getChildIndentationLevel() + offset);\r\n }", "title": "" }, { "docid": "072f2124c19da90cd92d660080b5bb86", "score": "0.4711563", "text": "function get_split_mk6_betline_pos(str_mk6) {\n var num_of_picks_in_first_line = 3;\n var temp_count = 0;\n for (var i = 0; i < str_mk6.length; i++) {\n if (str_mk6.charAt(i) == '+' || str_mk6.charAt(i) == '>')\n temp_count++;\n if (temp_count >= num_of_picks_in_first_line)\n break;\n }\n return i;\n}", "title": "" }, { "docid": "c15b80c63cf86f7f2f04289d86cba195", "score": "0.4710664", "text": "getGroupWidth(depth) {\n const remainingDepths = this.groupWidths.slice(depth, this.maxGroupDepth + 1);\n return remainingDepths.reduce((sum, next) => sum + next, 0) + (remainingDepths.length - 1) * this.style.groupColGap;\n }", "title": "" }, { "docid": "1512fc06be0f7ce78b16018910710ecf", "score": "0.4693077", "text": "function JSFieldIndex(field) {\n // Determine whether this field is a member of a group. Group fields are a bit\n // wonky: their \"containing type\" is a message type created just for the\n // group, and that type's parent type has a field with the group-message type\n // as its message type and TYPE_GROUP as its field type. For such fields, the\n // index we use is relative to the field number of the group submessage field.\n // For all other fields, we just use the field number.\n const containingType = field.getContainingType();\n const parentType = containingType.getContainingType();\n if (parentType) {\n for (const f of parentType.getFieldList()) {\n if (f.getType() == FieldDescriptor.Type.TYPE_GROUP &&\n f.getMessageType() == containingType) {\n return (field.getNumber() - f.getNumber()).toString();\n }\n }\n }\n return field.getNumber().toString();\n}", "title": "" }, { "docid": "4e8abb9a9cdd6f516982f5ecfb8a187c", "score": "0.46907508", "text": "function groupCodeToIndex(code)\n{\t\n\tvar ucc = code.toUpperCase();\n\tif(ucc == \"C\")\t//combat group\n\t{\n\t\tindex = 0;\n\t}\n\telse if(ucc == \"M\") //magic group\n\t{\n\t\tindex = 1;\n\t}\n\telse\t//stealth group (by default)\n\t{\n\t\tindex = 2;\n\t}\n\treturn index\n}", "title": "" }, { "docid": "b3f3178f50c97a8cb3d791441313a45d", "score": "0.4661664", "text": "function countInGroup(group, all) {\n let count = 0;\n let start = 0;\n\n for (let i = 0; i < PageData.DiagramGroups.length; i += 1) {\n if (i === group) {\n const end = start + PageData.DiagramGroups[i];\n for (let allIndex = start; allIndex < end; allIndex += 1) {\n if (all[allIndex]) {\n count += 1;\n }\n }\n return count;\n }\n start += PageData.DiagramGroups[i];\n }\n\n return -1;\n}", "title": "" }, { "docid": "d07f67a5820e682195ad97e85d96b4f8", "score": "0.46457908", "text": "assignPosition(node, position) { \n // assign the position\n node.position = position;\n\n // if the node is a \"leaf\" (on the end of a tree branch) end the recursion and let the above\n // function know to add 1 to the position \n if(node.children.length == 0){\n return 1;\n }\n \n // start the branch offset at 0\n let offset = 0;\n // recurse down the tree, adding 1 for every leaf node. \n // without multiple inheritance, this is the only reason we will need to increment position\n node.children.forEach(n => {\n // child nodes get assigned the passed-in position plus the offset\n offset += this.assignPosition(n, position+offset);\n });\n\n // return the offset to the above function\n return offset;\n }", "title": "" }, { "docid": "de2a7d19e30d222379ac5cdaa9c1fd4e", "score": "0.4640308", "text": "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "title": "" }, { "docid": "de2a7d19e30d222379ac5cdaa9c1fd4e", "score": "0.4640308", "text": "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "title": "" }, { "docid": "de2a7d19e30d222379ac5cdaa9c1fd4e", "score": "0.4640308", "text": "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "title": "" }, { "docid": "de2a7d19e30d222379ac5cdaa9c1fd4e", "score": "0.4640308", "text": "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "title": "" }, { "docid": "de2a7d19e30d222379ac5cdaa9c1fd4e", "score": "0.4640308", "text": "function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }", "title": "" }, { "docid": "566528117f89aeb28ca2a12be3dd6778", "score": "0.46165144", "text": "getChildIndentationLevel() {\r\n if (utils_1.TypeGuards.isSourceFile(this))\r\n return 0;\r\n return this.getIndentationLevel() + 1;\r\n }", "title": "" }, { "docid": "126424050046017d82509b9aca7016e0", "score": "0.46036685", "text": "function computeCharacterGroupPositions() {\n\tcharacters.forEach(function(character){\n\t\tvar sum, count;\n\t\tsum = count = 0;\n\t\tcharacter.appearances.forEach(function(appearance) {\n\t\t\tcount++;\n\t\t\tsum += groups.indexOf(appearance.scene.group);\n\t\t});\n\t\tcharacter.averageScenePosition = sum/count;\n\t});\n\n\tgroups.forEach(function(group){\n\t\tgroup.characters.sort(function(a,b){\n\t\t\tvar diff;\n\t\t\t// Average scene position.\n\t\t\tdiff = a.averageScenePosition - b.averageScenePosition;\n\t\t\tif (diff !== 0) {\n\t\t\t\treturn diff;\n\t\t\t}\n\n\t\t\treturn characters.indexOf(a)-characters.indexOf(b);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "618a2b18e0178dd74c6c2e035e87453f", "score": "0.45809886", "text": "function getOffset() {\n\t var indentation = [];\n\t var pos = line + 1;\n\t\n\t /* Done. Called when the last character is\n\t * eaten to retrieve the range’s offsets. */\n\t return function () {\n\t var last = line + 1;\n\t\n\t while (pos < last) {\n\t indentation.push((offset[pos] || 0) + 1);\n\t\n\t pos++;\n\t }\n\t\n\t return indentation;\n\t };\n\t }", "title": "" }, { "docid": "657fad8637d808292f8ac0c84f23e705", "score": "0.4560909", "text": "offsetLag() {\n const lastOffsetOfPartition = Long.fromValue(this.highWatermark).add(-1)\n const lastConsumedOffset = Long.fromValue(this.lastOffset())\n return lastOffsetOfPartition.add(lastConsumedOffset.multiply(-1)).toString()\n }", "title": "" }, { "docid": "0fad6b97664e385a5f3383cdce14c09e", "score": "0.45390105", "text": "getNextDisplayId()\n {\n \tlet disp = 0;\n \tfor( let a in this.children )\n \t{\n \t\tlet did = parseInt( this.children[a].displayId );\n \t\tif( did > disp )\n \t\t{\n \t\t\tdisp = did;\n \t\t}\n \t}\n \treturn parseInt( disp ) + 1;\n }", "title": "" }, { "docid": "f1d8dcd7e8b2ee10a62961e7a9d64888", "score": "0.4538203", "text": "function setRelativePosition (indentCount, lastIndentPosition) {\n // the first time this is called, last position will be null\n if (lastIndentPosition === null) {\n return 0;\n } else if (indentCount > lastIndentPosition) {\n // only indent one level at a time\n return lastIndentPosition + 1;\n } else {\n // this will manage indents of same level or where outdents are required\n return indentCount;\n }\n}", "title": "" }, { "docid": "9e2e00ee9ca96d115f32f01093551423", "score": "0.45296544", "text": "getParentIndex(childIndex) {\n return Math.floor((childIndex - 1) / 2);\n }", "title": "" }, { "docid": "939d084c20d71e059c2e8f438939a276", "score": "0.45264456", "text": "function getGroupLoc(selection) {\n\n var groupLoc = 'translate(0,0)';\n\n if (!selection.empty()) {\n\n //get the existing group location\n groupLoc = selection.attr('transform');\n console.log(groupLoc);\n }\n\n return groupLoc;\n }", "title": "" }, { "docid": "b33c29b6297694a934dfc7ac0598256d", "score": "0.4510576", "text": "function get_index_to_start_from() {\n var all_present_inlines =\n this.$(\"#inline_body tr\").not(\".form_error\");\n if (!all_present_inlines.length) return 0;\n var max_index = $(_.last(all_present_inlines)).attr(\"index\");\n return parseInt(max_index) + 1;\n }", "title": "" }, { "docid": "22f1f82fdbc8e47fb2bcd8a2340b05f7", "score": "0.45006323", "text": "function computeGroupRowIndices(groups) {\n let currentRowIndex = 0;\n for (const group of groups.values()) {\n if (group.depth !== 0) {\n continue;\n }\n currentRowIndex += computeGroupIndicesRecursive(group, currentRowIndex, groups);\n }\n }", "title": "" }, { "docid": "5f01b952853aaf3c6500408df7d79322", "score": "0.44776314", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "5f01b952853aaf3c6500408df7d79322", "score": "0.44776314", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "5f01b952853aaf3c6500408df7d79322", "score": "0.44776314", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "507337dc43a82c922fe104fb5379e43e", "score": "0.44753549", "text": "constructor(subgroupIndex /*: number */) {\n super();\n\n this.subgroupIndex = subgroupIndex;\n this.elements = group.subgroups[subgroupIndex].members;\n }", "title": "" }, { "docid": "534790a320b1a897df829702ab1e497a", "score": "0.4464957", "text": "getRowsIndexesFromGroupRow(groupIndex) {\n const first = this.getIndexOfFirstRowGroupedByRow(groupIndex) - groupIndex;\n let last = 0;\n if (this.groupingRowsByRow.length > groupIndex + 1) {\n last =\n this.getIndexOfFirstRowGroupedByRow(groupIndex + 1) - groupIndex - 1;\n } else {\n last = this.rows.length;\n }\n return { first: parseInt(first, 10), last: parseInt(last, 10) };\n }", "title": "" }, { "docid": "a796abd7e6b9c1008b6ad6c6248b9fe1", "score": "0.445312", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "title": "" }, { "docid": "28c5c4df3306b301077276dbe546f4a6", "score": "0.44529828", "text": "function position(group, groupType, rect) {\n // console.log('%c\\n'+' parent ' + groupType + ' rect is: ', 'background: #222; color: #EFEFEF; font-family: helvetica neue; font-size:20px; padding: 0 7px 3px 0;');\n // console.log(rect);\n var i = -1,\n row = (groupType === \"row\") ? false : true, // for ternary statements later, specifies whether that particular child is a row or not. Allows easy, centralised description of the parameter calculations that can be switched from row to column.\n n = group.length,\n x = rect.x,\n y = rect.y,\n o;\n var offset = 0;\n while (++i < n) {\n o = group[n-(i+1)],\n d = divisor(o, row, rect, group, n),\n o.id = typeof o.id !== 'undefined' ? o.id : genUuid(),\n o.x = row ? x : x + offset,\n o.y = row ? y + offset : y,\n o.dx = row ? rect.dx : rect.dx/d,\n o.dy = row ? rect.dy/d : rect.dy,\n offset += row ? o.dy : o.dx;\n // console.log({x:o.x, y: o.y, width:o.dx, height: o.dy});\n }\n }", "title": "" }, { "docid": "28c5c4df3306b301077276dbe546f4a6", "score": "0.44529828", "text": "function position(group, groupType, rect) {\n // console.log('%c\\n'+' parent ' + groupType + ' rect is: ', 'background: #222; color: #EFEFEF; font-family: helvetica neue; font-size:20px; padding: 0 7px 3px 0;');\n // console.log(rect);\n var i = -1,\n row = (groupType === \"row\") ? false : true, // for ternary statements later, specifies whether that particular child is a row or not. Allows easy, centralised description of the parameter calculations that can be switched from row to column.\n n = group.length,\n x = rect.x,\n y = rect.y,\n o;\n var offset = 0;\n while (++i < n) {\n o = group[n-(i+1)],\n d = divisor(o, row, rect, group, n),\n o.id = typeof o.id !== 'undefined' ? o.id : genUuid(),\n o.x = row ? x : x + offset,\n o.y = row ? y + offset : y,\n o.dx = row ? rect.dx : rect.dx/d,\n o.dy = row ? rect.dy/d : rect.dy,\n offset += row ? o.dy : o.dx;\n // console.log({x:o.x, y: o.y, width:o.dx, height: o.dy});\n }\n }", "title": "" }, { "docid": "9602565925c6e3a17979f92287cac25d", "score": "0.44467813", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "371cc040d23c354f141b8744cc6a1814", "score": "0.44455165", "text": "function findMinLevel() {\n\t\t\t// Compare them, to find the top most siblings.\n\t\t\tvar i, topStart, topEnd,\n\t\t\t\tmaxLevel = Math.min( startParents.length, endParents.length );\n\n\t\t\tfor ( i = 0; i < maxLevel; i++ ) {\n\t\t\t\ttopStart = startParents[ i ];\n\t\t\t\ttopEnd = endParents[ i ];\n\n\t\t\t\t// The compared nodes will match until we find the top most siblings (different nodes that have the same parent).\n\t\t\t\t// \"i\" will hold the index in the parents array for the top most element.\n\t\t\t\tif ( !topStart.equals( topEnd ) ) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// When startNode == endNode.\n\t\t\treturn i - 1;\n\t\t}", "title": "" }, { "docid": "078570643c3b3aaeda1cd9c9bf3d6e68", "score": "0.44448602", "text": "function getLineInfo(input, offset) {\n\t\t for (var line = 1, cur = 0;;) {\n\t\t lineBreakG.lastIndex = cur;\n\t\t var match = lineBreakG.exec(input);\n\t\t if (match && match.index < offset) {\n\t\t ++line;\n\t\t cur = match.index + match[0].length;\n\t\t } else {\n\t\t return new Position(line, offset - cur);\n\t\t }\n\t\t }\n\t\t}", "title": "" }, { "docid": "88af0776a5ba8dfb7c4caf44ec48ddbc", "score": "0.44352892", "text": "function _group(nodeLevel, currentLevel, options) {\n var f = options.groups.filter(function (val) {\n return val <= nodeLevel;\n });\n return f.length ? f[f.length - 1] : options.groups[0];\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.4422149", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.4422149", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.4422149", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "8c653e7008cb44d827e871f1862e485e", "score": "0.44187984", "text": "function resolveOffset () {\n if (offset === -1) return\n if (offset >= lines.length - height) {\n offset = Math.max(0, lines.length - height)\n } else if (offset < -1) {\n offset = Math.max(0, lines.length + offset + 1 - height)\n }\n }", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.4413686", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.4413686", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.4413686", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.4413686", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "84cb215a7846269a3000253a6733bbdf", "score": "0.4404477", "text": "function getRowStart(parentHeight, count, height, gutterSize) {\n let yPos;\n if (count === 1) {\n yPos = (parentHeight - height) / 2;\n }\n else {\n let gridHeight = (height * count) + ((count - 1) * gutterSize);\n yPos = (parentHeight - gridHeight) / 2;\n }\n return yPos;\n}", "title": "" }, { "docid": "0908d7a75fc114e4cfd58fb223b4214d", "score": "0.44043303", "text": "getParent(index){\n return Math.floor((index)/2)\n }", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.44030064", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.44030064", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.44030064", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.44030064", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.44030064", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "fded52813b414c470e922bdbc356747b", "score": "0.4396228", "text": "function findParentId(sunburstChartConfigurations, currentLevel, start, end)\n{\n if (currentLevel === 0)\n {\n return '';\n }\n \n let parts = sunburstChartConfigurations.levels[currentLevel - 1].parts;\n for (let i = 0; i < parts.length; i++)\n {\n if (start >= parts[i].start && end <= parts[i].end)\n {\n return generateSunburstSectionId(parts[i].start, parts[i].end);\n }\n }\n \n console.warn('Cannot find parent ID for ' + start + '-' + end);\n return '';\n}", "title": "" }, { "docid": "abac7f584a5d8221fa839cf2cb0c57be", "score": "0.43952447", "text": "function parseIdx(p, n){ // PathPoints, number for index\n var len = p.length;\n if( p.parent.closed ){\n return n >= 0 ? n % len : len - Math.abs(n % len);\n } else {\n return (n < 0 || n > len - 1) ? -1 : n;\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.43946323", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "3aac07be5aab887fdf9857893d33277d", "score": "0.438255", "text": "function calculateGridOffset(n) {\n\t\tif (n >= 0) {\n\t\t\treturn (n + gridSpacing / 2.0) % gridSpacing - gridSpacing / 2.0;\n\t\t} else {\n\t\t\treturn (n - gridSpacing / 2.0) % gridSpacing + gridSpacing / 2.0;\n\t\t}\n\t}", "title": "" }, { "docid": "ec3ad47bb44b8917ba9f583e2f10c4d2", "score": "0.4381183", "text": "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "title": "" }, { "docid": "42e084f0e9170d7bfd5dcda925266c2f", "score": "0.4379575", "text": "function getPrecedingSafeNodeIndex( container, offset ) {\n\t\t\t\tvar index;\n\n\t\t\t\twhile ( offset-- ) {\n\t\t\t\t\tindex = container.getChild( offset ).getIndex( true );\n\n\t\t\t\t\tif ( index >= 0 )\n\t\t\t\t\t\treturn index;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}", "title": "" }, { "docid": "d95e75107bbad58dd35c5b1c385019e7", "score": "0.43791935", "text": "multiPosition(axis, index) {\n let innerPadding = axis.orientation === 'Horizontal' ? 10 : 20;\n let multiPosition = new MultiLevelPosition(0, 0);\n if (axis.orientation === 'Horizontal') {\n let level0 = axis.maxLabelSize.height + innerPadding;\n let level1 = this.xAxisMultiLabelHeight[index - 1];\n multiPosition.x = (axis.isInversed ? axis.rect.x + axis.rect.width : axis.rect.x);\n multiPosition.y = index === 0 ? axis.rect.y + (axis.opposedPosition ? -level0 : level0) :\n axis.multiLevelPosition[index - 1].y + (axis.opposedPosition ? -level1 : level1);\n }\n else {\n let level0 = axis.maxLabelSize.width + innerPadding;\n let level1 = index !== 0 && (this.multiLevelSize[index - 1].width);\n multiPosition.x = index === 0 ? axis.rect.x - (axis.opposedPosition ? -level0 : level0) :\n axis.multiLevelPosition[index - 1].x - (axis.opposedPosition ? -(level1 + innerPadding) : level1 + innerPadding);\n multiPosition.y = axis.isInversed ? axis.rect.y : axis.rect.y + axis.rect.height;\n }\n return multiPosition;\n }", "title": "" }, { "docid": "7d00a1b9e371bae4f28ed2843e4d0445", "score": "0.43723783", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n} // A second optional argument can be given to further configure", "title": "" }, { "docid": "7d00a1b9e371bae4f28ed2843e4d0445", "score": "0.43723783", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n} // A second optional argument can be given to further configure", "title": "" }, { "docid": "e3479637fb40fc298aab2eb66fc26c5b", "score": "0.43648756", "text": "getRealIndex() {\n return this.index % this.originalNumOfChildren\n }", "title": "" }, { "docid": "83df3152f9710b56e836857fdcd22cdb", "score": "0.43630934", "text": "function parseIdx(p, n){ // PathPoints, number for index\n var len = p.length;\n if(p.parent.closed){\n return n >= 0 ? n % len : len - Math.abs(n % len);\n } else {\n return (n < 0 || n > len - 1) ? -1 : n;\n }\n}", "title": "" }, { "docid": "28b559291c59852240f3736f7583d11d", "score": "0.43617824", "text": "getRowsIndexesFromGroupColumn(groupIndex) {\n const first = this.getIndexOfFirstRowGroupedByColumn(groupIndex);\n let last = 0;\n if (this.groupingRowsByColumn.length > groupIndex + 1) {\n last = this.getIndexOfFirstRowGroupedByColumn(groupIndex + 1) - 1;\n } else {\n last = this.rows.length - 1;\n }\n return { first: parseInt(first, 10), last: parseInt(last, 10) };\n }", "title": "" }, { "docid": "d3b525cd2617430d03b9c8361ffbc757", "score": "0.4355976", "text": "function calculateGroupingScore() {\n\n}", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "7a2776e2e11b6278c94ab599e28c2e78", "score": "0.43503413", "text": "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "title": "" }, { "docid": "059a95a47876a89416f066ee6b30c2d3", "score": "0.43432477", "text": "function prevClusterBreak(str, pos) {\n while (pos > 0) {\n var found = nextClusterBreak(str, pos - 2);\n if (found < pos)\n { return found; }\n pos--;\n }\n return 0;\n }", "title": "" }, { "docid": "6540cbe198494abcfc5d0b73de23f737", "score": "0.43409953", "text": "function getUVRuleSetIDPos (choosenID : int) : int {\n\t\tfor (var i = 0; i < UVcontainer.UVRuleSets.Count; i++) {\n\t\t\tif (UVcontainer.UVRuleSets[i].iD == choosenID) { \n\t\t\t\treturn i; // if we find a matching id, we break the loop and return the position in the list\n\t\t\t\t//break; \n\t\t\t} \n\t\t}\n\t\treturn -1; // if we didnt find something we return -1\n\t}", "title": "" }, { "docid": "58293fa72789bf90cd862bf91827bb68", "score": "0.4336336", "text": "getHierarchyLevel() {\r\n if (this.hierarchyLevel > -1) {\r\n return this.hierarchyLevel;\r\n }\r\n // since the template may have visual elements from different leves, output the highest value\r\n // between all sub-hierarchies\r\n if (this.visualElements.length === 0) {\r\n return 0;\r\n }\r\n const subHierarchies = this.visualElements.map(v => v.getHierarchyLevel());\r\n this.hierarchyLevel = Math.max(...subHierarchies) + 1;\r\n return this.hierarchyLevel;\r\n }", "title": "" } ]
faf9c0171f8eeae0da5c44583e376bb4
Prioritize URLs, lowest to highest: Some optional URL parameters, but none matched No optional parameters in URL Some optional parameters, some matched Some optional parameters, all matched
[ { "docid": "5ef0ed5b59416b6db0f5fb8256ac8a68", "score": "0.58170503", "text": "function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }", "title": "" } ]
[ { "docid": "283c164c1be2a115bf1afe279d1906dc", "score": "0.60202533", "text": "function matchPriority(params) {\n\t var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n\t if (!optional.length)\n\t return 0.000001;\n\t var matched = optional.filter(function (param) { return params[param.id]; });\n\t return matched.length / optional.length;\n\t }", "title": "" }, { "docid": "283c164c1be2a115bf1afe279d1906dc", "score": "0.60202533", "text": "function matchPriority(params) {\n\t var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n\t if (!optional.length)\n\t return 0.000001;\n\t var matched = optional.filter(function (param) { return params[param.id]; });\n\t return matched.length / optional.length;\n\t }", "title": "" }, { "docid": "c2b466531f2d50627cd06778cd15b713", "score": "0.57371944", "text": "function _findMatchingRoute (url) {\n let matches = [],\n final;\n\n if (!url) {\n return;\n }\n\n // Check all registered routes\n for (let route of _routes) {\n let routePaths = route.getFullPaths();\n\n routePaths.forEach((routePath) => {\n // Match the full route path with the URL\n let result = _matchPath(url, {\n path: routePath,\n exact: true\n });\n\n // There may be more than one matches, for example - /home, /:publicHandle\n if (result) {\n matches.push(route);\n }\n });\n }\n\n // If a match is not found then an attempt is made to find out a close match by removing the end slug from the URL and run the algorithm again\n if (matches.length === 0) {\n let slugs = url.split('/').filter((slug) => !_.isEmpty(slug));\n slugs.pop();\n return _findMatchingRoute(slugs.join('/'));\n }\n\n // If there are more than one match then prefer a more specific match\n if (matches.length > 1) {\n // more than one match is found for the URL\n // this situation occurs when a specific route and one or more generic routes match at the same time\n // for example if home and :publicHandle both are registered as top level routes, then navigating to appurl/home will yield 2 matches\n // for these cases we prefer the specific match i.e. 'home' over the generic one i.e. ':publicHandle'\n\n // To determine the preference - we check every route and get the number of dynamic segments in it\n // For example, if we have a route - something/:firstId/:secondId, then firstId & secondId are dynamic segments\n // If we 2 such routes registered - something/:firstId/:secondId & something/specific/:secondId\n // For a transition 'something/specific/others', we will have both the routes as matched\n // In this case we want to prefer the more specific one i.e. something/specific/:secondId\n // Calculate the number of dynamic segment\n // For the first route it's 2 - firstId & secondId\n // For the second route it's 1 - secondId\n // So we prefer the second one here\n let matchedRoute = matches.reduce((routeWithLeastDynamicSegments, currentRoute) => {\n // Get the dynamic segments of currently investigating route\n let dynamicSegments = getDynamicSegmentsFromRoutePattern(currentRoute.url);\n\n // If current route has less number of dynamic segment than already stored route's\n // Then mark the current route as routeWithLeastDynamicSegments\n // Store the route itself and number of dynamic segment for future comparison\n if (dynamicSegments.length < routeWithLeastDynamicSegments.dynamicSegmentCount) {\n routeWithLeastDynamicSegments = {\n dynamicSegmentCount: dynamicSegments.length,\n route: currentRoute\n };\n }\n return routeWithLeastDynamicSegments;\n }, {\n dynamicSegmentCount: Number.POSITIVE_INFINITY // We start with the Infinity so that the first encountered route will be set as routeWithLeastDynamicSegments\n });\n\n // matchedRoute is going to be the route with least dynamic segment\n final = matchedRoute.route;\n }\n else {\n final = matches[0];\n }\n\n return final;\n}", "title": "" }, { "docid": "9d0b6263a19506b0a527ecd15a383427", "score": "0.56975466", "text": "function OverrideDefaultsWithUrlParameters() {\n var querystring = location.search.slice(1);\n let params = new URLSearchParams(querystring);\n\n // If the URL indicates to use metric, convert the already-set default\n // values from imperial to metric. This will make sure that any values\n // that are NOT supplied by parameters are the defaults (but in metric).\n if (params.get(\"units\") == \"metric\") {\n $('input:radio[name=units][value=metric]').attr('checked', true);\n $('input:radio[name=units][value=imperial]').attr('checked', false);\n ChangeUnits();\n }\n\n // Check each field to see if a URL-parameter should override it. If so,\n // apply the override.\n\n if ((params.get(\"rp_wr\") != null) && !isNaN(Number(params.get(\"rp_wr\")))) {\n $('input:text[name=rp_wr]').val(Number(params.get(\"rp_wr\")));\n }\n if ((params.get(\"rp_wb\") != null) && !isNaN(Number(params.get(\"rp_wb\")))) {\n $('input:text[name=rp_wb]').val(Number(params.get(\"rp_wb\")));\n }\n if ((params.get(\"rp_a\") != null) && !isNaN(Number(params.get(\"rp_a\")))) {\n $('input:text[name=rp_a]').val(Number(params.get(\"rp_a\")));\n }\n if ((params.get(\"rp_cd\") != null) && !isNaN(Number(params.get(\"rp_cd\")))) {\n $('input:text[name=rp_cd]').val(Number(params.get(\"rp_cd\")));\n }\n if ((params.get(\"rp_dtl\") != null) && !isNaN(Number(params.get(\"rp_dtl\")))) {\n $('input:text[name=rp_dtl]').val(Number(params.get(\"rp_dtl\")));\n }\n if ((params.get(\"ep_crr\") != null) && !isNaN(Number(params.get(\"ep_crr\")))) {\n $('input:text[name=ep_crr]').val(Number(params.get(\"ep_crr\")));\n }\n if ((params.get(\"ep_rho\") != null) && !isNaN(Number(params.get(\"ep_rho\")))) {\n $('input:text[name=ep_rho]').val(Number(params.get(\"ep_rho\")));\n }\n if ((params.get(\"ep_g\") != null) && !isNaN(Number(params.get(\"ep_g\")))) {\n $('input:text[name=ep_g]').val(Number(params.get(\"ep_g\")));\n }\n if ((params.get(\"ep_headwind\") != null) && !isNaN(Number(params.get(\"ep_headwind\")))) {\n $('input:text[name=ep_headwind]').val(Number(params.get(\"ep_headwind\")));\n }\n if ((params.get(\"p2v\") != null) && !isNaN(Number(params.get(\"p2v\")))) {\n $('input:text[name=p2v]').val(Number(params.get(\"p2v\")));\n }\n if ((params.get(\"v2p\") != null) && !isNaN(Number(params.get(\"v2p\")))) {\n $('input:text[name=v2p]').val(Number(params.get(\"v2p\")));\n }\n}", "title": "" }, { "docid": "e7c03257895dbc4af31fa19638a8ce57", "score": "0.5592279", "text": "_correctUrlQuery(query = {}) {\n let validQuery = {}\n // Only these parameters can be filtered on.\n const validFilter = ['familyName', 'givenName', 'emailAddress']\n for (let i in validFilter) {\n let parameter = validFilter[i]\n if (query[parameter]) {\n validQuery[parameter] = query[parameter]\n }\n }\n // sortBy has valid values and a default.\n const validSortBy = ['familyName', 'givenName', 'emailAddress']\n if (!query.sortBy || (validSortBy.indexOf(query.sortBy) == -1)) {\n validQuery.sortBy = validSortBy[0]\n } else {\n validQuery.sortBy = query.sortBy\n }\n // sortOrder has valid values and a default.\n const validSortOrder = ['ascending', 'descending']\n if (!query.sortOrder || (validSortOrder.indexOf(query.sortOrder) == -1)) {\n validQuery.sortOrder = validSortOrder[0]\n } else {\n validQuery.sortOrder = query.sortOrder\n }\n\n return validQuery\n }", "title": "" }, { "docid": "2be2c9a93ae3a8def8e417cd186910fc", "score": "0.55788076", "text": "function standardiseRouterUrl(url) {\n let finalUrl = url\n\n const orgMatch = match('/org/:slug/(.*)', { decode: decodeURIComponent })\n const orgMatchResult = orgMatch(finalUrl)\n if (orgMatchResult) {\n finalUrl = finalUrl.replace(orgMatchResult.params.slug, '[slug]')\n }\n\n const newOrgMatch = match('/new/:slug', { decode: decodeURIComponent })\n const newOrgMatchResult = newOrgMatch(finalUrl)\n if (newOrgMatchResult) {\n finalUrl = finalUrl.replace(newOrgMatchResult.params.slug, '[slug]')\n }\n\n const projectMatch = match('/project/:ref/(.*)', { decode: decodeURIComponent })\n const projectMatchResult = projectMatch(finalUrl)\n if (projectMatchResult) {\n finalUrl = finalUrl.replace(projectMatchResult.params.ref, '[ref]')\n }\n\n return finalUrl\n}", "title": "" }, { "docid": "7091b4e02242713352565ff534468de7", "score": "0.5520556", "text": "function kiwi_url_param(pnames, default_val, not_found_val)\n{\n var pn_isArray = isArray(pnames);\n\tif (default_val == undefined) default_val = true;\n\tif (not_found_val == undefined) not_found_val = null;\n\n // skip initial '?'\n\tvar params = (window.location && window.location.search && window.location.search.substr(1));\n\tif (!params) return not_found_val;\n\t\n var rv = not_found_val;\n params.split(\"&\").forEach(function(pv) {\n var pv_a = pv.split(\"=\");\n if (pn_isArray) {\n pnames.forEach(function(pn) {\n if (pn != pv_a[0]) return;\n rv = (pv_a.length >= 2)? pv_a[1] : default_val;\n //console.log('kiwi_url_param '+ pn +'='+ rv);\n });\n } else {\n if (pnames == pv_a[0]) {\n rv = (pv_a.length >= 2)? pv_a[1] : default_val;\n //console.log('kiwi_url_param '+ pnames +'='+ rv);\n }\n }\n });\n \n return rv;\n}", "title": "" }, { "docid": "a09cb1e7ff5483454ff76207c3ffc886", "score": "0.5447288", "text": "function urlParseForParams() {\n // Valid / expected url formats:\n // /vbb/:enterpriseName/latest\n // /vbb/:enterpriseName/latest?user=[someuserid]&nonce=[somenonce]\n // /vbb/:enterpriseName/:proofId\n // /vbb/:enterpriseName/:proofId?user=[someuserid]&nonce=[somenonce]\n var urlParams = $location && $location.path().split('/');\n var startIdx = urlParams && urlParams.indexOf('vbb');\n // temp fix for changeTip\n if (startIdx === -1) {\n startIdx = urlParams.indexOf('proof');\n }\n function getProofIdFromUrl() {\n urlProofId = urlParams[startIdx + 2];\n if (!urlProofId) {\n // If no proof ID in the url, default to the latest proof\n urlProofId = DEFAULT_PROOF_ID;\n }\n return urlProofId;\n }\n $scope.urlEnterpriseName = urlParams[startIdx + 1].toLowerCase();\n $scope.urlUserId = query.user;\n urlNonce = query.nonce;\n urlProofId = getProofIdFromUrl();\n }", "title": "" }, { "docid": "a8dfe2830717963d93dbad473d44a040", "score": "0.5442586", "text": "function replaceURLPlaceholders(rawUrl){\n var URL = rawUrl.replace('%40%40REPLACE-TYPE%40%40',proposalType).replace('%40%40REPLACE-FILTERKEY%40%40',filterKey);\n var $propSearch = $('#prop-search');\n if ($propSearch.val() != 'Filter') {\n URL = URL.replace('%40%40REPLACE-FILTERTEXT%40%40',$propSearch.val());\n }\n else URL = URL.replace('%40%40REPLACE-FILTERTEXT%40%40','');\n URL = URL.replace('%40%40REPLACE-START%40%40',proposalPickerPage * proposalsPerPage);\n URL = URL.replace('%40%40REPLACE-END%40%40',(proposalPickerPage + 1) * proposalsPerPage);\n URL = URL.replace('%40%40REPLACE-SORTCOLOMN%40%40',sortColumn);\n URL = URL.replace('%40%40REPLACE-CONTESTSORTCOLOMN%40%40',contestSortColumn);\n URL = URL.replace('%40%40REPLACE-SORTORDER%40%40',sortOrder);\n URL = URL.replace('%40%40REPLACE-SECTIONID%40%40',currentSectionId);\n URL = URL.replace('%40%40REPLACE-CONTESTPK%40%40',contestPK);\n return URL;\n}", "title": "" }, { "docid": "dc5a141a167d35337243d80aece6b2f6", "score": "0.53874403", "text": "function filterURL(page_no = '') {\n let filter_values = {\n price: {min: 0, max: 0},\n sort_by: '',\n categories: [],\n brands: []\n }\n\n // get all the values\n filter_values.price.min = document.getElementsByClassName('filter_price_min')[0].value;\n filter_values.price.max = document.getElementsByClassName('filter_price_max')[0].value;\n\n let cats = document.getElementsByClassName('filter_category');\n for (var i = 0; i < cats.length; i++) {\n if (cats[i].checked) {\n filter_values.categories.push(cats[i].value);\n }\n }\n\n let brands = document.getElementsByClassName('filter_brand');\n for (var i = 0; i < brands.length; i++) {\n if (brands[i].checked) {\n filter_values.brands.push(brands[i].value);\n }\n }\n\n filter_values.sort_by = document.getElementsByClassName('filter_sort_by')[0].value;\n let url = new URL(window.location.href);\n\n url.searchParams.delete('min');\n url.searchParams.delete('max');\n if (filter_values.price.min && filter_values.price.max) {\n url.searchParams.append('min', filter_values.price.min);\n url.searchParams.append('max', filter_values.price.max);\n }\n\n if (filter_values.sort_by == 'relevance') {\n url.searchParams.delete('sort_by');\n }\n\n url.searchParams.delete('categories');\n if (filter_values.categories.length > 0) {\n let x = '';\n for (var i = 0; i < filter_values.categories.length; i++) {\n x = x + filter_values.categories[i] +',';\n }\n url.searchParams.append('categories', x.substring(0, x.length - 1));\n }\n\n url.searchParams.delete('brands');\n if (filter_values.brands.length > 0) {\n let x = '';\n for (var i = 0; i < filter_values.brands.length; i++) {\n x = x + filter_values.brands[i] +',';\n }\n url.searchParams.append('brands', x.substring(0, x.length - 1));\n }\n\n url.searchParams.delete('sort_by');\n if (filter_values.sort_by) {\n if (filter_values.sort_by == 'relevance') {\n\n }else {\n url.searchParams.append('sort_by', filter_values.sort_by);\n }\n }\n url.searchParams.delete('page');\n if (page_no) {\n url.searchParams.append('page', page_no);\n }\n\n window.location.href = url.href;\n}", "title": "" }, { "docid": "ab3316b0a51dc0512d30754ecd31c70b", "score": "0.5367082", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "title": "" }, { "docid": "ab3316b0a51dc0512d30754ecd31c70b", "score": "0.5367082", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "title": "" }, { "docid": "ab3316b0a51dc0512d30754ecd31c70b", "score": "0.5367082", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "title": "" }, { "docid": "1c4093d3d81b4c3c1fffe8a7531c0532", "score": "0.5326665", "text": "function paramitize(fragments__){\n\tvar composite= {},\n\t keys= []\n\tfor(var i in arguments){\n\t\tvar arg= arguments[i]\n\t\tfor(var j in arg){\n\t\t\tcomposite[j]= arg[j]\n\t\t\tif(keys.indexOf(j) == -1)\n\t\t\t\tkeys.push(j)\n\t\t}\n\t}\n\tkeys.sort()\n\n\tvar param= \"\",\n\t sig= \"\"\n\tfor(var i in keys){\n\t\tvar key= keys[i],\n\t\t val= composite[key]\n\t\tif(key != \"callback\" && key != \"format\"){\n\t\t\tsig+= key+val\n\t\t}\n\t\tparam+= (i==0?\"\":\"&\")+key+\"=\"+val\n\t}\n\tsig+= auth.secret\n\tconsole.log(\"sig\",sig)\n\tparam+= \"&api_sig=\"+nd5(sig)\n\treturn param\n}", "title": "" }, { "docid": "d7436d0eb7af7d65ebbbc8b007930a0a", "score": "0.53147084", "text": "function _getAllUrlParams(url, desiredParam) {\n\t\t\tif (typeof desiredParam === 'string') {\n\t\t\t\tdesiredParam = desiredParam.toLowerCase();\n\t\t\t} else {\n\t\t\t\t// Any other type = NO FILTERING\n\t\t\t\tdesiredParam = false;\n\t\t\t}\n\t\n\t\t\t// get query string from url (optional) or window\n\t\t\t// RLN: modified logic to consider any String url as being complete; otherwise URL with no\n\t\t\t// search causing using window URL\n\t//\t\tvar queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n\t\t\tvar queryString = (typeof url === 'string') ? url.split('?')[1] : window.location.search.slice(1);\n\t\n\t\t\t// we'll store the parameters here\n\t\t\tvar obj = {};\n\t\n\t\t\t// if query string exists\n\t\t\tif (queryString) {\n\t\t\t\t// stuff after # is not part of query string, so get rid of it\n\t\t\t\tqueryString = queryString.split('#')[0];\n\t\n\t\t\t\t// split our query string into its component parts\n\t\t\t\tvar arr = queryString.split('&');\n\t\n\t\t\t\tfor (var i=0; i<arr.length; i++) {\n\t\t\t\t\t// separate the keys and the values\n\t\t\t\t\tvar a = arr[i].split('=');\n\t\n\t\t\t\t\t// in case params look like: list[]=thing1&list[]=thing2\n\t\t\t\t\tvar paramNum = undefined;\n\t\t\t\t\tvar paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\n\t\t\t\t\t\t\tparamNum = v.slice(1,-1);\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t});\n\t\n\t\t\t\t\t// set parameter value (use 'true' if empty)\n\t\t\t\t\tvar paramValue = typeof(a[1])==='undefined' ? true : a[1];\n\t\n\t\t\t\t\t// (optional) keep case consistent\n\t\t\t\t\tparamName = paramName.toLowerCase();\n\t\t\t\t\t// RLN: skip paramName not matching filter\n\t\t\t\t\tif (desiredParam) {\n\t\t\t\t\t\tif (paramName !== desiredParam) {\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\t// RLN FIX: wrapped to only operate on typeof === 'string'\n\t\t\t\t\tif (typeof paramValue === 'string') {\n\t\t\t\t\t\tparamValue = paramValue.toLowerCase();\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// if parameter name already exists\n\t\t\t\t\tif (obj[paramName]) {\n\t\t\t\t\t\t// convert value to array (if still string)\n\t\t\t\t\t\tif (typeof obj[paramName] === 'string') {\n\t\t\t\t\t\t\tobj[paramName] = [obj[paramName]];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if no array index number specified...\n\t\t\t\t\t\tif (typeof paramNum === 'undefined') {\n\t\t\t\t\t\t\t// put the value on the end of the array\n\t\t\t\t\t\t\tobj[paramName].push(paramValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if array index number specified...\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// put the value at that index number\n\t\t\t\t\t\t\tobj[paramName][paramNum] = paramValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// if param name doesn't exist yet, set it\n\t\t\t\t\t// RLN FIX: when paramValue is boolean, obj[paramName] has no push() failing if param is included again with string value: ?a&a=2\n\t\t\t\t\telse {\n\t\t\t\t\t\tobj[paramName] = [];\n\t\t\t\t\t\tobj[paramName].push(paramValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn obj;\n\t\t}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "fa572f6de160b745ce331fe3cf890284", "score": "0.53113407", "text": "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "title": "" }, { "docid": "72b52b8b65e952347e490459d30d113e", "score": "0.5263041", "text": "function urlFor(endpoint, parameters, external) {\n var url = null,\n params = [],\n maxMatchDegree = 0.0,\n keys;\n\n if ($.type(parameters) === \"boolean\") {\n external = parameters\n }\n\n parameters = ($.type(parameters) !== 'undefined') ? parameters : {};\n external = ($.type(external) !== 'undefined') ? external : false;\n\n if (g.rules[endpoint] === undefined) {\n throw new Error(\"Uncorrect endpoint in urlFor(\\\"\" + endpoint + \"\\\", \" +\n JSON.stringify(parameters) + \")\");\n }\n\n keys = $.map(parameters, function (value, key) {\n return key;\n });\n\n // Find the first matched rule among rules in this endpoint.\n $.each(g.rules[endpoint], function (index, rule) {\n var match = true,\n currentMatchDegree = 0.0;\n\n $.each(rule.params, function (index, param) {\n if ($.inArray(param, keys) === -1) {\n match = false;\n return false;\n }\n });\n\n if (match) {\n currentMatchDegree = parseFloat(rule.params.length) / keys.length;\n if (currentMatchDegree > maxMatchDegree || url === null) {\n maxMatchDegree = currentMatchDegree;\n url = rule.rule;\n params = rule.params;\n }\n }\n });\n\n if (url) {\n $.each(keys, function (index, key) {\n // Build in params\n if ($.inArray(key, params) > -1) {\n url = url.replace(new RegExp(\"<[^:]*:?\" + key + \">\"), parameters[key]);\n } else {\n // Query string params\n if (url.indexOf(\"?\") === -1) {\n url += \"?\";\n }\n if (!endsWith(url, '?')) {\n url += \"&\";\n }\n url += key + \"=\" + parameters[key];\n }\n });\n } else {\n throw new Error(\"Uncorrect parameters in urlFor(\\\"\" + endpoint + \"\\\", \" +\n JSON.stringify(parameters) + \")\");\n }\n\n if (external) {\n url = g.domain + url\n }\n\n return url;\n }", "title": "" }, { "docid": "c45dc5ca129ae6bce17bbb2c662f93b3", "score": "0.5232722", "text": "function getPrioritizedParts(options) {\n var prioritizedParts = [];\n\n // Get all the parts which ard defined as a single part.\n for (var part in parts) {\n if (parts[part].isActive) {\n parts[part].urlTemplate = options.urlTemplate;\n prioritizedParts.push(parts[part]);\n }\n }\n\n // Get all the parts which are collections of keys\n for (var part in aggregatedParts) {\n if (aggregatedParts[part].isActive) {\n aggregatedParts[part].urlTemplate = options.aggregateUrlTemplate;\n prioritizedParts.push(aggregatedParts[part]);\n }\n }\n\n // Sort the parts based on priority\n prioritizedParts.sort(function (a, b) {\n return a.priority - b.priority;\n });\n\n // Return the collection.\n return prioritizedParts;\n }", "title": "" }, { "docid": "dd26772442694040ce156c42763034d4", "score": "0.51889664", "text": "function prioritizeResults() {\n // Iteratively elevate the priority of each search result.\n const results = document.querySelectorAll('a > h3');\n results.forEach((element) => {\n element.parentElement.tabIndex = 1;\n });\n}", "title": "" }, { "docid": "489e48e88865555dbcdfebb3cae2a014", "score": "0.51675445", "text": "_correctUrlQuery(query, options) {\n const replace = options && !!options.replace\n let validQuery = {}\n // Only these parameters can be filtered on.\n const validFilter = ['tag', 'postedTime']\n for (let i in validFilter) {\n let parameter = validFilter[i]\n if (query[parameter]) {\n validQuery[parameter] = query[parameter]\n }\n }\n let navigate = this.props.router[replace\n ? 'replace'\n : 'push']\n // If the valid query differs from the supplied query, redirect to it.\n if (!_.isEqual(query, validQuery)) {\n navigate({\n pathname: this.props.location.pathname,\n query: validQuery\n })\n }\n }", "title": "" }, { "docid": "65a9c9a6cf2dd54f08f4d0e26a0d4b41", "score": "0.5080162", "text": "function aplyPathParams(url, pathParams) {\n const keys = Object.getOwnPropertyNames(pathParams);\n keys.sort((k1, k2) => (k2.length - k1.length)); //sorts descending by length\n keys.forEach((key) => {\n url = url.replace(\":\" + key, pathParams[key]);\n });\n return url;\n}", "title": "" }, { "docid": "dee9cc366772cff3919b3dfb2f9c16b9", "score": "0.50783676", "text": "matchRoute(url, routes) {\n routes.forEach(({ route, controllerAction }) => {\n let tmp;\n if (route !== '/') {\n tmp = route.replace(/^\\//, '');\n tmp = tmp.split('/');\n } else {\n tmp = route.split();\n }\n\n for (let i = 0; i < url.length; i++) {\n if (url.length === tmp.length) {\n // Checking if route has \":\"\n if (tmp[i] !== url[i] && tmp[i].indexOf(':') !== -1) {\n tmp[i] = url[i];\n this.params.push(url[i]);\n }\n\n if (_.difference(tmp, url).length === 0) {\n if (typeof controllerAction === 'function') {\n controllerAction(...this.params);\n return;\n } else {\n controllerAction.push(...this.params);\n }\n url = controllerAction;\n break;\n }\n }\n }\n });\n return url;\n }", "title": "" }, { "docid": "345ef8748321e63693bcad1de7708d77", "score": "0.50713515", "text": "function getPreferredPath(matches, givenPath) {\n givenPath = givenPath.split(\"/\").filter(a => !!a);\n var chosen = matches[0];\n\n if (matches.length > 1) {\n matches.forEach(pageData => {\n const patternPath = pageData.path.split(\"/\").filter(a => !!a);\n if (patternPath && !patternPath[patternPath.length - 1].startsWith(\"$\")) {\n chosen = pageData;\n }\n });\n }\n return chosen;\n}", "title": "" }, { "docid": "8363891b77bab6efd01ead13a468bc18", "score": "0.49943262", "text": "url({ url }) {\n const removeKeysStartingWith = [\"utm_\", \"uta_\"]; // Remove all query parameters beginning with these strings\n const removeKeys = [\"fblid\", \"gclid\"]; // Remove all query parameters matching these keys\n\n const search = url.search\n .split(\"&\")\n .map((parameter) => parameter.split(\"=\"))\n .filter(\n ([key]) =>\n !removeKeysStartingWith.some((startingWith) =>\n key.startsWith(startingWith)\n )\n )\n .filter(\n ([key]) =>\n !removeKeys.some((removeKey) => key === removeKey)\n );\n\n return {\n ...url,\n search: search\n .map((parameter) => parameter.join(\"=\"))\n .join(\"&\"),\n };\n }", "title": "" }, { "docid": "804a99d9604bbf931207638e54bcedda", "score": "0.4990168", "text": "function filterQueryParams(params, defaultParams) {\n var findOpts = Object.assign({}, defaultParams || {});\n\n if (params) {\n Object.keys(_discoverySortable.queryParams).forEach(function (opt) {\n if (!(0, _utils.isEmpty)(params[opt])) {\n findOpts[opt] = params[opt];\n }\n });\n }\n\n return findOpts;\n }", "title": "" }, { "docid": "cd7bc650270f5f23544c27aa534125e5", "score": "0.4972623", "text": "urlParameterQuestion() {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n if(urlParams.has('q')){\n if(urlParams.get('q') < this.test.length){\n this.currentIndex = urlParams.get('q');\n }\n }\n }", "title": "" }, { "docid": "fafe7c140d763f7b336015f37e8e2316", "score": "0.496516", "text": "function pre(name, defaultValue) {\n var d = defaultValue === undefined ? url.defaults[name] : defaultValue;\n url.params[name] = d;\n return d;\n }", "title": "" }, { "docid": "1daaf9e038220bab34aac0e317c2c238", "score": "0.49587098", "text": "applyFilters() {\n const { history, urlQueryParams, sortConfig, filterConfig } = this.props;\n const searchParams = { ...urlQueryParams, ...this.state.currentQueryParams };\n const search = cleanSearchFromConflictingParams(searchParams, sortConfig, filterConfig);\n\n history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, search));\n }", "title": "" }, { "docid": "2d36d2537b1d60ed8e151e75111f374f", "score": "0.49584466", "text": "function AddSortParameters(url) {\n var sortParameters = $thead.find('.sortable-th');\n for (var i = 0; i < sortParameters.length; i++) {\n if ($(sortParameters[i]).find('.ptr-sort').hasClass('fa-sort-asc')) {\n url = url + '&sortBy=' + $(sortParameters[i]).attr('data-container') + '&sortingType=asc';\n break;\n } else if ($(sortParameters[i]).find('.ptr-sort').hasClass('fa-sort-desc')) {\n url = url + '&sortBy=' + $(sortParameters[i]).attr('data-container') + '&sortingType=desc';\n break;\n }\n }\n return url;\n }", "title": "" }, { "docid": "e5c561f8edeffb504659983cae80fcbc", "score": "0.49293417", "text": "function parseListParams(req, defaultSortField, defaultSortOrder, defaultPageSize, maxPageSize) {\n const {\n oba, obd, ps, lr,\n } = req.query || {};\n const result = {};\n let order;\n if (oba) {\n result.order = { [convertField(oba)]: 1 };\n order = 1;\n } else if (obd) {\n result.order = { [convertField(obd)]: -1 };\n order = -1;\n } else {\n result.order = { [convertField(defaultSortField)]: defaultSortOrder };\n order = defaultSortOrder;\n }\n\n if (!ps) {\n result.pageSize = defaultPageSize;\n } else if (ps > maxPageSize) {\n result.pageSize = maxPageSize;\n } else {\n result.pageSize = Number(ps);\n }\n\n if (lr) {\n const parts = lr.split(':');\n result.lastResult = {};\n result.lastResult.key = [convertField(parts[0])];\n if (order === 1) {\n result.lastResult.value = { $gt: parts[1] };\n } else {\n result.lastResult.value = { $lt: parts[1] };\n }\n }\n return result;\n}", "title": "" }, { "docid": "acdd31011ebfdfc19d9df46b509d3839", "score": "0.49045554", "text": "evaluatePageMatch(req) {\n const slug = req.params[0];\n if (!req.data.bestPage) {\n return;\n }\n if (req.data.bestPage.slug === slug) {\n req.data.page = req.data.bestPage;\n }\n let remainder = slug.substr(req.data.bestPage.slug.length);\n // Strip trailing slashes for consistent results\n remainder = remainder.replace(/\\/+$/, '');\n // For consistency, guarantee a leading / if there is not one\n // already. This way parsing remainders attached to the home\n // page (the slug of which is '/') is not a special case\n if (remainder.charAt(0) !== '/') {\n remainder = '/' + remainder;\n }\n req.remainder = remainder;\n }", "title": "" }, { "docid": "705fb8a91395c19435babf715a21b056", "score": "0.489851", "text": "function set_urlParams() {\n\t\tvar parts, value,\n\t\t\tparams = {},\n\t\t\tsearch = location.search.substring(1).split('&'),\n\t\t\ti = 0,\n\t\t\tlen = search.length;\n\n\t\tfor (; len > i; ++i) {\n\t\t\tparts = search[i].split('=');\n\t\t\tvalue = parts[1];\n\t\t\t// Cast booleans and treat no value as true\n\t\t\tparams[decodeURIComponent(parts[0])] =\n\t\t\t\tvalue && value !== 'true' ?\n\t\t\t\t\tvalue === 'false' ? false :\n\t\t\t\t\tdecodeURIComponent(value) :\n\t\t\t\ttrue;\n\t\t}\n\n\t\treturn params;\n\t}", "title": "" }, { "docid": "2151e80a23cbe8f1560530a289c38a80", "score": "0.4895634", "text": "function FindProxyForURLByUrlfilter(url, host) {\n if (shExpMatch(url, \"http://*.vanclimg.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.vancl.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.tmall.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.tbcdn.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.taobaocdn.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.taobao.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.suning.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.suning.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.qzone.qq.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.photo.store.qq.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.pbc.gov.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.microsoft.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.lixian.vip.xunlei.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.jd.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.icbc.com.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.cmbchina.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.ccb.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.ccb.com.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.ccb.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.boc.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.bankcomm.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.bank-of-china.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.amazon.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.aliyun.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.alipayobjects.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.alipay.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.alicdn.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.abchina.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.95559.com.cn/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.51buy.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.360buyimg.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://*.360buy.com/*\")) return \"DIRECT\";\n if (shExpMatch(url, \"http://192.168.1.*\")) return \"DIRECT\";\n if (shExpMatch(url, \"*/acmsd/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adfiles/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adflash/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adimage/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adjk.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adjs/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adphoto/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adpics/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adpolestar/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adpshow.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adpuba/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adservice/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adv/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/advpic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/attachments/ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com/js/ad*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com.cn/js/ad*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/data/ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.cn/ads/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com/js/ads/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/dkgg/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/events/ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/floatad*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/gaog/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/gg1.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/gg2.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggao.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggao/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggjs/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggpic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/guangao/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/guangg/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/guanggao.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/guanggao/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/images/prom/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.info/ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/main/s?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/paypic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/piaofu.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/picad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/pic/ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/proxy.htm?id=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/proxy.html?id=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tan.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tan1.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/u/_sponsor/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tanchuang.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/webafp?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/rotate_ad?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://biz.weibo.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://a.alimama.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://m1.ifengimg.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://a.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cb.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cpro.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cbjs.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://drmcmm.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://eiv.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://hm.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ikcode.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://nsclick.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://spcode.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tk.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tkweb.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tongji.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tracker.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ucstat.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://unstat.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://utk.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cpro.baidustatic.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://g.163.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://popme.163.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adgeo.163.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://stat.ws.126.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img1.126.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img2.126.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://news.baidu.com/js/usertrack.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://cdn.tanx.com/t/tanxssp.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://box.zhangmen.baidu.com/js/ad.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://images.sohu.com/cs/jsfile/js/ct.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.wenku8.cn/configs/article/indextop.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/FGLinker.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/Flashget_base64*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/flashget.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/thunderForumLinker.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/webThunderDetect.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://bbs.area-11.com/js/lazyload/jquery-1.4.2.min.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://blog.vsharing.com/*addblogviewcount.aspx*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://cdn.flyertea.com/static/js/common.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://illiweb.com/rsc/35/frm/lang/zh.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://images.yoka.com/pic/div/2008/pic/minmax.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://kafanqk.aliapp.com/yuekan.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://kkpgv*.xunlei.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://psd.tutsplus.com/wp-content/themes/tuts/js/lazyload.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://static.ikafan.com/*/yuekan.js\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.111cn.net/js/divshows.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.icili.com/content/jquery-1.4.4.min.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.pconline.com.cn/js/ivy.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.wanmei.com/public/js/wm.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*_ad.css\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*0x*0.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*Couplet.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*gguang.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*ad*.flv\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad.json\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adframe.Js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adshow.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/beacon.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/counter.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/couplet.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/data/images/flash.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/duilian.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ga.Js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/googleword.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/html/ads-*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/*_tc.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/*ad.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/PagePop.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/adv.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/click.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/dw.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/events.Js?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/fmt.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/js2.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/m.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/newtc.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/open.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/tc*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/piaofu.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/piwik.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/popupWin.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/pv.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/quant.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/scripts/t.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/show_ads.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/sta_collection*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/stat.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/stat/*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tan.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tc.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/text_link.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tj.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tongji.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tonglan.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/topad.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/union.*js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/unipro/pub/*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/urchin*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/wenzi*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/winpop*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*Ads/ggCodes*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*analytics.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*duilian*.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*google-analytics.*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*guanggao.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*ichMedia.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*js/count.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*js/piao.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*js/top1.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*tanchuang.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.com/j.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ADPush/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/Advertisers/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/BurstingPipe/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/Cooperation/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/FlashAD/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/UploadADPic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/a-d-s/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/abvert/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad-images/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad_api/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad_images/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad_img/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad_js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad_pic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adbox/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adclick/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adcode/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adfile/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adfront/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adimages/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adimg/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adlog/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adpics/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adpolestar/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ads/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adsClick/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ads_*/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adsview/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adsame/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adscpv/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adscript/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adspace/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adv/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/advertise/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/advpic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adx/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/baidu_ads/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/baiduunion/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/counter/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/cpro/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/dale_ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/float_ad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/floatmedia/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/gg/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggao/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/gggif/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggjs/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggpic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/guanggao/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/html.ng/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ieupdate/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js.ng/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/jscode/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/minisite/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/moneys/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/newad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/pagead/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/pfpnews/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*advertisement/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/pingjs/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/promos/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/spcode/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tanchuang/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/taobao/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/tuiguang/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/unionreg/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/webgame/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*/GgPic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/cnwk.1d/Ads/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ggs/html/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/html/click/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/iframe/*0_*0/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/images/g_js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/svnad/htm/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/www/delivery/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/www/if/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/www/iframe/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/static/material/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/material/js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/plugins/dabandeng/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/data/attachment/common/cf/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adb.php\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adt.php\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adv.php\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adx.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad_redirect.php?id=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/mediacode.php?id=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/click_media_qqupfloat.php\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/mediadisplay.php?bid=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/banner.htm\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/banner/banner.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*0x*0*.htm\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*0x*0.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/banner_*0*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/gg.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/html/*ad-*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/html/taobao*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/gg_*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/main/ad.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/static/iframe/*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/static/taobao-*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/top_ad.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/union.*htm*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*-*0.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*0x*0.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*0x*0.png\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*0x*0.swf\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*_ad.Gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*_ad.swf\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/1x1.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad-banner.jpg\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ad.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adbanner.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adspacer.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/advclose.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/close.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/flash/ad.swf*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/fudong.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/images/*-ad.png\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/images/banner.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/images/spacer.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/link/*.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/logo/*.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/piaofu.gif*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/police.png\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/popup.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/rightad.Jpg\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/spacegif.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/zx110.png\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com/*.asp?u=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com/*union*uid*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com/delivery/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.com/iclk/?s=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*ad.jsp?wid=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/*callback.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/Ggao*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adlink.aspx?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adclick.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adclick?sid=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adfclick?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adfshow?user=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ads.php?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/ads?client=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adsfile.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adshow.php?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/adshow?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/advdsp.aspx*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/click.*id=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/clickCode.php?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/iclk/?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/inc/popbox*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/js/ggad_*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/link/click.php?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/main/adfclick*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/main/adfshow*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/pop_page.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/popup.php?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/show?placeid=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/stat.php?*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/stat.php?id=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/union_*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*960x120.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*=adpublish\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*Advertising*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*Deliver/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*RichMediaShow*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*ad/common/tg*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*alimama*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*uploadadpic/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://js.*.com/page/?s=*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.com/click/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.com/i.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.com/union/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.analytics.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*/AD/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*/stats/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ad.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adclient.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adfarm.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adforward.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adimage.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adimg.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adm.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adp.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ads.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adsense.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adsview*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adv.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://allyes.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://analytics.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://counter.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cpm.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cpv.*.com/*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ggao.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://material.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://pv.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://syndication.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tongji.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://track.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tracking.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://uimg.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://urchin.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*doubleclick.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.2o7.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.51yes.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.adsfactor.net*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.allyes.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.adsame.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.datamaster.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.cbsi.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.chanet.com.cn*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.cnzz.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.cnzz.net*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://irs01.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.effectivemeasure.net*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.googlesyndication.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.googleadservices.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.googletagservices.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.imrworldwide.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.irs09.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.irs01.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.miaozhen.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.linezing.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.mediav.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.ad-plus.cn*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.shenduchuanmei.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.union.youdao.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"impservice*.youdao.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.chinauma.net*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.pagechoice.net*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.serving-sys.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.wauee.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.users.51.la*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://pub.mop.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*cbjs.baidu.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*cpro.baidu.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.share.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://hm.baidu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*unstat.baidu.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://duiwai.baidu.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.baidustatic.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*drmcmm.baidu.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*eiv.baidu.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*spcode.baidu.*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*google-analytics.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.admaster.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cnrdn.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.scorecardresearch.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.wrating.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"https://ss.cnnic.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://sports.sina.com.cn/iframe/js/2012/live.js*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://newspush.sinajs.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://cluster.woocall.sina.com.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://d*.sina.com.cn/*/*/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://d*.sina.com.cn/iframe/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://pfp.sina.com.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://rm.sina.com.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://widget.weibo.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.ra.icast.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*newhuagg/*.*f\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*newhuagg/*.*g\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*newhuagg/newhua_*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www1.gamersky.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://rh.qq.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.stnn.cc/images/xy/*.html\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://j.wit.qq.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tcss.qq.com*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tajs.qq.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ads*.qq.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://discuz.gtimg.cn/cloud/scripts/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.cnsat.net/*ictuer/*.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://static.nphoto.net/media/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.jb51.net/imgby/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.orsoon.com/orsoon/img*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.piaodown.com/other/js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://js.mumayi.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.000webhost.com/images/banners/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.17173.com/if/x/*.htm\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://media.17173.com/x/media*0.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.mediafire.com/templates/linkto/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://x.itiexue.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://images.xxsy.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://rcm-*.amazon.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://pic.jdunion.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://pbcdn.com/activities/*/*banner*.png\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.ayinfo.cn/data/js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.ayinfo.cn/column/unicom/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.kaixin001.com.cn/swf/cpm/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://pic.zol-img.com.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://sss.zol.com.cn/cgimp/out/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ad*.cnool.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://images.chinaz.com/tool/*.htm\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.pingpang.info/banner/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adlog.com.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.danlan.org/KFC/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.biz5.sandai.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.cm.sandai.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ebp.renren.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://jebe.xnimg.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://a.xnimg.cn/imgpro/banner/status/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.da-ads.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://a-m-s.poco.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://t.douban.com/img/files/file-*.jpg\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://mr*.douban.com/*/rda/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://sp.vcimg.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://shows.21cn.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.ithome.com/block/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://read.qidian.com/iframe/footer_qidian.html\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.Mininova.Org/js/vidukilayer.Js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.ltddd.com/js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.chunai.com/main.html?s=random\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.uu1001.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.11xs.com/js/BookText_EndMenuBottom.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.hxsk.net/hxskad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.5dmail.net/js/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://a.xilu.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://panda.kdnet.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://super.kdnet.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://806.tianya.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://static.tianya.cn/global/wizard/tytc/typop.tianya.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img1.126.net/channel*/*/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://adgeo.163.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://g.163.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://popme.163.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://qing.weibo.com/blog/api/getsearchnatant.php*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www.163.com/special/00774IKG/pdtj0823.html\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://stadig.ifeng.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://bc.ifeng.com/*=ifeng*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://*.ifengimg.com/mappa/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://blogfile.ifeng.com/uploadfiles/main_blog/v3_block58.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://de.deliver.ifeng.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://sc.ifeng.com/crossdomain.xml\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://vimg.ifeng.com/live/images/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://y*.ifengimg.com/*/2012/*/*.swf\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://y*.ifengimg.com/ifeng/sources/12*-*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://y*.ifengimg.com/tres/recommend/*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.ifeng.com/tres/html/120*-*.js\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://img.ifeng.com/tres/html/110119adbr/swfobj.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.cnbeta.com/yodao*.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.cnbeta.com/youdao*.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.cnbeta.com/lbe*.jpg\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.cnbeta.com/oray*.jpg\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://img.cnbeta.com/*300.gif\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://img.cnbeta.com/wy.gif\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://img.cnbeta.com/maipu.swf\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://img.cnbeta.com/szpda300.jpg\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://tv.sohu.com/upload/swf/*/panel/ErrorAds.swf\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://mfiles.sohu.com/tv/csad/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://v*.tudou.com/td*/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://at-img*.tdimg.com/sales/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*addplayer*report*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.ss3w.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/sogou*.exe\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*.brand.sogou.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*/partner/*.exe\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"*sogou.com/cpc*ad*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://ivy.pconline.com.cn/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.pconline.com.cn/market/open/*/index.html\")) return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://www1.pconline.com.cn/images/lmt/area_lmt.js\") return \"PROXY 127.0.0.1:8086\";\n if (url == \"http://message.csdn.net/msg.popup.js\") return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://bwp.cnet.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://bwp.download.cnet.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://wap.pingan.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://admd.yam.com/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://p4u.hinet.net/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://www.tt1069.com/banners/*\")) return \"PROXY 127.0.0.1:8086\";\n if (shExpMatch(url, \"http://drd.hauchi.com.tw/*\")) return \"PROXY 127.0.0.1:8086\";\n return \"DIRECT\";\n}", "title": "" }, { "docid": "5c74eb7eca8cd1b87d170e838ac0e35d", "score": "0.4892006", "text": "function queryString(){\n\t\tvar url;\n\t\tif(searchParameter == '' && foodParameter =='' && brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage;\n\t\t\treturn url;\n\t\t}\n\t\t// Search \n\t\telse if(!searchParameter == '' && foodParameter =='' && brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && !foodParameter =='' && brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+'&food='+foodParameter;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && foodParameter =='' && !brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+'&brewed_before='+brewedBefore;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && foodParameter =='' && brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+abv;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && !foodParameter =='' && !brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+'&food='+foodParameter+'&brewed_before='+brewedBefore;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && !foodParameter =='' && brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+'&food='+foodParameter+abv;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && foodParameter =='' && !brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+'&brewed_before='+brewedBefore+abv;\n\t\t\treturn url;\n\t\t}\n\t\t// Food\n\t\telse if(searchParameter == '' && !foodParameter =='' && brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&food='+foodParameter\n\t\t\treturn url;\n\t\t}\n\t\telse if(searchParameter == '' && !foodParameter =='' && !brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&food='+foodParameter+'&brewed_before='+brewedBefore;\n\t\t\treturn url;\n\t\t}\n\t\telse if(searchParameter == '' && !foodParameter =='' && brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&food='+foodParameter+abv;\n\t\t\treturn url;\n\t\t}\n\t\telse if(searchParameter == '' && !foodParameter =='' && !brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&food='+foodParameter+'&brewed_before='+brewedBefore+abv;\n\t\t\treturn url;\n\t\t}\n\t\t// Brewed\n\t\telse if(searchParameter == '' && foodParameter =='' && !brewedBefore == '' && abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&brewed_before='+brewedBefore;\n\t\t\treturn url;\n\t\t}\n\t\telse if(searchParameter == '' && foodParameter =='' && !brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&brewed_before='+brewedBefore+abv;\n\t\t\treturn url;\n\t\t}\n\t\t// ABV\n\t\telse if(searchParameter == '' && foodParameter =='' && brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+abv;\n\t\t\treturn url;\n\t\t}\n\t\telse if(!searchParameter == '' && !foodParameter =='' && !brewedBefore == '' && !abv == ''){\n\t\t\turl = 'https://api.punkapi.com/v2/beers?page='+page+'&per_page='+showPerPage+'&beer_name='+searchParameter+'&food='+foodParameter+'&brewed_before='+brewedBefore+abv;\n\t\t\treturn url;\n\t\t}\n\t}", "title": "" }, { "docid": "00378649c053eee7ff00257939738db7", "score": "0.48825762", "text": "cleanUpUrl() {\n this.uri = Object.values(this.urlParameters)\n .reduce((uri, p) => {\n let match = p.match ? p.match : new RegExp(`:${p.name}(\\\\(.*\\\\))?(?=\\\\/|$)`);\n let placeholder = p.placeholder ? p.placeholder : (p.required ? `:${p.name}` : `:${p.name}?`);\n return uri.replace(match, placeholder);\n }, this.uri);\n }", "title": "" }, { "docid": "888db9b6e14a1df24c4d25717e5c7b7c", "score": "0.4882573", "text": "function urlPivots() {\n const pivots = [];\n const params = (new URL(document.URL)).searchParams;\n const val = params.get('p');\n if (val !== null && val != '') {\n try {\n const re = new RegExp(val);\n for (let i = 0; i < stacks.Sources.length; i++) {\n const src = stacks.Sources[i];\n if (re.test(src.UniqueName) || re.test(src.FileName)) {\n pivots.push(i);\n }\n }\n } catch (error) {}\n }\n if (pivots.length == 0) {\n pivots.push(0);\n }\n return pivots;\n }", "title": "" }, { "docid": "7c72d204ab7b8f5c221feec8723726b8", "score": "0.48817688", "text": "function replaceURLPlaceholders(rawUrl){\n var URL = rawUrl.replace('@@REPLACE-TAB@@', pickerTab)\n .replace('@@REPLACE-FILTERKEY@@', filterKey);\n var $propSearch = $('#prop-search');\n if ($propSearch.val() != 'Filter') {\n URL = URL.replace('@@REPLACE-FILTERTEXT@@', $propSearch.val());\n }\n else URL = URL.replace('@@REPLACE-FILTERTEXT@@',' ');\n URL = URL.replace('@@REPLACE-START@@', proposalPickerPage * proposalsPerPage);\n URL = URL.replace('@@REPLACE-END@@', (proposalPickerPage + 1) * proposalsPerPage);\n URL = URL.replace('@@REPLACE-SORTCOLOMN@@', sortColumn);\n URL = URL.replace('@@REPLACE-CONTESTSORTCOLOMN@@', contestSortColumn);\n URL = URL.replace('@@REPLACE-SORTORDER@@', sortOrder);\n URL = URL.replace('@@REPLACE-SECTIONID@@', currentSectionId);\n URL = URL.replace('@@REPLACE-contestId@@', contestId);\n return URL;\n}", "title": "" }, { "docid": "196241af89c7d0a3b5a1f314c8e378bb", "score": "0.48576155", "text": "function filterQueryParams(params, defaultParams) {\n var findOpts = defaultParams || {};\n if (params) {\n Object.keys(queryParams).forEach(function (opt) {\n if (params[opt]) {\n findOpts[opt] = params[opt];\n }\n });\n }\n return findOpts;\n }", "title": "" }, { "docid": "18d296c4dedfe821b107f6eb90355872", "score": "0.4854452", "text": "getURLs(localBusinesses, filter, urlsNumber) {\n let city = '';\n let category = '';\n if (filter && filter.city) city = filter.city;\n if (filter && filter.category) category = filter.category;\n\n console.log('city index:'+this.cityIndex);\n console.log('city:'+this.citiesArray[this.cityIndex]);\n this.localBusinesses = localBusinesses;\n this.filtredLocalBusinesses = _.filter(this.localBusinesses, comp => comp.source === 'yelp');\n console.log(this.filtredLocalBusinesses.length+' local businesses from yelp');\n this.urlsNumber = urlsNumber || 100;\n let estimatedResultsPerPage = 10;\n\n //setting the query URL depending on the chosen category\n let paramsURL = '';\n\n if (!city) {\n if (this.citiesArray[this.cityIndex]) {\n city = this.citiesArray[this.cityIndex];\n } else {\n console.log('done with all cities, please add more.');\n return false;\n }\n }\n paramsURL = city.replace(/ /g, '+');\n console.log('scraping local businesses from '+city);\n\n if (city === 'New York') {\n this.filtredLocalBusinesses = _.filter(this.filtredLocalBusinesses, comp =>\n comp.city.toLowerCase() === 'new york' || comp.city.toLowerCase() === 'brooklyn' );\n } else {\n this.filtredLocalBusinesses = _.filter(this.filtredLocalBusinesses, comp => comp.city.toLowerCase() === city.toLowerCase() );\n }\n console.log(this.filtredLocalBusinesses.length+' '+city+' local businesses from yelp in db');\n if (category) {\n category = category.toLowerCase();\n this.filtredLocalBusinesses = _.filter(this.filtredLocalBusinesses, comp => {\n for(let i = 0; i < comp.categories.length; i++) {\n if (comp.categories[i].toLowerCase() === category.toLowerCase()) {\n return true;\n }\n }\n return false;\n });\n }\n\n //setting the page we'll start scraping on, basing on companies array.\n if (this.pageNumber === 0) {\n this.pageNumber = parseInt(this.filtredLocalBusinesses.length/estimatedResultsPerPage);\n if (this.pageNumber > this.maxPageNumber) this.pageNumber = this.maxPageNumber;\n if (category) this.pageNumber -= 5;\n if (this.pageNumber < 0) this.pageNumber = 0;\n }\n\n console.log('starting at page :'+this.pageNumber+' - 10 result per page');\n\n return new Promise((resolve) => {\n let urlsToReturn = [];\n\n this._scrapeForUrls(paramsURL, category, urlsToReturn, () => {\n console.log(urlsToReturn.length+' url returned from request');\n resolve(urlsToReturn);\n });\n\n });\n\n\n }", "title": "" }, { "docid": "d8fde775ba80a9bfbc5c9db6b82bd9b0", "score": "0.4841157", "text": "function parseExtraURLParams() {\n var params = _.pick( $location.search(), 'qzip', 'qradius' );\n var hasChanged = ctrl.qzip !== params.qzip ||\n ctrl.qradius !== params.qradius;\n\n if ( hasChanged ) {\n ctrl.qzip = params.qzip;\n ctrl.qradius = parseInt(params.qradius) || 3000;\n }\n return hasChanged;\n }", "title": "" }, { "docid": "424c12fa401bbc716174332feb669218", "score": "0.48397264", "text": "function searchParamsOrEmpty(url) {\r\n if (!(url === null || url === void 0 ? void 0 : url.includes('?'))) {\r\n return {};\r\n }\r\n const [_, ...rest] = url.split('?');\r\n return querystringDecode(rest.join('?'));\r\n}", "title": "" }, { "docid": "16c502ea1dede692dfbcd872927df65a", "score": "0.48315716", "text": "function getAllUrlParams()\n {\n var filterParams = {};\n const queryString = window.location.search;\n if (queryString) {\n const urlParams = new URLSearchParams(queryString);\n urlParams.forEach(function(value, key) {\n filterParams[key] = value;\n });\n \n console.log(filterParams);\n \n return filterParams;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "19ce1acc05d3851f84b6ca216fce1c4f", "score": "0.48018214", "text": "handleQuery(req){\n if((!req.query || !req.query.i) || req.query.i.split(',').lenght > 3 ){\n return null;\n }\n var query = req.query.i;\n var params = query.split(',');\n params.sort();\n\n return params;\n }", "title": "" }, { "docid": "e28581e103b7be47824c6cef581cd78f", "score": "0.47975716", "text": "function urlparam(names) {\n var result = 0;\n jQuery.each(names, function(index, item) {\n var results = new RegExp('[\\\\?&]' + item + '=([^&#]*)').exec(window.location.href);\n if (results) {\n result = 1;\n return false;\n }\n });\n return result;\n }", "title": "" }, { "docid": "9e039e3d588280b7e6b632323a8928b7", "score": "0.47972986", "text": "filtrerUrls () {\n const pattern = this.filterTxtUrls.toLowerCase()\n this.dataUrlsFiltered = this.dataUrls.filter((row) => {\n return row.url.toLowerCase().includes(pattern) || row.title.toLowerCase().includes(pattern)\n })\n }", "title": "" }, { "docid": "75061580cb22b5f0ae6f072923207595", "score": "0.47943282", "text": "function apiSelector(){\n if(query === undefined || query === 'random'){\n apiUrl = defaultApi;\n } else {\n let firstPartSearchApi = `https://api.unsplash.com/search/photos?client_id=${API_KEY}&query=${query}&count=${count}&page=${page}&`;\n let secondPartSearchApi = filteredNameValue.join('&')\n const searchApi = `${firstPartSearchApi}${secondPartSearchApi}`;\n apiUrl = searchApi;\n }\n }", "title": "" }, { "docid": "6165bed9728c25f4673549fe39f2b20c", "score": "0.4772422", "text": "function getFilter(urls){\n return {urls: urls};\n}", "title": "" }, { "docid": "004b4a9863165b49a5392180bb0563c6", "score": "0.47705734", "text": "function prefill() {\n window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/g, function(m, key, value) {\n if (key == 'limit'){\n limit = value;\n } else if (key == 'pat'){\n pat = value;\n } else if (key == 'itemtype'){\n itemtype = value;\n } else if (key == 'pagepile'){\n pagepile = value;\n }\n });\n}", "title": "" }, { "docid": "97a9e51ac832101ee858d341f50b4e2e", "score": "0.47703516", "text": "function finalurl() {\n var url = new URL(window.location.href);\n var search_params = url.searchParams;\n search_params.set('sorting', document.getElementById(\"sort-list\").value);\n url.search = search_params.toString();\n var new_url = url.toString();\n return new_url\n}", "title": "" }, { "docid": "8d0c5a1206654beaf65788933e2f4fc2", "score": "0.47686127", "text": "function useSearchParams(defaultInit) {\n true ? warning(typeof URLSearchParams !== \"undefined\", \"You cannot use the `useSearchParams` hook in a browser that does not \" + \"support the URLSearchParams API. If you need to support Internet \" + \"Explorer 11, we recommend you load a polyfill such as \" + \"https://github.com/ungap/url-search-params\\n\\n\" + \"If you're unsure how to load polyfills, we recommend you check out \" + \"https://polyfill.io/v3/ which provides some recommendations about how \" + \"to load polyfills only for users that need them, instead of for every \" + \"user.\") : 0;\n let defaultSearchParamsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(createSearchParams(defaultInit));\n let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();\n let searchParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {\n let searchParams = createSearchParams(location.search);\n\n for (let key of defaultSearchParamsRef.current.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParamsRef.current.getAll(key).forEach(value => {\n searchParams.append(key, value);\n });\n }\n }\n\n return searchParams;\n }, [location.search]);\n let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate)();\n let setSearchParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((nextInit, navigateOptions) => {\n navigate(\"?\" + createSearchParams(nextInit), navigateOptions);\n }, [navigate]);\n return [searchParams, setSearchParams];\n}", "title": "" }, { "docid": "775bd97e0342238e0fd31c490e7053a9", "score": "0.4763911", "text": "match(rule, uri){\r\n let parts = Util.distinct(rule.split('/').map(r => Util.completePart(r)));\r\n let fragments = Util.distinct(uri.split('/').map(r => Util.completePart(r)));\r\n if(\r\n !rule || \r\n !uri || \r\n !parts || \r\n !parts.length || \r\n !fragments || \r\n !fragments.length ||\r\n fragments.length != parts.length\r\n ){\r\n return false;\r\n }\r\n let params = {};\r\n let res = parts.map((part, i) => {\r\n //param placeholder\r\n if(part.startsWith('/:')){\r\n return {key: part.slice(1), index: i}\r\n }\r\n if(part === fragments[i]){\r\n return true;\r\n }\r\n return null;\r\n }).filter(p => p);\r\n if(res.length != parts.length){\r\n return null;\r\n }\r\n return res.filter(r => typeof r === 'object').reduce((acc, curr) => {\r\n acc[curr.key.slice(1)] = fragments[curr.index].slice(1);\r\n return acc;\r\n }, {});\r\n }", "title": "" }, { "docid": "38ef0667098f31d61d47c02c66400b28", "score": "0.47573477", "text": "recognize(url, parentComponent) {\n var componentRecognizer = MapWrapper.get(this._rules, parentComponent);\n if (isBlank(componentRecognizer)) {\n return PromiseWrapper.resolve(null);\n }\n // Matches some beginning part of the given URL\n var possibleMatches = componentRecognizer.recognize(url);\n var matchPromises = ListWrapper.map(possibleMatches, (candidate) => this._completeRouteMatch(candidate));\n return PromiseWrapper.all(matchPromises)\n .then((solutions) => {\n // remove nulls\n var fullSolutions = ListWrapper.filter(solutions, (solution) => isPresent(solution));\n if (fullSolutions.length > 0) {\n return mostSpecific(fullSolutions);\n }\n return null;\n });\n }", "title": "" }, { "docid": "4c228a2619c76089b3b17271f4ce0cbd", "score": "0.47569537", "text": "function expander(paramMap) {\r\n var url = [];\r\n for(var i = 0, len = allParts.length; i < len; i++) {\r\n var part = allParts[i], param;\r\n if(typeof part === \"string\") {\r\n url.push(part);\r\n }else { // this is a param (a match result object)\r\n url.push(paramMap[part[1]] || (part[0] + \"?\"));\r\n }\r\n }\r\n return url.join(\"\");\r\n }", "title": "" }, { "docid": "6c01a95f1dfbd29fe862fbee186fd613", "score": "0.47436732", "text": "function queryBeforeFilters(){\n let fullUrl = window.location.href;\n //Prepend with category value if exists\n if(fullUrl.includes(\"category=\")){\n return fullUrl.substring(fullUrl.lastIndexOf('category='))+\"&\";\n }\n return \"\";\n }", "title": "" }, { "docid": "87ea76ac85744a58d4286f40814036ea", "score": "0.4742724", "text": "recognize(url, parentComponent) {\r\n var componentRecognizer = this._rules.get(parentComponent);\r\n if (isBlank(componentRecognizer)) {\r\n return PromiseWrapper.resolve(null);\r\n }\r\n // Matches some beginning part of the given URL\r\n var possibleMatches = componentRecognizer.recognize(url);\r\n var matchPromises = ListWrapper.map(possibleMatches, (candidate) => this._completeRouteMatch(candidate));\r\n return PromiseWrapper.all(matchPromises)\r\n .then((solutions) => {\r\n // remove nulls\r\n var fullSolutions = ListWrapper.filter(solutions, (solution) => isPresent(solution));\r\n if (fullSolutions.length > 0) {\r\n return mostSpecific(fullSolutions);\r\n }\r\n return null;\r\n });\r\n }", "title": "" }, { "docid": "961213f9e084b3509e0b016f3db3930d", "score": "0.4729305", "text": "function handleSearchParam(urlObjSearchProperty = '') {\n // Explode at &, and sort search params order for consistent results\n // ?b=2&a=1&c= -> [a=1, b=2, c=]\n // ?a=1&c=&b=2 -> [a=1, b=2, c=]\n const pass = urlObjSearchProperty.replace(/^\\?/, '').split('&').sort();\n // Filter out empty elements\n // ?b=2&a=1&c= -> [a=1, b=2]\n // ?b=2&a=1&c -> [a=1, b=2]\n const pass2 = pass.map(e => e.split('='));\n const pass3 = pass2.filter(e => Boolean(e[1]));\n const pass4 = pass3.map(e => e.join('/'));\n const out = String('/' + pass4.join('/')).replace(/pageI?d?/i, 'page');\n return (/^\\/$/.test(out)) ? '' : out;\n}", "title": "" }, { "docid": "7f0c13f0a3d8341ac9c0a9087665a245", "score": "0.47046742", "text": "function compose_url() {\n var url = get_opless_url();\n var isFirst= false;\n if (url.charAt(url.length-1) == '/') {\n isFirst = true;\n }\n for (var i=0; i<arguments.length; i++) {\n if (isFirst) {\n url += '?';\n isFirst = false;\n } else {\n url += '&';\n }\n url += arguments[i];\n }\n return url;\n}", "title": "" }, { "docid": "e59641ca9b24bd662cd06e3e4b57fffe", "score": "0.47018877", "text": "function isUrlSearchParams(value) {\n return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;\n }", "title": "" }, { "docid": "0508fedb6d8104edb5b85934d9027b94", "score": "0.46995938", "text": "function parseMapUrlParametersToFilters(searchString){\n var overallRating = 0;\n var minRel = 0;\n var minVariety = 0;\n var minService = 0;\n var minPricing = 0;\n var diets = [];\n var city = \"\";\n var searchRadius = 10000;\n var longitude = 24.940886;\n var latitude = 60.168182;\n var filters = {};\n var useLocation = true;\n var variables = searchString.replace(\"?\",\"\");\n var varArray = variables.split(\"&\");\n for(var i = 0; i<varArray.length; i++){\n var el = varArray[i];\n var varValPair = el.split(\"=\");\n if(varValPair[0] === \"minOverallRating\"){\n overallRating = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"minReliabilityRating\"){\n minRel = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"minVarietyRating\"){\n minVariety = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"searchRadius\"){\n searchRadius = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"minServiceAndQualityRating\"){\n minService = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"minPricing\"){\n minPricing = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"city\"){\n if(varValPair[1] !== undefined)\n {\n city = varValPair[1];\n useLocation = false;\n }\n else\n {\n city = \"\";\n }\n }\n if(varValPair[0] === \"searchLongitude\"){\n longitude = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"searchLatitude\"){\n latitude = parseInt(varValPair[1]);\n }\n if(varValPair[0] === \"diets\"){\n var dietList = varValPair[1].substring(1, varValPair[1].length - 1);\n var temp_diets = dietList.split(',');\n var diets = [];\n for(var j = 0; j<temp_diets.length;++j)\n {\n var obj = {value:temp_diets[j],name:\"\"}\n diets.push(obj)\n }\n }\n }\n filters = {\n overallRating:overallRating,\n minRel:minRel,\n minVariety:minVariety,\n searchRadius:searchRadius,\n minService:minService,\n minPricing:minPricing,\n city:city,\n longitude:longitude,\n latitude:latitude,\n diets:diets,\n useUserLocation:useLocation,\n }\n return filters;\n}", "title": "" }, { "docid": "2e9639d2116431ac37b4342f95de54d3", "score": "0.46987325", "text": "function matchParams(hiddenIn) {\r\n var urlList, easyUrl;\r\n // Don't do anything if URL doesn't have GET params\r\n if ((window.location.href.indexOf(\"?\") > 0) && (window.location.href.indexOf(\"=\") > 0)) {\r\n // Create link to pass to linkDict\r\n newLink = $(\"<a>\").attr(\"href\",window.location.href);\r\n urlList = myXss.linkDict(newLink);\r\n // Get current page attribs\r\n for (thisUrl in urlList) {\r\n theseAttribs = urlList[thisUrl];\r\n }\r\n // Loop through both objects checking values\r\n for (urlAttrib in theseAttribs) {\r\n for (hiddenAttrib in hiddenIn) {\r\n // Found a match, create easyUrl\r\n if ((hiddenIn[hiddenAttrib] == theseAttribs[urlAttrib])) {\r\n // Base href\r\n moneyUrl = window.location.protocol + \"//\" + window.location.host + window.location.pathname;\r\n easyUrl = createLink(moneyUrl, urlAttrib, urlList);\r\n }\r\n }\r\n }\r\n }\r\n return easyUrl;\r\n }", "title": "" }, { "docid": "0e42a82481ee5cdb496791831c1fcbe9", "score": "0.4695153", "text": "function updateExtraURLParams() {\n if (ctrl.qzip) {\n $location.search( 'qzip', ctrl.qzip );\n $location.search( 'qradius', ctrl.qradius );\n } else {\n $location.search( 'qzip', null );\n $location.search( 'qradius', null );\n }\n }", "title": "" }, { "docid": "054878e2d8d8383315533bd947a8a7d5", "score": "0.46863836", "text": "function param(err){if(err){return done(err);}if(i>=keys.length){return done();}paramIndex=0;key=keys[i++];name=key.name;paramVal=req.params[name];paramCallbacks=params[name];paramCalled=called[name];if(paramVal===undefined||!paramCallbacks){return param();}// param previously called with same value or error occurred\nif(paramCalled&&(paramCalled.match===paramVal||paramCalled.error&&paramCalled.error!=='route')){// restore value\nreq.params[name]=paramCalled.value;// next param\nreturn param(paramCalled.error);}called[name]=paramCalled={error:null,match:paramVal,value:paramVal};paramCallback();}// single param callbacks", "title": "" }, { "docid": "38a06a0d064e97b218a5ef6183e26d0f", "score": "0.46831515", "text": "getPageMatchSettings({ userData, url }){\n const { matcherLabel } = userData;\n \n const pageMatch = this.pageMatcherData.find(\n matcher => matcherLabel \n ? matcher.label === matcherLabel \n : matcher.url === url || matcher.match instanceof Array ? matcher.match.filter( m => url.includes(m) ).length : url.includes(matcher.match)\n );\n \n if(!pageMatch || !pageMatch.func)\n return { err: 'missing_page_setting', msg: 'Missing PageMatcher setting for this page' };\n \n return pageMatch;\n }", "title": "" }, { "docid": "eb6220e6e4f4df757bd276f3287c92e3", "score": "0.46750453", "text": "function sortParsedRules(rules) {\n for (let i = 0; i < rules.length; i++) {\n\t\tfor (let j = 0; j < rules.length-1; j++) {\n\t\t\tif (rules[j].priority > rules[j + 1].priority) {\n\t\t\t\tlet temp = rules[j];\n\t\t\t\trules[j] = rules[j + 1];\n\t\t\t\trules[j + 1] = temp;\n\t\t\t}\n\t\t}\n\t}\n return rules;\n}", "title": "" }, { "docid": "77ca84a2017fc844d2d216b571d6f357", "score": "0.46744797", "text": "formatPath() {\n let location = this.props.location;\n\n if (location.query.sort && location.query.t) {\n return `${location.pathname}?sort=${location.query.sort}&t=${location.query.t}&limit=25&after=t3_`\n } else {\n return `${location.pathname}?limit=25&after=t3_`\n }\n }", "title": "" }, { "docid": "98d6d836f8c4e57e9a20c8d27b05cfb2", "score": "0.4662659", "text": "updateParams() {\n const { history } = this.props;\n const { categories, tags } = this.state;\n\n const paramChunks = [];\n\n if (!checkIfAllSelected(categories, allValues.categories)) paramChunks.push(`categories=${categories.join(',')}`);\n if (!checkIfAllSelected(tags, allValues.tags)) paramChunks.push(`tags=${tags.join(',')}`);\n\n const search = (paramChunks.length === 0) ? '' : `?${paramChunks.join('&')}`;\n\n history.push({ search });\n }", "title": "" }, { "docid": "7d73242cf59726dde0d9a8f14492b4c3", "score": "0.46561196", "text": "function initializeFilterFromUrl() {\n const defaultFilter = createDefaultFilter();\n const params = getQueryParams();\n\n function getBoolOrDefault(name, defaultValue) {\n const urlValue = params.get(name);\n if (urlValue !== null) {\n return urlValue === \"true\";\n }\n return defaultValue;\n }\n\n return {\n name: params.get(\"name\"),\n nonRelevant: getBoolOrDefault(\"nonRelevant\", defaultFilter.nonRelevant),\n showRawData: getBoolOrDefault(\"showRawData\", defaultFilter.showRawData),\n profile: {\n check: getBoolOrDefault(\"check\", defaultFilter.profile.check),\n debug: getBoolOrDefault(\"debug\", defaultFilter.profile.debug),\n opt: getBoolOrDefault(\"opt\", defaultFilter.profile.opt),\n doc: getBoolOrDefault(\"doc\", defaultFilter.profile.doc)\n },\n scenario: {\n full: getBoolOrDefault(\"full\", defaultFilter.scenario.full),\n incrFull: getBoolOrDefault(\"incrFull\", defaultFilter.scenario.incrFull),\n incrUnchanged: getBoolOrDefault(\"incrUnchanged\", defaultFilter.scenario.incrUnchanged),\n incrPatched: getBoolOrDefault(\"incrPatched\", defaultFilter.scenario.incrPatched)\n },\n category: {\n primary: getBoolOrDefault(\"primary\", defaultFilter.category.primary),\n secondary: getBoolOrDefault(\"secondary\", defaultFilter.category.secondary)\n }\n };\n}", "title": "" }, { "docid": "fd31df0499a604e96a78136037c75952", "score": "0.46543348", "text": "function getAllUrlParams(url) {\r\n\r\n // get query string from url (optional) or window\r\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\r\n\r\n // we'll store the parameters here\r\n var obj = {};\r\n\r\n // if query string exists\r\n if (queryString) {\r\n\r\n // stuff after # is not part of query string, so get rid of it\r\n queryString = queryString.split('#')[0];\r\n\r\n // split our query string into its component parts\r\n var arr = queryString.split('&');\r\n\r\n for (var i=0; i<arr.length; i++) {\r\n // separate the keys and the values\r\n var a = arr[i].split('=');\r\n\r\n // in case params look like: list[]=thing1&list[]=thing2\r\n var paramNum = undefined;\r\n var paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\r\n paramNum = v.slice(1,-1);\r\n return '';\r\n });\r\n\r\n // set parameter value (use 'true' if empty)\r\n var paramValue = typeof(a[1])==='undefined' ? true : a[1];\r\n\r\n // (optional) keep case consistent\r\n paramName = paramName.toLowerCase();\r\n paramValue = paramValue.toLowerCase();\r\n\r\n // if parameter name already exists\r\n if (obj[paramName]) {\r\n // convert value to array (if still string)\r\n if (typeof obj[paramName] === 'string') {\r\n obj[paramName] = [obj[paramName]];\r\n }\r\n // if no array index number specified...\r\n if (typeof paramNum === 'undefined') {\r\n // put the value on the end of the array\r\n obj[paramName].push(paramValue);\r\n }\r\n // if array index number specified...\r\n else {\r\n // put the value at that index number\r\n obj[paramName][paramNum] = paramValue;\r\n }\r\n }\r\n // if param name doesn't exist yet, set it\r\n else {\r\n obj[paramName] = paramValue;\r\n }\r\n }\r\n }\r\n\r\n return obj;\r\n}", "title": "" }, { "docid": "95ab047b807807cceead9dbeb34a01c5", "score": "0.46519366", "text": "function getEndpointPreference() /*: BaseUrlsMap | EndpointName[]*/{\n var _Config$getCustomConf = config.getCustomConfig(),\n customUrl = _Config$getCustomConf.customUrl,\n urlStrategy = _Config$getCustomConf.urlStrategy,\n dataResidency = _Config$getCustomConf.dataResidency;\n if (customUrl) {\n // If custom URL is set then send all requests there\n if (dataResidency || urlStrategy) {\n incorrectOptionIgnoredMessage('customUrl', dataResidency ? 'dataResidency' : 'urlStrategy');\n }\n return {\n app: customUrl,\n gdpr: customUrl\n };\n }\n if (dataResidency && urlStrategy) {\n incorrectOptionIgnoredMessage('dataResidency', 'urlStrategy');\n }\n if (dataResidency) {\n return [dataResidency];\n }\n if (urlStrategy === UrlStrategy.India) {\n return [UrlStrategy.India, UrlStrategy.Default];\n }\n if (urlStrategy === UrlStrategy.China) {\n return [UrlStrategy.China, UrlStrategy.Default];\n }\n return [UrlStrategy.Default, UrlStrategy.India, UrlStrategy.China];\n}", "title": "" }, { "docid": "27c5ce45feb4e94349ccc90a6cc737c2", "score": "0.4651428", "text": "function getUrlParams (options$$1) {\n if (options$$1.url.indexOf('?') !== -1) {\n options$$1.requestParams = options$$1.requestParams || {};\n var queryString = options$$1.url.substring(options$$1.url.indexOf('?') + 1);\n options$$1.url = options$$1.url.split('?')[0];\n options$$1.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\n }\n options$$1.url = cleanUrl(options$$1.url.split('?')[0]);\n return options$$1;\n}", "title": "" }, { "docid": "37da84f3247c3cca763a918793059df7", "score": "0.46371382", "text": "function page_search(search_str, page_info) {\n if ('com' in page_info) {\n var com_match_info = check_list(search_str, page_info.com, page_info);\n } else {\n var com_match_info = null;\n }\n\n if ('sci' in page_info) {\n var sci_match_info = check_list(search_str, page_info.sci, page_info);\n } else {\n var sci_match_info = null;\n }\n\n if (com_match_info || sci_match_info) {\n if (better_match(com_match_info, sci_match_info)) {\n var pri = com_match_info.pri;\n } else {\n var pri = sci_match_info.pri;\n }\n\n var fit_info = {\n pri: pri,\n page_info: page_info,\n com_match_info: com_match_info,\n sci_match_info: sci_match_info\n };\n\n insert_match(fit_info);\n\n /* If there was a match on a page name, don't clutter up the auto-complete\n list with matches on its glossary terms. */\n return;\n }\n\n if ('glossary' in page_info) {\n /* We're willing to add one auto-complete entry for each separate anchor.\n We use the best fit among all terms associated with that anchor in\n combination with all page names. */\n var best_match_info = null;\n for (var j = 0; j < page_info.glossary.length; j++) {\n var glossary = page_info.glossary[j];\n\n /* Find the best match associated with glossary.anchor. */\n if ('com' in page_info) {\n var match_info = glossary_check_list(search_str, glossary,\n page_info.com, page_info);\n } else {\n var match_info = null;\n }\n\n if (match_info) {\n if ('anchor' in glossary) {\n var anchor = glossary.anchor;\n } else {\n var anchor = glossary.terms[0];\n }\n\n var fit_info = {\n pri: match_info.pri,\n page_info: page_info,\n com_match_info: match_info,\n sci_match_info: null,\n anchor: anchor\n };\n\n insert_match(fit_info);\n }\n }\n }\n}", "title": "" }, { "docid": "fd16d41e02e4b9da820bf8ac0a4064f5", "score": "0.46286047", "text": "function urlMatches(url) {\n\t//check in the ../extra directory to see how we got this string\n\tconst str = \"(ad.admitad.com/g/)|(ad.admitad.com/goto/)|(performance.affiliaxe.com/.*\\\\?aff_id=)|(performance.affiliaxe.com/.*&aff_id=)|(s.aliexpress.com/.*\\\\?af=)|(s.aliexpress.com/.*&af=)|(amazon.com/.*\\\\?tag=)|(amazon.com/.*&tag=)|(amazon.de/.*\\\\?tag=)|(amazon.de/.*&tag=)|(amazon.it/.*\\\\?tag=)|(amazon.it/.*&tag=)|(amazon.in/.*\\\\?tag=)|(amazon.in/.*&tag=)|(amazon.fr/.*\\\\?tag=)|(amazon.fr/.*&tag=)|(primevideo.com/.*\\\\?ref=)|(primevideo.com/.*&ref=)|(itunes.apple.com/.*\\\\?at=)|(itunes.apple.com/.*&at=)|(apple.com/.*\\\\?afid=)|(apple.com/.*&afid=)|(affiliates.audiobooks.com/.*\\\\?a_aid=.*&a_bid=)|(affiliates.audiobooks.com/.*\\\\?a_bid=.*&a_aid=)|(affiliates.audiobooks.com/.*&a_bid=.*&a_aid=)|(avantlink.com/.*\\\\?pw=)|(avantlink.com/.*&pw=)|(secure.avangate.com/.*\\\\?affiliate=)|(secure.avangate.com/.*&affiliate=)|(awin1.com/.*\\\\?awinaffid=)|(awin1.com/.*&awinaffid=)|(ad.zanox.com/ppc^)|(zenaps.com/rclick.php\\\\?)|(banggood.com/.*\\\\?p=)|(banggood.com/.*&p=)|(bookdepository.com/.*\\\\?a_aid=)|(bookdepository.com/.*&a_aid=)|(booking.com/.*\\\\?aid=)|(booking.com/.*&aid=)|(hop.clickbank.net^)|(anrdoezrs.net/click-)|(cj.dotomi.com^)|(dpbolvw.net/click-)|(emjcd.com^)|(jdoqocy.com/click-)|(kqzyfj.com/click-)|(qksrv.net^)|(tkqlhce.com/click-)|(designmodo.com/\\\\?u=)|(rover.ebay.com/.*\\\\?campid=)|(rover.ebay.com/.*&campid=)|(audiojungle.net/.*\\\\?ref=)|(audiojungle.net/.*&ref=)|(codecanyon.net/.*\\\\?ref=)|(codecanyon.net/.*&ref=)|(marketplace.envato.com/.*\\\\?ref=)|(marketplace.envato.com/.*&ref=)|(graphicriver.net/.*\\\\?ref=)|(graphicriver.net/.*&ref=)|(themeforest.net/.*\\\\?ref=)|(themeforest.net/.*&ref=)|(videohive.net/.*\\\\?ref=)|(videohive.net/.*&ref=)|(buyeasy.by/cashback/)|(buyeasy.by/redirect/)|(flipkart.com/.*\\\\?affid=)|(flipkart.com/.*&affid=)|(gtomegaracing.com/.*\\\\?tracking=)|(gtomegaracing.com/.*&tracking=)|(search.hotellook.com/.*\\\\?marker=)|(search.hotellook.com/.*&marker=)|(hotmart.net.br/.*\\\\?a=)|(hotmart.net.br/.*&a=)|(7eer.net/c/)|(evyy.net/c/)|(kontrolfreek.com/.*\\\\?a_aid=)|(kontrolfreek.com/.*&a_aid=)|(online.ladbrokes.com/promoRedirect\\\\?key=)|(online.ladbrokes.com/promoRedirect\\\\?.*&key=)|(makeupgeek.com/.*\\\\?acc=)|(makeupgeek.com/.*&acc=)|(gopjn.com/t/)|(pjatr.com/t/)|(pjtra.com/t/)|(pntra.com/t/)|(pntrac.com/t/)|(pntrs.com/t/)|(click.linksynergy.com/.*\\\\?id=)|(click.linksynergy.com/.*&id=)|(go.redirectingat.com/.*\\\\?id=)|(go.redirectingat.com/.*&id=)|(olymptrade.com/.*\\\\?affiliate_id=)|(olymptrade.com/.*&affiliate_id=)|(rstyle.me^)|(shopstyle.it^)|(shareasale.com/r.cfm^)|(shareasale.com/m-pr.cfm^)|(shareasale.com/u.cfm^)|(apessay.com/.*\\\\?rid=)|(apessay.com/.*&rid=)|(tatacliq.com/.*\\\\?cid=af:)|(tatacliq.com/.*&cid=af:)|(thermoworks.com/.*\\\\?tw=)|(thermoworks.com/.*&tw=)|(zaful.com/.*\\\\?lkid=)|(zaful.com/.*&lkid=)\";\n\tvar searchPattern = new RegExp(str);\n\treturn searchPattern.test(url);\n}", "title": "" }, { "docid": "ad07d2c168fc2e20a387d6c19f04e9f4", "score": "0.46235922", "text": "function findFirstRule(rules, url, referrerHost, thirdParty, requestType, genericRulesAllowed, badFilterRules) {\n const matchingRules = filterRules(\n rules,\n url,\n referrerHost,\n thirdParty,\n requestType,\n genericRulesAllowed,\n badFilterRules\n );\n\n if (!matchingRules) {\n return null;\n }\n\n return matchingRules.reduce(isHigherPriority);\n }", "title": "" }, { "docid": "737f9cb88c1646806e36cfa326fb5ca8", "score": "0.4619283", "text": "function getAllUrlParams(url) {\n\n // get query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n\n // we'll store the parameters here\n var obj = {};\n\n // if query string exists\n if (queryString) {\n\n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n\n // split our query string into its component parts\n var arr = queryString.split('&');\n\n for (var i=0; i<arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n\n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\n paramNum = v.slice(1,-1);\n return '';\n });\n\n // set parameter value (use 'true' if empty)\n var paramValue = typeof(a[1])==='undefined' ? true : a[1];\n\n // (optional) keep case consistent\n paramName = paramName.toLowerCase();\n paramValue = paramValue.toLowerCase();\n\n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "9f7853b5b4d9e17c13ea9b6d873b20bb", "score": "0.46192786", "text": "function replaceParams() {\n var href = $(this).attr(\"href\") || $(this).serialize()\n href = href.match(/\\?(.+)/)[1]\n href = TaxonGuide.cleanParamString(href)\n var state = href.match(/[\\?\\&=]/) ? $.deparam.querystring(href) : {}\n $.bbq.pushState(state, TaxonGuide.REPLACE_EXISTING)\n return false\n }", "title": "" }, { "docid": "79e992d1d6bf04bac094b19f85e0a709", "score": "0.46142864", "text": "function preprocessGetRequests()\n {\n // if we don't need to do anything, never mind\n if ((oData === null) || (oOptions.sMethod !== 'GET' && oOptions.sMethod !== 'HEAD'))\n {\n return;\n }\n\n // otherwise, append things\n sUri += ( sUri.indexOf( '?' ) === -1 ? '?' : '&' ) + oData;\n oData = null;\n }", "title": "" }, { "docid": "9a248ee0e83daec9535d28409a1c5970", "score": "0.4611101", "text": "function hentAlleUrlParametre (url = \"\") {\n\n\t// Hvis man ikke giver den en specifik URL, så bruger den browserens aktuelle URL.\n\tif (url == \"\") url = window.location.href;\n\n\turl = url + \"\"; // Dette sørger for, at der arbejdes med en KOPI af teksten og ikke den oprindelige tekst.\n\tvar urlParams = {};\n\turl.replace (\n\t\tnew RegExp(\"([^?=&]+)(=([^&]*))?\", \"g\"),\n\t\tfunction ($0, $1, $2, $3) {\n\t\t\turlParams[$1] = $3;\n\t\t}\n\t);\n\n\treturn urlParams;\n}", "title": "" }, { "docid": "71ea60ce8e55e5263b92a895f4246d39", "score": "0.46021688", "text": "function fixurl(q) {\n\n // Allow typical copy/paste error\n // ?url=http://server/hapi/info?{id,dataset}=abc\n // and treat as equivalent to \n // ?url=http://server/hapi&{id,dataset}=abc\n // for web interface and similar for command line.\n\n if (/\\?id=/.test(q['url'])) {\n q['id'] = q['url'].split(\"?id=\")[1];\n q['url'] = q['url']\n .split(\"?id=\")[0]\n .replace(/\\/info$|\\/data$|\\/catalog$/,\"\")\n }\n if (/\\?dataset=/.test(q['url'])) {\n q['id'] = q['url'].split(\"?datset=\")[1];\n q['url'] = q['url']\n .split(\"?dataset=\")[0]\n .replace(/\\/info$|\\/data$|\\/catalog$/,\"\")\n }\n q['url'] = q['url'].replace(/\\/$/,\"\");\n}", "title": "" }, { "docid": "d744ba8d74aa5b28c387c09690bd2622", "score": "0.4601398", "text": "function processCheapestRoutes(routeString){\n var routeRef = \"\";\n var routes = routeString.split(\",\");\n for(var i=0; i < routes.length - 1; i++){\n var rArr = tripMapByRoute[routes[i]+\"_\"+routes[i+1]];\n var cheapest = 0;\n var cheapRoute = \"\";\n rArr.forEach(function(rRef){\n var deal = tripMapByRef[rRef];\n var dealValue = deal.cost - (deal.cost * deal.discount / 100);\n if(dealValue < cheapest || cheapest == 0){\n cheapest = dealValue;\n cheapRoute = rRef;\n }\n });\n if(routeRef!=''){\n routeRef = routeRef + \",\" + cheapRoute;\n }\n else {\n routeRef = cheapRoute;\n }\n }\n return routeRef;\n}", "title": "" }, { "docid": "010b5fb376c8ac97330670bfda2a7f56", "score": "0.459648", "text": "function parseURL(){\n\t// check the URL passed for routing information\n\tconst query = window.location.search;\n\tconsole.log(query);\n\tconst urlParams = new URLSearchParams(query);\n\t\n\t// mode = solo means check for the example #, multi means check for the ordered string (not implemented anymore)\n\t//var mode = urlParams.get('mode');\n\tvar ex = Number(urlParams.get('ex'));\n\tvar tile = Number(urlParams.get('tile'));\n\t//console.log(mode,ex);\n\tif(ex < 1 || ex > 7){\n\t\tconsole.log(\"Link parameters do not match. Defaulted to example 1.\");\n\t\tex = 1;\n\t} else {\n\t\tconsole.log(\"You have chosen to open to example\", ex);\n\t}\n\t\n\t// start creating the map with any given info/the defaults\n\tcreateMap(ex,tile);\n}", "title": "" }, { "docid": "e79c30b84dad0c5c3e152fe1bd5504c7", "score": "0.4590538", "text": "function usePlaceMatch() {\n // Waits 0.1s before giving another prediction\n const throttledTerm = useThrottle(term, 100);\n /* eslint-disable */\n return useMemo(() => term === \"\" ? null :\n matchSorter(lines, term, { keys: [\"route__route_short_name\"] },\n { threshold: matchSorter.rankings.STARTS_WITH }), [throttledTerm]);\n }", "title": "" }, { "docid": "8c17e8e480e952cd82179c152c9dcecd", "score": "0.45773315", "text": "getParams(url) {\n let urlParts = url.split('/');\n let patternParts = this.pattern.split('/');\n let params = {};\n for (let idx in patternParts) {\n if (patternParts[idx].startsWith(':')) {\n let paramName = patternParts[idx].slice(1);\n params[paramName] = urlParts[idx];\n }\n }\n return params;\n }", "title": "" }, { "docid": "a83b59d5edc60302948a4311f69ce8e7", "score": "0.456821", "text": "function urlParam(name, defaultvalue) {\n var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); // [^&#] is a set with anything except & and #\n if (results == null) {\n return defaultvalue;\n } else {\n return results[1] || 0;\n }\n }", "title": "" }, { "docid": "1f0b74ba13486102e0b744b10816befe", "score": "0.45581806", "text": "function m(a){function b(a){var b=a(f,d);return b?(I(b)&&d.replace().url(b),!0):!1}if(!a||!a.defaultPrevented){var e=o&&d.url()===o;if(o=c,e)return!0;var g,h=j.length;for(g=0;h>g;g++)if(b(j[g]))return;\n// always check otherwise last to allow dynamic updates to the set of rules\nk&&b(k)}}", "title": "" }, { "docid": "353bd0df03c4c234d74c77d8bfc674b2", "score": "0.45553246", "text": "function generateFilterSuggestions() {\n var url = chosenResource.resource;\n url = url.replace(/\\s{5}\\(.*\\)$/, '').replace(/\\#.*$/, '');\n var isBlocked = ($(\".selected\").hasClass(\"blocked\"));\n var blocksuggestions = [];\n var strippedUrl = url.replace(/^[a-z\\-]+\\:\\/\\/(www\\.)?/, '');\n blocksuggestions.push(strippedUrl);\n if (strippedUrl.indexOf(\"?\") > 0 || strippedUrl.indexOf(\"#\") > 0) {\n strippedUrl = strippedUrl.replace(/(\\?|\\#).*/, '');\n blocksuggestions.push(strippedUrl);\n }\n if (strippedUrl.indexOf(\"/\") > 0 &&\n strippedUrl.lastIndexOf('/') !== strippedUrl.indexOf('/')) {\n strippedUrl = strippedUrl.substr(0, strippedUrl.lastIndexOf('/') + 1);\n blocksuggestions.push(strippedUrl);\n }\n if (strippedUrl.indexOf('/') > 0) {\n strippedUrl = strippedUrl.substr(0, strippedUrl.indexOf('/'));\n blocksuggestions.push(strippedUrl);\n }\n\n var minimumdomain = parseUri.secondLevelDomainOnly(strippedUrl, true);\n if (minimumdomain !== strippedUrl) {\n blocksuggestions.push(minimumdomain);\n }\n\n var suggestions = [];\n for (var i in blocksuggestions) {\n var inputBox = $(\"<input>\").\n attr(\"type\", \"radio\").\n attr(\"name\", \"urloption\").\n attr(\"id\", \"suggest_\" + i).\n val((isBlocked ? \"@@||\" : \"||\") + blocksuggestions[i]);\n var label = $(\"<label>\").\n attr(\"for\", \"suggest_\" + i).\n text(blocksuggestions[i]);\n suggestions.push(inputBox);\n suggestions.push(label);\n suggestions.push(\"<br/>\");\n }\n $(\"#suggestions\").empty();\n for (var i = 0; i < suggestions.length; i++)\n $(\"#suggestions\").append(suggestions[i]);\n if ($(\"#suggestions\").find('input:first-child').val().indexOf('?') > 0)\n $($(\"#suggestions\").children('input')[1]).prop('checked', true);\n else\n $(\"#suggestions\").find('input:first-child').prop('checked', true);\n\n if (!isBlocked)\n $(\"#selectblockableurl b\").text(translate(\"blockeverycontaining\"));\n else\n $(\"#selectblockableurl b\").text(translate(\"whitelisteverycontaining\"));\n var inputBox = $('<input>').\n attr(\"type\", \"text\").\n attr(\"id\", \"customurl\").\n attr(\"size\", \"99\").\n attr(\"title\", translate(\"wildcardhint\")).\n val(url).\n bind(\"input\", function() {\n $(\"#custom\").click()\n });\n $(\"#custom + label\").append(inputBox);\n}", "title": "" }, { "docid": "832332ee9a96a79f9847bb915ea884fc", "score": "0.4553574", "text": "function pruneUrl(url) {\n\treturn url.split('?')[0];\n }", "title": "" }, { "docid": "63b561dca2333b7ac0d1223db5e76e01", "score": "0.45490602", "text": "setAllSearchParams() {\n this.setLocationFromUrl();\n }", "title": "" }, { "docid": "ee2d7b44b34c3b4bc5a2504f3ffa1967", "score": "0.45458224", "text": "function urlQuery() {\n let urlString = window.location.href;\n let paramString = urlString.split(\"?\")[1];\n if(urlString.split(\"?\")[2] == \"aos\") {\n aos = false;\n }\n let queryString = new URLSearchParams(paramString);\n let flag = false;\n //Look for search keyword and then intiate the characterQuery process\n for (let pair of queryString.entries()) {\n if (pair[0] == \"search\") {\n characterQuery(pair[1], 24, false);\n flag = true;\n }\n }\n return flag;\n}", "title": "" }, { "docid": "4eb90672c385d689fb637150d90f6b05", "score": "0.45353472", "text": "handleUrlHash(props) {\n const { project, isFeedsLoading, phases, phasesTopics, feeds, loadProjectPlan, loadPhaseFeed, location } = props\n const hashParts = _.split(location.hash.substring(1), '-')\n const hashPrimaryId = parseInt(hashParts[1], 10)\n\n switch (hashParts[0]) {\n case 'comment': {\n if (!isFeedsLoading && !this.foundCommentInFeeds(feeds, hashPrimaryId)) {\n this.loadAllFeeds()\n }\n break\n }\n\n case 'feed': {\n if (!isFeedsLoading && !_.some(feeds, { id: hashPrimaryId})) {\n this.loadAllFeeds()\n }\n break\n }\n\n case 'phase': {\n const postId = parseInt(hashParts[3], 10)\n\n if (phases && phasesTopics) {\n if (!_.some(phases, { id: hashPrimaryId})) {\n let existingUserIds = _.map(project.members, 'userId')\n existingUserIds= _.union(existingUserIds, _.map(project.invites, 'userId'))\n loadProjectPlan(project.id, existingUserIds)\n } else if(postId && !(phasesTopics[hashPrimaryId].topic && phasesTopics[hashPrimaryId].topic.postIds.includes(postId))) {\n loadPhaseFeed(project.id, hashPrimaryId)\n }\n }\n break\n }\n }\n }", "title": "" }, { "docid": "34f9977f33704cfd329e6e18d5bee911", "score": "0.4535024", "text": "function _findURLMatches (url) {\n let matches = [];\n\n if (!url) {\n return [];\n }\n\n // If base route is provided then find the route and return\n if (url === '/') {\n let matchedBaseRoute = _findMatchingRoute(url);\n return matchedBaseRoute ? [matchedBaseRoute] : [];\n }\n\n // filter of empty slugs to prevent `//foo` being treated as\n // separate routes`['', 'foo']`\n let slugs = [...url.split('/').filter((slug) => slug !== ''), ''];\n let allMatchedRoutes = [];\n\n // Find a leaf node for the URL\n let matchedRoute = _findMatchingRoute(url);\n\n while (matchedRoute) {\n allMatchedRoutes.unshift(matchedRoute);\n matchedRoute = _findRouteByName(matchedRoute.parentName);\n }\n\n slugs.reduce((accumulator, current) => {\n let found = false;\n for (let route of allMatchedRoutes) {\n found = _findUrlAndAliasesMatchFromRoute(route, accumulator, matches, allMatchedRoutes);\n\n if (found) {\n break;\n }\n }\n\n return found ? current : accumulator + '/' + current;\n });\n\n return matches;\n}", "title": "" }, { "docid": "323f50dc2982420e8cd8cb8de0e5f717", "score": "0.45335826", "text": "function setUrlParams() {\n\t\tvar stateObject = {};\n\t\tvar title = 'Lipsum Generator | An @tomchewitt Experiment';\n\t\tvar newUrl = '?paras=' + params[0].val + '&words=' + params[1].val;\n\n\t\t// add to newUrl\n\t\tif (params[2].val == '1') {\n\t\t\tnewUrl += '&tags=1';\n\t\t}\n\t\tif (params[3].val == '1') {\n\t\t\tnewUrl += '&hodor=1';\n\t\t}\n\n\t\thistory.pushState(stateObject,title,newUrl);\n\t}", "title": "" }, { "docid": "59828650de56e7e15f1e2ec872e3fb1f", "score": "0.4529876", "text": "_urlSupported(url)\n {\n if(ppixiv.native)\n return true;\n\n url = new URL(url);\n let pathname = this._getPathWithoutLanguage(url.pathname);\n\n let parts = pathname.split(\"/\");\n let firstPart = parts[1]; // helpers.pixiv.getPageTypeFromUrl\n if(firstPart == \"artworks\")\n return true; // manga, current_illust\n else if(firstPart == \"users\")\n return true; // follows, artist, bookmarks, bookmarks_merged, bookmarks\n else if(pathname == \"/new_illust.php\" || pathname == \"/new_illust_r18.php\")\n return true; // new_illust\n else if(pathname == \"/bookmark_new_illust.php\" || pathname == \"/bookmark_new_illust_r18.php\")\n return true; // new_works_by_following\n else if(firstPart == \"tags\")\n return true; // search\n else if(pathname == \"/discovery\")\n return true; // discovery\n else if(pathname == \"/discovery/users\")\n return true; // discovery_users\n else if(pathname == \"/bookmark_detail.php\")\n return true; // related_illusts, related_favorites\n else if(pathname == \"/ranking.php\")\n return true; // rankings\n else if(pathname == \"/search_user.php\")\n return true; // search_users\n else if(pathname.startsWith(\"/request/complete\"))\n return true; // completed_requests\n else if(firstPart == \"\" && window.location.hash.startsWith(\"#ppixiv/edits\"))\n return true; // edited_images\n else\n return false;\n }", "title": "" } ]
397d981bcbf593d6ae7c1dfa7917fb2b
Iterates through array elements and swaps the current and current2 flags
[ { "docid": "4c24285ad1a24a596ee88c402f8aa3f1", "score": "0.7268629", "text": "swapCurrents() {\n let current = -1;\n let current2 = -1;\n\n for (let i = 0; i < this.array.length; i++) {\n if (this.array[i].current) {\n current = i;\n if (current2 >= 0) {\n break;\n }\n } else if (this.array[i].current2) {\n current2 = i;\n if (current >= 0) {\n break;\n }\n }\n }\n\n if (current >= 0 && current[2] >= 0) {\n this.array[current].current = false;\n this.array[current].current = true;\n this.array[current2].current2 = false;\n this.array[current2].current2 = true;\n }\n }", "title": "" } ]
[ { "docid": "8baf70ea69fe9688f9933902438ea2dc", "score": "0.6686318", "text": "function switchVals(arr, idxA, idxB) {\r\n var temp = arr[idxA];\r\n arr[idxA] = arr[idxB];\r\n arr[idxB] = temp;\r\n}", "title": "" }, { "docid": "ad1ce34aa6a6610df42491358532fa55", "score": "0.6677465", "text": "function swapValues(arr){\r\n for(i = 0; i < arr.length; i++){\r\n \r\n }\r\n \r\n}", "title": "" }, { "docid": "05c6853c611253420341ff7d369b807b", "score": "0.65201217", "text": "function complexSwap(arr){\n var iterations = Math.round(arr.length/4);\n for (i = 0; i < iterations; i++){\n var temp = arr[0 + i*2];\n arr[0 + i*2] = arr[arr.length - i*2 - 1];\n arr[arr.length - i*2 - 1] = temp;\n }\n console.log(arr);\n}", "title": "" }, { "docid": "848d826a8c7eb5fdb7613637a66e7671", "score": "0.6360252", "text": "function aiswap(arr, i1, i2) {\n\tvar tmp = arr[i1];\n\tarr[i1] = arr[i2];\n\tarr[i2] = tmp;\n}", "title": "" }, { "docid": "10c3e9715fff8052cda99c2d995c1aac", "score": "0.632477", "text": "function switchElements(arr, a, b){\n\tlet tmp = arr[a];\n\tarr[a] = arr[b];\n\tarr[b] = tmp;\n}", "title": "" }, { "docid": "e202a0188c447ec68e5522f889b1aa42", "score": "0.6268608", "text": "function shiftVals(array){\n for (var i = 0; i < array.length; i++) {\n array[i] = array[i+1];\n }\n array[array.length-1] = 0;\n return array;\n}", "title": "" }, { "docid": "d84ed9679b0fe6dc60245f0ea317f3e2", "score": "0.62304944", "text": "function change(array) {\n var temp;\n temp = array[0];\n array[0] = array[1];\n array[1] = temp;\n return array;\n}", "title": "" }, { "docid": "1ce54c96ffb6b43b3e2c68491e224d21", "score": "0.62298554", "text": "function SwapTowardTheCenter(){\n var temp = arr[0];\n for (var i = 0; i < 3; i+=2){\n temp = arr[i];\n arr[i] = arr[arr.length - i - 1];\n arr[arr.length - i - 1] = temp;\n }\n return arr;\n}", "title": "" }, { "docid": "f3e7728c8f50d67e09682233f37a88f2", "score": "0.6212592", "text": "swapValues (valArray)\n {\n let tempVal = valArray[0];\n valArray[0] = valArray[1];\n valArray[1] = tempVal;\n return valArray\n }", "title": "" }, { "docid": "575dabbb99772665085b51a4c10d62da", "score": "0.6175483", "text": "function switchpairs(arr){\n if(arr.length === 0){\n return false\n }\n var start;\n if(arr.length % 2 ==0){\n start = 0;\n }else{\n start = 1\n }\n for(var i = start;i<arr.length -1;i++){\n if(arr[i] == arr[i+1]-1){\n var temp = arr[i];\n arr[i] = arr[i+1];\n arr[i+1] = temp;\n }\n }\n return arr\n}", "title": "" }, { "docid": "78ba45dae45371fb978a33549d2bbef4", "score": "0.6166517", "text": "function reverseArrayInPlace(array) {\n //make the loop with half of the array length Math.floored as the end. this will acount for odd and even array lengths.\n for(let i = 0; i < Math.floor(array.length / 2); i++){\n //we now have to move the values and replace them with their corisponding index\n //it is easier to create a variable that will house the values\n let switched = array[i];\n array[i] = array[array.length - 1 - i];\n array[array.length - 1 - i] = switched;\n }\n}", "title": "" }, { "docid": "75033d3008b10696a050f4ae88bc71f8", "score": "0.6141145", "text": "function swap(arr, left, right, animations) {\n const temp = arr[left];\n // Insert a flag that indicate a swap\n animations.push(\"FLAG\")\n animations.push([left, arr[right]]);\n animations.push([right, arr[left]])\n arr[left] = arr[right];\n arr[right] = temp;\n \n}", "title": "" }, { "docid": "cdd256f4dd5ad7117c182ec8502fa598", "score": "0.6140191", "text": "function swapTowardTheCenter(arr){ //this one was hard for me. I realized after a while I just needed to do the same thing as the swaptowards the middle one except skip over every other one.\n var indexHold = 0;\n for(var i=0; i<arr.length/2; i++){\n indexHold = arr[i];\n if(i%2==0){\n arr[i]=arr[arr.length-(1+i)];\n arr[arr.length-(1+i)]=indexHold;\n }\n \n }\n return arr;\n}", "title": "" }, { "docid": "2097527bb7757bf40bb008860bcb0780", "score": "0.61243933", "text": "function arrShift(arr) {\n // for (var idx = 1; idx < arr.length; idx++) {\n // start at 0\n for (var idx = 0; idx < arr.length; idx++) {\n // arr[idx + 1] = arr[idx];\n // make current === to forward.\n arr[idx] = arr[idx + 1];\n \n }\n arr[arr.length - 1] = 0;\n console.log(arr);\n return arr;\n}", "title": "" }, { "docid": "f8c279ab9c13dcf61555c653f8905b74", "score": "0.60874945", "text": "function swapPairs3(array){\n console.log('Array before manipulation: ' + array);\n // let remainder = array.length % 2;\n // index equal to zero, where index is less than array length (minus the array length remainder), increment by 2 each loop\n for(let index = 0; index < (array.length - 1); index += 2){\n // assign array[index] to temp variable\n let temp = array[index];\n // console.log('Temp variable assigned to array[index] with value of: ' + temp);\n\n array[index] = array[index + 1];\n // console.log('Increment the array index value + 1: ' + array[index]);\n\n array[index + 1] = temp;\n // console.log('Array index + 1 now switched to temp value of: ' + temp);\n }\n return array;\n}", "title": "" }, { "docid": "0bbea720ca313cd5e00882da2aa4cf4c", "score": "0.6085038", "text": "function swapPairs(arr) {\n\tfor(let i = 0; i < arr.length - 1; i = i + 2) {\n\t\tlet temp = arr[i];\n\t\tarr[i] = arr[i + 1];\n\t\tarr[i + 1] = temp;\n\t}\n}", "title": "" }, { "docid": "f9dedc53c6b91376c60836329e6948e3", "score": "0.60791737", "text": "function swap(arr) {\n\tfor(var i = 0; i < arr.length/2; i+=2){\n\t\tlet temp = arr[i];\n\t\tarr[i] = arr[arr.length-1-i];\n\t\tarr[arr.length-1-i] = temp;\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "81d3b85463f497bce26e889521910dd3", "score": "0.6077984", "text": "function swapInner(arr, a, b) { for (var row = 0; row < Y_LIMIT; ++row) { swap(arr[row], a, b); } return arr; }", "title": "" }, { "docid": "359f95191dc69386d28e9524bd7cbd8b", "score": "0.6054088", "text": "function shiftArrayValues(arr) {\n\tfor(var i = 0; i < arr.length; i++) {\n\t\tarr[i] = arr[i + 1];\n\t}\n\tarr[arr.length - 1] = 0;\n\treturn arr;\n}", "title": "" }, { "docid": "85eb5cc466c448696bcd63682a2896ba", "score": "0.60033023", "text": "function swapValues (arr){\n for ( var i = 0; i < arr.length/2; i++){\n temp = arr[i];\n arr[i]= arr[arr.length -1-i];\n arr[arr.length-1-i]= temp;\n }\n return arr;\n}", "title": "" }, { "docid": "d4d309d0c6808d0104e1be8180fdb503", "score": "0.5999424", "text": "function doubleTrouble(arr){\n for (var i = 0; i < arr.length; i++){\n for (var j = arr.length-1; j > i; j--){\n arr[j+1] = arr[j]; // shift every element to the right by one from wherever i happens to be\n }\n arr[i+1] = arr[i]; // duplicating the value at i\n i++; // have i bump forward an extra 1\n }\n}", "title": "" }, { "docid": "cfc103abff60c2ca9bf7d9b1d12f681a", "score": "0.59952676", "text": "function swap(currentPosition,nextPosition,array){\n\t\tvar temp = array[currentPosition];\n\t\tarray[currentPosition] = array[nextPosition];\n\t\tarray[nextPosition] = temp;\n\t}", "title": "" }, { "docid": "963876487757bf6269a4bbc6f0947129", "score": "0.5974707", "text": "function swapArrayElements(attr, indexA, indexB) {\n var temp = attr[indexA];\n attr[indexA] = attr[indexB];\n attr[indexB] = temp;\n\n return attr;\n}", "title": "" }, { "docid": "af1217a7fa66c4a92fd580d41557a3c0", "score": "0.5948381", "text": "function swapValues(arr){\n var temp = arr[arr.length-1];\n arr[arr.length-1] = arr[0];\n arr[0] = temp;\n}", "title": "" }, { "docid": "f33d7cf4dec7e7b2d62abd1eb4d5cac4", "score": "0.5941624", "text": "function switchTiles(array) {\n var i = 0;\n\n // find the first two tiles in a row\n while (!array[i] || !array[i + 1]) i++;\n\n // store tile value\n var tile = array[i];\n // switche values\n array[i] = array[i + 1];\n array[i + 1] = tile;\n\n return array;\n }", "title": "" }, { "docid": "d6c329944f53bdd33022acec360dae19", "score": "0.5938792", "text": "function swapFL (arr) {\n var temp = arr[0];\n arr[0] = arr[arr.length-1];\n arr[arr.length-1]=temp;\n return arr;\n}", "title": "" }, { "docid": "11afd1ba7b594746d5129e2554522ee9", "score": "0.59383464", "text": "function swap(array, i, j, animations) {\n animations.push([i, j, array[i], array[j], true, 'secondary']);\n animations.push([i, j, array[i], array[j], true, 'primary']);\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n}", "title": "" }, { "docid": "d238a5f6b7ee25ca421c539452d4a023", "score": "0.59366417", "text": "function swapTwoValues(arr) {\n var temp =0;\n var num = 0;\n temp = arr[num];\n arr[num] = arr[arr.length - 1] \n arr[arr.length - 1] = temp;\n return arr;\n}", "title": "" }, { "docid": "73dd52ba4a4a07cefad071e3793c56e9", "score": "0.5926662", "text": "function swapPairs(arr) {\n for (i = 0; i < arr.length - 1; i += 2) {\n var temp = arr[i];\n arr[i] = arr[i + 1];\n arr[i + 1] = temp;\n }\n return arr;\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.59265643", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.59265643", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.59265643", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.59265643", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.59265643", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.59265643", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "3da18aa116cb34ee74e2f6311d02dc61", "score": "0.58916545", "text": "function exchange(arr, i, j) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }", "title": "" }, { "docid": "2a585c85237fe90b8f887ec6e85c5bdb", "score": "0.5881043", "text": "function swap(){\n arr = [-1,250,100,25];\n var arrnew = arr.slice();\n var temp = arrnew[0];\n arrnew[0] = arrnew[arrnew.length-1];\n arrnew[arrnew.length-1] = temp;\n return arrnew; \n}", "title": "" }, { "docid": "9c3585ae544ff35e4d6f8b5217521f89", "score": "0.58627266", "text": "function swapValue(array, valueOne, valueTwo) {\n holdValue = \"\"\n for (let i = 0; i < array.length; i++) {\n if (array[i] === valueOne) {\n for (let j = 0; j < array.length; j++) {\n if (array[j] === valueTwo) {\n holdValue = array[i]\n array[i] = array[j]\n array[j] = holdValue\n }\n }\n }\n if (array[i] === valueTwo) {\n for (let j = 0; j < array.length; j++) {\n if (array[j] === valueOne) {\n holdValue = array[i]\n array[i] = array[j]\n array[j] = holdValue\n }\n }\n }\n }\n return array\n}", "title": "" }, { "docid": "3ffb774749c39884314d1dfde8035ed3", "score": "0.585564", "text": "function SwapValue() {\n var arr = [1, 5, 10, -2];\n var firstelement = arr[0];\n for (let index = 0; index < arr.length; index++) {\n if (index == arr.length-1 ) {\n arr[0] = arr[index];\n arr[index] = firstelement;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "344193eacda615b8b0414347d26ca666", "score": "0.58491886", "text": "function swapPairs(arr){\n if (arr.length%2 == 0)\n\t\tarrlen = arr.length;\n\telse\n arrlen = arr.length-1;\n\n for (var i=0; i < arrlen; i+=2){\n temp = arr[i];\n arr[i] = arr[i+1];\n arr[i+1] = temp;\n } \n return arr;\n}", "title": "" }, { "docid": "eca578ef06122c69bb90912af096dc9c", "score": "0.584452", "text": "function swap(arr, index1, index2) {}", "title": "" }, { "docid": "b77e57ca9e2c5267d8023cee317dfb87", "score": "0.5815515", "text": "function swap(arr, i1, i2) {\n let temp = arr[i1];\n a[i1] = a[i2];\n a[i2] = temp;\n}", "title": "" }, { "docid": "2b010b5470147e8a355a2a1a5e51ad1c", "score": "0.5807727", "text": "function swapTowardCenter(arr) {\n for(var i = 0; i < arr.length/2; i += 2) {\n var tmp = arr[i];\n arr[i] = arr[arr.length-1-i];\n arr[arr.length-1-i] = tmp;\n }\n console.log(arr);\n}", "title": "" }, { "docid": "e4864d1f181a6d5402f408b493779fc0", "score": "0.5806483", "text": "function swapPairs2(array){\n console.log('Array before pair swapping: ');\n console.log (array);\n // determine whether an array is odd or even in length\n // can use modulo as test of odd or even\n if (array.length % 2 === 0){\n // iterate through array indexes and increment by values of 2\n for(let index = 0; index < array.length; index += 2){\n let temp = array[index];\n array[index] = array[index + 1];\n array[index + 1] = temp;\n }\n }\n else { // else is array length is an odd number of values do this\n // iterate through array indexes up to 2nd last index value, by increments of 2\n for(let index = 0; index < array.length - 1; index += 2){ \n let temp = array[index];\n array[index] = array[index + 1];\n array[index + 1] = temp;\n }\n }\n console.log('Array after pair swapping: ');\n return array;\n}", "title": "" }, { "docid": "8c56086dbbf815919b436cbb9f84a466", "score": "0.5800382", "text": "function swapPairs(arr){\n if (arr.length % 2 == 0){\n for (i=0; i<arr.length; i += 2){\n let temp = arr[i+1]\n arr[i+1] = arr[i]\n arr[i] = temp\n }\n } else {\n for (i=0; i < arr.length-1; i+= 2){\n let temp = arr[i+1]\n arr[i+1] = arr[i]\n arr[i] = temp\n }\n }\n return arr\n}", "title": "" }, { "docid": "64c0d086878f5921401e5026449b30a5", "score": "0.5791046", "text": "function fnArraySwitch(aArray, iFrom, iTo) {\n var mStore = aArray.splice(iFrom, 1)[0];\n aArray.splice(iTo, 0, mStore);\n }", "title": "" }, { "docid": "9e720f22750a96d4fcab034c7fb2be89", "score": "0.5789565", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n {\n var mStore = aArray.splice( iFrom, 1 )[0];\n aArray.splice( iTo, 0, mStore );\n }", "title": "" }, { "docid": "93080d863de0be00338cdda8c668e18e", "score": "0.5770952", "text": "function swap_val(arr){\n var x = arr[0];\n var y = arr[arr.length-1];\n arr[0] = y;\n arr[arr.length-1] = x;\nreturn arr\n}", "title": "" }, { "docid": "755960c77df1b72bdcb8dda79f87bd25", "score": "0.5768471", "text": "function reverseArrayInPlaceBetter(array) {\n for (let i = 0; i < Math.floor(array.length / 2); i++) {\n let old = array[i];\n array[i] = array[array.length - 1 - i];\n array[array.length - 1 - i] = old;\n }\n return array;\n }", "title": "" }, { "docid": "24f3727835afff21aa7b985fe12208d0", "score": "0.576644", "text": "function swapOddElements(arr) {\r\n var start = 0;\r\n var end = arr.length - 1;\r\n for (var i = 0; i < (arr.length - 1) / 2; i++) {\r\n var t = arr[start];\r\n arr[start] = arr[end]\r\n arr[end] = t;\r\n start += 2;\r\n end -= 2;\r\n if (start > (arr.length / 2)) break;\r\n }\r\n return arr;\r\n}", "title": "" }, { "docid": "1dcd751ff9131202742da96fcfe2a6b0", "score": "0.57632434", "text": "function swapVal(arr){\n var temp = arr[0];\n arr[0] = arr[arr.length - 1];\n arr[arr.length - 1] = temp;\n return arr;\n }", "title": "" }, { "docid": "fe992fda447eb930f34908fb2a0b11ad", "score": "0.5761511", "text": "function swap(arr)\n{\n var temp;\n var end=arr.length-1;\n for(var i=0; i<arr.length/2; i+=2)\n {\n \n temp=arr[i];\n arr[i]=arr[end-i];\n arr[end-i]=temp;\n }\n return arr\n}", "title": "" }, { "docid": "e48879494390186dbc0885246558f773", "score": "0.5752929", "text": "function swap(array, i, j) {\n\tconst tempValue = array[i];\n\tarray[i] = array[j];\n\tarray[j] = tempValue\n}", "title": "" }, { "docid": "f548120db38577be6abb29895ab7d6c0", "score": "0.57479787", "text": "function switcharoo (givenArray){\r\n\r\n var twist = [];\r\n twist[0] = givenArray[1];\r\n twist[1] = givenArray[0];\r\n return twist;\r\n}", "title": "" }, { "docid": "de0983f7ddff476e6023b1fb1a33e95e", "score": "0.57335", "text": "function swapArr(arr, i, j){\n\tlet temp = arr[i];\n\tarr[i] = arr[j];\n\tarr[j] = temp;\n}", "title": "" }, { "docid": "09f36aaf2d9686a27f283c4626653e78", "score": "0.57318074", "text": "function reverseArrayInPlace(arr) {\n for (let i = 0; i < Math.floor(arr.length / 2); i++) {\n let item = arr[i];\n arr[i] = arr[arr.length - 1 - i];\n arr[arr.length - 1 - i] = item\n }\n}", "title": "" }, { "docid": "9d51b2b51bd83b5b5848c5ea04dd1bc5", "score": "0.5721136", "text": "function mirrorArray(array) {\n var newArray = [];\n \n for(var i = 0; i < array.length; i += 1) {\n var el = array[i];\n newArray.push(el);\n }\n \n for (var i = array.length - 1; i >= 0; i -= 1) {\n var el = array[i];\n newArray.push(el);\n }\n \n return newArray;\n}", "title": "" }, { "docid": "ee5c222ba1b8d658566e4c0220a71b89", "score": "0.57126755", "text": "function swapTowardCenter(arr){\n var temp = [];\n\n for(var i=0; i<arr.length/2; i+=2){\n temp = arr[i];\n arr[i] = arr[arr.length-1-i];\n arr[arr.length-1-i] = temp;\n }\n // return arr;\n}", "title": "" }, { "docid": "3bab2702ab4f81de48ec28d14c22c799", "score": "0.5711923", "text": "_shiftElementsLeft(index){\n for(var i = index; i<this.length ; i++){\n this.data[i+1] = this.data[i];\n }\n }", "title": "" }, { "docid": "c6f942e4eef4312d4a910af0292e5d94", "score": "0.5711054", "text": "function swap(array, i, j) {\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n}", "title": "" }, { "docid": "89e27e41e4c572f37b20840bbadcb9b6", "score": "0.570862", "text": "function switched(arr_dim_2){\n var result = [];\n\n for (var i = 0; i < arr_dim_2.length; i++) {\n result[i] = arr_dim_2[arr_dim_2.length - (i+1)];\n }\n\n return result;\n }", "title": "" }, { "docid": "1c71f37ffdacae24825ed29f63b808e8", "score": "0.5708372", "text": "shiftIndexes(index) {\n\t\tfor (let i = index; i < this.length - 1; i++) {\n\t\t\tthis.data[i] = this.data[i + 1];\n\t\t}\n\t\tdelete this.data[this.length - 1];\n\t\tthis.length--;\n\t}", "title": "" }, { "docid": "98f889475304d7ff99bab9a0dbd6a6da", "score": "0.5702529", "text": "function shiftAndUpdate(array, num, idx) {\n for (let i = 0; i <= idx; i++) {\n if (i === idx) {\n array[i] = num;\n }\n else {\n array[i] = array[i + 1];\n }\n }\n}", "title": "" }, { "docid": "0ceee36e95adf14031834b9564ae52df", "score": "0.56948835", "text": "function coalesceInPlace(array) {\n let to = 0;\n for (let i = 0; i < array.length; i++) {\n if (!!array[i]) {\n array[to] = array[i];\n to += 1;\n }\n }\n array.length = to;\n }", "title": "" }, { "docid": "7f60e1b8367e45c7b9c3314aa8319ed0", "score": "0.5692271", "text": "function swap(array, i , j){\r\n let temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp\r\n return array\r\n}", "title": "" }, { "docid": "38a8e8683857ecaae9ba0c774a4f7f0e", "score": "0.56910735", "text": "function swap(array, i, j) {\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n}", "title": "" }, { "docid": "ec9ee746567025c9d8784b8b76353336", "score": "0.56908154", "text": "function swap(array, i, j) {\n\tlet temp = array[i];\n\tarray[i] = array[j];\n\tarray[j] = temp;\n}", "title": "" }, { "docid": "eb457ef039322b3c00fa80755ed43d83", "score": "0.56891936", "text": "function swap(array,i,j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "title": "" }, { "docid": "b8915dc7ba91c6704b6d52f1f90eec8b", "score": "0.56844383", "text": "function reverseArrayInPlace(array) {\n var num = Math.floor(array.length/2);\n var replace = array.length -1;\n for(let i = 0; i < num; i++){\n var a = array[i];\n array[i] = array[replace];\n array[replace] = a;\n replace --;\n }\n}", "title": "" }, { "docid": "d450a4adf2e788496717bd10743c8498", "score": "0.5680989", "text": "swap(index1, index2, arr){\n let ref = arr[index1];\n arr[index1] = arr[index2];\n arr[index2] = ref;\n return arr;\n }", "title": "" }, { "docid": "e8c74bb651bed9b85f798e1c324c0272", "score": "0.56759965", "text": "function swapTowardCenter(arr){\n\nvar temp = arr[0]; \narr[0] = arr[arr.length-1];\narr[arr.length-1] = temp;\nvar temp2 = arr[2];\narr[2] = arr[arr.length-3];\narr[arr.length-3] = temp2;\nreturn arr;\n\n}", "title": "" }, { "docid": "bb1ef383491f44cf6155d6b5dcb42059", "score": "0.56741977", "text": "function swap(arr, a, b) { var tmp = arr[a]; arr[a] = arr[b]; arr[b] = tmp; return arr; }", "title": "" }, { "docid": "b9d747d55fc951faa82c344afc64d3aa", "score": "0.5671329", "text": "function moveZeroes(array) {\n let curr = 0;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] !== 0) {\n [array[curr], array[i]] = [array[i], array[curr]];\n curr++;\n }\n }\n return array;\n}", "title": "" }, { "docid": "2a04ef4d3aafea7d46d1f2e6d07cf3a7", "score": "0.566985", "text": "function shiftArr(arr) {\n // start the loop off at index 1; run for the entire length of the array; incement by 1;\n for(var i =1; i<arr.length; i++){ \n //replace (or set) the index before the one we are on with the index we are on\n // this is the shift\n arr[i-1] = arr[i];\n }\n //outside of the for loop (after the loop is over) we make the last index 0\n arr[arr.length-1] = 0;\n return arr;\n}", "title": "" }, { "docid": "b58bddd992e5db1892c37f1634370255", "score": "0.56659615", "text": "function swap(array, pos1, pos2) {\n var element1 = array[pos1];\n var element2 = array[pos2];\n array[pos1] = element2;\n array[pos2] = element1;\n }", "title": "" }, { "docid": "b58bddd992e5db1892c37f1634370255", "score": "0.56659615", "text": "function swap(array, pos1, pos2) {\n var element1 = array[pos1];\n var element2 = array[pos2];\n array[pos1] = element2;\n array[pos2] = element1;\n }", "title": "" }, { "docid": "9597612c3b2a5cf591293fb02e532093", "score": "0.5660837", "text": "function reverseArrayInPlace(array){\nfor(let i=0; i<=Math.floor(array.length/2);i++){\n let old = array[i];\n array[i]=array[array.length-1-i];\n array[array.length-1-i]=old;\n}\nreturn array;\n}", "title": "" }, { "docid": "6dd0143dc840c28c84ed9a9ea9699644", "score": "0.5660291", "text": "function reverseArrayInPlace(arr) {\n\t\tfor (var i = 0; i < Math.floor(arr.length / 2); i++) {\n\t\t\tvar old = arr[i];\n\t\t\tarr[i] = arr[arr.length - 1 - i];\n\t\t\tarr[arr.length - 1 - i] = old;\n\t\t}\n\t\treturn arr;\n\t}", "title": "" }, { "docid": "23a87dff17238376ee40db57ca43df3c", "score": "0.56562376", "text": "function swapTowardCenter(arr){\n for (var i = 0; i < arr.length/2; i+=2){\n var temp = arr[i];\n arr[i] = arr[arr.length-1-i];\n arr[arr.length-1-i] = temp;\n }\n return arr;\n}", "title": "" }, { "docid": "1cd154d596ef1b85e6a3cd6f6b5473ad", "score": "0.5655914", "text": "function swap(arr, i, j) {\n let tmp = arr[j]; // 2\n arr[j] = arr[i]; // 2 = 3\n arr[i] = tmp; // 3 = 2\n return arr;\n}", "title": "" }, { "docid": "5f2ba91223fd976337db28ba3f4c1232", "score": "0.5654785", "text": "function shiftArrayValsLeft(arr) {\n for(var x = 0; x < arr.length; x++) {\n arr[x] = arr[x + 1];\n if(x === arr.length - 1) {\n arr[x] = 0;\n }\n }\n console.log(arr); //Outputs [4, 6, 8, 0]\n}", "title": "" }, { "docid": "ec48a0798655f26974982bec6efe8d6d", "score": "0.5652112", "text": "function swap(arr)\n{\n var temp = 0;\n\n temp = arr[0];\n arr[0] = arr[arr.length-1];\n arr[arr.length-1] = temp;\n\n temp = arr[3];\n arr[3] = arr[arr.length-4];\n arr[arr.length-4] = temp;\n\n return arr;\n}", "title": "" }, { "docid": "81ad14ac0be991714ceb03a1b4ff19e0", "score": "0.56495076", "text": "function bubbleSortSuperOptimized(arr) {\n var noSwaps = true;\n for (var i = arr.length; i > 0; i--) {\n for (var j = 0; j < i - 1; j++) {\n console.log(arr, arr[j], arr[j + 1]);\n if (arr[j] > arr[j + 1]) {\n swapES6(arr, j, j + 1);\n // if there is a swap change flag\n noSwaps = false;\n }\n }\n console.log('ONE PASS COMPLETE!');\n if (noSwaps) break;\n }\n return arr;\n}", "title": "" }, { "docid": "2f5e8f51209a7a28cf0fc9a1e68443c5", "score": "0.5644102", "text": "function swapStringForArrayNegativeVals(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\";\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "e51a3fe85d3a2c84bc8bce619eb7b5e4", "score": "0.5643327", "text": "function swap(arr, a, b) {\n printStepArrayColor(arr, [a, b]);\n let temp = arr[a];\n arr[a] = arr[b];\n arr[b] = temp;\n printStepArrayNoColor(arr);\n}", "title": "" }, { "docid": "510f55e3fe1bef0601071f5e15ed23c4", "score": "0.5638609", "text": "function swap(arr, i, j) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }", "title": "" }, { "docid": "1d655363ddbc09d81e85768febcd7379", "score": "0.56359196", "text": "function reverseArrayInPlace(swapArgs) {\n\n for (i = 0; i < Math.floor(swapArgs.length / 2); i++) { //only need to iterate through half of arguments because that's when you start to run into the mirrored positions in the 'array' that you've already swapped. Round down (floor) so that middle value of an odd-numbered array of arguments is left unchanged\n var movingArg = swapArgs[i];\n swapArgs[i] = swapArgs[swapArgs.length - i - 1];\n swapArgs[swapArgs.length - i - 1] = movingArg;\n \n }\n \n return swapArgs;\n \n}", "title": "" }, { "docid": "f4d88f6176965c5453ce35d55cfc3ce2", "score": "0.563463", "text": "function swapStringForArrayNegativeVals(arr){\n for(let i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\";\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "98a508091706927f61eebde00753cffe", "score": "0.5633547", "text": "_swap(index1, index2) {\n var temp = this.values[index1];\n this.values[index1] = this.values[index2];\n this.values[index2] = temp;\n }", "title": "" }, { "docid": "0b51516607ff8ac2e97bc5fe0bfe7e56", "score": "0.56330323", "text": "function swap(array, i, j) {\n // YOUR CODE HERE\n return array;\n}", "title": "" }, { "docid": "634ab3d7fa7e09a10fb2ab72db8f584c", "score": "0.56252164", "text": "function swap(arr, i, j) {\n if (i === j) return;\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n // console.log(arr);\n }", "title": "" }, { "docid": "8f92d560107f4a80feab84723e6a9b49", "score": "0.5624159", "text": "swap(index1, index2) {\n [this.values[index1], this.values[index2]] = [this.values[index2], this.values[index1]];\n }", "title": "" }, { "docid": "a93af6c0b2da861cde4892d81fb59926", "score": "0.5622631", "text": "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "title": "" }, { "docid": "ea1bbaffdc51c0480201209f448d1e4e", "score": "0.56219923", "text": "shiftIndex(index = 0) {\n for (let i = index; i < this.length; i++) {\n this.data[i] = this.data[i + 1];\n }\n }", "title": "" }, { "docid": "a7dc11dc680360fb29b3df7e40dddb1a", "score": "0.5620803", "text": "nextStep(arr, j) {\n this.visualizer.selectedItemsIndexes[0] = this.swaps[j].index;\n this.move(arr, this.swaps[j].index, this.swaps[j].value);\n }", "title": "" }, { "docid": "88662678fe6515cf8d359620149f866e", "score": "0.56205755", "text": "function swap(arr, i, j) {\n\tvar tmp = arr[i];\n\tarr[i] = arr[j];\n\tarr[j] = tmp;\n}", "title": "" }, { "docid": "fa497a206b719a2ab660a58ad661146e", "score": "0.56185514", "text": "function tranpose(){\r\n for (let i = 0; i < 4; i++){\r\n for (let j = 0; j < i; j++){\r\n [boardState.val[i][j], boardState.val[j][i]] = [boardState.val[j][i], boardState.val[i][j]];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "95b1f18a4177864dde26545308019a02", "score": "0.56122977", "text": "function centerSwap(arr){\n for(var i = 0; i < arr.length/2; i+=2){\n var temp = arr[i];\n arr[i] = arr[arr.length-1-i];\n arr[arr.length-1-i] = temp;\n }\n return arr;\n}", "title": "" }, { "docid": "876aac1de124b85a6b2b53f483e1b070", "score": "0.560845", "text": "function ShiftTheValues(arr){\n var newArr = [];\n for (let i = arr.length-1; i >= 0 ; i--) {\n newArr.push(arr[i])\n }\n return newArr\n}", "title": "" }, { "docid": "f02b60b93752734241e9fdb762b1906d", "score": "0.56050014", "text": "function arraySwap(ary, idx1, idx2)\n{\n var z = ary[idx1];\n ary[idx1] = ary[idx2];\n ary[idx2] = z;\n}", "title": "" } ]
d2fe372ebb27cec3bc86d463ae94e1f1
5. (...) spread oparator;
[ { "docid": "08cc8a4a9f5a7bdc1b3cbd53aebf5a13", "score": "0.0", "text": "function maxNumber( array = [] ){ //==> Default parameter;\n const max = Math.max(...array); //==> ... spread oparator;\n return max;\n}", "title": "" } ]
[ { "docid": "86dd9b14459befc9136cccd15db785f1", "score": "0.6113124", "text": "function pruebaSpread(a,b,c){\n return a+b+c;\n}", "title": "" }, { "docid": "55cf7426ae7673030eb420f742e7a01a", "score": "0.57349116", "text": "function MULTIPLYBY5(x) {\n // Custom 함수 만들기\n var result = x * 5;\n return result;\n}", "title": "" }, { "docid": "95a0fd9a3c89532a1616602d94002b4b", "score": "0.56630385", "text": "function MultiX() {point *=2;}//nesting a function which will count by whatever value by using the \"=\" and any other operator applicable here.", "title": "" }, { "docid": "c4dd6799c5e1e639342ae1225e53612b", "score": "0.5655944", "text": "function o(t,e,n){s.lazy(t,e,n),s.lazy(t.expression.mathWithTransform,e,n)}", "title": "" }, { "docid": "f5b23c65f189096cf611e09eba58cd8b", "score": "0.5651503", "text": "function multiplyFive(number) {\n return 5 * number;\n}", "title": "" }, { "docid": "91a52543ea77cd28497eee543e4adf74", "score": "0.5592549", "text": "function i(t,e,n){o(t,e,n),o(t.expression.mathWithTransform,e,n)}", "title": "" }, { "docid": "114be8bfa00bf3a1ca345f244134b8d2", "score": "0.55610883", "text": "function multiplyFive (number){\n return number*5;\n}", "title": "" }, { "docid": "ebf64ad29a4e99540b1826ec3b798348", "score": "0.55438644", "text": "function myFunctionBeforeSpread(a,b,c) {\n console.log(`a=${a}, b=${b}, c=${c}`);\n}", "title": "" }, { "docid": "28909fe3024541678bc420308cbe4601", "score": "0.5527459", "text": "function g(a, b) {\nreturn a * b * 3.5;\n}", "title": "" }, { "docid": "b065634c38690d9208fbcf3b49b6e623", "score": "0.5504938", "text": "function timesFive(num0) {\n return num0*5;\n}", "title": "" }, { "docid": "e3fb1eb65c16d79bfd159d57e0aed201", "score": "0.5497864", "text": "function g(n){\n return of(n * 2);\n}", "title": "" }, { "docid": "abf0b410716d2fa480d93e5d6148c459", "score": "0.5484504", "text": "function timesFive(val) {\n return val * 5; \n}", "title": "" }, { "docid": "f52130f4ace8743bc9e5c7806a03bb9c", "score": "0.5480245", "text": "function explodingSixes(value)\n{\n // Get sixes then multiply by 2\n let returnValue = (value * (1/6)) * 2;\n return Math.floor(returnValue);\n}", "title": "" }, { "docid": "ac3c337f2e1fc0d01ad577506bb9c2b0", "score": "0.5478228", "text": "function i(t,e,n){t[e]=n,t.expression.mathWithTransform[e]=n}", "title": "" }, { "docid": "819beada6e2ff8471a66446ac50c4d02", "score": "0.5476623", "text": "function getDividedByFive(...numbers) {\n return numbers.filter((el) => el % 5 === 0);\n }", "title": "" }, { "docid": "15ef66871e281e9e9c3c89443460f364", "score": "0.5468072", "text": "function multiplyBy5(num) {\n return num*5\n}", "title": "" }, { "docid": "11f6f2b5f125c71cfeb3c3a12f7e9a1b", "score": "0.5463791", "text": "function timesFive(arg1) {\n return arg1 * 5;\n}", "title": "" }, { "docid": "009fcaa89898e47386835f7b1d016cf2", "score": "0.5459675", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "009fcaa89898e47386835f7b1d016cf2", "score": "0.5459675", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "009fcaa89898e47386835f7b1d016cf2", "score": "0.5459675", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "009fcaa89898e47386835f7b1d016cf2", "score": "0.5459675", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "009fcaa89898e47386835f7b1d016cf2", "score": "0.5459675", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "009fcaa89898e47386835f7b1d016cf2", "score": "0.5459675", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "9e4fc24ee302b60f55de6cb163d86082", "score": "0.5442762", "text": "function fruitCutPieces(fruit) {\n return fruit * 4;\n}", "title": "" }, { "docid": "4cd9f6363517cd64fed2c88a179a8bce", "score": "0.54386663", "text": "function timesFive(num) {\r\n return num * 5;\r\n \r\n}", "title": "" }, { "docid": "075991be99a7a916e04d9bd7c75691de", "score": "0.5437492", "text": "function timesFive(num1) {\n\n return num1 * 5;\n}", "title": "" }, { "docid": "29a1274fb807cdf5535c1c11bebd51ad", "score": "0.5435358", "text": "function n$5(n,o){const t=-n[0],c=-n[1],f=-n[2],i=o[3],s=o[7],u=o[11],e=o[15];o[0]+=i*t,o[1]+=i*c,o[2]+=i*f,o[4]+=s*t,o[5]+=s*c,o[6]+=s*f,o[8]+=u*t,o[9]+=u*c,o[10]+=u*f,o[12]+=e*t,o[13]+=e*c,o[14]+=e*f;}", "title": "" }, { "docid": "4842bf1f058554de18fbae77af1ed12f", "score": "0.5419295", "text": "function timesFive(num) {\n return num*5;\n}", "title": "" }, { "docid": "4842bf1f058554de18fbae77af1ed12f", "score": "0.5419295", "text": "function timesFive(num) {\n return num*5;\n}", "title": "" }, { "docid": "f2c366f0a1d205383ffe292af9b3e209", "score": "0.54184055", "text": "function pazymiuVidurkis(){\n var x= 5;\n var x1 = 10;\n var x2 = 8;\n var x3 = 6;\n var x4 = 8;\n console.log (z = (x + x1 + x2 + x3 + x4)/5)\n}", "title": "" }, { "docid": "16990008a7133370561ad4fee6b2bce8", "score": "0.54175323", "text": "function timesFive (num){\n return num*5;\n}", "title": "" }, { "docid": "d20973abc3b0efdc46ff1cce39d2ce7b", "score": "0.5406206", "text": "function f5(initial, ...factors) {\n console.log(initial);\n console.log(factors);\n const product = factors.reduce((factor, product) => factor * product, initial);\n console.log(product);\n}", "title": "" }, { "docid": "2b6e0c8c6d4d0bdc9d2b72cc73938ccb", "score": "0.54061216", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "2b6e0c8c6d4d0bdc9d2b72cc73938ccb", "score": "0.54061216", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "2b6e0c8c6d4d0bdc9d2b72cc73938ccb", "score": "0.54061216", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "2b6e0c8c6d4d0bdc9d2b72cc73938ccb", "score": "0.54061216", "text": "function timesFive(num) {\n return num * 5;\n}", "title": "" }, { "docid": "50f3adb26c663846ced056a2a2ec28f0", "score": "0.54049015", "text": "function timesFive(num){\n return num * 5;\n}", "title": "" }, { "docid": "6fb8dbf0c51629ca4fbdafe0692b1c1c", "score": "0.5398483", "text": "function printSpread(...a) { // Spread as function args\n console.log(a);\n}", "title": "" }, { "docid": "88834c1f4a85eb6dbab39ea334eb1007", "score": "0.53932935", "text": "function plusFive(number) {\n return number + 5;\n}", "title": "" }, { "docid": "b27af24713113781443f5a01f06b61bf", "score": "0.53830326", "text": "function timesFive(num) {\n return num *5;\n}", "title": "" }, { "docid": "25f75dbdc31263efecdddb37c14646c9", "score": "0.53789306", "text": "function timesFive(num2) {\r\n \r\n return num2 * 5;\r\n \r\n }", "title": "" }, { "docid": "4c7d0f61ec5d1a139905752f0aaccd4e", "score": "0.53695494", "text": "function timesFive(num){\r\n return num * 5;\r\n}", "title": "" }, { "docid": "25fa59e11a38c423057ca570ea031102", "score": "0.53673816", "text": "function timesFive(num) {\n return num * 5; \n }", "title": "" }, { "docid": "e803c5b367f38262d811595a83013cf9", "score": "0.5363227", "text": "function putTogether(first) {\n\tmultiply(four(), first) {\n\t\tconsole.log();\n\t}\n}", "title": "" }, { "docid": "38fbbfc73c0a48eacd5afcebf9db3910", "score": "0.5342279", "text": "function addFive(input) {\n return input + 5;\n}", "title": "" }, { "docid": "dc722b781a35d1ad2e921f22d4be03d0", "score": "0.53365815", "text": "function timesFive(num){\n return num * 5;\n}", "title": "" }, { "docid": "e2cd46820026256da452e080fd0cf895", "score": "0.53162694", "text": "function multiplyByNineFifths(number) {\n return number * (9/5);\n}", "title": "" }, { "docid": "e2cd46820026256da452e080fd0cf895", "score": "0.53162694", "text": "function multiplyByNineFifths(number) {\n return number * (9/5);\n}", "title": "" }, { "docid": "9d074e77d24e256dc781f67716620740", "score": "0.5308723", "text": "function s$4(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}", "title": "" }, { "docid": "e9a5073a38297547aa9289c51db7531a", "score": "0.53069615", "text": "function spreadoperatordemo(a, b, c, ...d) {\n console.log(a, b, c, d);\n}", "title": "" }, { "docid": "d5dac999a5fdb192f3ae41976c4e90fe", "score": "0.5302763", "text": "function g (number){\n return number + 3\n }", "title": "" }, { "docid": "aa40878fab9925ab156fb34a0366469a", "score": "0.52972615", "text": "function cutFruitPieces(fruit){\n return fruit * 4;\n}", "title": "" }, { "docid": "3cce88dd23e60fa76ef72391f40c8249", "score": "0.5292177", "text": "function thirtySeven() {\n console.log(18 + 19);\n }", "title": "" }, { "docid": "1cf1e2e1ada2c0c058b0d72d02e704f3", "score": "0.52921265", "text": "function cutFruitPieces(fruit) {\n return fruit * 4\n}", "title": "" }, { "docid": "6e32838dad70c91c58b130d787a14508", "score": "0.5257231", "text": "function pazymiuVidurkis() {\n\nvar x = 5;\nvar y = 10;\nvar t = 8;\nvar w = 6;\nvar r = 8;\nvar vidurkis = (( x + y + t + w + r)/5);\nconsole.log(\"vidurkis (5,10,8,6,8) yra:\",vidurkis);\nconsole.log(\"skaiciuoti vidurki\");\n}", "title": "" }, { "docid": "8c6a976986f9f93b89f462cd5875f0f5", "score": "0.52543694", "text": "function g(a, b) {\n\treturn a * b * 3.5;\n}", "title": "" }, { "docid": "985b29023f7e9d1d734ba4c2a8f5fb84", "score": "0.5246281", "text": "function sumWithSpreadOp(x,y){\n\treturn x + y;\n}", "title": "" }, { "docid": "1d06d194ae0460c3c6a76f9541edd330", "score": "0.5246105", "text": "function cutFruit(fruit) {\n return fruit * 4;\n}", "title": "" }, { "docid": "882ed64425194ddc0509a3346069439c", "score": "0.52385837", "text": "function Ce(e,t,n){const o=e.slice();return o[1]=t[n],o}", "title": "" }, { "docid": "fd3cbab1cc7bbeebba942be0c65e60ea", "score": "0.5231056", "text": "function pazymiuVidurkis1(x1, x2, x3, x4, x5){\n console.log (z = (x5 + x1 + x2 + x3 + x4)/5)\n}", "title": "" }, { "docid": "b746c3fb023738ad1cece4068246ef0b", "score": "0.52164865", "text": "function triple(x){\r\n return x*3;\r\n}", "title": "" }, { "docid": "50225ec26bac334b555b9df95529d58f", "score": "0.52094394", "text": "function five() {\n return 5;\n}", "title": "" }, { "docid": "761c6a66f249cc998c544fe3aaedc5f1", "score": "0.5207161", "text": "function visitExpressionOfSpread(node) {\n return ts.visitNode(node.expression, visitor, ts.isExpression);\n }", "title": "" }, { "docid": "761c6a66f249cc998c544fe3aaedc5f1", "score": "0.5207161", "text": "function visitExpressionOfSpread(node) {\n return ts.visitNode(node.expression, visitor, ts.isExpression);\n }", "title": "" }, { "docid": "b0f3530dfae338af95de161ebca5ab1d", "score": "0.5205691", "text": "function shout(value){\n let result = value+value;\n console.log (result);\n return result;\n }", "title": "" }, { "docid": "a0265ce03a3d9eb45ad41ff46e8c0bdd", "score": "0.5204641", "text": "function tripletIt(n){\n console.log(n * 3);\n}", "title": "" }, { "docid": "c70587cc857d69bb6fdd78ce25f7270c", "score": "0.5195171", "text": "function dotsOfStars(a,b,c) {\n var sum1 = '';\n for (var i = 0; i < a; i++) {\n sum1 += '*'; \n }\n var sum2 = '';\n for (var j = 0; j < b; j++) {\n sum2 += '*'; \n }\n var sum3 = '';\n for (var i = 0; i < c; i++) {\n sum3 += '*'; \n }\n return sum1 + '\\n' + sum2 + '\\n' + sum3;\n\n}", "title": "" }, { "docid": "bf6055879134f88c6b5d55067c43120b", "score": "0.5180556", "text": "function computed_6() {\n return six;\n }", "title": "" }, { "docid": "251745910d25f7e789e58cff89bc185e", "score": "0.5177023", "text": "function bar(x) {\n return x / 2;\n }", "title": "" }, { "docid": "251745910d25f7e789e58cff89bc185e", "score": "0.5177023", "text": "function bar(x) {\n return x / 2;\n }", "title": "" }, { "docid": "18680f72e2e6e3bc4b123e55de4a571c", "score": "0.5160604", "text": "modifier(value) {\n return Math.floor((value - 10) / 2)\n }", "title": "" }, { "docid": "5c2b65782c512ab2c3a5708648cef3da", "score": "0.51579976", "text": "function ss(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}", "title": "" }, { "docid": "0f377e4dbac98e4d2af2977ea435c0ac", "score": "0.5153512", "text": "function sum(...num) {\n let totalSum = 0;\n console.log(num);\n return totalSum;\n}", "title": "" }, { "docid": "64d881fa7a72e492bb31e96ece4e6fb1", "score": "0.51473135", "text": "function g(step) {\n\t\treturn x + step;\n\t}", "title": "" }, { "docid": "f84e32f2bc5b86aa5457ef14ed2d4d94", "score": "0.51335967", "text": "function expp(n) {\n return n[0](n[1][0](n[1][1][0](n[1][1][1]),n[1][2][0](n[1][2][1]))); \n}", "title": "" }, { "docid": "e369254ad641738dee0dd6ff2c26ce0b", "score": "0.51252335", "text": "dot() {}", "title": "" }, { "docid": "07a44affd9c9a099d3940e67a70b4cb8", "score": "0.51225317", "text": "effect() {let inator = new Decimal(0)\n\t\t\t\t\t for (let x = 10; x <= 30; x += 10) for (let y = 1; y <= 3; y++) {\n\t\t\t\t\t var z = x + y\n\t\t\t if(hasUpgrade(\"cbb\", z)) inator = inator.add(1)\n\t\t\t\t\t }\n\t\t\t return new Decimal(1.1).pow(inator)}", "title": "" }, { "docid": "456fc204cace242a4a988df51419d600", "score": "0.5121009", "text": "function o53() {\n try {\no54.o55 = Math.fround(1);\n}catch(e){}\n try {\nreturn o54.o55;\n}catch(e){}\n }", "title": "" }, { "docid": "d581885997984e7c592c1d9de6857d36", "score": "0.51185125", "text": "function a1(...x) {}", "title": "" }, { "docid": "31320fa67f88bde4ea3f2d303bbb2d9b", "score": "0.51138216", "text": "function cee(){\n setzero(prevzero => prevzero.length > 1? prevzero.slice(0, -1) : \"0\");\n setcount(prevcount => zero[zero.length-1] === \")\"? prevcount + 1 : zero[zero.length-1] === \"(\"? prevcount - 1 : prevcount);\n setable(prevable => zero[zero.length-1] === \".\"? true : able);\n }", "title": "" }, { "docid": "9819bb24ab441cdf09b3292752eeea01", "score": "0.51129043", "text": "function isEvenOrDividesBy5 (num) {\n}", "title": "" }, { "docid": "4d171e8017d9d4de860b883d539860ee", "score": "0.51122975", "text": "function a$5h(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}", "title": "" }, { "docid": "1f8bab80601fdbf9a522296d32443ce1", "score": "0.51095545", "text": "function curve (grade){\n return grade +=5;\n}", "title": "" }, { "docid": "3af6b1db9de298f023b5a6fce41815d0", "score": "0.5102596", "text": "function fifth(args) {\n let a = '';\n for (let i = 1; i <= Number(args); i++) {\n a += i;\n }\n console.log(a.toString());\n}", "title": "" }, { "docid": "2cf58425af3c052f569b101597e952f4", "score": "0.5101149", "text": "function pazymiuVidurkis1(x1,x2,x3,x4,x5) { //mano\n // (vardinam kokie x bus rezultate)\nvar vir = ((x1 + x2 + x3 + x4 + x5)/5);\n// matematika kokios norime\nconsole.log(\"Pazymiai:\", x1 + \";\" , x2 + \";\" , x3 + \";\" , x4 + \";\" , x5 + \";\",\"Vidurkis:\", vir+ \";\");\n// isvardinam kas bus salia parasyta bei veiksmus na o \";\" atskiria arba sukuria tarpus pvz vardas \";\" pavarde\n}", "title": "" }, { "docid": "bd410f16cc549b471207c74b26abf3c9", "score": "0.5095854", "text": "function n$4O(n){return n}", "title": "" }, { "docid": "2ca119799c1d36b92bc13440da23b240", "score": "0.5095694", "text": "function twoNumbers(){\r\n console.log (3 * 4);\r\n\r\n}", "title": "" }, { "docid": "2b150bcb7a20327a98f17b1167444878", "score": "0.50893426", "text": "function foo5(x, n) {\n return x[n + 10] + x[n + 11] + x[n + 12];\n}", "title": "" }, { "docid": "34c5993d43ba6f741e32f8511f694724", "score": "0.5088983", "text": "function f2() {\n console.log(Math.round(6.35 * 10) / 10);\n\n}", "title": "" }, { "docid": "a9b0b7b34d3dd96b87cf6aee4412f369", "score": "0.508733", "text": "static tripple(n) {\n return (n || 1) * 3;\n }", "title": "" }, { "docid": "3882d727ed910bb18ac907e7837969e7", "score": "0.5085403", "text": "function visitExpressionOfSpread(node) {\n return ts.visitNode(node.expression, visitor, ts.isExpression);\n }", "title": "" }, { "docid": "f23de466e19c775015ddcad509131a3b", "score": "0.5073328", "text": "function liner(t, b, c, d) {\n return (c * t) / d + b;\n}", "title": "" }, { "docid": "eaf559d77ac6f82c46b8f6e8dc2d93c5", "score": "0.5071962", "text": "function calc() {\n return number4;\n}", "title": "" }, { "docid": "b9be2984966d1090fe2766c3dff5d976", "score": "0.507015", "text": "function five() {\n return 5;\n}", "title": "" }, { "docid": "b3b4f8c2ffa39f4422ff1fb8709752ec", "score": "0.506934", "text": "function crsmark(a)\r\n{\r\nlet exm = avg(2)*(a/100)\r\n return exm \r\n}", "title": "" }, { "docid": "b3b4f8c2ffa39f4422ff1fb8709752ec", "score": "0.506934", "text": "function crsmark(a)\r\n{\r\nlet exm = avg(2)*(a/100)\r\n return exm \r\n}", "title": "" }, { "docid": "360c9a2b75a7b2ecbe6ed1b4c37e49ae", "score": "0.5069143", "text": "function vidurkis1(x1, x2, x3, x4, x5) {\n var vidurkis = (x1 + x2 + x3 + x4 + x5) / 5;\n console.log(\"Vidurkis yra: \" + vidurkis);\n}", "title": "" }, { "docid": "9c7bbb701b733c9beef7f844c919506f", "score": "0.50680256", "text": "function logNums2 (...nums){\r\n console.log(nums)\r\n}", "title": "" }, { "docid": "39f6effa9d6e802c52d0d60fd8878ba8", "score": "0.50638616", "text": "function we(e,t){return null===e||!1===e||void 0===e?$[t]:(\"number\"===typeof e&&(e=String(e)),e=r.format.from(e),e=T.toStepping(e),!1===e||isNaN(e)?$[t]:e)}", "title": "" }, { "docid": "66c003cea685579191de2fea47075aea", "score": "0.50637454", "text": "function plusFive(num){\n return num + 5\n}", "title": "" }, { "docid": "e60df3e9df5fa68efbebde6c6c765480", "score": "0.5061317", "text": "function doble(...num){\n\treturn num.map(function(numero){\n\t\treturn numero * 2\n\t})\n}", "title": "" } ]
9dc027b127b49935bd629ceba05f77f5
This javascript function validates the text box is not empty, atleast one check box is checked, and one radio button is selected
[ { "docid": "41f427332fbde324d28e8467da9cb265", "score": "0.72073984", "text": "function validate() \r\n{\r\n // Checks if checkbox and radio fields are valid\r\n var checkBoxCheck = valCheckBoxes();\r\n var radioCheck = valRadio();\r\n\r\n // Flag for validity\r\n var OK=false;\r\n\r\n if(checkBoxCheck) {\r\n if(radioCheck) {\r\n OK = true;\r\n }\r\n }\r\n\r\n // Submit form if all fields valid\r\n if(OK) {\r\n document.getElementById(\"form1\").submit();\r\n } else {\r\n return;\r\n }\r\n\r\n}", "title": "" } ]
[ { "docid": "5a600df89a12555ba759cb195c0e3362", "score": "0.72778606", "text": "function validation(event) {\n var radio_check = document.getElementsByName('gender'); // Fetching radio button by name.\n var input_field = document.getElementsByClassName('text_field'); // Fetching all inputs with same class name text_field and an html tag textarea.\n var input_field2 = document.getElementsByClassName('form-control');\n var text_area = document.getElementsByTagName('textarea');\n// Validating radio button.\n if (radio_check[0].checked === false && radio_check[1].checked === false) {\n var y = 0;\n } else {\n var y = 1;\n }\n// For loop to count blank inputs.\n for (var i = input_field.length; i > count; i--) {\n if (input_field[i - 1].value === '' || text_area.value === '') {\n count = count + 1;\n } else {\n count = 0;\n }\n }\n\n if (count !== 0 || y === 0) {\n alert(\"*All Fields are mandatory*\"); // Notifying validation\n event.preventDefault();\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "1f49b9727ce0900b646dcfdf823cb41c", "score": "0.726501", "text": "function validation(event) {\nvar radio_check = document.getElementsByName('gender'); // Fetching radio button by name.\nvar input_field = document.getElementsByClassName('text_field'); // Fetching all inputs with same class name text_field and an html tag textarea.\nvar text_area = document.getElementsByTagName('textarea');\n// Validating radio button.\nif (radio_check[0].checked == false && radio_check[1].checked == false) {\nvar y = 0;\n} else {\nvar y = 1;\n}\n// For loop to count blank inputs.\nfor (var i = input_field.length; i > count; i--) {\nif (input_field[i - 1].value == '' || text_area.value == '') {\ncount = count + 1;\n} else {\ncount = 0;\n}\n}\nif (count != 0 || y == 0) {\nalert(\"*All Fields are mandatory*\"); // Notifying validation\nevent.preventDefault();\n} else {\nreturn true;\n}\n}", "title": "" }, { "docid": "31a156e3c225836348e7ceb364c71527", "score": "0.701453", "text": "function validateCheckRadio(){\n var err = {};\n\n jQuery('.radio-group, .checkbox-group').each(function(){\n if(jQuery(this).hasClass('required'))\n if (!jQuery(this).find('input:checked').length)\n err[jQuery(this).find('input:first').attr('name')] = 'Please complete this mandatory field.';\n });\n\n if (!jQuery.isEmptyObject(err)){\n validator.invalidate(err);\n return false ;\n }\n else return true;\n\n }", "title": "" }, { "docid": "61912e75330d943eac476abed8e52ede", "score": "0.6915434", "text": "function valRadio()\r\n {\r\n var okRadio = false;\r\n\r\n // If a radio button is checked, turn flag true\r\n if(document.getElementById(\"radio1\").checked) {\r\n okRadio=true;\r\n }\r\n if(document.getElementById(\"radio2\").checked) {\r\n okRadio=true;\r\n }\r\n if(document.getElementById(\"radio3\").checked) {\r\n okRadio=true;\r\n }\r\n\r\n // If atleast one radio checked\r\n if(!okRadio) { \r\n alert(\"Please select a payment type\");\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "4ba04167f53d1946bac4b4d04a2258fd", "score": "0.6843011", "text": "function check_Empty() {\n var valid_empty = false;\n var empty = 0;\n var check = 0;\n \n $('#nom, #num, #pass, #confirm-pass').each(function(){\n if (this.value == \"\") {\n empty++;\n } \n });\n \n if($('.check_edad').prop('checked')){\n check++;\n }\n if($('.check_tc').prop('checked')){\n check++;\n }\n \n if(empty == 0 && check == 2){\n \n valid_empty = true;\n }\n return valid_empty;\n }", "title": "" }, { "docid": "fef9ddcbf5c533a6c3f58adaf4754083", "score": "0.6798733", "text": "function validateMandatoryFields(){\t\r\n\tcant=document.getElementById('alert_type_cant').value;\r\n\tvar checked=0;\r\n\tfor(i=0;i<cant;i++){\r\n\t\tname='alert_type_' + i;\t\t\r\n\t\tif(document.getElementById(name).checked){\r\n\t\t\tchecked=1;\r\n\t\t}\r\n\t}\r\n\tif(checked!=0){\r\n\t\tdocument.forma.submit();\r\n\t}else{\r\n\t\talert(\"Por favor seleccione una alerta\");\r\n\t}\t\r\n}", "title": "" }, { "docid": "4493b48d7455f6ef533c5631a1a3b35a", "score": "0.67720646", "text": "function validateRequired(element)\n {\n // If text field, ensure it contains something\n if (element.type == \"text\" || element.type == \"textarea\")\n {\n if (element.value != \"\") return true;\n }\n // If fieldset, ensure at least one is checked\n else if (element.type == \"fieldset\")\n {\n var boxes = element.getElementsByTagName(\"input\");\n for (var i = 0; i < boxes.length; i++)\n if (boxes[i].checked) return true;\n }\n // If select, ensure an option is picked\n else if (element.type == \"select-one\")\n {\n if (element.options[element.selectedIndex].value != \"\") return true;\n }\n\n // Return false if it didn't pass any checks\n return false;\n }", "title": "" }, { "docid": "ae73cad7d4f3a03f2a33313a46102fc2", "score": "0.6747326", "text": "function checkForm() {\r\n var d = document.getElementById('mainForm'); // just a shortcut\r\n var errors = false;\r\n var errorMsg = \"\";\r\n// basic check required fields\r\n if (d.name.value == \"\") {\r\n errorMsg += \"Please enter your name.\\n\";\r\n errors = true;\r\n }\r\n // check if one of the radio buttons for site rating is selected\r\n var checkedSiteRating = false;\r\n for (var i = 0; i < 3; i++) {\r\n if (d.siterating[i].checked)\r\n checkedSiteRating = true;\r\n }\r\n if (!checkedSiteRating) {\r\n errorMsg += \"Please select a site rating.\\n\";\r\n errors = true;\r\n }\r\n // if errors exist, popup error message\r\n if (errors)\r\n alert(errorMsg);\r\n // return true (submit form) or false (don't submit form) depending on errors\r\n return !errors;\r\n}", "title": "" }, { "docid": "ae73cad7d4f3a03f2a33313a46102fc2", "score": "0.6747326", "text": "function checkForm() {\r\n var d = document.getElementById('mainForm'); // just a shortcut\r\n var errors = false;\r\n var errorMsg = \"\";\r\n// basic check required fields\r\n if (d.name.value == \"\") {\r\n errorMsg += \"Please enter your name.\\n\";\r\n errors = true;\r\n }\r\n // check if one of the radio buttons for site rating is selected\r\n var checkedSiteRating = false;\r\n for (var i = 0; i < 3; i++) {\r\n if (d.siterating[i].checked)\r\n checkedSiteRating = true;\r\n }\r\n if (!checkedSiteRating) {\r\n errorMsg += \"Please select a site rating.\\n\";\r\n errors = true;\r\n }\r\n // if errors exist, popup error message\r\n if (errors)\r\n alert(errorMsg);\r\n // return true (submit form) or false (don't submit form) depending on errors\r\n return !errors;\r\n}", "title": "" }, { "docid": "b75751a6620031aedbb7f3c069d5aebd", "score": "0.6733618", "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": "06f54b246047ffdc533d849ecf8f8c1f", "score": "0.67335016", "text": "function validateLobbyFields(){\r\n if( $(\"#CreateLobbyTemplateForm input[name=frontends]:checked\").val() == null){\r\n alert(\"Please enter a frontEnd\");\r\n return false;\r\n }else if($(\"#CreateLobbyTemplateForm input[name=channelTypes]:checked\").val() == null){\r\n alert(\"Please choose at least one channel\");\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "c94a98f6b9d6c3c13b669de3518339ad", "score": "0.6693582", "text": "function checkFieldsEquiStep2() {\n if(frmCertEquivalency2.cmbxTypeOfStudy.selectedKey == 0) {\n //alert(\"Please select Type of study\");\n\t\t frmCertEquivalency2.lblTypeOfStudy.skin=\"sknLblRed\";\n\t\tfrmCertEquivalency2.lblTypeOfStudy.text=kony.i18n.getLocalizedString(\"lblPleaseSelectTypeStudy\"); \t\t\n \t\tfrmCertEquivalency2.cmbxTypeOfStudy.setFocus(true);\n \t\treturn false;\n } else if (frmCertEquivalency2.cmbxTypeOfStudy.selectedKey == 6) {\n if (frmCertEquivalency2.txtBoxOthers.text == \"\") {\n // alert(\"Please enter Type of study details\");\n\t\t\t\t frmCertEquivalency2.lblTypeOfStudy.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblTypeOfStudy.text=kony.i18n.getLocalizedString(\"lblPleaseTypeOfStudyDetailsOthers\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtBoxOthers.setFocus(true);\n\t\t \t\treturn false;\n \n }\n }\n if (frmCertEquivalency2.imgSelf.src != \"checked.png\")\n {\n if (frmCertEquivalency2.txtSponsoredBy = undefined || frmCertEquivalency2.txtSponsoredBy.text == \"\")\n {\n //alert(\"Please Enter sponseredBy\");\n \tfrmCertEquivalency2.lblScholType.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblScholType.text=kony.i18n.getLocalizedString(\"lblPleaseEnterSponserBy\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtSponsoredBy.setFocus(true);\n\t\t \t\treturn false;\n }\n }\n if (frmCertEquivalency2.txtNoofyears = undefined || frmCertEquivalency2.txtNoofyears.text == \"\") {\n //alert(\"Please enter No.of years\");\n //return false;\n\t\t\t\tfrmCertEquivalency2.lblNoofyears.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblNoofyears.text=kony.i18n.getLocalizedString(\"lblPleaseEnterNoOfYears\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtNoofyears.setFocus(true);\n\t\t \t\treturn false;\n } else if (frmCertEquivalency2.txtStartYear = undefined || frmCertEquivalency2.txtStartYear.text == \"\") {\n //alert(\"Please enter Starting Date of Study\");\n //return false;\n\t\t\t\tfrmCertEquivalency2.lblStartYear.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblStartYear.text=kony.i18n.getLocalizedString(\"lblPleaseEnterStartStudyDate\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtStartYear.setFocus(true);\n\t\t \t\treturn false;\n } else if (!validateYear(frmCertEquivalency2.txtStartYear.text, \"please enter valid year\")) {\n // return false;\n\t\t\t\tfrmCertEquivalency2.lblStartYear.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblStartYear.text=kony.i18n.getLocalizedString(\"lblPleaseEnterValidYear\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtStartYear.setFocus(true);\n\t\t \t\treturn false;\t\n } else if (frmCertEquivalency2.txtGraduationYear = undefined || frmCertEquivalency2.txtGraduationYear.text == \"\") {\n //alert(\"Please enter Date of Graduation\");\n //return false;\n\t\tfrmCertEquivalency2.lblGraduationYear.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblGraduationYear.text=kony.i18n.getLocalizedString(\"lblPleaseEnterDateOfGraduation\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtGraduationYear.setFocus(true);\n\t\t \t\treturn false;\t\n } else if (!validateYear(frmCertEquivalency2.txtGraduationYear.text, \"please enter valid year\")) {\n \t\t\t frmCertEquivalency2.lblGraduationYear.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblGraduationYear.text=kony.i18n.getLocalizedString(\"lblPleaseEnterValidYear\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtGraduationYear.setFocus(true);\n\t\t \t\treturn false;\t\n } else if (frmCertEquivalency2.txtStartYear.text > frmCertEquivalency2.txtGraduationYear.text) {\n //alert(\"please enter correct Starting Date of Study\");\n frmCertEquivalency2.lblStartYear.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblStartYear.text=kony.i18n.getLocalizedString(\"lblPleaseEnterStartYear\"); \t\t\n\t\t \t\tfrmCertEquivalency2.txtStartYear.setFocus(true);\n\t\t \t\treturn false;\t\n } else if (frmCertEquivalency2.dropdownSelectCountry.selectedKey == 0) {\n // alert(\"please select Country of Examination\");\n frmCertEquivalency2.lblCountryExamHeld.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblCountryExamHeld.text=kony.i18n.getLocalizedString(\"lblPleaseSelectCountryExam\"); \t\t\n\t\t \t\tfrmCertEquivalency2.dropdownSelectCountry.setFocus(true);\n\t\t \t\treturn false;\t\n } else if (frmCertEquivalency2.dropdownpaymentmethod.selectedKey == 0) {\n //alert(\"please select payment method\");\n frmCertEquivalency2.lblPaymentMethod.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblPaymentMethod.text=kony.i18n.getLocalizedString(\"lblPleaseSelectPaymentMethod\"); \t\t\n\t\t \t\tfrmCertEquivalency2.dropdownpaymentmethod.setFocus(true);\n\t\t \t\treturn false;\t\n } else if (frmCertEquivalency2.dropdownpaymentcardtype.selectedKey == 0) {\n //alert(\"please select payment Type\");\n frmCertEquivalency2.lblPaymentMethod.skin=\"sknLblRed\";\n\t\t\t\tfrmCertEquivalency2.lblPaymentMethod.text=kony.i18n.getLocalizedString(\"lblPleasePaymentType\"); \t\t\n\t\t \t\tfrmCertEquivalency2.dropdownpaymentcardtype.setFocus(true);\n\t\t \t\treturn false;\n }\n \n \n // else if (frmCertEquivalency2.txtNoofTerms = undefined || frmCertEquivalency2.txtNoofTerms.text == \"\") {\n\t\t\t//\tfrmCertEquivalency2.lblNoofTerms.skin=\"sknLblRed\";\n\t\t\t//\tfrmCertEquivalency2.lblNoofTerms.text=kony.i18n.getLocalizedString(\"lblPleaseEnterNoofTerms\"); \t\t\n\t\t \t\t//frmCertEquivalency2.txtNoofTerms.setFocus(true);\n\t\t \t\t//return false;\n // }\n \n \n}", "title": "" }, { "docid": "0774f23bd0ecda0e61247df50e7996e2", "score": "0.66843367", "text": "function checkRequiredFields(input)\r\n{\r\n // YOU SHOULD ONLY NEED TO CHANGE THE VALUES FOR THE FOLLOWING\r\n // TWO ARRAYS (requiredFields and fieldNames). ENSURE THAT\r\n // THE VALUES LISTED FOR requiredFields MATCH THE NAMES ASSIGNED\r\n // TO FIELD ELEMENTS IN YOUR FORM.\r\n\r\n // ENTER THE NAME (OR PARTIAL NAME) OF EVERY FIELD IN YOUR FORM\r\n // THAT MUST HAVE A VALUE (Case-Sensitive)\r\n var requiredFields = new Array(\"part_id\",\"ready1\");\r\n\r\n // TEXT TO DISPLAY THAT DESCRIBES THE MISSING FIELD(S) TO THE USER\r\n var fieldNames = new Array(\"Participant ID\",\"Confirmation that the form is ready to send\");\r\n \r\n \r\n // YOU SHOULD NOT NEED TO MAKE ANY CHANGES BELOW THIS POINT ------\r\n\r\n var fieldCheck = true;\r\n var fieldsNeeded = \"\\nA value must be entered in the following \" +\r\n \"field(s):\\n\\n\\t\";\r\n\r\n for(fieldNum=0; fieldNum < requiredFields.length; fieldNum++) {\r\n if ((input.elements[requiredFields[fieldNum]].value == \"\") ||\r\n (input.elements[requiredFields[fieldNum]].value == \" \") ||\r\n (input.elements[requiredFields[fieldNum]].type == \"radio\" &&\r\n !input.elements[requiredFields[fieldNum]].checked)) {\r\n fieldsNeeded += fieldNames[fieldNum] + \"\\n\\t\";\r\n fieldCheck = false;\r\n }\r\n }\r\n\r\n // ALL REQUIRED FIELDS HAVE BEEN ENTERED\r\n if (fieldCheck == true)\r\n {\r\n getAllFields();\r\n return true;\r\n }\r\n // SOME REQUIRED FIELDS ARE MISSING VALUES\r\n else\r\n {\r\n alert(fieldsNeeded);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "fec27b0c51a90e12b1148f9c215dd32a", "score": "0.6682804", "text": "function validateCheckbox() {\n\n var checkboxes = document.getElementsByName('purpose');\n var err = document.getElementById('alertMsg');\n\n err.innerText = \"\";\n for(var i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n return true;\n }\n }\n err.innerText = \"You must select at least one checkbox\";\n return false;\n}", "title": "" }, { "docid": "b1910b3eb8ae86611dae65dcd9f7a877", "score": "0.66800636", "text": "function validate() {\r\n if($('#title').val() == \"\") {\r\n alert(\"What happened? Make it short and concise.\");\r\n return false;\r\n }\r\n \r\n if($('#report-desc').val().length < 10) {\r\n alert(\"Please describe the incident more.\");\r\n return false;\r\n }\r\n\r\n if($('input[type=radio][name=severity]:checked').val() == undefined) {\r\n alert(\"Please select a severity.\\nYou may refer to the severity ranking chart.\");\r\n return false;\r\n }\r\n \r\n if($('#name').val() == \"\") {\r\n alert(\"What is your name?\");\r\n }\r\n\r\n return true;\r\n \r\n}", "title": "" }, { "docid": "ad8638e91e53d69d0df43679e0c5dc51", "score": "0.6663737", "text": "function checkFunc() {\n if (document.querySelectorAll('input[type=\"radio\"]:checked').length === 0) alert(\"Pas de réponse : 0 point\");\n }", "title": "" }, { "docid": "2d5d1bf4e9bb85545531ddc777818631", "score": "0.6657491", "text": "function validInitialSelections() {\n\tvar check = false;\n\tvar message = 'Not valid workout selections: need to have atleast 1 ';\n\tif (!anyOptionsSelected(muscleGroupInputs) && !anyOptionsSelected(equipmentInputs)) {\n\t\talert(message + 'muscle group AND 1 equipment selected!');\n\t} else if (!anyOptionsSelected(muscleGroupInputs)) {\n\t\talert(message + 'muscle group selected!');\n\t} else if (!anyOptionsSelected(equipmentInputs)) {\n\t\talert(message + 'equipment selected!');\n\t} else if (!anyOptionsSelected(workoutTypeInputs)) {\n\t\talert(message + 'workoutType selected!');\n\t\tconsole.log(\n\t\t\t\"no workoutType selected, dont know how this happened - shouldn't be posssible because of radio buttons??\"\n\t\t);\n\t} else {\n\t\t//no problems\n\t\tcheck = true;\n\t}\n\treturn check;\n}", "title": "" }, { "docid": "895340675a806d70b172bc9ace60a4f2", "score": "0.6655497", "text": "_check_if_forms_are_filled() {\n // Count the multiple choice questions, and compare that to the amount of radio buttons checked to make sure we\n // have enough checked answers.\n let multi = this._check_multiple_choice();\n let multi_choice = this._check_multiple_choice_table();\n let open = this._check_open_questions();\n let open_table = this._check_open_question_table();\n\n if (multi && multi_choice && open && open_table) {\n this._save_items_to_db(true);\n } else {\n alert('Please add the missing answers before saving!')\n }\n }", "title": "" }, { "docid": "6ca432e28699740175513c3ccb08a704", "score": "0.6644945", "text": "function regis()\r\n{\r\n\tvar birth = document.getElementById(\"birth\");\r\n\tvar village = document.getElementById(\"village\");\r\n\tvar Phone = document.getElementById(\"Phone\");\r\n\tvar Id = document.getElementById(\"Id\");\r\n\t\r\n\t\r\n\t\r\n\tif(birth.value.trim() ==\"\" || village.value.trim() ==\"\" || Phone.value.trim() ==\"\" || Id.value.trim() ==\"\")\r\n { alert(\"Please Fill all Fields...!\");\r\n\t return false;\r\n\t \r\n\t }\r\n}", "title": "" }, { "docid": "037a2622562686cbf86ca253c4fefde7", "score": "0.66415066", "text": "function personStatus(){\r\n var radio_choice = false;\r\n for (counter = 0; counter < partAForm.personstatus.length; counter++)\r\n {\r\n if (partAForm.personstatus[counter].checked)\r\n radio_choice = true;\r\n }\r\n if (!radio_choice)\r\n {\r\n alert(\"Please select a Person Status.\")\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "94511d4b2a7ac627f019d7f5f368f160", "score": "0.6622704", "text": "function checkAllfields(){\n var fuel1 = document.getElementById('fuel');\n if(fuel1.value.length === 0){\n alert(\"Please enter fuel detail\");\n fuel1.focus();\n return false;\n }\n\n var price1 = document.getElementById('price');\n if(price1.value.length === 0){\n alert(\"Please enter fuel price\");\n price1.focus();\n return false;\n }\n\n var salary1 = document.getElementById('salary');\n if(salary1.value.length === 0){\n alert(\"Please enter salary\");\n salary1.focus();\n return false;\n }\n var total1 = document.getElementById('total');\n if(total1.value.length === 0){\n alert(\"Please enter total details\");\n total1.focus();\n return false;\n }\n}", "title": "" }, { "docid": "67faa111da2de3dfcf30da48bd6fa5ca", "score": "0.6607984", "text": "function validateRadio() {\n document.getElementById('radioError').innerText = \"\";\n var radios = document.getElementsByName('information');\n\n for(var i = 0; i < radios.length; i++) {\n if(radios[i].checked) {\n return true;\n }\n }\n\n document.getElementById('radioError').innerText = 'You must select a value';\n return false;\n}", "title": "" }, { "docid": "87e15cf8b416c37d1512fec1ea2030fc", "score": "0.6606624", "text": "function validate(){\n var choices = document.getElementsByTagName('input');\n var optionCount = 0;\n for (var i = 0; i < choices.length; i++) {\n if (choices[i].checked) {\n optionCount++;\n }\n }\n console.log(optionCount);\n if (optionCount != 2){\n alert(\"Please select 2.\");\n return false;\n }\n determineType();\n}", "title": "" }, { "docid": "d2a9621a5593d972c007b242ccb92bfc", "score": "0.65933526", "text": "function checkInputs() {\n if (document.getElementById(\"departureDate\").value == \"\") {\n alert(\"Please, First Choose A Departure Date \");\n }\n else if (getCount(\"firstClassCount\") == 0 && getCount(\"economyClassCount\") == 0) {\n alert(\"Please Choose Minimum One Cruise Class To Continue\");\n }\n else {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "85422a3397896727b8e6eb171dd4b21e", "score": "0.6581545", "text": "function validateAssignmentForm() {\n var title = document.getElementById(\"assignment-title\").value;\n var descr = document.getElementById(\"description\").value;\n var sub = document.getElementById(\"sub-date\").value;\n var mark = document.getElementById(\"total-mark\").value;\n if ((title == \"\" || title == null) || (descr == \"\" || descr == null)\n || (sub == \"\" || sub == null) || (mark == \"\" || mark == null)) { \n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "4620c60a9278092e46e85cb3b84d545e", "score": "0.6563525", "text": "function validateForm() {\n var a = document.forms.Form.answer_a.value;\n var b = document.forms.Form.answer_b.value;\n var c = document.forms.Form.answer_c.value;\n if (\n (a === null || a === \"\",\n OR,\n b === null || b === \"\",\n OR,\n c === null || c === \"\")\n ) {\n alert(\"Please Fill Out Fields\");\n return false;\n }\n }", "title": "" }, { "docid": "20029a50bdc1139571ddb6938b4e5935", "score": "0.65471774", "text": "function requiredCheck () {\r\n var toCheck = form.find(\":required\").filter(function(i) { return $(this).val() === \"\"; });\r\n return (toCheck.length === 0);\r\n}", "title": "" }, { "docid": "89818bd6b83a065c87ab68455d632a10", "score": "0.65470225", "text": "function textValidatation(shopName, shopLocation, shopDescription){\n // to check if shop name is empty\n if(shopName.value.trim() == ''){\n alert(\"Please enter shop name\");\n shopName.focus();\n return false;\n } \n // to check if shop location is empty\n if(shopLocation.value.trim() == ''){\n alert(\"Please enter shop location\");\n shopLocation.focus();\n return false;\n }\n // to check if shop description is empty\n if(shopDescription.value.trim() == ''){\n alert(\"Please enter shop description\");\n shopDescription.focus();\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "9fad57365324c5555091f7f0e553f366", "score": "0.654007", "text": "function validateRadios(radio) {\n // iterate through all radios\n for (let i = 0; i < radio.length; i++) {\n // test if it was selected\n if (radio[i].checked) {\n // if true, return true value\n return true;\n }\n }\n // return false if non\n return false;\n } // end of validateRadios()", "title": "" }, { "docid": "5c48ac386e048e18f32deb7b882fbe33", "score": "0.6530213", "text": "function CheckBoxValidation(id)\n{\n\tvar checkBoxArray=document.getElementsByName(id.name);\n\tvar checkbox = 0;\n var node=id.parentNode;\n var Iscount=0;\n var childArray=node.childNodes;\n\tfor(var i=0; i < checkBoxArray.length; i++ )\n\t{\n\tif( checkBoxArray[ i ].checked ) //checking atleast one check box is checked\n\t\tcheckbox = 1;\n\t}\n\tif( checkbox==0) \n\t{\n\t\tmsg=\"* select one of the \"+id.name;\n\t\t for(var i=0;i<childArray.length;i++)\n {\n if(childArray[i].nodeName==\"P\")\n {\n Iscount++; \n }\n }\n if(Iscount==0)\n {\n AlertBox(id,msg,\"alert1\",\"p\");\n }\n \n\t}\n else\n {\n var node=id.parentNode;\n var Iscount=0;\n var childArray=node.childNodes;\n for(var i=0;i<childArray.length;i++)\n {\n if(childArray[i].nodeName==\"P\")\n {\n node.removeChild(childArray[i]);\n Iscount=0; \n }\n }\n }\n}", "title": "" }, { "docid": "0ca1c93d190b859b8d825df575bb96bd", "score": "0.6523999", "text": "function validateCompleteOrder() {\n var error = false;\n var input = document.getElementById(\"comment\").value;\n var errmsg = \"\";\n if(input == \"\") {\n error = true;\n errmsg += \"Please enter your comment.\";\n }\n if(!document.getElementById(\"star-5\").checked && !document.getElementById(\"star-4\").checked && !document.getElementById(\"star-3\").checked && !document.getElementById(\"star-2\").checked && !document.getElementById(\"star-1\").checked) {\n if(errmsg != \"\") {\n errmsg += \"\\n\";\n }\n error = true;\n errmsg += \"Please give the driver ratings.\";\n }\n if(error) {\n alert(errmsg);\n return false;\n }\n}", "title": "" }, { "docid": "22a74253eaaacff358b646a702cb5d9f", "score": "0.65212256", "text": "function checkForm () {\n markEmptyFields()\n validateName()\n validateCar()\n validateDate()\n validateDays()\n validateCard()\n validateCVV()\n validateExpiration()\n}", "title": "" }, { "docid": "2b7eff936c102f1ea3ce5c07de787723", "score": "0.6520905", "text": "function checkValid() {\n var validate = true;\n// check name and photo validate\n $(\".validate\").each(function () {\n if($(this).val() === \"\") {\n validate = false;\n }\n });\n// check choices are valid\n $(\".choices\").each(function () {\n if($(this).val() === \"\") {\n validate = false;\n }\n });\n return validate;\n }", "title": "" }, { "docid": "728b2e9b4f57904c4268ebe545f708f6", "score": "0.65133995", "text": "function checkoption(name)\r\n{\r\n let checked=0;\r\n let form=document.forms[\"form1\"][\"Education_Level\"];\r\n for(let i=0;i<form.length;i++)\r\n {\r\n if(form[i].selected==true)\r\n {\r\n checked++;\r\n }\r\n }\r\n console.log(checked);\r\n if(checked > 0)\r\n {\r\n let el=document.getElementById(\"errors\");\r\n while(el.firstChild)\r\n {\r\n el.removeChild(el.firstChild);\r\n }\r\n }\r\n else\r\n {\r\n let el=document.getElementById(\"errors\");\r\n while(el.firstChild)\r\n {\r\n el.removeChild(el.firstChild);\r\n }\r\n let tag=document.createElement(\"p\");\r\n let text=document.createTextNode(\"Please enter your education level\");\r\n tag.appendChild(text); \r\n el.appendChild(tag);\r\n }\r\n}", "title": "" }, { "docid": "9831b1692e3395706be6f96b2a07d02d", "score": "0.6506008", "text": "function validate() {\n //Makes sure all fields have a value before allowing submission\n var tags1 = $('#players').materialtags('items').length > 0;\n var tags2 = $('#clubs').materialtags('items').length > 0;\n var tags3 = $('#authors').materialtags('items').length > 0;\n var checked = $('#options').val().length > 0;\n if ((tags1 || tags2 || tags3) && checked)\n $('#submit-button').prop('disabled', false);\n else\n $('#submit-button').prop('disabled', true);\n}", "title": "" }, { "docid": "75823c3961c5c993772b1220a26feefd", "score": "0.6482449", "text": "function checkInterest() {\n\n\n var cbox = document.getElementsByClassName('checkbox');\n if (\n cbox[0].checked == false &&\n cbox[1].checked == false &&\n cbox[2].checked == false\n ) {\n document.getElementById(\"interesterr\").innerHTML = \"* Atleast one interest is required!\";\n\n }\n else if (cbox[0].checked == true ||\n cbox[1].checked == true ||\n cbox[2].checked == true) {\n document.getElementById(\"interesterr\").innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "ffa465e39297a88492104f4a1f9c2125", "score": "0.64736295", "text": "function checkFieldsEquiStep1() {\n if (frmCertEquivalency1.txtCertSubittedBy = undefined || frmCertEquivalency1.txtCertSubittedBy.text == \"\") {\n //alert(\"Please enter certificate submitted by feild\");\n\t\tfrmCertEquivalency1.lblCertSubmit.skin=\"sknLblRed\";\n\t\tfrmCertEquivalency1.lblCertSubmit.text=kony.i18n.getLocalizedString(\"lblPleaseSelectCertificateSubmitBy\"); \t\t\n \t\tfrmCertEquivalency1.txtCertSubittedBy.setFocus(true);\n \t\treturn false; \n } else if (frmCertEquivalency1.dropdownStudyLevel.selectedKey == 0) {\n //alert(\"Please select study level\");\n frmCertEquivalency1.lblStudyLevel.skin=\"sknLblRed\";\n\t\tfrmCertEquivalency1.lblStudyLevel.text=kony.i18n.getLocalizedString(\"lblPleaseSelectStudyLevel\"); \t\t\n \t\tfrmCertEquivalency1.dropdownStudyLevel.setFocus(true);\n \t\treturn false; \n } else if (frmCertEquivalency1.txtMajor = undefined || frmCertEquivalency1.txtMajor.text == \"\") {\n //alert(\"Please enter Major\");\n frmCertEquivalency1.lblMajor.skin=\"sknLblRed\";\n\t\tfrmCertEquivalency1.lblMajor.text=kony.i18n.getLocalizedString(\"lblPleaseEnterMajor\"); \t\t\n \t\tfrmCertEquivalency1.txtMajor.setFocus(true);\n \t\treturn false; \n } else if (frmCertEquivalency1.txtIssuedBy = undefined || frmCertEquivalency1.txtIssuedBy.text == \"\") {\n //alert(\"Please enter Minor\");\n frmCertEquivalency1.lblIssueBy.skin=\"sknLblRed\";\n\t\tfrmCertEquivalency1.lblIssueBy.text=kony.i18n.getLocalizedString(\"lblPleaseSelectMinor\"); \t\t\n \t\tfrmCertEquivalency1.txtIssuedBy.setFocus(true);\n \t\treturn false;\n } \n}", "title": "" }, { "docid": "c8f476eac44e2366c71976d1603d316e", "score": "0.6472095", "text": "function Validate () {\n\n // Get Checked checbox\n let AddCheckboxcheck = document.querySelectorAll(\"#Add input[type='checkbox']:checked\");\n\n var field_BDL = form_add.elements[\"bdl\"];\n var field_DiskN = form_add.elements[\"n_disk\"];\n\n //if form_OK = true -> submit is active\n var form_OK = true;\n \n/********* Values **************/\n if(field_BDL.value == '') {\n form_OK = false;\n }\n if(field_DiskN.value == ''){\n form_OK = false;\n }\n if(AddCheckboxcheck.length == 0){//If 0 checkbox is checked\n form_OK = false;\n }\n\n /********* Validate ************/\n if (!form_OK) {\n submit.disabled=true;\n }\n else {\n submit.disabled=false;\n }\n\n}", "title": "" }, { "docid": "3816ff27186ac04d899a42861a1a8c7f", "score": "0.6462862", "text": "function isRequired(names, captions) {\n strVal = document.getElementById(names).value;\n strVal = Trim(strVal);\n //alert(strVal)\n if (strVal == \"\") {\n alert(\"Please enter the value for \" + captions);\n return false;\n }\n\n if (document.getElementById(nam[intform]).type == \"select-one\") {\n if (document.getElementById(nam[intform]).selectedIndex <= 0) {\n if (msg != \"\")\n msg = msg + \",\"\n msg = msg + cap[intform]\n return false;\n }\n }\n}", "title": "" }, { "docid": "4e0a3f636a57998b470c60ccd3e13d53", "score": "0.64577127", "text": "function isValidSubject()\r\n{\r\n \r\n var c = document.getElementsByTagName(\"input\");\r\n for (var i = 0; i<c.length; i++){\r\n if (c[i].type == \"checkbox\")\r\n {\r\n if (c[i].checked) {\r\n return true;\r\n }\r\n }\r\n } \r\n return false;\r\n}", "title": "" }, { "docid": "1663c66a6d6bf61d06f30661c4e62ccb", "score": "0.6457559", "text": "validateStep(step) {\n let stepForValidation = formValidation.querySelector(`[data-step=${CSS.escape(step)}]`);\n let stepTextInputs = stepForValidation.querySelectorAll(\"input[type='text']\");\n let stepNumberInput = stepForValidation.querySelector(\"input[type='number']\");\n let stepCheckboxInputs = stepForValidation.querySelectorAll(`input[name=\"categories\"]:checked`)\n let stepRadioInput = stepForValidation.querySelector(\"input[name='institution']:checked\")\n console.log(stepRadioInput)\n console.log(stepForValidation)\n if (stepTextInputs.length !== 0) {\n for (let i = 0; i < stepTextInputs.length; i++) {\n if (stepTextInputs[i].id === \"id_pick_up_date\") {\n if (!validateDate(stepTextInputs[i])) {\n return false;\n }\n } else if (stepTextInputs[i].id === \"id_zip_code\") {\n if (!validateZipCode(stepTextInputs[i])) {\n return false;\n }\n } else if (stepTextInputs[i].id === \"id_pick_up_time\") {\n if (!validatePickUpTime(stepTextInputs[i])) {\n return false;\n }\n } else if (stepTextInputs[i].id === \"id_phone_number\") {\n if (!validatePhone(stepTextInputs[i])) {\n return false;\n }\n } else if (stepTextInputs[i].value === \"\") {\n stepTextInputs[i].focus();\n alert(\"Proszę wypełnić zaznaczone pole\")\n return false;\n };\n };\n } else if (stepNumberInput) {\n let num = stepNumberInput.value\n if (num < 1 || num >= 10 || num % 1 !== 0) {\n stepNumberInput.focus();\n alert(\"Ilość worków musi być w przedziale 1 - 10. Nie mogą być podane połówki\");\n return false;\n }\n } else if (stepCheckboxInputs.length === 0 && step === 1) {\n alert(\"Należy zaznaczyć przynajmniej jedną z opcji\")\n return false;\n } else if (!stepRadioInput && step == 3) {\n alert(\"Należy wybrac organizację której chcesz przekazać dary\")\n return false;\n };\n return true;\n\n function validateDate(inputText) {\n let dateformat = /^(0?[1-9]|[12][0-9]|3[01])[\\/](0?[1-9]|1[012])[\\/]\\d{4}$/;\n // Match the date format through regular expression\n if (inputText.value.match(dateformat)) {\n // Extract the string into month, date and year\n let pdate = inputText.value.split('/');\n\n let dd = parseInt(pdate[0]);\n let mm = parseInt(pdate[1]);\n let yy = parseInt(pdate[2]);\n // Create list of days of a month [no leap year by default]\n let ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if (mm == 1 || mm > 2) {\n if (dd > ListofDays[mm - 1]) {\n alert('Invalid date format!');\n return false;\n }\n }\n if (mm == 2) {\n let lyear = false;\n if ((!(yy % 4) && yy % 100) || !(yy % 400)) {\n lyear = true;\n }\n if ((lyear == false) && (dd >= 29)) {\n alert('Invalid date format!');\n return false;\n }\n if ((lyear == true) && (dd > 29)) {\n alert('Invalid date format!');\n return false;\n }\n }\n // Verify if provided date is from the past\n let dateNow = new Date()\n let match = /(\\d+)\\/(\\d+)\\/(\\d+)/.exec(inputText.value)\n let dateProvided = new Date(Date.UTC(match[3], match[2]-1, match[1]));\n\n if (dateNow >= dateProvided) {\n inputText.focus();\n alert('Data odbioru nie może być z przeszłości!');\n return false;\n }\n } else {\n inputText.focus();\n alert(\"Invalid date format!\");\n return false;\n }\n return true;\n };\n\n function validateZipCode(inputText) {\n let zipCodeFormat = /^\\d{2}-\\d{3}$/;\n if (inputText.value.match(zipCodeFormat)) {\n return true;\n } else {\n inputText.focus();\n alert(\"Niepoprawny kod pocztowy! Format 00-000.\")\n return false;\n }\n };\n\n function validatePhone(inputText) {\n let phoneFormat = /^\\+?1?\\d{8,12}$/\n if (!inputText.value.match(phoneFormat)) {\n inputText.focus();\n alert(\"Niepoprawny format numeru! Prosze podać numer stacjonarny lub komórkowy.\")\n return false;\n }\n return true;\n };\n\n function validatePickUpTime(inputText) {\n let timeFormat = /^([0-1]?[0-9]|[2][1-3])[:]([0-5][0-9])/;\n\n if (inputText.value.match(timeFormat)) {\n // Extract the string into month, date and year\n let pdate = inputText.value.split(':');\n\n let hh = parseInt(pdate[0], 10);\n let mm = parseInt(pdate[1], 10);\n\n if (20 > hh && 8 > hh) {\n inputText.focus();\n alert(\"Odbiór musi być w godzinach 08:00 - 20:00\");\n return false;\n };\n return true;\n } else {\n inputText.focus();\n alert(\"Niepoprawny format godzin. Poprawny format jest w przedzaile 00:00 - 23:59\");\n return false;\n };\n };\n }", "title": "" }, { "docid": "cf33b0c8386f3a4df81d3513cf36a5c3", "score": "0.6451954", "text": "function validarSelecionado(){\n\tvar formularioUsuario = document.getElementById('formularioUsuario');\n\tvar campo;\n\t\n\tfor(var item=0; item<formularioUsuario.length; item++){\n \tcampo = formularioUsuario[item];\n if(campo.type=='radio' && campo.checked){\n \treturn true;\n \t}\n }\n alert('É Necessario selecinar um item da Tela!!!');\n return false;\n}", "title": "" }, { "docid": "9ede04573cb9437b8a9063067a91c95e", "score": "0.6447069", "text": "function chksitegrp()\n{\n if((document.getElementById('txtgrpname').value.length == 0) || (document.getElementById(\"txtgrpname\").value.indexOf(\" \") == 0))\n {\n alert(\"Please enter group name\");\n document.getElementById('txtgrpname').focus();\n return false;\n } \n else if((document.getElementById('txtgrpdesc').value.length == 0) || (document.getElementById(\"txtgrpdesc\").value.indexOf(\" \") == 0))\n {\n alert(\"Please enter group description\");\n document.getElementById('txtgrpdesc').focus();\n return false;\n }\n else\n {\n return true;\n }\n}", "title": "" }, { "docid": "a0a0640678a446230d8db9ec588ff4fa", "score": "0.6446074", "text": "function checkform()\n\n{// ouverture fonction du bouton\n\n var nom = \"x\";\n var prenom;\n var sexeM = false;\n var sexeF = false;\n var dob;\n var adresse;\n var ville;\n var email;\n var select;\n var question;\n\n //validation formulaire NOM\n\n nom = document.getElementById(\"nom\").value ;\n console.log (\"nom : \" + nom);\n console.log (\"longueur : \" + nom.length);\n\n\n if (nom.length<1)\n {\n window.alert(\"le champ 'nom' est obligatoire\");\n }\n\n //validation formulaire PRENOM\n\n prenom = document.getElementById(\"prenom\").value ;\n console.log (\"prenom : \" + prenom);\n\n\n if (prenom.length<1)\n {\n alert(\"le champ 'prenom' est obligatoire\");\n }\n\n\n //validation formulaire SEXE\n\n\n sexeM = document.getElementById(\"sexeM\").checked ;\n sexeF = document.getElementById(\"sexeF\").checked ;\n console.log (\"sexeM : \" + sexeM);\n console.log (\"sexeF : \" + sexeF);\n\n if(sexeM == false && sexeF == false)\n {\n alert(\"le champ 'Sexe' est obligatoire\");\n }\n\n\n //validation formulaire DOB\n\n\n dob = document.getElementById(\"dob\").value ;\n console.log (\"dob : \" + dob);\n\n\n // METHODE expression régulière pour cadrer le format général\n\n var dob = new RegExp(\"/^[0-9][0-9]\\/[0-9][0-9]\\/[0-9][0-9][0-9][0-9]$/\");\n var resultat = dob.test(\"javascript\");\n\n\n\n // Validation champ Code Postale\n\n codepostal = document.getElementById(\"codepostal\").value ;\n console.log (\"codepostal : \" + codepostal);\n\n var cptaille = 0;\n var checkcp = false; //booléen\n\n cptaille = codepostal.length;\n console.log(codepostal.length); // véification taille du code\n codepostal = parseInt(codepostal); //conversion du CP en numérique\n console.log(\"code postale : \" + codepostal + \"type of : \" + typeof codepostal + \"length \" + cptaille);\n\n if (cptaille == 5 && isNaN(codepostal)!= true)\n\n {\n checkcp = true;\n }\n\n else \n {\n window.alert(\"Le code postal doit comprendre 5 caractères numériques.\");\n checkcp = false;\n }\n\n // Validation champ adresse\n\n adresse = document.getElementById(\"adresse\").value ;\n console.log (\"adresse : \" + adresse);\n\n if (adresse.length<1)\n {\n window.alert(\"le champ 'adresse' doit être renseigné\");\n }\n\n // Validation champ ville\n\n ville = document.getElementById(\"ville\").value ;\n console.log (\"ville : \" + ville);\n\n if (ville.length<1)\n {\n window.alert(\"le champ 'ville' doit être renseigné\");\n }\n\n // Validation champ email\n\n email = document.getElementById(\"email\").value ;\n console.log (\"email : \" + email);\n var checkcemail= false; //booléen\n\n if (email.indexOf(\"@\") != -1) //check si le caractère @est présent\n\n { \n checkcemail = true;\n } \n\n else\n\n {\n window.alert(\"L'adresse mail doit comporter un caractère '@'.\");\n checkcemail = false;\n }\n\n\n // Validation champ sélect\n\n\n select = document.getElementById(\"select\").value ;\n console.log (\"select : \" + select);\n var checkselect = false; //booléen\n\n // VALIDATION CHOIX SUJET\n\n\n if (select == \"Mes commandes\" || select == \"Question sur un produit\" || select == \"Réclamations\" || select == \"Autres\")\n {\n checkselect = true;\n\n // si le choix est fait, alors cela doit apparaitre dans la box\n // condition pour éviter écrasement des données par select si un commentaire rentré\n if (document.getElementById(\"question\").value =\"\")\n\n {\n document.getElementById(\"question\").value = select;\n }\n \n }\n\n else\n\n {\n window.alert(\"merci de renseigne un Sujet\");\n checkcemail = false;\n }\n\n // VERIFICATION de la CASE COCHEE\n\n question = document.getElementById(\"defaultCheck1\").checked ;\n console.log (\"question : \" + question);\n var checkcheckbox = false;\n\n\n if (question == true) //check si la check box est bien cochée\n { \n checkcheckbox = true;\n } \n\n else\n\n {\n window.alert(\"Vous devez autoriser le traitement du formulaire\");\n checkcheckbox = false;\n }\n\n /*\n \nvalidation avec apparition message en cas d'erreur dans le formulaire avec d-none\nelement.classList.remove(\"d-none\");\n\n\nAutre option = créer un span vide avec un ID \net le remplir dans javascript\n\n */ \n\n\n}// fermeture fonction du bouton", "title": "" }, { "docid": "00ad6adf0a0c19897d2b4c266b8ef26b", "score": "0.6443264", "text": "function validate() {\n\tisValid = true;\n\tif (document.getElementById(\"nameId\").value == \"\") {\n\t\tisValid = false;\n\t\terrorStyle(document.getElementById(\"nameField\"));\n\t} else {\n\t\tcheckOK(document.getElementById(\"nameField\"));\n\t}\n\tif (document.getElementById(\"birthDateId\").value == \"\") {\n\t\tisValid = false;\n\t\terrorStyle(document.getElementById(\"dateField\"));\n\t} else {\n\t\tif (!isValidDOB(document.getElementById(\"birthDateId\").value)) {\n\t\t\tisValid = false;\n\t\t\terrorStyle(document.getElementById(\"dateField\"));\n\t\t}\n\t\telse {\n\t\t\tcheckOK(document.getElementById(\"dateField\"));\n\t\t}\n\t}\n\tif (!isRadioChecked(document.getElementsByName(\"gender\"))) {\n\t\tisValid = false;\n\t\terrorStyle(document.getElementById(\"genderField\"));\n\t} else {\n\t\tcheckOK(document.getElementById(\"genderField\"));\n\t}\n\tif (document.getElementById(\"skillsId\").value == \"\") {\n\t\tisValid = false;\n\t\terrorStyle(document.getElementById(\"skillField\"));\n\t} else {\n\t\tcheckOK(document.getElementById(\"skillField\"));\n\t}\n\tif (!isCheckboxChecked(document.getElementsByName(\"hobbies\"))) {\n\t\tisValid = false;\n\t\terrorStyle(document.getElementById(\"hobbyField\"));\n\t}\n\telse {\n\t\tcheckOK(document.getElementById(\"hobbyField\"));\n\t}\n\treturn isValid;\n}", "title": "" }, { "docid": "9c4f474701cc7d1c4aeb10cfd2b9ec4b", "score": "0.64431375", "text": "function ValidatePage2Step2_PJLibrary(sender, args) {\n var inputobjs = document.getElementsByTagName(\"input\");\n var selectobjs = document.getElementsByTagName(\"select\");\n var Q2_1, Q2_2, Q3_1, Q3_2, Q4, Q5, Q6, bValid = true, Q5CheckedValue;\n var Q5 = new Array();\n var j = 0;\n var valobj = document.getElementById(sender.id);\n\n for (var i = 0; i < inputobjs.length - 1; i++) {\n //for Q2_1\n if (inputobjs[i].id.indexOf(\"txtFirstName1\") >= 0)\n Q2_1 = inputobjs[i];\n //for Q2_1\n if (inputobjs[i].id.indexOf(\"txtLastName1\") >= 0)\n Q2_2 = inputobjs[i];\n //for Q3_1\n if (inputobjs[i].id.indexOf(\"RadioBtnQ31\") >= 0)\n Q3_1 = inputobjs[i];\n //for Q3_2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ32\") >= 0)\n Q3_2 = inputobjs[i];\n //for Q5\n if (inputobjs[i].id.indexOf(\"RadioButtionQ5\") >= 0) {\n Q5[j] = inputobjs[i];\n j = j + 1;\n }\n //for Q6\n if (inputobjs[i].id.indexOf(\"txtCamperSchool\") >= 0)\n Q6 = inputobjs[i];\n } //end of for loop\n\n //to get the select objects (ddlgrade) for Q4\n for (var k = 0; k <= selectobjs.length - 1; k++) {\n if (selectobjs[k].id.indexOf(\"ddlGrade\") >= 0) {\n Q4 = selectobjs[k];\n break;\n }\n }\n\n if (trim(Q2_1.value) == \"\") {\n valobj.innerHTML = \"<ul><li>Please enter PJL member first name.</li></ul>\";\n bValid = false;\n }\n else if (trim(Q2_2.value) == \"\") {\n valobj.innerHTML = \"<ul><li>Please enter PJL member last name.</li></ul>\";\n bValid = false;\n }\n //validate Q3\n else if (Q3_1.checked == false && Q3_2.checked == false) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 2</li></ul>\";\n bValid = false;\n }\n //validate Q4\n else if (Q4.selectedIndex == 0) {\n valobj.innerHTML = \"<ul><li>Please select a Grade</li></ul>\";\n bValid = false;\n }\n else {\n //validate Q5\n var bChecked = false;\n\n for (var k = 0; k <= Q5.length - 1; k++) {\n if (Q5[k].checked == true) {\n Q5CheckedValue = Q5[k].value;\n bChecked = true;\n break;\n }\n }\n\n if (!bChecked) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 4</li></ul>\";\n bValid = false;\n }\n else if (Q5CheckedValue != \"3\" && trim(Q6.value) == \"\")//validate Q6 (if it is not home school)\n {\n valobj.innerHTML = \"<ul><li>Please enter Name of the School</li></ul>\";\n bValid = false;\n }\n }\n\n args.IsValid = bValid;\n return;\n}", "title": "" }, { "docid": "5166578b09b693a5dfa61864730a775e", "score": "0.64273524", "text": "function submitForm(event) {\n event.preventDefault()\n if (!input[\"checked\"]) {\n alert(\"accept the terms and conditions\");\n }\n else if (Object.keys(input).length !== demographics.length + medical.length + 1) {\n alert(\"please fill out all the data\")\n }\n else {\n console.log(input);\n }\n\n }", "title": "" }, { "docid": "6b8fe07d1f82425101ba44214bc0bef6", "score": "0.64151716", "text": "function validation(event) {\n var input_field = document.getElementsByClassName('text_field'); // Fetching all inputs with same class name text_field and an html tag textarea.\n\n // For loop to count blank inputs.\n\n for (var i = input_field.length; i > count; i--) {\n if (input_field[i - 1].value == '') {\n count = count + 1;\n } else {\n count = 0;\n }\n }\n if (count != 0) {\n alert(\"*All Fields are mandatory*\"); // Notifying validation\n event.preventDefault();\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "de1849750b618a01df1b7b2f51addc9b", "score": "0.64084166", "text": "function ValidatePage2Step2_Orange(sender, args) {\n var inputobjs = document.getElementsByTagName(\"input\");\n var selectobjs = document.getElementsByTagName(\"select\");\n var Q3_1, Q3_2, Q4_1, Q4_2, Q5_1, Q5_2;\n\n var j = 0;\n var valobj = document.getElementById(sender.id);\n for (var i = 0; i < inputobjs.length - 1; i++) {\n //for Q3_1\n if (inputobjs[i].id.indexOf(\"RadioBtnQ3_0\") >= 0) {\n Q3_1 = inputobjs[i];\n }\n //for Q3_2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ3_1\") >= 0) {\n Q3_2 = inputobjs[i];\n }\n\n //for Q4_1\n if (inputobjs[i].id.indexOf(\"RadioBtnQ4_0\") >= 0) {\n Q4_1 = inputobjs[i];\n }\n\n //for Q4_2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ4_1\") >= 0) {\n Q4_2 = inputobjs[i];\n }\n\n //for Q5_1\n if (inputobjs[i].id.indexOf(\"RadioBtnQ5_0\") >= 0) {\n Q5_1 = inputobjs[i];\n }\n\n //for Q5_2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ5_1\") >= 0) {\n Q5_2 = inputobjs[i];\n }\n } //end of for loop\n\n //validate Q3\n if (Q3_1.checked == false && Q3_2.checked == false) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 1</li></ul>\";\n args.IsValid = false;\n return;\n }\n else if (Q3_2.checked) //if \"no\" is checked\n {\n //to validate for Q4 and Q5\n if (Q4_1.checked == false && Q4_2.checked == false) {\n valobj.innerHTML = \"<li>Please answer Question No. 2</li>\";\n args.IsValid = false;\n return;\n }\n else if (Q4_1.checked) {\n if (Q5_1.checked == false && Q5_2.checked == false) {\n valobj.innerHTML = \"<li>Please answer Question No. 3</li>\";\n args.IsValid = false;\n return;\n }\n }\n }\n\n args.IsValid = true;\n return;\n}", "title": "" }, { "docid": "34c82e6e201e9b91e2806f6c5ec45581", "score": "0.64045477", "text": "function validation(){\n /* Getting value from the inputs */\n var inputName = document.getElementById(\"inputName\").value;\n var inputPhone = document.getElementById(\"inputPhone\").value;\n var inputAddress = document.getElementById(\"inputAddress\").value;\n var inputCity = document.getElementById(\"inputCity\").value;\n var inputState = document.getElementById(\"inputState\").value;\n var inputZip = document.getElementById(\"inputZip\").value;\n\n\n /* checking if all inputs are filled */\n var allTrue = true;\n if (inputName.length > 1 && inputPhone.length > 1 && inputAddress.length > 1 && inputCity.length > 1 && inputState.length > 1 && inputZip.length > 1){\n allTrue = false;\n }\n if (allTrue === false){\n document.getElementById(\"submit\").removeAttribute(\"disabled\");\n } else{\n document.getElementById(\"submit\").setAttribute(\"disabled\",\"true\");\n }\n\n}", "title": "" }, { "docid": "0dedcedb8ce9d23caa651da0bd60e388", "score": "0.6381502", "text": "function Validar_Formulario() {\n // Recorre los radio de genero\n for (var i = 0; i < genero.length; i++){\n if (genero[i].checked) {\n genero = genero[i].value;\n }\n }\n if (nombre.value != \"\"\n && apellido.value != \"\"\n && direccion.value != \"\"\n && telefono.value != \"\"\n && correo.value != \"\"\n && pass.value != \"\"\n && genero >= 0\n && nacimiento.value != \"\"\n && cui.value != \"\"\n && choosenDpto > 0\n && choosenMncipio > 0) {\n if (pass.value != pass2.value) {\n alert('Las contraseñas no coinciden');\n } else if (tos.cheked == false) {\n alert('Debes aceptar los teminos y condiciones')\n } else {\n agregarAdmin();\n }\n } else {\n alert('Debe llenar todos los campos')\n }\n}", "title": "" }, { "docid": "47f370bc6048cf5802f31679876a9bbd", "score": "0.63799095", "text": "function validateTrainerForm() {\n var first = document.getElementById(\"trainer-first-name\").value;\n var last = document.getElementById(\"trainer-last-name\").value;\n var subject = document.getElementById(\"subject\").value; \n if ((first == \"\" || first == null) || (last == \"\" || last == null)\n || (subject == \"\" || subject == null)) { \n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "c35cd3ab6069bbc57d17a50d1a40d2e6", "score": "0.6370545", "text": "function Validate(){\n\tif (document.getElementById(\"takki_manadarlaun\").checked) {\n\t\t\n\t\tif (ValidateManudur()) {\n\t\t\tReikna();\n\t\t};\n\t\treturn false;\n\t};\n\tif (document.getElementById(\"takki_timakaup\").checked) {\n\t\t\n\t\tReiknaUtFraTima();\n\t\treturn false;\n\t};\n\treturn false;\n}", "title": "" }, { "docid": "35ab76cd07d3019fe0bab27699b9e872", "score": "0.6354669", "text": "function checkSignUP() {\n \n var user_signup = document.forms[\"form-signup\"][\"username-signup\"].value,\n pass_signup = document.forms[\"form-signup\"][\"password-signup\"].value,\n email = document.forms[\"form-signup\"][\"email\"].value,\n check = document.getElementById(\"confirm-terms\");\n \n if ( isEmpty(user_signup) || isEmpty(pass_signup) || isEmpty(email) ) {\n alert(\"Please enter all information in the required fields\");\n } else if (check.checked == false) {\n alert(\"Please read the terms and approve them first\");\n } else {\n alert(\"Successfully Registered\");\n }\n}", "title": "" }, { "docid": "46ea42cee301bb50f0b94a000e3a7b32", "score": "0.63540834", "text": "function required(name, email, major, role, biography) {\n if (name.length === 0 || email.length === 0 || major.length === 0 ||\n role.length === 0 || biography.length === 0) {\n alert(\"All fields are required please enter all the required fields.\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "2e07341d88e4434df1977c363a1b00c3", "score": "0.63255817", "text": "function checkEmptydata() {\r\n\r\n var isEmpty = false;\r\n var studentname = document.getElementById(\"studentname\").value;\r\n var fathername = document.getElementById(\"fathername\").value;\r\n var email = document.getElementById(\"email\").value;\r\n \r\n if (studentname == \"\"){\r\n alert(\"Student name field should not be empty\");\r\n isEmpty = true;\r\n }else if (fathername == \"\"){\r\n alert(\"Father name field should not be empty\");\r\n isEmpty = true;\r\n }else if (email == \"\"){\r\n alert(\"Email field should not be empty\");\r\n isEmpty = true;\r\n }\r\n return isEmpty;\r\n}", "title": "" }, { "docid": "d03d0cb8322522de23be71499e6fd249", "score": "0.6310989", "text": "function checkall(){\n if(validateApr() && validateTerm() && validateForm()) {\n getValues();\n }\n}", "title": "" }, { "docid": "ec46aa1eb38ac4a658371dabfd64653b", "score": "0.63094234", "text": "function validateTWikiMandatoryFields(event) {\n if (twiki.Pref.validateSuppressed) {\n return true;\n }\n var ok = true;\n var els = twiki.getElementsByClassName(document, 'select',\n 'twikiMandatory');\n for (var j = 0; j < els.length; j++) {\n var one = false;\n for (var k = 0; k < els[j].options.length; k++) {\n if (els[j].options[k].selected) {\n one = true;\n break;\n }\n }\n if (!one) {\n alert(\"The required form field '\" + els[j].name +\n \"' has no value.\");\n ok = false;\n }\n }\n var taglist = new Array('input', 'textarea');\n for (var i = 0; i < taglist.length; i++) {\n els = twiki.getElementsByClassName(document, taglist[i],\n 'twikiMandatory');\n for (var j = 0; j < els.length; j++) {\n if (els[j].value == null || els[j].value.length == 0) {\n alert(\"The required form field '\" + els[j].name +\n \"' has no value.\");\n ok = false;\n }\n }\n }\n return ok;\n}", "title": "" }, { "docid": "c7aeb0dd3f259f03acd112440dee551e", "score": "0.63074464", "text": "function validateCheckbox() {\n var cba = {},\n cmsg = {};\n cb.each(function (i) {\n var checkboxes = $(this).find(':checkbox');\n cmsg[i] = '.msg-required-' + $(this).attr('id');\n cba[i] = [];\n $(checkboxes).each(function () {\n if ($(this).is(':checked')) cba[i].push($(this).val());\n $(this).off('change').on('change', function () {\n $.inArray($(this).val(), cba[i]) > -1 ? cba[i].splice($.inArray($(this).val(), cba[i]), 1) : cba[i].push($(this).val());\n cba[i].length > 0 ? $(cmsg[i]).nosSlideUp() : $(cmsg[i]).nosSlideDown();\n });\n });\n if (cba[i].length < 1) $(cmsg[i]).nosSlideDown();\n });\n }", "title": "" }, { "docid": "6d2a5eb92c81a026e96a1689d65f66a0", "score": "0.62945735", "text": "function checkEmptyInput()\n {\n var isEmpty = false,\n marke = document.getElementById(\"marke\").value;\n modell = document.getElementById(\"modell\").value;\n kraftstoff = document.getElementById(\"kraftstoff\").value;\n schaltung = document.getElementById(\"schaltung\").value;\n tueren = document.getElementById(\"tueren\").value;\n klima = document.getElementById(\"klima\").value;\n navigationsgeraet = document.getElementById(\"navigationsgeraet\").value;\n plaetze = document.getElementById(\"plaetze\").value;\n raucherwagen = document.getElementById(\"raucherwagen\").value;\n stellplatznummer = document.getElementById(\"stellplatznummer\").value;\n\n if(marke === \"\"){\n alert(\"Bitte gib für den Auftrag einen Titel ein!\");\n isEmpty = true;\n }\n else if(modell === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(krafstoff === \"\"){\n alert(\"Bitte füge deinem Auftrag eine kurze Beschreibung hinzu!\");\n isEmpty = true;\n }\n else if(schaltung === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(tueren === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(klima === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(navigationsgeraet === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(plaetze === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(raucherwagen === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n else if(stellplatznummer === \"\"){\n alert(\"Bitte gib für den Auftrag die Anzahl der Auftragnehmer ein\");\n isEmpty = true;\n }\n return isEmpty;\n }", "title": "" }, { "docid": "64e9396c4a9a67fa19692205a117c6d3", "score": "0.6292029", "text": "function validateTWikiMandatoryFields(event) {\n if (twiki.Pref.validateSuppressed) {\n return true;\n }\n var ok = true;\n var els = twiki.getElementsByClassName(document, 'twikiMandatory', 'select');\n for (var j = 0; j < els.length; j++) {\n var one = false;\n for (var k = 0; k < els[j].options.length; k++) {\n if (els[j].options[k].selected) {\n one = true;\n break;\n }\n }\n if (!one) {\n alert(\"The required form field '\" + els[j].name + \"' has no value.\");\n ok = false;\n }\n }\n var taglist = new Array('input', 'textarea');\n for (var i = 0; i < taglist.length; i++) {\n els = twiki.getElementsByClassName(document, 'twikiMandatory', taglist[i]);\n for (var j = 0; j < els.length; j++) {\n if (els[j].value == null || els[j].value.length == 0) {\n alert(\"The required form field '\" + els[j].name + \"' has no value.\");\n ok = false;\n }\n }\n }\n return ok;\n}", "title": "" }, { "docid": "d4d1b213e4713fae01e201f8f9a76fb1", "score": "0.6281202", "text": "function loans()\r\n{\r\n\tvar Account_no = document.getElementById(\"Account_no\");\r\n\tvar Amount = document.getElementById(\"Amount\");\r\n\tvar Years = document.getElementById(\"Years\");\r\n\tvar Name = document.getElementById(\"Name\");\r\n\tvar Surname = document.getElementById(\"Surname\");\r\n\r\n\t\r\n\t\r\n\tif(Account_no.value.trim() ==\"\" || Amount.value.trim() ==\"\" || Years.value.trim() ==\"\" || Name.value.trim() ==\"\" || Surname.value.trim() ==\"\")\r\n { alert(\"Please Fill all Fields...!\");\r\n\t return false;\r\n\t \r\n\t }\r\n}", "title": "" }, { "docid": "078eba45c0f6df790105524a1435d30d", "score": "0.6266236", "text": "function checkRadio(_element, errorMes) {\n var cty = document.getElementsByName(_element)\n if (!cty[0].checked && !cty[1].checked) {\n // verify that a country is selected\n cty[0].style.outline = \"1px solid red\";\n cty[1].style.outline = \"1px solid red\";\n\t\tif(_element == \"country\")\n\t\t\tdocument.getElementById(\"errorMessage\").innerHTML =\"please choose Inside the US or outside the US\";\n\t\tif(_element == \"time\")\n\t\t\tdocument.getElementById(\"errors\").innerHTML =\"please choose Elapsed time or Projected time.\";\n return [false, cty];\n }\n else\n {\n\t\tdocument.getElementById(errorMes).innerHTML =\"\";\n\t\tcty[0].style.outline = \"\";\n cty[1].style.outline = \"\";\n return [true, cty];\n }\n}", "title": "" }, { "docid": "b7e163713b7352e049ae9744bb9b76ea", "score": "0.6262346", "text": "function validateFieldInventary(){\n\tvar resultc = true;\n\t$('#alertInventaryUnit').hide()\n\tif($('#RadioDetailedAvailability').is(\":checked\")){\n\t\tif($('#textInvFloorPlan').val() == 0 && $('#textInvProperty').val() == 0 ){\n\t\t\tconsole.log(\"entro\")\n\t\t\tresultc = false;\n\t\t}\n\t}else{\n\t\tif($('#textInvProperty').val() == 0 ){\n\t\t\tconsole.log(\"tambien aqui\")\n\t\t\tresultc = false;\n\t\t}\n\t}\n\t\n\treturn resultc;\n\t\n}", "title": "" }, { "docid": "afddb704aa8af2896dff75c4272bf26e", "score": "0.62619865", "text": "function ValidatePage2Step2_MountainChai(sender, args) {\n var inputobjs = document.getElementsByTagName(\"input\");\n var selectobjs = document.getElementsByTagName(\"select\");\n var Q5, Q7, bValid = true, Q2CheckedValue, Q3CheckedValue, Q4CheckedValue, Q6CheckedValue;\n var Q2 = new Array();\n var Q3 = new Array();\n var Q4 = new Array();\n var Q6 = new Array();\n var j = 0;\n var k = 0;\n var l = 0;\n var m = 0;\n var valobj = document.getElementById(sender.id);\n\n for (var i = 0; i < inputobjs.length - 1; i++) {\n //for Q2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ2\") >= 0)\n { Q2[j] = inputobjs[i]; j = j + 1; }\n //for Q3\n // if (inputobjs[i].id.indexOf(\"RadioBtnQ3\")>=0)\n // {Q3[k] = inputobjs[i]; k=k+1;}\n // //for Q4\n // if (inputobjs[i].id.indexOf(\"RadioBtnQ4\")>=0)\n // {Q4[l] = inputobjs[i]; l=l+1;}\n //for Q6\n if (inputobjs[i].id.indexOf(\"RadioButtionQ6\") >= 0) {\n Q6[m] = inputobjs[i];\n m = m + 1;\n }\n //for Q7\n if (inputobjs[i].id.indexOf(\"txtCamperSchool\") >= 0)\n Q7 = inputobjs[i];\n } //end of for loop\n //to get the select objects (ddlgrade) for Q4\n for (var k = 0; k <= selectobjs.length - 1; k++) {\n if (selectobjs[k].id.indexOf(\"ddlGrade\") >= 0) {\n Q5 = selectobjs[k];\n break;\n }\n }\n\n //validate Q2\n //validate Q6\n var bQ2Checked = false;\n var bQ3Checked = false;\n var bQ4Checked = false;\n var bQ6Checked = false;\n for (var k = 0; k <= Q2.length - 1; k++) {\n if (Q2[k].checked == true) {\n Q2CheckedValue = Q2[k].value;\n bQ2Checked = true;\n break;\n }\n }\n // for (var k=0; k<=Q3.length-1; k++)\n // {\n // if (Q3[k].checked==true)\n // {\n // Q3CheckedValue = Q3[k].value;\n // bQ3Checked = true;\n // break;\n // }\n // }\n // for (var k=0; k<=Q4.length-1; k++)\n // {\n // if (Q4[k].checked==true)\n // {\n // Q4CheckedValue = Q4[k].value;\n // bQ4Checked = true;\n // break;\n // }\n // } \n // \n for (var k = 0; k <= Q6.length - 1; k++) {\n if (Q6[k].checked == true) {\n Q6CheckedValue = Q6[k].value;\n bQ6Checked = true;\n break;\n }\n }\n if (!bQ2Checked && bValid) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 1</li></ul>\";\n bValid = false;\n }\n // else if(Q2CheckedValue == \"2\")\n // {\n // //validate Q3 \n // if (!bQ3Checked)\n // {\n // valobj.innerHTML = \"<ul><li>Please answer Question No. 2</li></ul>\";\n // bValid = false;\n // }\n // else if(Q3CheckedValue == \"1\")\n // {\n // //validate Q4 \n // if (!bQ4Checked)\n // {\n // valobj.innerHTML = \"<ul><li>Please answer Question No. 3</li></ul>\";\n // bValid = false;\n // } \n // } \n // }\n //validate Q5\n if (Q5.selectedIndex == 0 && bValid) {\n valobj.innerHTML = \"<ul><li>Please select a Grade</li></ul>\";\n bValid = false;\n }\n\n //validate Q6\n if (!bQ6Checked && bValid) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 3</li></ul>\";\n bValid = false;\n }\n else if (Q6CheckedValue != \"3\" && trim(Q7.value) == \"\" && bValid)//validate Q7(if it is not home school)\n {\n valobj.innerHTML = \"<ul><li>Please enter Name of the School</li></ul>\";\n bValid = false;\n }\n args.IsValid = bValid;\n return;\n}", "title": "" }, { "docid": "77efb7910cbff3b64137ed136faea6e0", "score": "0.6257841", "text": "function validateEndForm(){\r\n var error_string = \"\";\r\n\r\n /*Check whether question 1 is answered*/\r\n var ques1_select = false;\r\n var ques1_length = window.document.my_form.satisfaction.length;\r\n\r\n for(var i = 0; i < ques1_length; i++){\r\n if(window.document.my_form.satisfaction[i].checked){\r\n ques1_select = true;\r\n break;\r\n\t\t}\r\n }\r\n if(!ques1_select) error_string += \"Please select a response for question 3!\\n\";\r\n\r\n /*Check whether question 2 is answered*/\r\n var ques2_select = false;\r\n var ques2_length = window.document.my_form.satisfaction2.length;\r\n\r\n for(var i = 0; i < ques2_length; i++){\r\n if(window.document.my_form.satisfaction2[i].checked){\r\n ques2_select = true;\r\n break;\r\n }\r\n }\r\n if(!ques2_select) error_string += \"Please select a response for question 4!\\n\";\r\n\t\r\n\t/*Check whether question 3 is answered*/\r\n var ques3_select = false;\r\n var ques3_length = window.document.my_form.satisfaction3.length;\r\n\r\n for(var i = 0; i < ques3_length; i++){\r\n if(window.document.my_form.satisfaction3[i].checked){\r\n ques3_select = true;\r\n break;\r\n }\r\n }\r\n if(!ques3_select) error_string += \"Please select a response for question 5!\\n\";\r\n\r\n if(error_string == \"\") return true;\r\n else {alert(error_string); return false;}\r\n}", "title": "" }, { "docid": "08946851a788bf9447b01c9abde11a53", "score": "0.62557185", "text": "function check_adds_edit(theForm) {\n\n var reason = \"\";\n\n var check = $('#set_field').val();\n\n if(check==1)\n {\n\n reason += validateEmpty(theForm.add_img);\n }\n else if(check==2)\n {\n\n reason += validateEmpty(theForm.script_code);\n \n }\n \n //reason += validateEmpty(theForm.district);\n reason += validateEmpty(theForm.title);\n //reason += validateText(theForm.country);\n \n \n if (reason != \"\") {\n\n alert(\"Some fields need correction:\\n\" + reason);\n return false;\n\n }\n\n return true;\n}", "title": "" }, { "docid": "5512ccefcd6d483ab675917281e2ecb5", "score": "0.6249089", "text": "function validar(){\n if (codigo.value == \"\" || nombre.value == \"\" || descripcion.value == \"\" || cantidad.value ==\"\" || costo.value ==\"\"){\n return 0;\n }\n else{\n return 1;\n }\n}", "title": "" }, { "docid": "cd9acce31090377579e2c7f93052648c", "score": "0.62486565", "text": "function checkForEmptyFields(e) {\r\n // hide the error message element \r\n var errorArea = document.getElementById(\"errors\");\r\n errorArea.className = \"hidden\";\r\n\r\n var cssSelector = \"input[type=text],input[type=password]\";\r\n var fields = document.querySelectorAll(cssSelector);\r\n\r\n // loop thru the input elements looking for empty values\r\n var fieldList = [];\r\n for (i=0; i<fields.length; i++) {\r\n if (fields[i].value == null || fields[i].value == \"\") {\r\n // since a field is empty prevent the form submission\r\n e.preventDefault();\r\n fieldList.push(fields[i]);\r\n }\r\n }\r\n \r\n var select = document.getElementById(\"payment\"); \r\n alert(\"selectedIndex=\" + select.selectedIndex);\r\n if (select.value == 0) alert(\"zero\");\r\n \r\n \r\n var rememberMe = document.getElementById(\"save\");\r\n if (! rememberMe.checked) {\r\n alert(\"not checked\");\r\n }\r\n \r\nvar radios = document.querySelectorAll(\"input[name=region]\");\r\nfor (var i=0; i < radios.length; i++) {\r\n if (radios[i].checked) {\r\n alert(radios[i].value + \" was checked\"); \r\n }\r\n}\r\n \r\n \r\n // now set up the error message\r\n var msg = \"The following fields can't be empty: \";\r\n if (fieldList.length > 0) {\r\n for (i=0; i<fieldList.length; i++) {\r\n msg += fieldList[i].id + \",\";\r\n }\r\n errorArea.innerHTML = \"<p>\" + msg + \"</p>\";\r\n errorArea.className = \"visible\";\r\n } \r\n else {\r\n e.submit();\r\n }\r\n }", "title": "" }, { "docid": "63d7fafe7cc65b43cd6609642c00c06c", "score": "0.6243379", "text": "function ValidatePage2Step2_MidSex(sender, args) {\n var inputobjs = document.getElementsByTagName(\"input\");\n var selectobjs = document.getElementsByTagName(\"select\");\n var Q3_1, Q3_2, Q4, Q5, Q6, bValid = true, Q5CheckedValue;\n var Q5 = new Array();\n var j = 0;\n var valobj = document.getElementById(sender.id);\n\n for (var i = 0; i < inputobjs.length - 1; i++) {\n //for Q3_1\n if (inputobjs[i].id.indexOf(\"RadioBtnQ31\") >= 0)\n Q3_1 = inputobjs[i];\n //for Q3_2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ32\") >= 0)\n Q3_2 = inputobjs[i];\n //for Q5\n if (inputobjs[i].id.indexOf(\"RadioButtionQ5\") >= 0) {\n Q5[j] = inputobjs[i];\n j = j + 1;\n }\n //for Q6\n if (inputobjs[i].id.indexOf(\"txtCamperSchool\") >= 0)\n Q6 = inputobjs[i];\n } //end of for loop\n\n //to get the select objects (ddlgrade) for Q4\n for (var k = 0; k <= selectobjs.length - 1; k++) {\n if (selectobjs[k].id.indexOf(\"ddlGrade\") >= 0) {\n Q4 = selectobjs[k];\n break;\n }\n }\n\n //validate Q3\n if (Q3_1.checked == false && Q3_2.checked == false) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 1</li></ul>\";\n bValid = false;\n }\n //validate Q4\n else if (Q4.selectedIndex == 0) {\n valobj.innerHTML = \"<ul><li>Please select a Grade</li></ul>\";\n bValid = false;\n }\n else {\n //validate Q5\n var bChecked = false;\n\n for (var k = 0; k <= Q5.length - 1; k++) {\n if (Q5[k].checked == true) {\n Q5CheckedValue = Q5[k].value;\n bChecked = true;\n break;\n }\n }\n\n if (!bChecked) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 3</li></ul>\";\n bValid = false;\n }\n else if (Q5CheckedValue != \"3\" && trim(Q6.value) == \"\")//validate Q6 (if it is not home school)\n {\n valobj.innerHTML = \"<ul><li>Please enter Name of the School</li></ul>\";\n bValid = false;\n }\n }\n\n args.IsValid = bValid;\n return;\n}", "title": "" }, { "docid": "1435b928ac4ad9005d8eb821c8c7def3", "score": "0.62307787", "text": "function isValidationRequired() {\n\tif($('input[name=\"user.vmwarePartnerCertified\"]').filter(':checked').val() == \"false\"){\n\t\tif (areaOfInterestHidden.search(\"datacenter_cloud_infrastructure\")!=-1){\n\t\t\treturn true;\n\t\t}else if (areaOfInterestHidden.search(\"infrastructure_operations_management\")!=-1){\n\t\t\treturn true;\n\t\t}else if (areaOfInterestHidden.search(\"secutiry_products\")!=-1){\n\t\t\treturn true;\n\t\t}else if (areaOfInterestHidden.search(\"IT_business_management\")!=-1){\n\t\t\treturn true;\n\t\t}else {\n\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n\t\t\n}", "title": "" }, { "docid": "81480194f93c4c72f4742a2c3f91681b", "score": "0.6229841", "text": "function isInputSelected() {\n // If the radio button is filled in do something, else do something else.\n // Note: the length of 0 is an unfilled choice in a radio button.\n if (!$('input[name=answer-choice]:checked').length > 0) {\n swal(\n 'Don\\'t know? Or just not trying hard enough!',\n 'Please choose an option from the choices.',\n 'warning'\n )\n } else {\n checkAnswer();\n }\n}", "title": "" }, { "docid": "5cbd661872359a573f5b8ca572fe720a", "score": "0.62296087", "text": "function check_selected() {\n var is_valid = true;\n if (countC0 === 0 || countC1 === 0) {\n is_valid = false;\n alert(\n 'Please select at least one from each category, or the option \"None\".'\n );\n }\n return is_valid;\n}", "title": "" }, { "docid": "1557096c9e5ecc11efa075cf6c1a8f46", "score": "0.6226057", "text": "function formCheck(formobj, fieldRequired, fieldDescription){\n // dialog message\n var alertMsg = \"#xarML('Please complete the following fields:')#\\n\";\n \n var l_Msg = alertMsg.length;\n \n for (var i = 0; i < fieldRequired.length; i++){\n var obj = formobj.elements[fieldRequired[i]];\n if (obj){\n switch(obj.type){\n case \"select-one\":\n if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == \"\"){\n alertMsg += \" - \" + fieldDescription[i] + \"\\n\";\n }\n break;\n case \"select-multiple\":\n if (obj.selectedIndex == -1){\n alertMsg += \" - \" + fieldDescription[i] + \"\\n\";\n }\n break;\n case \"text\":\n case \"textarea\":\n if (obj.value == \"\" || obj.value == null){\n alertMsg += \" - \" + fieldDescription[i] + \"\\n\";\n }\n break;\n default:\n }\n if (obj.type == undefined){\n var blnchecked = false;\n for (var j = 0; j < obj.length; j++){\n if (obj[j].checked){\n blnchecked = true;\n }\n }\n if (!blnchecked){\n alertMsg += \" - \" + fieldDescription[i] + \"\\n\";\n }\n }\n }\n }\n\n if (alertMsg.length == l_Msg){\n return true;\n }else{\n alert(alertMsg);\n return false;\n }\n}", "title": "" }, { "docid": "c10422232f32daf19cc7615fd8b512b7", "score": "0.6224949", "text": "function isRadioChecked(form) {\n // initialize an array that will hold all the names of the radio button groups\n radioButtonGroups = new Array();\n for (i=0; i<form.length; i++) {\n //alert (form.elements[i].type);\n if ( form.elements[i].type=='radio') {\n formObjectName = form.elements[i].name;\n //alert (\"the form object is \" + formObjectName);\n alreadyFound = false;\n for (j=0; j<radioButtonGroups.length; j++) {\n if (radioButtonGroups[j]==formObjectName) {\n alreadyFound=true;\n break;\n }\n }\n if (!alreadyFound) {radioButtonGroups.push(formObjectName);}\n } // end if\n } // end for\n //alert (radioButtonGroups[0]);\n //alert (radioButtonGroups.length);\n\n for (k=0; k<radioButtonGroups.length; k++) {\n somethingChecked = false; // initialize whether one value is checked in each radio group\n radioOptions = form.elements[radioButtonGroups[k]].length;\n //alert (\"there are \" + radioOptions + \" options available for this radio button group\");\n for (counter=0; counter<radioOptions; counter++) {\n result = form.elements[radioButtonGroups[k]][counter].checked;\n //alert (\"result is \" + result);\n if (result) {\n somethingChecked = true;\n break;\n }\n else {\n emptyRadio = form.elements[radioButtonGroups[k]][counter];\n }\n\n }\n if ( !somethingChecked ) {\n emptyRadio.focus();\n alert(\"You must choose a value for the '\" + fieldLabels[emptyRadio.name] + \"' radio button group.\");\n return false\n } // end if\n } // end for\n return true\n}", "title": "" }, { "docid": "695507ac65d709694f5b37ab2edc3685", "score": "0.62236285", "text": "function validateForm() {\n\n //boolean indicating if fields have been filled out\n var isValid = true;\n\n //check if name or photo fields are empty\n $(\".aboutYou\").each(function() {\n if ($(this).val() === \"\") {\n isValid = false;\n }\n });\n \n //check if any of the questions are not answered\n $(\".question\").each(function() {\n if ($(this).val() === \"\") {\n isValid = false;\n }\n });\n \n return isValid;\n }", "title": "" }, { "docid": "353d753426754590edca65bac196f874", "score": "0.6220669", "text": "function validateForm(Name, Assignedto, Description, DueDate, Status){\n //get the values retrieved on the click event and check valid \n //assigned by and to are > 0 and < 20\n //description is technically meant to be > 20 (over 10 for testing)\n //due date is supplied\n //status is supplied\n //test all the info supplied and return true or false\n\n let isAllValid = false\n\n if (((Name.length > 0) && (Name.length < 20)) \n && ((Assignedto.length > 0) && (Assignedto.length < 20)) && \n ((Description.length > 0) && (Description.length < 40)) && (DueDate) && (Status)) {\n isAllValid = true\n return isAllValid;\n }\n}", "title": "" }, { "docid": "496ae0055b467355bb7777e8a3137716", "score": "0.62205935", "text": "function isRadioButtonChecked() {\r\n\tvar selected = false;\r\n\tvar isWeb1 = document.getElementById(\"rb1\").checked;\r\n var isWeb2 = document.getElementById(\"rb2\").checked;\r\n var isWeb3 = document.getElementById(\"rb3\").checked;\r\n\t\r\n\tif (isWeb1 || isWeb2 || isWeb3) {//if anyone is checked, it is ok!\r\n selected = true; \r\n }\r\n\telse {\r\n\t\tselected = false; //if not checked, feedback is given to answer Q2\r\n\t\tgErrorMsg = gErrorMsg + \"Please Answer Question 2\\n\";\r\n\t}\r\n return selected;\r\n}", "title": "" }, { "docid": "d5f4c40620982ed9dc5c233a835c42ed", "score": "0.6216677", "text": "function inputsCheck() {\n if ($('.addcoursesection__radiobox input').is(':checked') && $('.addcoursesection__checkswrap input').is(':checked')) {\n $('.addcoursesection__continue').removeClass('disable');\n } else {\n $('.addcoursesection__continue').addClass('disable');\n }\n }", "title": "" }, { "docid": "9df34275f8cc62869169ce2a1599d6f0", "score": "0.62165385", "text": "function checkEmptyInput() {\r\n var isEmpty = false,\r\n name = document.getElementById(\"name\").value,\r\n arrivaltime = document.getElementById(\"arrivaltime\").value,\r\n bursttime = document.getElementById(\"bursttime\").value;\r\n\r\n if (name === \"\") {\r\n alert(\"Process Name Connot Be Empty\");\r\n isEmpty = true;\r\n }\r\n if (arrivaltime === \"\") {\r\n alert(\"Arrival time Connot Be Empty\");\r\n isEmpty = true;\r\n }\r\n if (bursttime === \"\") {\r\n alert(\"Burst time Connot Be Empty\");\r\n isEmpty = true;\r\n }\r\n return isEmpty;\r\n}", "title": "" }, { "docid": "18c3737dec4d4c01a6347c2125661d73", "score": "0.6215603", "text": "function checkForm(form) {\n // get all the inputs within the submitted form\n var inputs = form.getElementsByTagName('input');\n for (var i = 0; i < inputs.length; i++) {\n // only validate the inputs that have the required attribute\n if(inputs[i].hasAttribute(\"required\")){\n if(inputs[i].value == \"\"){\n // found an empty field that is required\n alert(\"Please fill all required fields\");\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "ab6d2e8b541e390e8e125429253a8118", "score": "0.6213981", "text": "function validateRadio() {\n if(document.SandalForm.sizes[0].checked) {\n return true;\n }\n if(document.SandalForm.sizes[1].checked) {\n return true;\n }\n if(document.SandalForm.sizes[2].checked) {\n return true;\n }\n if(document.SandalForm.sizes[3].checked) {\n return true;\n }\n if(document.SandalForm.sizes[4].checked) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "84751db1b6ed941c3f3b0fcbe63c7176", "score": "0.6213912", "text": "function chkcreateterminal()\n{\n// if(document.getElementById('txttermname').value.length == 0)\n// {\n// alert(\"Please input terminal name\");\n// document.getElementById('txttermname').focus();\n// return false;\n// }\n// if(document.getElementById('txttermcode').value.length == 0)\n// {\n// alert(\"Please input terminal code\");\n// document.getElementById('txttermcode').focus();\n// return false;\n// }\n if(document.getElementById('cmbsitename').value == \"-1\")\n {\n alert(\"Please select Site/PEGS\");\n document.getElementById('cmbsitename').focus();\n return false;\n }\n// else if (!checkRadio(\"frmterminal\",\"optvip\"))\n// {\n// alert(\"Please select if vip or not\");\n// return false;\n// }\n else\n return true;\n}", "title": "" }, { "docid": "c3cb4b389f72f6c582f9ae205c794287", "score": "0.62088937", "text": "function CheckAll()\n{\n\n\tvar inputs = document.getElementsByTagName(\"input\");\n\tvar selects = document.getElementsByTagName(\"select\");\n\n\tvar button = document.getElementById(\"submit_button\");\n\n\tvar valid = true;\n\n\t//loop that check every input has value and value is the correct\n\tfor(var i=0; i<inputs.length; i++)\n\t{\n\t\tif(!inputs[i].value || isValid == false || isEmailValid == false || hasName == false || isCheck == false)\n\t\t{\n\t\t\tvalid = false;\n\t\t}\n\t}\n\n\t// it checks if the select item is select or not \n\tfor(var j=0; j<selects.length; j++)\n\t{\t\n\t\t// mean no select is choose in the drop-down list\n\t\tif(selects[j].selectedIndex == -1)\n\t\t{\n\t\t\tvalid = false;\n\t\t}\n\t}\n\n\t\n\t// change the button color, it gives user a visual perspective of correct form or not\n\t\n\tif(valid)\n\t{\n\t\tbutton.disabled = false;\n\n\t\tbutton.style.backgroundColor = \"#1c8adb\";\n\t\tbutton.style.color = \"#fff\";\n\n\t}\n\telse\n\t{\n\t\tbutton.disabled = true;\n\n\t\tbutton.style.color = \"#fff\";\n\n\t\tbutton.style.backgroundColor = \"#808080\";\n\t}\n}", "title": "" }, { "docid": "4a825ede05c7bdcdf6623265f96689ef", "score": "0.6208469", "text": "function ValidatePage2Step2_MetroWest(sender, args) {\n var inputobjs = document.getElementsByTagName(\"input\");\n var selectobjs = document.getElementsByTagName(\"select\");\n var Q3_1, Q3_2, Q5, Q6, Q7, Q8, bValid = true, Q7CheckedValue;\n var Q7 = new Array();\n var j = 0;\n var valobj = document.getElementById(sender.id);\n\n for (var i = 0; i < inputobjs.length - 1; i++) {\n //for Q3_1\n if (inputobjs[i].id.indexOf(\"RadioBtnQ3_0\") >= 0) {\n Q3_1 = inputobjs[i];\n }\n //for Q3_2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ3_1\") >= 0) {\n Q3_2 = inputobjs[i];\n }\n\n //for school type\n if (inputobjs[i].id.indexOf(\"RadioBtnQ7\") >= 0) {\n Q7[j] = inputobjs[i];\n j = j + 1;\n }\n\n if (inputobjs[i].id.indexOf(\"txtCamperSchool\") >= 0)\n Q8 = inputobjs[i];\n\n\n } //end of for loop \n\n // \n //to get the select objects (ddlgrade) for Q6\n for (var k = 0; k <= selectobjs.length - 1; k++) {\n if (selectobjs[k].id.indexOf(\"ddlGrade\") >= 0) {\n Q6 = selectobjs[k];\n break;\n }\n }\n\n //validate Q3\n if (Q3_1.checked == false && Q3_2.checked == false) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 1</li></ul>\";\n args.IsValid = false;\n return;\n //bValid = false;\n }\n //For Synagogue and JCC Question\n if (Q3_1.checked == true || Q3_2.checked == true) {\n var returnVal = ValidateSynagogueAndJCCQuestion(inputobjs, selectobjs, valobj, false);\n if (returnVal == false) {\n args.IsValid = false;\n return;\n }\n }\n\n //validate Q6\n if (Q6.selectedIndex == 0) {\n valobj.innerHTML = \"<ul><li>Please select a Grade</li></ul>\";\n args.IsValid = false;\n return;\n }\n else {\n //validate Q7\n var bChecked = false;\n\n for (var k = 0; k <= Q7.length - 1; k++) {\n if (Q7[k].checked == true) {\n Q7CheckedValue = Q7[k].value;\n bChecked = true;\n break;\n }\n }\n\n if (!bChecked) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 4</li></ul>\";\n args.IsValid = false;\n return;\n }\n else if (Q7CheckedValue != \"3\" && trim(Q8.value) == \"\") //validate Q8 (if it is not home school)\n {\n valobj.innerHTML = \"<ul><li>Please enter Name of the School</li></ul>\";\n args.IsValid = false;\n return;\n }\n }\n args.IsValid = true;\n return;\n}", "title": "" }, { "docid": "fef52f2a7ba7c87f2dad457398d4c9c6", "score": "0.6206904", "text": "function validateForm() {\n /*Assigns the values of each input based on the name that links each individual set of inputs into variables*/\n var formValidation1 = document.forms[\"myForm\"][\"size\"].value;\n var formValidation2 = document.forms[\"myForm\"][\"color\"].value;\n var formValidation3 = document.forms[\"myForm\"][\"style\"].value;\n var formValidation4 = document.forms[\"myForm\"][\"amount\"].value;\n /*If loop checks to see if any of the inputs are empty when submit button is clicked*/\n if (formValidation1 == \"\" || formValidation2 == \"\" || formValidation3 == \"\" || formValidation4 == \"\") {\n /*Induce an alert message if one of the inputs are empty*/\n alert(\"All fields must be filled before submission\");\n /*Return false*/\n return false;\n } else {\n /*Return true */\n return true;\n }\n }", "title": "" }, { "docid": "21aa90f2328ce7817ccb1e10c32ee530", "score": "0.62055033", "text": "function ValidatePage2Step2_JCCRanch(sender, args) {\n var inputobjs = document.getElementsByTagName(\"input\");\n var selectobjs = document.getElementsByTagName(\"select\");\n var Q5, Q7, bValid = true, Q2CheckedValue, Q3CheckedValue, Q4CheckedValue, Q6CheckedValue;\n var Q2 = new Array();\n var Q3 = new Array();\n var Q4 = new Array();\n var Q6 = new Array();\n var j = 0;\n var k = 0;\n var l = 0;\n var m = 0;\n var valobj = document.getElementById(sender.id);\n\n for (var i = 0; i < inputobjs.length - 1; i++) {\n //for Q2\n if (inputobjs[i].id.indexOf(\"RadioBtnQ2\") >= 0)\n { Q2[j] = inputobjs[i]; j = j + 1; }\n //for Q3\n if (inputobjs[i].id.indexOf(\"RadioBtnQ3\") >= 0)\n { Q3[k] = inputobjs[i]; k = k + 1; }\n //for Q4\n if (inputobjs[i].id.indexOf(\"RadioBtnQ4\") >= 0)\n { Q4[l] = inputobjs[i]; l = l + 1; }\n //for Q6\n if (inputobjs[i].id.indexOf(\"RadioButtionQ6\") >= 0) {\n Q6[m] = inputobjs[i];\n m = m + 1;\n }\n //for Q7\n if (inputobjs[i].id.indexOf(\"txtCamperSchool\") >= 0)\n Q7 = inputobjs[i];\n } //end of for loop\n //to get the select objects (ddlgrade) for Q4\n for (var k = 0; k <= selectobjs.length - 1; k++) {\n if (selectobjs[k].id.indexOf(\"ddlGrade\") >= 0) {\n Q5 = selectobjs[k];\n break;\n }\n }\n\n //validate Q2\n //validate Q6\n var bQ2Checked = false;\n var bQ3Checked = false;\n var bQ4Checked = false;\n var bQ6Checked = false;\n for (var k = 0; k <= Q2.length - 1; k++) {\n if (Q2[k].checked == true) {\n Q2CheckedValue = Q2[k].value;\n bQ2Checked = true;\n break;\n }\n }\n for (var k = 0; k <= Q3.length - 1; k++) {\n if (Q3[k].checked == true) {\n Q3CheckedValue = Q3[k].value;\n bQ3Checked = true;\n break;\n }\n }\n for (var k = 0; k <= Q4.length - 1; k++) {\n if (Q4[k].checked == true) {\n Q4CheckedValue = Q4[k].value;\n bQ4Checked = true;\n break;\n }\n }\n\n for (var k = 0; k <= Q6.length - 1; k++) {\n if (Q6[k].checked == true) {\n Q6CheckedValue = Q6[k].value;\n bQ6Checked = true;\n break;\n }\n }\n if (!bQ2Checked) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 1</li></ul>\";\n bValid = false;\n }\n else if (Q2CheckedValue == \"2\") {\n //validate Q3 \n if (!bQ3Checked) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 2</li></ul>\";\n bValid = false;\n }\n else if (Q3CheckedValue == \"1\") {\n //validate Q4 \n if (!bQ4Checked) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 3</li></ul>\";\n bValid = false;\n }\n }\n }\n //validate Q5\n if (Q5.selectedIndex == 0 && bValid) {\n valobj.innerHTML = \"<ul><li>Please select a Grade</li></ul>\";\n bValid = false;\n }\n\n //validate Q6\n if (!bQ6Checked && bValid) {\n valobj.innerHTML = \"<ul><li>Please answer Question No. 5</li></ul>\";\n bValid = false;\n }\n else if (Q6CheckedValue != \"3\" && trim(Q7.value) == \"\")//validate Q7(if it is not home school)\n {\n valobj.innerHTML = \"<ul><li>Please enter Name of the School</li></ul>\";\n bValid = false;\n }\n args.IsValid = bValid;\n return;\n}", "title": "" }, { "docid": "7cf37f1485e70c1b72ba2619f67168d0", "score": "0.6204903", "text": "function fnMandatoryCheck(objControlId, objControlName)\r\r\n{\r\r\n for(var iCount = 0; iCount<objControlId.length; iCount ++ )\r\r\n {\r\r\n\tvar objControl = eval(objControlId[iCount]);\r\r\n\tif(objControl.value == \"\")\r\r\n\t{\r\r\n\t alert(objControlName[iCount]+\" cannot be empty \");\r\r\n\t objControl.focus();\r\r\n\t return false;\r\r\n\t break;\r\r\n \t}\r\r\n }\r\r\n return true;\r\r\n}", "title": "" }, { "docid": "0040802eb053d7677cb87dbe5735eb58", "score": "0.6199557", "text": "function validateStudentForm() {\n var first = document.getElementById(\"first-name\").value;\n var last = document.getElementById(\"last-name\").value;\n var birth = document.getElementById(\"birth-date\").value;\n var tuition = document.getElementById(\"tuition-fees\").value;\n if ((first == \"\" || first == null) || (last == \"\" || last == null)\n || (birth == \"\" || birth == null) || (tuition == \"\" || tuition == null)) { \n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "04e5ebb181e0a3a00e15c65bd9d600b6", "score": "0.61968136", "text": "function apProfilesRadioFormValidate(frmId) {\n\n var txtFieldIdArr = new Array();\n\n /* radio */\n txtFieldIdArr[0] = \"tf1_radioRTSThreshold,Please enter valid RTS Threshold\";\n txtFieldIdArr[1] = \"tf1_radioLoadValue,Please enter valid Load Balancing\";\n txtFieldIdArr[2] = \"tf1_radioMaxClients,Please enter valid Maximum Clients\";\n txtFieldIdArr[3] = \"tf1_radioDTIMPeriod,Please enter valid DTIM Period\";\n txtFieldIdArr[4] = \"tf1_radioBeaconInterval,Please enter valid Beacon Interval\";\n txtFieldIdArr[5] = \"tf1_radioInitialPower,Please enter valid Initial Power\";\n txtFieldIdArr[6] = \"tf1_radioRFScanInterval,Please enter valid RF Scan Interval\";\n txtFieldIdArr[7] = \"tf1_radioFragThreshold,Please enter valid Frag Threshold\";\n txtFieldIdArr[8] = \"tf1_radioRFScanDuration,Please enter valid RF Scan Duration\";\n txtFieldIdArr[9] = \"tf1_radioRateLimit,Please enter valid Rate Limit\";\n txtFieldIdArr[10] = \"tf1_radioRateLimitBurst,Please enter valid Rate Limit Burst\";\n txtFieldIdArr[11] = \"tf1_radioMinimumPower,Please enter valid Minimum Power\";\n \n\n if (txtFieldArrayCheck(txtFieldIdArr) == false)\n return false;\n \n if (isProblemCharArrayCheck(txtFieldIdArr, \"'\\\" \", NOT_SUPPORTED) == false) \n return false; \n \n if (numericValueRangeCheck(document.getElementById('tf1_radioRTSThreshold'), '', '', 0, 2347, true, 'Invalid RTS Threshold.', 'Bytes') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioLoadValue'), '', '', 1, 100, true, 'Invalid Load Balancing.', '%') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioMaxClients'), '', '', 0, 200, true, 'Invalid Maximum Clients.', '') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioDTIMPeriod'), '', '', 1, 255, true, 'Invalid DTIM Period.', 'Beacons') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioBeaconInterval'), '', '', 20, 2000, true, 'Invalid Beacon Interval.', 'M. Sec.') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioInitialPower'), '', '', 1, 100, true, 'Invalid Initial Power.', '%') == false)\n return false;\n if (numericValueRangeCheck(document.getElementById('tf1_radioMinimumPower'), '', '', 1, 100, true, 'Invalid Minimum Power.', '%') == false)\n return false;\n\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioRFScanInterval'), '', '', 30, 120, true, 'Invalid RF Scan Interval.', 'secs') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioFragThreshold'), '', '', 256, 2346, true, 'Invalid Frag Threshold.', 'bytes') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioRFScanDuration'), '', '', 10, 2000, true, 'Invalid RF Scan Duration.', 'M. Sec.') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioRateLimit'), '', '', 1, 50, true, 'Invalid Rate Limit.', 'pkts/sec') == false)\n return false;\n\n if (numericValueRangeCheck(document.getElementById('tf1_radioRateLimitBurst'), '', '', 1, 75, true, 'Invalid Rate Limit Burst.', 'pkts/sec') == false)\n return false;\n\n if ($(\"#tf1_radioAutomaticChannel\").attr(\"class\") == \"enable-disable-on\"){\n if( document.getElementById('tf1_autoEligibleChannel20').selectedIndex == -1)\n {\n alert(\"Error! 'Automatic Channel' requires selection of atleast one channel from supported channels list.\");\n return false;\n }\n }\n\n if( document.getElementById('tf1_basicRateSetChannel20').selectedIndex == -1)\n {\n alert(\"Invalid Input! setting basic rates to default selection.\");\n return false;\n }\n\n if( document.getElementById('tf1_supportedRateSetChannel20').selectedIndex == -1)\n {\n alert(\"Invalid Input! setting support rates to default selection.\");\n return false;\n }\n \n setHiddenChks(frmId);\n return true;\n}", "title": "" }, { "docid": "1c5c8617b5e9406dc8f6ba6d2cba1e53", "score": "0.6196772", "text": "function validateRadioStatus(frm) {\n\tvar msg=new Array(2);\n\tvar msgCnt = 0;\n\tvar rdVal1=0;\n\tvar elements = frm.elements;\n\tvar elementsLength = elements.length;\t\t\t\t\n\tfor (var i = 0; i < elementsLength; i++) {\n\t\tif (elements[i].type == \"radio\") {\n\t\t\tif (elements[i].checked) \t\t\t\t\t\t\n\t\t\t\trdVal1=elements[i].value;\n\t\t}\n\t}\n\t\tif (rdVal1<=0) {\n\t\t\talert(\"Please select atleast one Record\");\n\t\t\treturn false;\n\t\t}\t\t\t\t\n\t\treturn rdVal1;\n}", "title": "" }, { "docid": "c5fff89dd89c04e6e38c8f87e5096cb6", "score": "0.6196239", "text": "function validarChecksProtei() {\n \n $(\"#recorrerCheckProtei > input\").each(function(){\n\n if($(this).val() == 1) {\n\n $(this).attr('checked');\n\n }else{\n\n if ($(this).val() == 0) {\n\n $(this).removeAttr('checked');\n \n }\n }\n });\n\n}", "title": "" }, { "docid": "264fe34466f439971bb57bbb10a9195e", "score": "0.61952233", "text": "function validarChecksGrasas() {\n \n $(\"#recorrerCheckGrasas > input\").each(function(){\n\n if($(this).val() == 1) {\n\n $(this).attr('checked');\n\n }else{\n\n if ($(this).val() == 0) {\n\n $(this).removeAttr('checked');\n \n }\n }\n });\n\n}", "title": "" }, { "docid": "72717761bf8c03dadbf0b750c7c7061c", "score": "0.6193662", "text": "function formHasErrors()\n{\n\tvar errorFlag = false;\n\n var name = document.getElementById(\"firstname\");\n\n if(!formFieldHasInput(name)){\n document.getElementById(\"name_error\").style.display = \"block\";\n \n if(!errorFlag){\n name.focus();\n }\n errorFlag = true;\n }\n\n var phone = document.getElementById(\"phone\");\n\n if(!formFieldHasInput(phone)){\n document.getElementById(\"phone_error\").style.display = \"block\";\n \n if(!errorFlag){\n phone.focus();\n }\n errorFlag = true\n\n }\n else{\n \n var regexPhone = /^\\d{10}$/;\n \n if(!regexPhone.test(phone.value)){\n document.getElementById(\"phone_invalid\").style.display = \"block\";\n if(!errorFlag){\n phone.select();\n phone.focus();\n }\n errorFlag = true\n }\n }\n \n var email = document.getElementById(\"email\");\n\n\tif(!formFieldHasInput(email)){\n\t \tdocument.getElementById(\"email_error\").style.display = \"block\";\n\n\t \tif(!errorFlag){\n\t \t\temail.focus();\n\t \t}\n\t \terrorFlag = true;\n }\n\telse{\n\n\t var regexMail = new RegExp(/^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/); \n\n\t if(!regexMail.test(email.value)){\n\t \tdocument.getElementById(\"email_invalid\").style.display = \"block\";\n\n\t \tif(!errorFlag){\n\t \t\temail.focus();\n\t \t\temail.select();\n\t \t}\n\t \terrorFlag = true;\n\t }\n\t}\n\n\t var financeCheck = document.getElementById(\"box1\").checked;\n\t var fitnessCheck = document.getElementById(\"box2\").checked;\n var skillCheck = document.getElementById(\"box3\").checked;\n var otherCheck = document.getElementById(\"box4\").checked;\n var comments = document.getElementById(\"comments\");\n\n if(!financeCheck && !fitnessCheck && !skillCheck && !otherCheck){\n document.getElementById(\"check_error\").style.display = \"block\";\n\n\t\tif(!errorFlag){\n\t\t\tdocument.getElementById(\"box1\").focus();\n\t\t}\n\t\terrorFlag = true;\n }\n \n if(otherCheck && !formFieldHasInput(comments)){\n document.getElementById(\"comments_error\").style.display = \"block\";\n if(!errorFlag){\n\t\t\tcomments.focus();\n\t\t}\n\t\terrorFlag = true;\n }\n \treturn errorFlag;\n}", "title": "" }, { "docid": "9917cd49144162a257eef6fbd093fc57", "score": "0.6192655", "text": "function checkOtherSkills() {\n var otherSkillsTextField = document.getElementById(\"other-input\");\n var otherSkillsCheckbox = document.getElementById(\"other\").checked;\n\n if (otherSkillsCheckbox && otherSkillsTextField.value == \"\") {\n otherSkillsTextField.placeholder = \"Please enter your other skills.\";\n otherSkillsTextField.style.backgroundColor = \"#ffe6e6\";\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "d759c57126d396098748a57186fb7856", "score": "0.61875254", "text": "function checkEmptyFields() {\n var fields = document.getElementsByTagName(\"INPUT\");\n var empty = 0;\n for(var i = 0; i < fields.length; i++){\n if(fields[i].value == \"\"){\n var field_name = fields[i].name;\n var labels = document.getElementsByTagName(\"LABEL\");\n for(var j = 0; j < labels.length; j++)\n {\n if(labels[j].htmlFor == field_name)\n {\n labels[j].className += \" text-danger\";\n }\n }\n empty++;\n }\n }\n if(empty > 0)\n {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "43211315e5fc1d5b046c839dd4169260", "score": "0.6185504", "text": "function isCheckBoxChecked() {\r\n\tvar selected = false;\r\n\tvar ischeck1 = document.getElementById(\"cb1\").checked;\r\n var ischeck2 = document.getElementById(\"cb2\").checked;\r\n var ischeck3 = document.getElementById(\"cb3\").checked;\r\n \r\n if (ischeck1 || ischeck2 || ischeck3) {//if anyone is checked, it is ok!\r\n selected = true;\r\n }\r\n else {\r\n\t\tselected = false; //if not checked, feedback is given to answer Q3\r\n\t\tgErrorMsg = gErrorMsg + \"Please Answer Question 3\\n\"; \r\n }\r\n return selected;\r\n}", "title": "" }, { "docid": "77eb644666ae51ba3f58881274695eb3", "score": "0.61836374", "text": "function genderCheck(){\n var x = $(\"input[name='gender']:checked\").val();\n if(x==undefined){\n $('#generror').text(\"please select gender\");\n genflag= false;\n }\n else{\n $('#generror').text(\" \");\n genflag = true;\n }\n }", "title": "" }, { "docid": "924b5d24628fcfcb3f065a94cdc1d3d9", "score": "0.61814094", "text": "function formValidate() {\n var genderValue = document.getElementsByName(\"gender\");\n if( document.form.year.value == \"\" || document.form.year.value.length !=4){\n alert(`Please enter a valid year of birth! eg 1990`);\n document.form.year.focus();\n return false;\n }\n else if( document.form.month.value == \"\" || document.form.month.value <= 0 || document.form.month.value > 12){\n alert(`Please enter your month of birth! between 1 and 12`);\n document.form.month.focus();\n return false;\n }\n else if( document.form.date.value == \"\" || document.form.date.value <= 0 || document.form.date.value > 31) {\n alert(`Please enter a valid date that you were born in!`);\n document.form.day.focus();\n return false;\n }\n else if( genderValue[0].checked == false && genderValue[1].checked == false ) {\n alert(`You must select gender. Male or Female`);\n return false;\n } \n else{\n return true ;\n } \n}", "title": "" }, { "docid": "bf25779a7e029b012c6fa42030c700a8", "score": "0.6179431", "text": "function chksurveyradio()\n{\nvar buttons = document.survey.radio;\nfor (var i=0; i< buttons.length; i++) {\nif (buttons[i].checked)\n// break;\nreturn true;\n}\nif (i==buttons.length)\n alert(\"Please Select at least one!\");\n// alert(\"Radio Button \" + (i+1) + \" is checked.\");\nreturn false;\n}", "title": "" } ]
392f1ed1f7a4c7790e3f25907f0b848c
Parse ingredients and measurements for card, returns an unordered list with the ingredients and measurements
[ { "docid": "6f999205e2451b8ee1aba64d828feb0d", "score": "0.69928354", "text": "parseIngMeasure(drink) {\n\t\tlet listIngredients = [];\n\t\tlet listMeasures = [];\n\t\tfor (var ingredient in drink) {\n\t\t\tvar ingTemp = ingredient.split(\"strIngredient\");\n\t\t\tvar measureTemp = ingredient.split(\"strMeasure\");\n\t\t\t// Check if drinkIngredient is valid\n\t\t\tif (\n\t\t\t\tingTemp[0] === \"\" &&\n\t\t\t\tdrink[ingredient] != null &&\n\t\t\t\tdrink[ingredient] !== \"\"\n\t\t\t) {\n\t\t\t\tlistIngredients.push(drink[ingredient]);\n\t\t\t}\n\t\t\t// Check if the drink measurement is valid\n\t\t\tif (\n\t\t\t\tmeasureTemp[0] === \"\" &&\n\t\t\t\tdrink[ingredient] != null &&\n\t\t\t\tdrink[ingredient] !== \"\"\n\t\t\t) {\n\t\t\t\tlistMeasures.push(drink[ingredient]);\n\t\t\t}\n\t\t}\n\n\t\t// Combine ingredients and measurements into list items\n\t\tlet element = listIngredients.map((item, index) => {\n\t\t\treturn (\n\t\t\t\t<li key={index}>\n\t\t\t\t\t{item}: {listMeasures[index]}\n\t\t\t\t</li>\n\t\t\t);\n\t\t});\n\n\t\treturn <ul id=\"card-list\">{element}</ul>;\n\t}", "title": "" } ]
[ { "docid": "1e8f4d37c1da8fa274fba4d23c5d62f1", "score": "0.6321043", "text": "parseIngredients(ingredients) {\n return ingredients.map((ingredient) => ({\n quantity: this.parseAmount(\n ingredient.measures.metric.amount,\n ingredient.measures.metric.unitShort.toLowerCase()\n ),\n unit: this.parseUnit(ingredient.measures.metric.unitShort.toLowerCase()),\n ingredient: ingredient.name,\n aisle: ingredient.aisle,\n }));\n }", "title": "" }, { "docid": "8b15c71f25430ea612ac9bf56585d019", "score": "0.61444163", "text": "parseIngredirents() {\n\t\tconst unitLong = [\n\t\t\t'tablespoons',\n\t\t\t'tablespoon',\n\t\t\t'ounces',\n\t\t\t'ounce',\n\t\t\t'teaspoons',\n\t\t\t'teaspoon',\n\t\t\t'cups',\n\t\t\t'pound',\n\t\t];\n\t\tconst unitShort = [\n\t\t\t'tbsp',\n\t\t\t'tbsp',\n\t\t\t'oz',\n\t\t\t'oz',\n\t\t\t'tsp',\n\t\t\t'tsp',\n\t\t\t'cup',\n\t\t\t'pound',\n\t\t\t'oz,',\n\t\t];\n\n\t\tconst newingredients = this.ingredientList.map((el) => {\n\t\t\t//1) uniform units\n\t\t\t// grabs a raw ingredient and converts into lowercase. foreach loops through uniLong and replaces any word that it finds similar in raw ingredient to similar word in unitShort\n\t\t\tlet ingredient = el.toLowerCase();\n\t\t\tunitLong.forEach((unit, i) => {\n\t\t\t\tingredient = ingredient.replace(unit, unitShort[i]);\n\t\t\t});\n\t\t\t//console.log(ingredient);\n\t\t\t//2)remove brackets\n\t\t\tingredient = ingredient.replace(/ *\\([^)]*\\) */g, ' '); // this is a regEx which replaces parathesis\n\n\t\t\t//3) parse into units, counts and ingredienst\n\t\t\tconst arrIng = ingredient.split(' '); //this retruns an array with words of each ingredient\n\t\t\tconst unitIndex = arrIng.findIndex((el2) => unitShort.includes(el2)); // here the findIndex() returns the index of arrIng where the callback function turns out to be true\n\t\t\tlet objIng;\n\t\t\tif (unitIndex > -1) {\n\t\t\t\t//there is a unit\n\t\t\t\tconst arrCount = arrIng.slice(0, unitIndex); // 4 1/2 cups will give ['4', '1/2']\n\t\t\t\tlet count;\n\t\t\t\tif (arrCount.length === 1) {\n\t\t\t\t\tcount = eval(arrIng[0].replace('-', '+'));\n\t\t\t\t\tcount = Math.round(count * 100) / 100;\n\t\t\t\t} else {\n\t\t\t\t\tcount = eval(arrIng.slice(0, unitIndex).join('+'));\n\t\t\t\t\tcount = Math.round(count * 100) / 100;\n\t\t\t\t}\n\t\t\t\tobjIng = {\n\t\t\t\t\tcount,\n\t\t\t\t\tunit: arrIng[unitIndex],\n\t\t\t\t\tingredient: arrIng.slice(unitIndex + 1).join(' '),\n\t\t\t\t};\n\t\t\t} else if (parseInt(arrIng[0], 10)) {\n\t\t\t\t//no unit but, 1st element is a number\n\t\t\t\tobjIng = {\n\t\t\t\t\tcount: parseInt(arrIng[0], 10),\n\t\t\t\t\tunit: '',\n\t\t\t\t\tingredient: arrIng.slice(1).join(' '),\n\t\t\t\t};\n\t\t\t} else if (unitIndex === -1) {\n\t\t\t\t//there is no unit and no number in 1st position\n\t\t\t\tobjIng = {\n\t\t\t\t\tcount: 1,\n\t\t\t\t\tunit: '',\n\t\t\t\t\tingredient, //ws6 we can use object delclaration like this\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn objIng;\n\t\t});\n\t\tthis.ingredientList = newingredients;\n\t}", "title": "" }, { "docid": "1db094b139b5aae1980b3da6e1795108", "score": "0.6090025", "text": "parseIngredients() {\n const unitLong = [\n \"tablespoon\",\n \"tablespoons\",\n \"ounces\",\n \"ounce\",\n \"teaspoons\",\n \"teaspoon\",\n \"cups\",\n \"pounds\"\n ];\n const unitShort = [\n \"tbsp\",\n \"tbsp\",\n \"oz\",\n \"oz\",\n \"tsp\",\n \"tsp\",\n \"cup\",\n \"pound\"\n ];\n\n const newIngredients = this.ingredients.map(items => {\n let ingredient = items.toLowerCase();\n unitLong.forEach((element, index) => {\n ingredient = ingredient.replace(element, unitShort[index]);\n });\n\n ingredient = ingredient.replace(/[{()}]/g, \"\");\n\n const arrIng = ingredient.split(\" \");\n const unitIndex = arrIng.findIndex(element =>\n unitShort.includes(element)\n );\n\n let objIng;\n if (unitIndex > -1) {\n const arrayCount = arrIng.slice(0, unitIndex);\n\n let count;\n if (arrayCount.length === 1) {\n count = eval(arrayCount[0].replace(\"-\", \"+\"));\n } else {\n count = eval(arrayCount.slice([0], unitIndex).join(\"+\"));\n }\n\n objIng = {\n count,\n unit: arrIng[unitIndex],\n ingredient: arrIng.slice(unitIndex + 1).join(\" \")\n };\n } else if (parseInt(arrIng[0], 10)) {\n objIng = {\n count: parseInt(arrIng[0], 10),\n unit: \"\",\n ingredient: arrIng.slice(1).join(\" \")\n };\n } else if (unitIndex === -1) {\n objIng = {\n count: 1,\n unit: \"\",\n ingredient\n };\n }\n return objIng;\n });\n\n this.ingredients = newIngredients;\n }", "title": "" }, { "docid": "880301dd204d2bcf8714c05d74fb2234", "score": "0.608689", "text": "function renderMealCard(meal) {\n\n // Sets mealID and mealName to for the current meal's info\n mealID = meal.idMeal;\n mealName= meal.strMeal;\n\n // Sets the recipe title, image, and instructions to their proper elements\n $(\"#recipe-title\").text(meal.strMeal);\n\n $(\"#meal-image\").attr(\"src\", meal.strMealThumb);\n\n $(\"#recipe-instructions\").text(meal.strInstructions);\n\n //==============================================================================\n // This creates an array containing all of the ingredients with the respective measurements\n var ingredientArray = [];\n\n var ingredient = meal.strMeasure1.trim() + \" \" + meal.strIngredient1.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure2.trim() + \" \" + meal.strIngredient2.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure3.trim() + \" \" + meal.strIngredient3.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure4.trim() + \" \" + meal.strIngredient4.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure5.trim() + \" \" + meal.strIngredient5.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure6.trim() + \" \" + meal.strIngredient6.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure7.trim() + \" \" + meal.strIngredient7.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure8.trim() + \" \" + meal.strIngredient8.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure9.trim() + \" \" + meal.strIngredient9.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure10.trim() + \" \" + meal.strIngredient10.trim();\n\n ingredientArray.push(ingredient);\n\n ingredient = meal.strMeasure11.trim() + \" \" + meal.strIngredient11.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure12.trim() + \" \" + meal.strIngredient12.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure13.trim() + \" \" + meal.strIngredient13.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure14.trim() + \" \" + meal.strIngredient14.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure15.trim() + \" \" + meal.strIngredient15.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure16.trim() + \" \" + meal.strIngredient16.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure17.trim() + \" \" + meal.strIngredient17.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure18.trim() + \" \" + meal.strIngredient18.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure19.trim() + \" \" + meal.strIngredient19.trim();\n\n ingredientArray.push(ingredient);\n \n ingredient = meal.strMeasure20.trim() + \" \" + meal.strIngredient20.trim();\n\n ingredientArray.push(ingredient);\n //==============================================================================\n\n // Empties the ingredient list\n $(\"#ingredients-list\").empty();\n\n // Sets an index to be used for the ingredientArray\n var index = 0;\n\n // Instances an array which will be used later\n var ingredientEl = [];\n \n // A while-loop that checks whether there is an ingredient at index \n while (ingredientArray[index] != \" \") {\n\n // Sets the instanced variable from earlier to a new jQuery object\n ingredientEl = $(\"<li>\").addClass(\"list-group-item\");\n\n // Sets the text of the jQuery object to the ingredient at index\n ingredientEl.text(ingredientArray[index]);\n\n // Appends the jQuery object to the ingredient list\n $(\"#ingredients-list\").append(ingredientEl);\n\n // Increases index by 1\n index++;\n }\n\n // Sets the link into the source button\n $(\"#recipe-link-button\").attr(\"href\", meal.strSource);\n }", "title": "" }, { "docid": "5c285769c4a87740365dfb35f59fa269", "score": "0.5980854", "text": "parseIngredients() {\n const unitsLong = ['tablespoons', 'tablespoon', 'tbs', 'ounces', 'ounce', 'teaspoons', 'teaspoon', 'cups', 'pounds', 'cans', 'can', 'c'];\n const unitsShort = ['tbsp', 'tbsp', 'tbsp', 'oz', 'oz', 'tsp', 'tsp', 'cup', 'pound', 'can', 'can', 'c'];\n\n const newIngredients = this.ingredients.map(el => {\n // el contains three parameters-> image, text, weight\n\n // 1) Make units uniform\n\n let ingredient = el.text.toLowerCase();\n\n unitsLong.forEach((unit, i) => {\n ingredient = ingredient.replace('.', '');\n ingredient = ingredient.replace(unit, unitsShort[i]);\n });\n \n // 2) Remove brackets\n ingredient = ingredient.replace(/[\\])}[{(]/g, ''); \n\n // 3) Parse ingredients into count, unit and ingredient \n const arrIng = ingredient.split(' ');\n const unitIndex = arrIng.findIndex(el2 => unitsShort.includes(el2));\n\n // make an object to store the count, unit and ingredients.\n let objIng;\n\n let count;\n if (unitIndex > -1) {\n // There is a unit\n // arrCount will contains the count before unit Index.\n // eg. 4 1/2 cups => arrCount = [4, 1/2] --> eval(\"4+1/2\")-> 4.5\n const arrCount = arrIng.slice(0, unitIndex);\n \n if (arrCount.length === 1) {\n if (arrCount[0].length > 1) {\n // There are some formats that are 1(joined)1/2, therefore, to deal with that we need to add this method. \n count = parseInt(arrIng[0], 10) + 0.5;\n } else {\n count = eval(arrIng[0].replace('-', '+'));\n }\n } else {\n // this evaluates the provided string with given option\n try {\n count = eval(arrIng.slice(0, unitIndex).join('+'));\n } catch(err) {\n count = 1;\n }\n }\n\n objIng = {\n count, \n unit: arrIng[unitIndex],\n ingredient: arrIng.slice(unitIndex+1).join(' '),\n weight: Math.ceil(el.weight)\n };\n } else if (parseInt(arrIng[0], 10)) {\n // There is no unit, but 1st element is number\n\n objIng = {\n count: parseInt(arrIng[0], 10),\n unit: '',\n // remove the first element and join rest of ingredients.\n ingredient: arrIng.slice(1).join(' '),\n weight: Math.ceil(el.weight)\n }\n } else if (unitIndex === -1) {\n objIng = {\n count: 1,\n unit: '',\n // ingredient: ingredient\n // or just\n ingredient,\n weight: Math.ceil(el.weight)\n }\n }\n\n return objIng;\n });\n\n this.ingredients = newIngredients;\n }", "title": "" }, { "docid": "fb7ff7a6450f6cd4c80e49b3383a3ce1", "score": "0.5918026", "text": "displayIngredients(drink) {\n // console.log(drink);\n\n let ingredients = [];\n for (let i = 1; i < 16; i++) {\n const ingredientMeasure = {}\n if(drink[`strIngredient${i}`] !== '') {\n ingredientMeasure.ingredient = drink[`strIngredient${i}`]\n ingredientMeasure.measure = drink[`strMeasure${i}`]\n ingredients.push(ingredientMeasure)\n\n } \n }\n\n \n // console.log(ingredients);\n\n // Build the Template\n\n let ingredientTemplate = '';\n ingredients.forEach( ingredient => {\n ingredientTemplate += `\n\n <li class=\"list-group-item\"> \n ${ingredient.ingredient} - ${ingredient.measure}\n </li>\n `;\n })\n\n \n return ingredientTemplate\n \n }", "title": "" }, { "docid": "a9ccd260d8aba266eae9eb35f6b10d53", "score": "0.5849924", "text": "function buildDisplayOfIngredients(recipe) {\n var ingredients = \"<ul>\";\n //boucle\n for (let i = 0; i < recipe.ingredients.length; i++) {\n ingredients +=\n \"<li> <span class='nameIngredient'> \" +\n recipe.ingredients[i].ingredient +\n `</span>`; // ajout quantity\n if (recipe.ingredients[i].quantity) {\n ingredients += \":\" + \" \" + recipe.ingredients[i].quantity;\n }\n //ajout de unit\n if (recipe.ingredients[i].unit) {\n ingredients += \" \" + recipe.ingredients[i].unit;\n }\n ingredients += \"</li>\";\n }\n ingredients += \"</ul>\";\n\n return ingredients;\n}", "title": "" }, { "docid": "5034f2193b23752da519c62fede07d0b", "score": "0.5759336", "text": "function extractFlavors() {\n var flavors = document.getElementsByClassName(\"flavor\");\n var objects = [];\n for (var i = 0; i <= flavors.length - 1; i++) {\n var flavorObject = {}\n var descriptionTag = flavors[i].getElementsByClassName(\"description\")[0];\n\n flavorObject.element = flavors[i];\n flavorObject.name = descriptionTag.children[0].textContent;\n flavorObject.description = descriptionTag.children[1].textContent;\n\n var priceTag = flavors[i].getElementsByClassName(\"price\")[0];\n var priceasstring = priceTag.textContent.substring(1);\n flavorObject.price = parseFloat(priceasstring); //parsefloat is the same as +before the string\n \n var metaTag = flavors[i].getElementsByClassName(\"meta\")[0];\n flavorObject.quantity = +metaTag.children[0].textContent;\n objects.push(flavorObject);\n };\n return objects;\n }", "title": "" }, { "docid": "a7fecd7f4b7cf2bd162acf33f7d2c829", "score": "0.5726621", "text": "function ingredient_parser(ingredients, amounts) {\n\tvar ingredientNames = ingredients.split(',');\n\tvar ingredientAmounts = amounts.split(',');\n\tvar ingredients = {}; \n\tfor(var index = 0; index < ingredientNames.length; index++)\n\t\tingredients[ingredientNames[index]] = ingredientAmounts[index];\n\n\t//return [ingredientNames, ingredientAmounts];\n\treturn [ingredientNames, ingredients]\n}", "title": "" }, { "docid": "866af639672236855fc027ea0b72f3c2", "score": "0.5720309", "text": "function retrieveCardInfo(stringList) {\n var distanceBetweenDescripAndSet = 4;\n var wordsByLine = stringList.split('\\n');\n var cardsArray = [];\n for (var i = 0; i < wordsByLine.length; i++) {\n var titleStart = wordsByLine[i].indexOf('<b>') + 3;\n var titleEnd = wordsByLine[i].indexOf('</b>');\n if (titleStart >= 0 && titleEnd >= titleStart) {\n var strTitle = wordsByLine[i].slice(titleStart, titleEnd);\n var descripStart = titleEnd + 7; //distance between end of title and start of description\n var descripEnd = wordsByLine[i].indexOf('<u>') - 1;\n if (descripEnd >= 0) {\n var strDescrip = wordsByLine[i].slice(descripStart, descripEnd);\n var setStart = descripEnd + distanceBetweenDescripAndSet;\n var setEnd = wordsByLine[i].indexOf('</u>');\n if (setEnd >= 0) {\n var strSet = wordsByLine[i].slice(setStart, setEnd);\n cardsArray.push({title: strTitle, descrip: strDescrip, set: strSet});\n }\n }\n }\n }\n return cardsArray;\n}", "title": "" }, { "docid": "6f6fe6d417986f86ee97c5df6a23d5dd", "score": "0.5693934", "text": "function extractIngredients(data) {\n let ingredients = [];\n let idx = 1;\n let ingredientsNotFound = true;\n\n while (ingredientsNotFound) {\n if (data[`strIngredient${idx}`] != null) {\n ingredients.push({ ingredient: data[`strIngredient${idx}`], measure: data[`strMeasure${idx}`] });\n idx++;\n } else {\n ingredientsNotFound = false;\n }\n }\n\n return ingredients;\n}", "title": "" }, { "docid": "3c63f6305bcf7c5011a23e4d94405acd", "score": "0.5638046", "text": "dynamicRecipeDetails() {\n\t\tlet targetRecipe = this.getRecipeDetails();\n\t\tlet ingredients = this.ingredientDetails(targetRecipe);\n\t\tlet ingredientsFormatted = ingredients.map((items, index) => <div key={index}><div>{items}</div></div>)\n\n\t\tlet instruction = this.instructionDetails(targetRecipe);\n\t\tlet instructionFormatted = instruction.map((steps, index) => <div key={index}><div>{steps}</div></div>)\n\t\t\n\t\treturn(\n\t\t<div>\n\t\t<div className=\"ingredients-title\">Ingredients</div>\n \t<div className=\"ingredient-container\">{ingredientsFormatted}</div>\n \t<div className=\"content-divider\"></div>\n \t<div className=\"recipe-container\">{instructionFormatted}</div>\n\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "8cd0f0a58528560d9e3dd3ae3be93bce", "score": "0.5551052", "text": "function parsePokedex($container, pokedex) {\n // Begin the unordered list\n var $ul = $('<ul class=\"list list-inline\">');\n\n // Loop over this for every pokemon\n for (var pokemon in pokedex) {\n var $li = $('<li class=\"pokemon-card\">'); // Start the item for the pokemon\n // Print the name of the pokemon as a H1 class name\n $li.append('<h3 class=\"name\"><span class=\"name\">' + pokemon + '</span><small class=\"id\"> #' + pokedex[pokemon][\"num\"] + '</small></h3>');\n // -- Abilities -- \n $li.append('<div class=\"ability-container\"><h4>Abilities</h4>' + (function(pokedex, pokemon) {\n var abilities = [];\n for (var ability in pokedex[pokemon][\"abilities\"]) {\n if (ability == \"0\") {\n abilities.push('<span class=\"abilitiy\"> '+ pokedex[pokemon][\"abilities\"][ability] +'</span>');\n }\n if (ability == \"1\") {\n abilities.push('<span class=\"abilitiy\"> '+ pokedex[pokemon][\"abilities\"][ability] +'</span>');\n }\n if (ability == \"h\") {\n abilities.push('<span class=\"hidden-ability abilitiy\"> '+ pokedex[pokemon][\"abilities\"][ability] +'</span>');\n }\n }\n return abilities;})(pokedex, pokemon) + '</div>');\n // -- Abilities --\n \n // Print the types of the pokemon\n $li.append('<div class=\"types-container\"><h4>Type(s)</h4> <span class=\"types\">' + pokedex[pokemon][\"types\"].join(\", \") + \"</span></div>\");\n\n // -- Weaknesses --\n var superEffective = [];\n var ultraEffective = [];\n var kindaResistant = [];\n var ultraResistant = [];\n var immune = [];\n var content = '<h4>Effectivness</h4><div class=\"weakness-container\"><table class=\"table-bordered weakness-table\">';\n for (var i = 0; i < types.length; i++) {\n if (pokedex[pokemon][\"types\"][1]) {\n if (weaknesschart[pokedex[pokemon][\"types\"][0]][types[i]] == 3|| weaknesschart[pokedex[pokemon][\"types\"][1]][types[i]] == 3) {\n immune.push(types[i]);\n } else {\n var typeSum = weaknesschart[pokedex[pokemon][\"types\"][0]] [types[i]] + weaknesschart[pokedex[pokemon][\"types\"][1]][types[i]];\n }\n } else {\n if (weaknesschart[pokedex[pokemon][\"types\"][0]][types[i]] == 3) {\n immune.push(types[i]);\n } else {\n var typeSum = weaknesschart[pokedex[pokemon][\"types\"][0]][types[i]];\n }\n }\n if (typeSum == 1) {\n superEffective.push(types[i]);\n } else if (typeSum == -1) {\n kindaResistant.push(types[i]);\n } else if (typeSum == -2) {\n ultraResistant.push(types[i]);\n } else if (typeSum == 2) {\n ultraEffective.push(types[i]);\n }\n }\n content += '<tr><td> Super Weak </td> <td>' + ultraEffective.join(\", \") + \"</td></tr>\";\n content += '<tr><td> Weak </td> <td>' + superEffective.join(\", \") + \"</td></tr>\";\n content += '<tr><td> Resistant </td> <td>' + kindaResistant.join(\", \") + \"</td></tr>\";\n content += '<tr><td> Super Resistant </td> <td>' + ultraResistant.join(\", \") + \"</tr>\";\n content += '<tr><td> Immune </td> <td>' + immune.join(\", \") + \"</tr>\";\n content += \"</table></div>\";\n $li.append(content);\n // -- Weaknesses --\n\n // Egg groups\n $li.append('<div class=\"egg-container\"><h4> Egg Group(s)</h4> <span class=\"egg-groups\">' + pokedex[pokemon][\"egg groups\"].join(\", \") + \"</span>\");\n // Create some base stat bars\n $li.append('<table class=\"stat-container\"><tr><td>HP: </td><td style=\"width:20\">' + makeStatBar(pokedex[pokemon][\"base stats\"][\"hp\"], \"#FF5050\") + \"</td></tr>\"\n + '<tr><td>Attack: </td><td>' + makeStatBar(pokedex[pokemon][\"base stats\"][\"atk\"], \"#FF9933\") + \"</td></tr>\"\n + '<tr><td>Defence: </td><td>' + makeStatBar(pokedex[pokemon][\"base stats\"][\"def\"], \"#FFFF94\") + \"</td></tr>\"\n + '<tr><td>Sp. Atk: </td><td>' + makeStatBar(pokedex[pokemon][\"base stats\"][\"spa\"], \"#0099FF\") + \"</td></tr>\"\n + '<tr><td>Sp. Def: </td><td>' + makeStatBar(pokedex[pokemon][\"base stats\"][\"spd\"], \"#0033CC\") + \"</td></tr>\"\n + '<tr><td>Speed: </td><td>' + makeStatBar(pokedex[pokemon][\"base stats\"][\"spe\"], \"#00CC00\") + \"</td></tr></table>\");\n // Create some Gender Ratio Bars\n if (pokedex[pokemon][\"gender ratio\"]){\n // if they have a gender ratio value, create a bar filled with blue to the percent male, therefore leaving the rest pink\n $li.append('<div class=\"gender-container\"><h4>Gender</h4>' + makeGenderBar(pokedex[pokemon][\"gender ratio\"][\"m\"]*100, '#3399FF', '#FF99CC'));\n // If the pokemon has a gender value (and therefore is all one gender)\n } else if (pokedex[pokemon][\"gender\"]) {\n // If they are all male, make an all male bar\n if (pokedex[pokemon][\"gender\"] == \"m\") {\n $li.append('<div class=\"gender-container\"><h4>Gender</h4>' + makeGenderBar(100, '#3399FF', '#FF99CC')+ '</div>');\n // If they are all female, make an all female bar\n } else if (pokedex[pokemon][\"gender\"] == \"f\"){\n $li.append('<div class=\"gender-container\"><h4>Gender</h4>' + makeGenderBar(0, '#3399FF', '#FF99CC')+ '</div>');\n // If they dont have either then make a genderless bar\n } else {\n $li.append('<div class=\"gender-container\"><h4>Gender</h4>' + makeGenderBar()+ '</div>');\n }\n // If they dont have a gender or a gender ratio then they are 50/50, make a 50% male bar\n } else {\n $li.append('<div class=\"gender-container\"><h4>Gender</h4>' + makeGenderBar(50, '#3399FF', '#FF99CC')+ '</div>');\n }\n $ul.append($li); // Add the item to the list\n }\n $container.append($ul); // Add the list to the div\n}", "title": "" }, { "docid": "b7699ece4cd1c0bc34a0750503c92d2f", "score": "0.55337155", "text": "function buildRecipeCardHtml(recipe) {\n //arrondi un nmbre au hasard entre 0 et 1 * 1000\n var number = Math.floor(Math.random() * 1000);\n var sourceImg =\n \"https://source.unsplash.com/collection/4466406/480x480?sig=\" +\n number +\n \"&client_id=hXJZfm926ewJ7LxaoHzwVxiR7cyTnkdu3Vidn6Ojdew\";\n var timing = recipe.time;\n //appel de la fonction qui construit l'affichage des ingredients\n var ingredients = buildDisplayOfIngredients(recipe);\n\n var instruction = recipe.description;\n var titleRecette = recipe.name;\n var cardHtml =\n `<div class=\"card\" title =\"` +\n titleRecette +\n `\">\n<img class=\"card-img-top\" src=` +\n sourceImg +\n ` alt=\"Card image cap\">\n<div class=\"card-body\">\n <div class=\"firstPartieCard\"> \n <div class=\"recipesTitle\"> ` +\n titleRecette +\n `</div>\n <div class=\"timing\"> <i class=\"far fa-clock iconClock\"> </i> &nbsp; <div class=\"numberTiming\">` +\n timing +\n ` </div> <div class=\"minTiming\" > min </div></div>\n </div>\n <div class=\"secondPartieCard onePartieCard\">\n <div class=\"ingredients\">` +\n ingredients +\n `\n </div>\n <div class=\"instruction\">` +\n troncInstruction(instruction) +\n `</div>\n </div> \n</div>\n</div>\n`;\n return cardHtml;\n}", "title": "" }, { "docid": "a28ed84726458db8ebf4e37897cd6382", "score": "0.5517233", "text": "function RenderCards(props){\n const recipes = props.data;\n\n const cards = recipes.map(recipe =>{\n return <RecipeCard\n key={recipe.strMeal} \n data={recipe}\n getShoppingItems={props.getShoppingItems}\n shoppingItems={props.shoppingItems}\n />\n })\n\n return(\n <div>\n {cards}\n </div>\n )\n}", "title": "" }, { "docid": "d509b87099d1ce2d434d66f68ed40ab6", "score": "0.5505128", "text": "function getRecipes(x) {\n\n //Clears any previous content where the Recipes will be displayed\n $(\"#recipeList\").empty();\n $(\"#recipeList2\").empty();\n $(\"#recipeList3\").empty();\n\n //Assigns the response results to a variable to be used by the function\n var mealResults = x.hits;\n\n //Cycles through all the results to separate them into their own columns. \n for (i = 0; i < mealResults.length; i++) {\n if (i == 0 || i == 5) {\n var rCol = $(\"<div>\").addClass(\"col s2 offset-s1\");\n } else {\n var rCol = $(\"<div>\").addClass(\"col s2\");\n }\n //Adds a link to the Full Recipe on the image of the result\n var rImg = $(\"<img>\").attr(\"src\", mealResults[i].recipe.image);\n var linkUrl = mealResults[i].recipe.url;\n var rLink = $(\"<a>\").attr(\"href\", linkUrl).attr(\"target\", \"_blank\");\n (rLink).append(rImg);\n var imgDiv = $(\"<div>\").addClass(\"card-image\").append(rLink);\n\n //Creates the contents of the card. Preparing the Title of the Recipe and passing the ingredient list to the proper function before appending the resulting list.\n var rTitle = $(\"<div>\").addClass(\"card-title center pd10\").text(mealResults[i].recipe.label)\n var rIng = mealResults[i].recipe.ingredientLines;\n var rlist = ingredientList(rIng);\n var rCard = $(\"<div>\").addClass(\"card grey lighten-4 left\")\n \n //Appends each card with the Image, Title and Ingredient list before appending it to the proper column\n rCard.append(imgDiv, rTitle, rlist);\n rCol.append(rCard);\n\n //Separates the columns into groups of 5 for aesthetic purposes\n if (i <= 4) {\n $(\"#recipeList\").append(rCol);\n } else {\n $(\"#recipeList2\").append(rCol);\n }\n }\n }", "title": "" }, { "docid": "486b4f6f7930a10bba4c39635300cb93", "score": "0.549784", "text": "function displayRecipe(x) {\n\n var queryURL = \"https://api.yummly.com/v1/api/recipe/\" + x + \"?_app_id=32912019&_app_key=210449776997cc0adaf6fb150addc070\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n console.log(response)\n \n var imageDiv = $(\"<div>\");\n var nameDiv = $(\"<div>\");\n var ingredientsDiv = $(\"<div>\");\n var recipeDiv = $(\"<div>\");\n \n var name = $(\"<h2>\").text(response.name);\n var image = $(\"<img>\").attr(\"src\", response.images[\"0\"].hostedLargeUrl);\n var ingredients = $(\"<h4>\").text(response.ingredientLines);\n var recipe = $(\"<a>\").text(\"Full recipe\").addClass(\"link\").attr(\"link\", response.attribution.url);\n\n nameDiv.append(name);\n $(\".name\").append(nameDiv);\n imageDiv.append(image);\n $(\".image\").append(imageDiv);\n recipeDiv.append(recipe);\n $(\".recipe\").append(recipeDiv);\n\n var ingredients = $(\"<div>\");\n id = response.id;\n var ingredientString = response.ingredientLines;\n console.log(ingredientString);\n \n for(var i = 0; i < response.ingredientLines.length; i++) {\n var ingredient = $(\"<h5>\").text(\"- \" + response.ingredientLines[i]);\n ingredients.append(ingredient); \n }\n\n ingredientsDiv.append(ingredients);\n $(\".ingredients\").append(ingredientsDiv);\n\n var timeHeader = $(\"<h4>\").text(\"Time\");\n var time = $(\"<h5>\").text(response.totalTime);\n var courseHeader = $(\"<h4>\").text(\"Course\");\n var course = $(\"<h5>\").text(response.attributes.course[\"0\"]);\n var servingsHeader = $(\"<h4>\").text(\"Servings\");\n var servings = $(\"<h5>\").text(response.numberOfServings);\n var ratingHeader = $(\"<h4>\").text(\"Rating\");\n\n $(\".additional-info\").append(timeHeader , time, courseHeader, course, servingsHeader, servings, ratingHeader, rating);\n \n for (var i = 1; i < 6; i++){\n var rating = $(\"<i>\").addClass(\"material-icons \" + i).text(\"star_border\").attr(\"num\", i);\n $(\".additional-info\").append(rating);\n }\n for (var i = 1; i < response.rating + 1; i++) {\n $(\".\" + i).text(\"star\");\n }\n });\n }", "title": "" }, { "docid": "af9c783ba3e09a52757517fef3ea6d31", "score": "0.54971415", "text": "function parseIngredient(i) {\r\n\t/*\r\n\t * Notes for parsing:\r\n\t * If there is a comma or parenthesis, ignore what is after it\r\n\t * Ignore everything before and includeing first word that is not 0-9 or '.' or '/'\r\n\t * trim at end to remove whitespace\r\n\t * If there is an \"or\", remove word before, after, and including\r\n\t * Ignore up to and including words:\r\n\t *\t\t-chopped\r\n\t *\t\t-shredded\r\n\t *\t\t-sliced\r\n\t *\t\t-diced\r\n\t *\t\t-of\r\n\t *\t\t-ripe\r\n\t *\t\t-fresh\r\n\t *\t\t-cloves\r\n\t *\t\t-head\r\n\t *\t\t-ground\r\n\t *\t\t-pinch\r\n\t *\t\t-large\r\n\t *\t\t-small\r\n\t *\t\t-medium\r\n\t *\t\t-whole\r\n\t */\r\n\r\n var txt = i.replace(/(([0-9]|[ ]|[/]|[.])+)/,\"\"); //remove nuumbers, space, /, and .\r\n txt = txt.trim();\t//trim whitespce\r\n txt = txt.substr(txt.indexOf(\" \") + 1);\t//remove next word after (units of measurement)\r\n\r\n\t//remove before and after \"or\"\r\n txt = txt.replace(/[^ ]+ or [^ ]+/, \"\");\r\n\r\n //remove words and everything before them\r\n txt = txt.replace(/[^]*(chopped|shredded|sliced|diced|of|ripe|fresh|cloves|head|ground|pinch|large|small|medium|whole)+/, \"\");\r\n\r\n //remove everything after and including comma or parenthesis\r\n txt = txt.replace(/([,]|[(])[^]*/, \"\");\r\n\r\n return txt.trim();\r\n}", "title": "" }, { "docid": "b9228bed8cf902b40abe33e910d355f2", "score": "0.5484293", "text": "function fetchFoodRecipe() {\n\n\n const id = \"95bec68a\";\n const apikey = \"840cc0deadbcf75537491882e1c4d4f6\";\n\n fetch(`https://api.edamam.com/search?q=${inputFoods.value}&app_id=${id}&app_key=${apikey}`)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n\n\n\n for (i = 0; i < data.hits.length; i++) {\n document.querySelector('.card-columns').innerHTML += `<div class=\"card\">\n <div class=\"card-img\">\n <img src=\"${data.hits[i].recipe.image}\" style=\"width: 354px;height:250px;\" class=\"card-img-top img-fluid\" loading=\"lazy\" alt=\"\" target=\"_blank\">\n </div>\n <div class=\"card-body\">\n <div class=\"card-title\">\n <h5 class=\"font-weight-bolder text-center\">${data.hits[i].recipe.label} \\n</h5>\n <hr>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">${data.hits[i].recipe.ingredientLines}</li>\n \n </ul>\n <div class=\"card-body\" >\n <span>How to cook: </span> <a href=\"${data.hits[i].recipe.url}\" class=\"card-link\" target=\"_blank\">${data.hits[i].recipe.url}</a>\n </div>\n </div>\n </div>\n\n `;\n\n\n }\n })\n .catch(err => console.log(err));\n\n}", "title": "" }, { "docid": "a22d0fb656b703f62f4555b4e1b39e19", "score": "0.54498947", "text": "function fetchDrinkIngredients(drinkId, i) {\n var drinkIngrUrl = 'https://www.thecocktaildb.com/api/json/v1/1/lookup.php?i=' + drinkId;\n\n fetch(drinkIngrUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n // THese IF's are making sure that the ingredients for each drink do not come back null or undefined or esle we simply leave the space blank \n if (data.drinks[0].strIngredient1 !== null && data.drinks[0].strIngredient1 !== undefined) {\n var ingr1 = data.drinks[0].strIngredient1;\n } else {\n var ingr1 = '';\n }\n if (data.drinks[0].strIngredient2 !== null && data.drinks[0].strIngredient2 !== undefined) {\n var ingr2 = data.drinks[0].strIngredient2;\n } else {\n var ingr2 = '';\n }\n if (data.drinks[0].strIngredient3 !== null && data.drinks[0].strIngredient3 !== undefined) {\n var ingr3 = data.drinks[0].strIngredient3;\n } else {\n var ingr3 = '';\n }\n\n if (data.drinks[0].strIngredient4 !== null && data.drinks[0].strIngredient4 !== undefined) {\n var ingr4 = data.drinks[0].strIngredient4;\n } else {\n var ingr4 = '';\n }\n\n if (data.drinks[0].strIngredient5 !== null && data.drinks[0].strIngredient5 !== undefined) {\n var ingr5 = data.drinks[0].strIngredient5;\n } else {\n var ingr5 = '';\n }\n // This inserts the drink ingredients gathered above as innerHTML into the drinks card \n var drinkWrapper = document.getElementById('id-' + i);\n drinkWrapper.innerHTML =\n `<span>${ingr1} </span><br> <span>${ingr2} </span><br> <span>${ingr3} </span><br> <span>${ingr4} </span> <br> <span>${ingr5} </span>`\n })\n}", "title": "" }, { "docid": "aea91b986386fe8bad803fe9838596b3", "score": "0.5424782", "text": "function parseCard(card) {\n var parsedCard = {\n refresh: card[0],\n initiative: card[1],\n }\n\n if (card[2]) {\n parsedCard.line1 = {\n primaryOrSecondary: primaryOrSecondary(card[2].split(' ')[0]),\n content: card[2].split(' ').splice(1)\n }\n }\n if (card[3]) {\n parsedCard.line2 = {\n primaryOrSecondary: primaryOrSecondary(card[3].split(' ')[0]),\n content: card[3].split(' ').splice(1)\n }\n }\n if (card[4]) {\n parsedCard.line3 = {\n primaryOrSecondary: primaryOrSecondary(card[4].split(' ')[0]),\n content: card[4].split(' ').splice(1)\n }\n }\n if (card[5]) {\n parsedCard.line4 = {\n primaryOrSecondary: primaryOrSecondary(card[5].split(' ')[0]),\n content: card[5].split(' ').splice(1)\n }\n }\n return parsedCard;\n }", "title": "" }, { "docid": "b9e87bb8249fe46e0a80d6de91fdfa7c", "score": "0.54117084", "text": "function randomizeCard(inputsGiven) {\n var tempItem;\n var tempItemNum;\n var cardItemsList = [];\n var numDeletions = 1;\n // resets BINGOitemsList with inputs to create new card if no dataset is used\n if (inputsGiven) {\n BINGOitemsList = [];\n if (numItems == 4) {\n for (var x = 1; x <= 9; x++) {\n appendItem(BINGOitemsList, getText(\"listInput\" + x));\n if (getText(\"listInput\" + x) == \"\") {\n removeItem(BINGOitemsList, x - numDeletions);\n numDeletions ++;\n }\n }\n } else if (numItems == 5) {\n for (var g = 1; g <= 9; g++) {\n appendItem(BINGOitemsList, getText(\"listInput\" + g));\n }\n if (screenId == \"extraItemsScreen\") {\n for (g = 10; g <= 21; g++) {\n appendItem(BINGOitemsList, getText(\"input\" + g));\n if (getText(\"input\" + g) == \"\" && BINGOitemsList.length <= g) {\n removeItem(BINGOitemsList, g - numDeletions);\n numDeletions ++;\n }\n }\n }\n } else if ((numItems == 8 || numItems == 9)) {\n for (var h = 1; h <= 9; h++) {\n appendItem(BINGOitemsList, getText(\"listInput\" + h));\n }\n for (h = 10; h <= 16; h++) {\n appendItem(BINGOitemsList, getText(\"input\" + h));\n }\n if (screenId == \"extraItemsScreen\") {\n for (h = 17; h <= 21; h++) {\n appendItem(BINGOitemsList, getText(\"input\" + h));\n if (getText(\"input\" + h) == \"\" && BINGOitemsList.length <= h) {\n removeItem(BINGOitemsList, h - numDeletions);\n numDeletions ++;\n }\n }\n }\n } else if (numItems == 20) {\n for (var j = 1; j <= 9; j++) {\n appendItem(BINGOitemsList, getText(\"listInput\" + j));\n }\n for (j = 10; j <= 27; j++) {\n appendItem(BINGOitemsList, getText(\"input\" + j));\n }\n if (screenId == \"extraItemsScreen\") {\n for (j = 28; j <= 33; j++) {\n appendItem(BINGOitemsList, getText(\"input\" + j));\n if (getText(\"input\" + j) == \"\" && BINGOitemsList.length <= j) {\n removeItem(BINGOitemsList, j - numDeletions);\n numDeletions ++;\n }\n }\n }\n } else if (numItems >= 24) {\n for (var k = 1; k <= 9; k++) {\n appendItem(BINGOitemsList, getText(\"listInput\" + k));\n }\n for (k = 10; k <= 30; k++) {\n appendItem(BINGOitemsList, getText(\"input\" + k));\n }\n if (screenId == \"extraItemsScreen\") {\n for (k = 31; k <= 33; k++) {\n appendItem(BINGOitemsList, getText(\"input\" + k));\n if (getText(\"input\" + k) == \"\" && BINGOitemsList.length <= k) {\n removeItem(BINGOitemsList, k - numDeletions);\n numDeletions ++;\n }\n }\n }\n }\n }\n // fills cardItemsList just long enough to fill the card spaces\n for (var i = 0; i < numItems; i++) {\n tempItemNum = randomNumber(0, BINGOitemsList.length - 1);\n tempItem = BINGOitemsList[tempItemNum];\n appendItem(cardItemsList, tempItem);\n removeItem(BINGOitemsList, tempItemNum);\n }\n // outputs cardItemsList on the card\n if (numItems == 4) {\n // sets font size of non-free spaces\n setProperty(\"output1\", \"font-size\", 13);\n setProperty(\"output3\", \"font-size\", 13);\n setProperty(\"output7\", \"font-size\", 13);\n setProperty(\"output9\", \"font-size\", 13);\n // sets font size of free spaces\n setProperty(\"output2\", \"font-size\", 20);\n setProperty(\"output4\", \"font-size\", 20);\n setProperty(\"output5\", \"font-size\", 20);\n setProperty(\"output6\", \"font-size\", 20);\n setProperty(\"output8\", \"font-size\", 20);\n // fills out free spaces\n setText(\"output2\", \"FREE\");\n setText(\"output4\", \"FREE\");\n setText(\"output5\", \"FREE\");\n setText(\"output6\", \"FREE\");\n setText(\"output8\", \"FREE\");\n // fills out item spaces\n setText(\"output1\", cardItemsList[0]);\n setText(\"output3\", cardItemsList[1]);\n setText(\"output7\", cardItemsList[2]);\n setText(\"output9\", cardItemsList[3]);\n } else if (numItems == 5) {\n //sets font size of non-free spaces\n setProperty(\"output1\", \"font-size\", 13);\n setProperty(\"output3\", \"font-size\", 13);\n setProperty(\"output5\", \"font-size\", 13);\n setProperty(\"output7\", \"font-size\", 13);\n setProperty(\"output9\", \"font-size\", 13);\n // sets font size of free spaces\n setProperty(\"output2\", \"font-size\", 20);\n setProperty(\"output4\", \"font-size\", 20);\n setProperty(\"output6\", \"font-size\", 20);\n setProperty(\"output8\", \"font-size\", 20);\n // fills out free spaces\n setText(\"output2\", \"FREE\");\n setText(\"output4\", \"FREE\");\n setText(\"output6\", \"FREE\");\n setText(\"output8\", \"FREE\");\n // fills out item spaces\n setText(\"output1\", cardItemsList[0]);\n setText(\"output3\", cardItemsList[1]);\n setText(\"output5\", cardItemsList[2]);\n setText(\"output7\", cardItemsList[3]);\n setText(\"output9\", cardItemsList[4]);\n } else if (numItems == 8) {\n // sets font size of all spaces\n for (i = 1; i <= 9; i++) {\n setProperty(\"output\" + i, \"font-size\", 13);\n }\n // sets font size of free space\n setProperty(\"output5\", \"font-size\", 20);\n setText(\"output5\", \"FREE\");\n // fills out 3x3 grid before free square\n for (i = 1; i <= 4; i++) {\n setText(\"output\" + i, cardItemsList[i - 1]);\n }\n // fills out 3x3 grid after free square\n for (i = 6; i <= 9; i++) {\n setText(\"output\" + i, cardItemsList[i - 2]);\n }\n } else if (numItems == 9) {\n // fills out 3x3 grid\n for (i = 1; i <= 9; i++) {\n setProperty(\"output\" + i, \"font-size\", 13);\n }\n for (i = 1; i <= 9; i++) {\n setText(\"output\" + i, cardItemsList[i - 1]);\n }\n } else if (numItems == 20) {\n // sets font size of all spaces\n for (i = 1; i <= 25; i++) {\n setProperty(\"output2-\" + i, \"font-size\", 11);\n }\n // fills out free spaces\n setText(\"output2-1\", \"FREE\");\n setText(\"output2-5\", \"FREE\");\n setText(\"output2-13\", \"FREE\");\n setText(\"output2-21\", \"FREE\");\n setText(\"output2-25\", \"FREE\");\n // fills out first line of 5x5 grid\n for (i = 2; i <= 4; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 2)]);\n }\n // fills out second line of 5x5 grid\n for (i = 6; i <= 10; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 3)]);\n }\n // fills out third line of 5x5 grid\n for (i = 11; i <= 12; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 3)]);\n }\n for (i = 14; i <= 15; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 4)]);\n }\n // fills out fourth line of 5x5 grid\n for (i = 16; i <= 20; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 4)]);\n }\n // fills out fifth line of 5x5 grid\n for (i = 22; i <= 24; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 5)]);\n }\n } else if (numItems == 24) {\n // sets font size of all spaces\n for (i = 1; i <= 25; i++) {\n setProperty(\"output2-\" + i, \"font-size\", 11);\n }\n // fills out free space\n setText(\"output2-13\", \"FREE\");\n // fills out first and second lines of 5x5 grid\n for (i = 1; i <= 10; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 1)]);\n }\n // fills out first part of third line before free square of 5x5 grid\n for (i = 11; i <= 12; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 1)]);\n }\n // fills out second part of third line after free square of 5x5 grid\n for (i = 14; i <= 15; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 2)]);\n }\n // fills out fourth and fifth lines of 5x5 grid\n for (i = 16; i <= 25; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 3)]);\n }\n } else if (numItems == 25) {\n // sets font size of all spaces\n for (i = 1; i <= 25; i++) {\n setProperty(\"output2-\" + i, \"font-size\", 11);\n }\n // fills out all of 5x5 grid\n for (i = 1; i <= 25; i++) {\n setText(\"output2-\" + i, cardItemsList[(i - 1)]);\n }\n }\n}", "title": "" }, { "docid": "d88076d06c8cb4be831ee7abadead741", "score": "0.5402083", "text": "function renderDrinks() {\n var queryURL = \"https://www.thecocktaildb.com/api/json/v1/1/random.php\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n var drinkName = $(\"<h3>\")\n .text(response.drinks[0].strDrink)\n .appendTo(\"#nameAndPic\");\n var drinkImage = $(\"<img>\")\n .attr(\"src\", response.drinks[0].strDrinkThumb)\n .appendTo(\"#nameAndPic\");\n var ingSection = $(\"<h5>\")\n .text(\"Ingredients: \")\n .appendTo(\"#listOfIngredients\");\n\n var ingredients = [\n response.drinks[0].strIngredient1,\n response.drinks[0].strIngredient2,\n response.drinks[0].strIngredient3,\n response.drinks[0].strIngredient4,\n response.drinks[0].strIngredient5,\n response.drinks[0].strIngredient6,\n response.drinks[0].strIngredient7,\n response.drinks[0].strIngredient8,\n response.drinks[0].strIngredient9,\n response.drinks[0].strIngredient10,\n response.drinks[0].strIngredient11,\n response.drinks[0].strIngredient12,\n response.drinks[0].strIngredient13,\n response.drinks[0].strIngredient14,\n response.drinks[0].strIngredient15,\n ];\n\n var newArray = ingredients.filter(function (noNull) {\n return noNull != null;\n });\n\n var measurements = [\n response.drinks[0].strMeasure1,\n response.drinks[0].strMeasure2,\n response.drinks[0].strMeasure3,\n response.drinks[0].strMeasure4,\n response.drinks[0].strMeasure5,\n response.drinks[0].strMeasure6,\n response.drinks[0].strMeasure7,\n response.drinks[0].strMeasure8,\n response.drinks[0].strMeasure9,\n response.drinks[0].strMeasure10,\n response.drinks[0].strMeasure11,\n response.drinks[0].strMeasure12,\n response.drinks[0].strMeasure13,\n response.drinks[0].strMeasure14,\n response.drinks[0].strMeasure15,\n ];\n\n var measureArray = measurements.filter(function (noNull) {\n return noNull != null;\n });\n\n for (i = 0; i < newArray.length; i++) {\n var ingredientList = $(\"<ul>\").appendTo(\"#listOfIngredients\");\n var newIngredients = $(\"<li>\")\n .text(measureArray[i] + \": \" + newArray[i])\n .appendTo(ingredientList);\n }\n\n var insrSection = $(\"<h5>\").text(\"Instructions\").appendTo(\"#howTo\");\n var mix = $(\"<p>\")\n .text(response.drinks[0].strInstructions)\n .appendTo(\"#howTo\");\n });\n}", "title": "" }, { "docid": "0f95f78d9f006be0c54f7ee4a023840b", "score": "0.5398944", "text": "function cardParse(card) {\r\n\tvar name = card.find(\"athlete_name\").text();\r\n\tvar id = card.find(\"athlete_id\").text();\r\n\tvar gold = card.find(\"gold_num\").text();\r\n\tvar sport = card.find(\"sport\").text();\r\n\tvar country = card.find(\"country\").text();\r\n\tvar continent = card.find(\"continent\").text();\r\n\treturn (new Card(name, id, gold, sport, country, continent));\r\n}", "title": "" }, { "docid": "b2974600cfa9399d70b14d6d69692f93", "score": "0.5335041", "text": "function ingredientList(a) {\n\n //Creates a div where all the ingredients will go\n var recipeText = $(\"<div>\").addClass(\"fHeight\");\n\n //Runs through every ingredient in the array in order to separate them into their own line/paragraph\n for (var x = 0; x < a.length; x++) {\n var ingText = $(\"<p>\").text(a[x]);\n $(recipeText).append(ingText);\n }\n return recipeText;\n }", "title": "" }, { "docid": "ef9a699272a10f56e9d6c0f801b698d4", "score": "0.53202707", "text": "function getInstructions(num) {\n var drinkIngredients = \"https://www.thecocktaildb.com/api/json/v1/1/lookup.php?i=\" + num;\n $.ajax({\n url: drinkIngredients,\n method: \"GET\"\n }).then(function (data) {\n divArray = [];\n drinkArray = [];\n $(\"#container\").empty();\n $(\"#container2\").empty();\n console.log(data);\n var newerDiv = $(\"<div>\");\n newerDiv.attr(\"class\", \"grid-x align-center\")\n $(\"#container2\").append(newerDiv);\n var drinkInfoDiv = $(\"<div>\");\n drinkInfoDiv.attr(\"class\", \"medium-6 drink-info\");\n newerDiv.append(drinkInfoDiv);\n var secondDiv = $(\"<div>\");\n secondDiv.attr(\"class\", \"drink-name\");\n drinkInfoDiv.append(secondDiv);\n var newerImg = $(\"<img>\");\n newerImg.attr(\"src\", data.drinks[0].strDrinkThumb);\n newerImg.attr(\"class\", \"featured-drink\")\n secondDiv.append(newerImg);\n var newerH3 = $(\"<h3>\");\n newerH3.attr(\"class\", \"drinkName\");\n newerH3.text(data.drinks[0].strDrink);\n drinkInfoDiv.append(newerH3);\n var newH5 = $(\"<h5>\");\n newH5.text(\"Ingredients:\");\n drinkInfoDiv.append(newH5);\n var newUl = $(\"<ul>\");\n newUl.attr(\"class\", \"ingredients\");\n drinkInfoDiv.append(newUl);\n var newLi = $(\"<li>\");\n newLi.text(data.drinks[0].strIngredient1 + data.drinks[0].strMeasure1);\n newUl.append(newLi);\n for (var i = 2; i < 16; i++) {\n if (data.drinks[0][`strIngredient${i}`]) {\n var measure = \"\"\n if (data.drinks[0][`strMeasure${i}`]) {\n measure = data.drinks[0][`strMeasure${i}`]\n }\n var newLi = $(\"<li>\");\n newLi.text(data.drinks[0][`strIngredient${i}`] + \" \" + measure);\n newUl.append(newLi);\n }\n }\n var newerH5 = $(\"<h5>\");\n newerH5.text(\"Glass typically used:\");\n drinkInfoDiv.append(newerH5);\n var glassType = $(\"<ul>\");\n glassType.attr(\"class\", \"ingredients\");\n drinkInfoDiv.append(glassType);\n var glassLi = $(\"<li>\");\n glassLi.text(data.drinks[0].strGlass);\n glassType.append(glassLi);\n var instructionsH5 = $(\"<h5>\");\n instructionsH5.text(\"Instructions:\")\n drinkInfoDiv.append(instructionsH5);\n var detailedInstructions = $(\"<p>\");\n detailedInstructions.attr(\"class\", \"instructions\");\n detailedInstructions.text(data.drinks[0].strInstructions);\n drinkInfoDiv.append(detailedInstructions);\n\n\n });\n }", "title": "" }, { "docid": "6f19fb2f065e5f8a701f8587dc579b46", "score": "0.5315289", "text": "function getIngredients() {\n axios.get(informationBulk)\n .then(function (response) {\n ingredients = response.data;\n ingredients.forEach(element =>{\n allIngredients = element.extendedIngredients;\n allIngredients.forEach(element =>{\n //console.log(element.name);\n ingredientList.push(element.name);\n });\n });\n printAllIngredients();\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "d9371d9b2971761932c29238fc689809", "score": "0.5312095", "text": "parseContent() {\n // Create the pormise\n const API_BASE = \"http://localhost:4141/fn\"\n\n const readCardPromise = (name, data) => {\n const url = `${API_BASE}/card/${name}`\n return fetch(url, {\n method: 'post',\n body: (data),\n }).then(r => r.text())\n }\n\n var hashList = this.content.match(/[A-Za-z0-9]{46}/g)\n readCardPromise('cardRead', String(hashList)).then(result => {\n var cardContents = result.split(\"|\")\n var counter = 0\n var pos = 0\n var temp_tags = []\n var temp_contents = []\n\n this.content.replace(/{{\\w{46}}}/g,\n function(match, offset, s){\n // push the previous string\n if (offset !== 0) {\n temp_contents.push(s.substring(pos, offset))\n temp_tags.push('div')\n }\n\n // push the current string\n pos = offset + match.length\n console.log(\"Get the content of the card\" + cardContents[counter])\n temp_contents.push(cardContents[counter]);\n temp_tags.push(basiccard)\n\n counter++;\n\n return match;\n });\n\n this.contents = temp_contents\n this.tags = temp_tags;\n });\n }", "title": "" }, { "docid": "2df401e322bf5c8ccd08ef322c9d01db", "score": "0.53055334", "text": "createRecipeIngredients(ingredientsList) {\n let ingredientsDiv = document.createElement(\"ul\");\n ingredientsDiv.classList.add(\"ingredientDiv\");\n for (let ingredient of ingredientsList) {\n let itemLi = document.createElement(\"li\");\n itemLi.classList.add(\"ingredientLi\");\n ingredient = this.formatIngredients(ingredient);\n itemLi.innerHTML = ingredient;\n ingredientsDiv.appendChild(itemLi);\n }\n return ingredientsDiv;\n }", "title": "" }, { "docid": "3c5bdc6f32185d8aba43dd0b5d68acfe", "score": "0.5285923", "text": "function renderDessert(dessertPair) {\n var appId = \"1efc5cb5\";\n var appKey = \"b93713d669042a8117816b234a336ee5\";\n var dessertInput = dessertPair;\n var queryURL = `https://api.edamam.com/api/food-database/parser?ingr=${dessertInput}&app_id=${appId}&app_key=${appKey}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n })\n .then(function (res) {\n var $cardDiv = $(\"<div>\");\n var $cardImg = $(\"<div>\");\n var $cardContent = $(\"<div>\").addClass(\"card-content\");\n var label = $(\"<span>\").text(res.hints[0].food.label).addClass(\"activator\"); //add id later\n var imgURL = res.hints[0].food.image;\n var img = $(\"<img>\").attr(\"src\", imgURL);\n var icon = $(\"<i>\").addClass(\"material-icons right\").text(\"nutrition facts\");\n var cardReveal = $(\"<div>\").addClass(\"card-reveal\");\n var revealLabel = $(\"<span>\").addClass(\"card-title\");\n var revealIcon = $(\"<i>\").addClass(\"material-icons right\").text(\"close\");\n var nutritionInfo = $(\"<p>\").text(\"Nutritional Info:\");\n var nutritionCard = $(\"<div>\");\n\n var calories = res.hints[0].food.nutrients.ENERC_KAL;\n var protein = res.hints[0].food.nutrients.PROCNT;\n var fiber = res.hints[0].food.nutrients.FIBTG;\n var carbs = res.hints[0].food.nutrients.CHOCDF;\n var fats = res.hints[0].food.nutrients.FAT;\n\n\n $cardDiv.addClass(\"card\");\n console.log(imgURL);\n\n if (typeof imgURL === \"string\") {\n var $cardImg = $(\"<div>\");\n var imgURL = res.hints[0].food.image;\n var img = $(\"<img>\").attr(\"src\", imgURL);\n $cardDiv.append($cardImg);\n } else {\n var $cardImg = $(\"<div>\");\n var googleImg = $(\"<img>\");\n var googleLink = $('<a>');\n var googleDiv = $('<div>');\n var food = res.hints[0].food.label.split(' ').join('+');\n googleLink.text(\" See Google\");\n googleImg.attr(\"src\", \"./images/google-it.jpg\");\n googleLink.attr(\"href\", `https://www.google.com/search?q=${food}&rlz=1C1CHBF_enUS882US882&sxsrf=ALeKk02VMbJMBjEP2PYB65uMF5lnpXxx_A:1586523972450&source=lnms&tbm=isch&sa=X&ved=2ahUKEwihtbiu9t3oAhUHCc0KHZnmAw8Q_AUoAnoECA0QBA&biw=1920&bih=1089`);\n $cardImg.append(googleImg);\n $cardDiv.append($cardImg);\n googleDiv.append(googleLink);\n $cardContent.append(googleDiv);\n }\n\n $cardImg.addClass(\"card-image\");\n // Adds AOS animation to the card\n $cardDiv.attr(\"data-aos\", \"fade-left\");\n $cardDiv.attr(\"data-aos-offset\", \"300\");\n $cardDiv.attr(\"data-aos-duration\", \"1500\");\n label.attr(\"id\", \"card-name\"); \n\n img.addClass('activator');\n\n // Append divs to page\n label.append(icon);\n $cardDiv.append($cardImg);\n // $cardDiv.append($cardImg);\n $cardDiv.append($cardContent);\n $cardImg.append(img);\n $cardContent.append(label);\n $cardDiv.append(cardReveal);\n cardReveal.append(revealLabel);\n revealLabel.append(revealIcon);\n cardReveal.append(nutritionInfo);\n nutritionInfo.append(nutritionCard);\n nutritionCard.append(\"calories: \" + calories + \" KCAL, protein: \" + protein + \"g, fiber: \" + fiber + \"g, carbs: \" + carbs + \"g, \" + \"fats: \" + fats);\n $(\"#dessert-display\").append($cardDiv);\n })\n .catch(function () {\n console.log(\"Sorry no food for you!\");\n });\n }", "title": "" }, { "docid": "83b53a338a75a7ae71df20dc36b6a272", "score": "0.5268409", "text": "generateShoppingList() {\n return this.props.calendar.reduce( (meals,day) => {\n const { breakfast, lunch, dinner } = day.meals;\n\n // add meals (breakfast, lunch, dinner) to the meals array if not null\n breakfast && meals.push(breakfast);\n lunch && meals.push(lunch);\n dinner && meals.push(dinner);\n\n return meals;\n }, [])\n .reduce( (ingredients, meal) => {\n return ingredients.concat(meal.ingredientLines);\n }, []);\n }", "title": "" }, { "docid": "14f0dc1382c1c1fe9a1b69ba8c042029", "score": "0.5268372", "text": "function recipeLooker() {\n var recipe = $(\"#search-term\").val();\n console.log(recipe);\n console.log(\"hellooooo\");\n\n // var recipePlace = $('<div>');\n // Replace all spaces in food with %20 because API uses URL-Encode \n for (i = 0; i < recipe.length; i++) {\n if (recipe[i] === \" \") {\n console.log(\"hi\");\n recipe[i] = \"%20\";\n }\n }\n\n\n $.ajax({\n url: edamamLink + recipe + \"&app_id=\" + edamamId + \"&app_key=\" + edamamKey,\n method: \"GET\"\n })\n\n .then(function(response) {\n console.log(response);\n\n\n var recipes = response;\n\n // Double check if need to use closing tag stuff\n\n for (i = 0; i < 5; i++) {\n\n var singleRecipe = $('<div id=\"indivRecipe\" class=\"flip-card\" data-aos=\"fade-left\" data-aos-duration=\"2000\">');\n\n\n var singleRecipeHoldCards = $('<div class=\"flip-card-inner\">');\n var frontPic = $('<div class=\"flip-card-front\" style=\"width:75%\">');\n\n var backIngredients = $('<div class=\"flip-card-back\" style=\"width:75%\">');\n\n\n singleRecipeHoldCards.append(frontPic);\n singleRecipeHoldCards.append(backIngredients);\n singleRecipe.append(singleRecipeHoldCards);\n\n\n var imgElement = $('<img class=\"card-img-top\">');\n frontPic.append(imgElement);\n\n\n var name = $('<h3><strong>' + response.hits[i].recipe.label + '</strong></h3>');\n\n frontPic.append(name);\n frontPic.append('<p class=\"hover\"> Hover over to see ingredients and steps! </p>');\n var calories = $('<p>' + Math.round(response.hits[i].recipe.calories) + ' calories </p>');\n frontPic.append(calories);\n\n var instructions = response.hits[i].recipe.url;\n\n\n recipeImage = response.hits[i].recipe.image;\n imgElement.attr(\"src\", recipeImage);\n frontPic.append(imgElement);\n\n\n backIngredients.append('<h5>Ingredients</h5>');\n for (j = 0; j < response.hits[i].recipe.ingredientLines.length; j++) {\n var ingredients = $('<ul> <li>' + response.hits[i].recipe.ingredientLines[j] + '</li></ul>');\n backIngredients.append(ingredients);\n }\n\n var link = $('<a href=\"' + instructions + '\" class=\"btn btn-success\" style=\"width:70%;\">Steps</a>');\n link.attr(\"target\", \"_blank\");\n backIngredients.append(link);\n\n // singleRecipe.append('<h5>Nutritional Facts</h5>');\n // for(h = 0; h < 9; h++){\n // var nutrition = response.hits[i].recipe.digest[h].label;\n // singleRecipe.append('<ul><li>Total ' + nutrition + ' = ' + Math.round(response.hits[i].recipe.digest[h].total) + '</li>');\n // }\n\n // $(\"#indivRecipe\").html(response.data);\n // recipePlace.append(singleRecipe);\n singleRecipe.appendTo(\"#recepies-section\");\n }\n\n\n {\n /* <div class=\"card\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Card title</h5>\n <p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card's content.</p>\n <a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>\n </div>\n </div> */\n }\n\n\n\n\n\n\n })\n\n\n }", "title": "" }, { "docid": "289afd72ea51d7bfd0a949439522193f", "score": "0.52680486", "text": "function displayRecipesDetailedById()\n { \n for (var i = 0; i < nomRecipes.length; i++) { \n var recipe = nomRecipes[i];\n\n //prep the title \n var title = $(\"#recipeName\"); \n title.text(recipe.title);\n\n //prep the image\n var src = recipe.imageSrc;\n var img =$(\"#recipeImage\");\n img.addClass(\"imgRecipe\");\n img.attr(\"src\", src); \n\n //organize ingredients\n var ingredientsMain = $(\"#ingredients\");\n var ingredList = $(\"<ul>\"); \n ingredList.attr(\"id\", \"ingredList\");\n ingredientsMain.append(ingredList);\n\n //display ingredients\n var ingredients = \"\";\n var ingredientsList = recipe.ingredientsList;\n for (var i=0; i < ingredientsList.length; i++)\n {\n var ingredients = $(\"<li>\");\n ingredients.text(ingredientsList[i].name); \n ingredList.append(ingredients); \n } \n\n //organize and display recipe\n var recipeCard = $(\"#recipeName\");\n var instructionsList = recipe.instructionsList;\n\n //console.log(instructionsList);\n var instructionsP = $(\"#recipe_instructions\");\n var instructions = $(\"<ul>\");\n instructionsP.append(instructions); \n for (var i=0; i < instructionsList.length; i++)\n {\n var instructions = $(\"<li>\");\n instructions.text(instructionsList[i].step); \n instructionsP.append(instructions); \n } \n }\n }", "title": "" }, { "docid": "49af61f1ad2b3ba34b4e14b908869081", "score": "0.52378803", "text": "reduceCard(list, item) {\n let weather = item.weather[0];\n this.today = this.today.add(1, 'day');\n \n list.push(`\n <weather-card \n weather-type=\"${weather.main}\" \n description=\"${weather.description}\" \n icon=\"${weather.icon}\"\n temp-high=\"${item.temp.max}\"\n temp-low=\"${item.temp.min}\"\n humidity=\"${item.humidity}\"\n day-of-week=\"${formatDOW(this.today)}\">\n </weather-card>\n `);\n \n return list;\n }", "title": "" }, { "docid": "d199412c8e98d0954f14695bf0761d1c", "score": "0.5226667", "text": "function calculateIngredients(){\n\tvar num = $(\"input.button-question\").val();\n var unit = $(\"select#select-measurement\").val();\n var ingredient = $(\"input[name='radio-button']:checked\").val();\n\n // if we are on eggs, also set the unit to eggs\n if(ingredient === 'eggs') {\n \tunit = ingredient;\n }\n\n return [num, unit, ingredient];\n}", "title": "" }, { "docid": "f1373c7388616077561237a7b4f5d80e", "score": "0.5216156", "text": "function createMatchedRecipeCard(recipe, idAppend, div) {\n var id = recipe.name+'_id'+recipe.id+idAppend;\n var nameFormatted = formatForFrontend(recipe.name);\n console.log(div, id);\n $(div).append(\n '<div class=\"col-6 col-lg-4\">'+\n '<div class=\"card\">'+\n '<div id='+id+'>'+\n '<img class=\"card-img-top img-fluid\" src='+recipe.image+'>'+\n '<h6 class=\"card-title text-center mt-2\">'+nameFormatted+'</h6>'+\n '</div>'+\n '</div>'+\n '</div>'\n )\n var cuisineFormatted = formatForFrontend(recipe.cuisine);\n var mealsFormatted = mealString(recipe.breakfast, recipe.lunch, recipe.dinner);\n $(\"#recipe-full\").append(\n '<div id='+id+'_full>'+\n '<div class=\"row\">'+\n '<div class=\"col-sm-1 offset-sm-11\">'+\n '<img class=\"close-recipe mt-3\" src=\"img/cross.png\">'+\n '</div>'+\n '</div>'+\n '<div class=\"recipe-head text-center\">'+\n '<h1>'+nameFormatted+'</h1>'+\n '<p class=\"lead\">'+\n '</p>'+\n '<hr>'+\n '<div class=\"row\">'+\n '<div class=\"col-sm-3\"><p>Cuisine: '+cuisineFormatted+'</p></div>'+\n '<div class=\"col-sm-3\"><p>Meal: '+mealsFormatted+'</p></div>'+\n '<div class=\"col-sm-3\"><p>Time: '+recipe.time+' minutes</p></div>'+\n '<div class=\"col-sm-3\"><p>Calories: '+recipe.calories+'</p></div>'+\n '</div>'+\n '<hr>'+\n '<img class=\"img-fluid\" src='+recipe.image+' alt=\"\">'+\n '<hr>'+\n '</div>'+\n '<div class=\"row mt-4\" >'+\n '<div class=\"col-lg-6 pl-5\">'+\n '<div class=\"recipe-ingredients\">'+\n '<h4>Ingredients: </h4>'+\n '<ul id='+id+'_ingredients>'+\n\n '</ul>'+\n '</div>'+\n '</div>'+\n '<div class=\"col-lg-6\">'+\n '<div class=\"recipe-directions\">'+\n '<h4>Directions: </h4>'+\n '<ol id='+id+'_directions>'+\n\n '</ol>'+\n '</div>'+\n '</div>'+\n '</div>'+\n '</div>'\n )\n recipe.ingredientsList.forEach(function(line) {\n $('#'+id+'_ingredients').append('<li>'+line+'</li>');\n })\n recipe.directionsList.forEach(function(line) {\n $('#'+id+'_directions').append('<li>'+line+'</li>');\n })\n\n $('#'+id+'_full').css(\"display\", \"none\");\n\n $('#'+id+'_full .close-recipe').click(function() {\n $('#'+id+'_full').hide();\n $(\"#main-content\").show();\n console.log(\"on click close \"+div + \" with id \" +id);\n })\n $('#'+id).click(function() {\n $(\"#main-content\").hide();\n $('#'+id+'_full').show();\n console.log(\"on click open \"+div + \" with id \" +id);\n })\n}", "title": "" }, { "docid": "746b2c8f462a145f049e9ddaf9153cc7", "score": "0.52083844", "text": "function DrinkDetails({ details }) {\n const steps = [];\n if (details && details.ing1) {\n for (let i = 1; i < 16; i++) {\n const ing = details[\"ing\" + i];\n if (ing) {\n const measure = details[\"measure\" + i] || \"\";\n steps.push({ id: i, ing: ing, measure: measure });\n }\n }\n // console.log(steps);\n }\n\n return (\n <Container className=\"drinkDetails\">\n <Row id=\"drinkName\">\n <h3>{details.name}</h3>\n </Row>\n <Row id=\"favBtn\">\n <Favorite favDetails={details} />\n </Row>\n <Row>\n <Col id=\"drinkImage\">\n <img src={details.image} alt={details.name} />\n </Col>\n <Col id=\"drinkInt\">\n <Row>\n <p>{details.instructions}</p>\n </Row>\n <Row id=\"drinkIng\">\n <ol>\n {steps.map(({ id, ing, measure }) => {\n return (\n <li key={id}>\n <span>{ing}&nbsp;</span>\n <span>{measure}</span>\n </li>\n );\n })}\n </ol>\n </Row>\n </Col>\n </Row>\n </Container>\n );\n}", "title": "" }, { "docid": "adda1ef35d68c2dc289af22b9486ba72", "score": "0.5194425", "text": "function display(food) {\n document.getElementById(\"image\").src = food.image;\n document.getElementById(\"dishName\").innerText = food.name;\n document.getElementById(\"calories\").innerText = food.calories + \" calories per serving, \"+food.servings; \n document.getElementById(\"recipeBox\").innerHTML = food.recipeHTML;\n for (x=0;x<food.ingredients.length;x++) {\n $(\"#ingredientBox\").append(food.ingredients[x]+\"<br>\");\n }\n}", "title": "" }, { "docid": "89ac80ef08a2d787d42750b1ed078e12", "score": "0.5179794", "text": "function receiveRecipeValues() {\n var allIngredients = document.getElementsByName('ingredients');\n var ingredients = [];\n for (let i = 0, l = allIngredients.length; i<l; i++) {\n if(allIngredients[i].value !== \"\") {\n ingredients.push(allIngredients[i].value);\n }\n }\n\n var name = document.getElementById('name').value;\n var description = document.getElementById('description').value;\n var recipe = { name, ingredients, description };\n return recipe;\n}", "title": "" }, { "docid": "4ebf4a523d4bdc9f78a327f6007e89e6", "score": "0.5171475", "text": "getRecipes(session, args) {\n debugger;\n const meals = args.intent.entities; //[0].entity; ist zb \"tomatoe\";\n const mealName = [];\n meals.forEach(function (meal) {\n mealName.push(meal.entitiy);\n });\n const recipies = foodApi.getRecipesFromIngredients(mealName);\n var card = new Builder.ThumbnailCard(session)\n .title(recipies[0].name)\n .subtitle(recipies[0].ingredients)\n .text(recipies[0].description)\n .images([\n Builder.CardImage.create(session, 'https://i.pinimg.com/originals/e9/ac/62/e9ac624779305034569b6cfe4002679a.jpg')\n ])\n .buttons([\n Builder.CardAction.openUrl(session,recipies[0].url, 'see whole recipe')\n ]);\n // attach the card to the reply message\n var msg = new Builder.Message(session).addAttachment(card);\n session.send(msg);\n }", "title": "" }, { "docid": "54fa10789e10cdccf4c3d375837f4f80", "score": "0.5171328", "text": "function printIngredients(ingredients) {\n console.log(ingredients);\n let ingredient = $(\"<li>\");\n ingredient.html(ingredients);\n ingredientList.append(ingredient);\n}", "title": "" }, { "docid": "e25af43c61f99d047db24c25eff264f9", "score": "0.515909", "text": "ingredientsList(mineral) {\n if (!REAGENTS[mineral] || _.isEmpty(mineral)) {\n return [];\n }\n else {\n return this.ingredientsList(REAGENTS[mineral][0])\n .concat(this.ingredientsList(REAGENTS[mineral][1]), mineral);\n }\n }", "title": "" }, { "docid": "931d96485e8d61fddb95f7e8f5709686", "score": "0.5156183", "text": "getIngredientsDom(ingredients) {\n ingredients = ingredients instanceof Array ?\n ingredients : [ ingredients ];\n \n ingredients = ingredients.filter((v) => {\n return (v && typeof v === \"string\");\n });\n \n let list = [],\n cutoff = ingredients.length > 5 ?\n Math.ceil(ingredients.length / 2) : ingredients.length,\n timestamp = Date.now();\n \n for (let i=0, l=ingredients.length; i<l; ++i) {\n let ingredient = purify(ingredients[i], ALLOWED_HTML);\n \n list.push(\n <li\n key={`timestamp-${i}`}\n style={i === cutoff ? { breakBefore:\"column\" } : {}}\n dangerouslySetInnerHTML={{ __html: ingredient }}\n ></li>\n );\n }\n \n return list;\n }", "title": "" }, { "docid": "7be1db3c100c38ffc3c452e4747b199f", "score": "0.5152502", "text": "function sort_tags_to_import(entries) {\n var tags = [];\n var cards = [];\n for (let entry of entries) {\n entry = entry.split(\",\");\n entry = $.map(entry, $.trim);\n if (entry[0] == \"card\") {\n cards.push(entry);\n } else if (entry[0] == \"tag\") {\n tags.push(entry);\n }\n }\n tags.sort(function(a, b) {\n return a[1] - b[1];\n });\n return tags.concat(cards);\n}", "title": "" }, { "docid": "d4f1f246c9393a87e56036260acfbab6", "score": "0.51340806", "text": "function build_ingredients(line){\n line = line + \"\";\n line = line.split(\"\\n\");\n let data = {\"ingredients\":line};\n return data;\n }", "title": "" }, { "docid": "921263f8c33d121f486951160476803d", "score": "0.51337624", "text": "function foodParser(response) {\n //Meta data about the food item from the edamam database\n let values = {\n URI: response.uri,\n FOOD: response.ingredients[0].parsed[0].food,\n QUANTITY: response.ingredients[0].parsed[0].quantity,\n MEASURE: response.ingredients[0].parsed[0].measure,\n FOODID: response.ingredients[0].parsed[0].foodId,\n FOODURI: response.ingredients[0].parsed[0].foodURI,\n WEIGHT: response.ingredients[0].parsed[0].weight,\n RETAINED_WEIGHT: response.ingredients[0].parsed[0].weight,\n MEASURE_URI: response.ingredients[0].parsed[0].measureURI\n }\n //Adds nutrient info\n for (var nutrient in response.totalNutrients) {\n values[nutrient+\"_QUANTITY\"] = response.totalNutrients[nutrient].quantity\n values[nutrient+\"_UNIT\"] = response.totalNutrients[nutrient].unit\n }\n //Adds health labels\n response.healthLabels.forEach(label => {\n values[label] = true;\n })\n return insertFood(values);\n }", "title": "" }, { "docid": "87586375df6b5d8b9a5fb14f2b7c1001", "score": "0.509122", "text": "function ingredientContent (ingredientName, text) {\n const content = document.querySelectorAll('div.pdp-info-container div.info');\n // Check for length\n if (content && content.length > 1) {\n // Check for ingredientName\n if (ingredientName) {\n // Check for the content has text or not\n if (content[1].textContent) {\n if (content[1].textContent.includes(ingredientName)) {\n let calcium;\n // Check for calcium\n if (ingredientName.toLowerCase() === 'calcio') {\n // Check for the calcium with given text if it is present get the value and add it to DOM\n if (content[1].textContent.includes(text)) {\n calcium = content[1].textContent.replace(/(.+Calcio)\\s\\(([0-9.]+)\\s(\\w+\\/\\w+)(.+)/g, '$2');\n addElementToDocument('calcium', calcium);\n // If calcium has data get the unit\n if (calcium) {\n const calciumUnit = content[1].textContent.replace(/(.+Calcio)\\s\\(([0-9.]+)\\s(\\w+\\/\\w+)(.+)/g, '$3');\n addElementToDocument('calciumUnit', calciumUnit);\n }\n // if calcium didn't match with given text then get the calcium value and append to DOM\n } else {\n calcium = content[1].textContent.replace(/(.+Calcio)\\s(\\d+,\\d+)\\s(.*)/g, '$2');\n addElementToDocument('calcium', calcium);\n }\n // Check for sodium\n } else if (ingredientName.toLowerCase() === 'sodio') {\n // Check for the sodium with given text if it is present get the value and add it to DOM\n let sodium;\n if (content[1].textContent.includes(text)) {\n sodium = content[1].textContent.replace(/(.+Sodio)\\s\\(([0-9.]+)\\s(\\w+\\/\\w+)(.+)/g, '$2');\n addElementToDocument('sodium', sodium);\n // If sodium has data get the unit\n if (sodium) {\n const sodiumUnit = content[1].textContent.replace(/(.+Sodio)\\s\\(([0-9.]+)\\s(\\w+\\/\\w+)(.+)/g, '$3');\n addElementToDocument('sodiumUnit', sodiumUnit);\n }\n // if sodium didn't match with given text then get the sodium value and append to DOM\n } else {\n sodium = content[1].textContent.replace(/(.+Sodio)\\s(\\d+,\\d+)[.\\s](.*)/g, '$2');\n addElementToDocument('sodium', sodium);\n }\n // Check for magnesium\n } else if (ingredientName.toLowerCase() === 'magnesio') {\n let magnesium;\n // Check for the magnesium with given text if it is present get the value and add it to DOM\n if (content[1].textContent.includes(text)) {\n magnesium = content[1].textContent.replace(/(.+Magnesio)\\s\\(([0-9.]+)\\s(\\w+\\/\\w+)(.+)/g, '$2');\n addElementToDocument('magnesium', magnesium);\n // If magnesium has data get the unit\n if (magnesium) {\n const magnesiumUnit = content[1].textContent.replace(/(.+Magnesio)\\s\\(([0-9.]+)\\s(\\w+\\/\\w+)(.+)/g, '$3');\n addElementToDocument('magnesiumUnit', magnesiumUnit);\n }\n // if magnesium didn't match with given text then get the magnesium value and append to DOM\n } else {\n magnesium = content[1].textContent.replace(/(.+Magnesio)\\s(\\d+,\\d+)\\s(.*)/g, '$2');\n addElementToDocument('magnesium', magnesium);\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "7ecc42a21cef65e1934e0adb3924e1f2", "score": "0.5089256", "text": "function printMeasurements(measurements) {\n console.log(measurements);\n let measurement = $(\"<li>\");\n measurement.html(measurements);\n ingredientMeasure.append(measurement);\n}", "title": "" }, { "docid": "d9b9d27ec4b1e42140bebb5f430cae53", "score": "0.5087314", "text": "function parseIngredientQuantity(data) {\n if( data.meta.includes(\"to taste\") ) {\n return 'To taste';\n }\n else { \n return Number.isInteger(data.amount) ? `${data.amount} ${data.unit}` : `${data.amount.toFixed(2)} ${data.unit}`;\n } \n}", "title": "" }, { "docid": "a6e696faa0a522b4e9e440a011a39b8f", "score": "0.5086257", "text": "function populateRecipeBox() {\n let $selectedCard = $recipes.find(\".panel-primary\").parent();\n let recipeNumber = $selectedCard[0].dataset.recipe;\n if (recipeNumber <= recipeObjectArray.length) {\n let recipe = recipeObjectArray[recipeNumber - 1];\n if (recipe) {\n $(\"#drinkName\").val(recipe.name);\n $(\"#instructions\").val(recipe.instructions);\n $(\"#description\").val(recipe.description);\n $ingredients.find(\".ingredient\").remove();\n for (let j = 0; j < recipe.ingredients.length; j++) {\n let $clone = $(\".ingClone\").clone();\n $clone.removeClass(\"ingClone\");\n $clone.addClass(\"ingredient\");\n $clone.find(\".measure\").val(recipe.ingredients[j].measure);\n $clone.find(\".ingName\").val(recipe.ingredients[j].ingredientName);\n $clone.toggle();\n $clone.appendTo($ingredients);\n }\n }\n } else {\n $(\"#drinkName\").val(\"\");\n $(\"#instructions\").val(\"\");\n $(\"#description\").val(\"\");\n $ingredients.find(\".ingredient\").remove();\n let $clone = $(\".ingClone\").clone();\n $clone.removeClass(\"ingClone\");\n $clone.addClass(\"ingredient\");\n $clone.toggle();\n $clone.appendTo($ingredients);\n }\n}", "title": "" }, { "docid": "6d12c09b80e38c31e3d72de818b106b9", "score": "0.5086078", "text": "function readProductList(list) {\n\n let $searchCardBar = `\n <div style=\"background-color:#EEDAC1\">\n <span> Top 2 items from Amazon</span>\n </div>\n `\n $('.auto-complete').append($searchCardBar)\n for (let i=0; i<2; i++) {\n title = list[i.toString()].ItemAttributes[0].Title[0]\n picture = list[i.toString()].LargeImage[0].URL[0]\n description = list[i.toString()].DetailPageURL[0]\n rating = \"See Amazon link for rating\"\n if (title.length > 40){\n shortenedName = title.slice(0,40) + '...'\n let $searchCard = `\n <div class='auto-complete-item'>\n <div class='search-card'>\n <img src=\"${picture}\">\n <span>${shortenedName}</span>\n </div>\n <div class=\"display-box\" style=\"background:url(${picture}) no-repeat; background-size: cover;\">\n <span>\n <div class=\"display-detail\">\n <h2>${shortenedName}</h2>\n <h4>Category: product</h4>\n <h4 style=\"display:none\">Rating: ${rating}</h4>\n <h4 style=\"display:none\">Description: ${description}</h4>\n <br><br>\n <button type=\"button\" class=\"add-item\">Add to List</button>\n </div>\n </span>\n </div>\n </div>\n `\n $('.auto-complete').append($searchCard)\n } else {\n let $searchCard = `\n <div class='auto-complete-item'>\n <div class='search-card'>\n <img src=\"${picture}\">\n <span> ${title}</span>\n </div>\n <div class=\"display-box\" style=\"background:url(${picture}) no-repeat; background-size: cover;\">\n <span>\n <div class=\"display-detail\">\n <h2>${title}</h2>\n <h4>Category: product</h4>\n <h4 style=\"display:none\">Rating: ${rating}</h4>\n <h4 style=\"display:none\">Description: ${description}</h4>\n <br><br>\n <button type=\"button\" class=\"add-item\">Add to List</button>\n </div>\n </span>\n </div>\n </div>\n `\n $('.auto-complete').append($searchCard)\n }\n }\n}", "title": "" }, { "docid": "aaee043368ddad429d19ab956c59ee36", "score": "0.5079646", "text": "function createAnimalTradingCardHTML(animal) {\n // const cardHTML = '<div class=\"card\">' +\n // '<h3 class=\"name\">' + animal.name + '</h3>' +\n // '<img src=\"' + animal.name + '.jpg\" alt=\"' + animal.name +'\" class=\"picture\">' +\n // '<div class=\"description\">' +\n // '<p class=\"fact\">' + animal.fact + '</p>' +\n // '<ul class=\"details\">' +\n // '<li><span class=\"bold\">Scientific Name</span>: ' + animal.scientificName + '</li>' +\n // '<li><span class=\"bold\">Average Lifespan</span>: ' + animal.lifespan + '</li>' +\n // '<li><span class=\"bold\">Average Speed</span>: ' + animal.speed + '</li>' +\n // '<li><span class=\"bold\">Diet</span>: ' + animal.diet + '</li>' +\n // '</ul>' +\n // '<p class=\"brief\">' + animal.summary + '</p>' +\n // '</div>' +\n // '</div>';\n\n const cardHTML = `<div class=\"card\">\n <h3 class=\"name\"> ${animal.name} </h3>\n <img src=${animal.name}.jpg alt=${animal.name} class=\"picture\" />\n <div class=\"description\">\n <p class=\"fact\"> ${animal.fact} </p>\n <ul class=\"details\">\n <li><span class=\"bold\"> Scientific Name </span> ${animal.scientificName} </li>\n <li><span class=\"bold\"> Average Lifespan </span> ${animal.lifespan} </li>\n <li><span class=\"bold\"> Scientific Name </span> ${animal.speed} </li>\n <li><span class=\"bold\"> Scientific Name </span> ${animal.diet} </li>\n </ul>\n <p class=\"brief\"> ${animal.summary} </p>\n </div>\n </div>`\n\n return cardHTML;\n}", "title": "" }, { "docid": "fd14fc1f3856ce074b581d781112b973", "score": "0.5073458", "text": "async function getDivCardsAndItems(){\n // return [{\n // id: 0,\n // cardName: \"The Mayor\",\n // cardChaos: 18,\n // cardStack: 5,\n // itemName: \"The Perandus Manor\",\n // itemChaos: 115,\n // stackChaos: 90,\n // profitMargin: 25\n // }, {\n // id: 1,\n // cardName: \"The Professor\",\n // cardChaos: 7,\n // cardStack: 4,\n // itemName: \"The Putrid Cloister\",\n // itemChaos: 68,\n // stackChaos: 28,\n // profitMargin: 40\n // }, {\n // id: 2,\n // cardName: \"The Landing\",\n // cardChaos: 9,\n // cardStack: 5,\n // itemName: \"The Beachhead\",\n // itemChaos: 60,\n // stackChaos: 45,\n // profitMargin: 15\n // }] // sample data to delete later\n // fetch the div card\n const divCardResponseJson = await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=DivinationCard&language=en').then(r => r.json());\n // single out div card\n const divCardJson = divCardResponseJson.lines;\n const uniqueDivCards = divCardJson.map(function(item){\n if (item.explicitModifiers[0]) {\n // return item.explicitModifiers[0].text\n const divCard = {\n name: item.name,\n stackSize: item.stackSize,\n chaos: Math.round(item.chaosValue),\n explicitModifiers: item.explicitModifiers[0].text,\n divCardRaw: item\n };\n let divString = divCard.explicitModifiers;\n let divArray = divString.split('}')[0].split('{'); //index 0 = <uniqueitem>, index 1 = item name\n if (divArray[0] === '<uniqueitem>'){\n divCard.uniqueItem = divArray[1];\n return divCard;\n } else{\n return null\n }\n } else {\n return null\n }\n }).filter(Boolean);\n // console.log('uniqueDivCards' , uniqueDivCards);\n // fetch the unique Accessories\n const uniqueAccessories = (await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=UniqueAccessory&language=en').then(r => r.json())).lines;\n const uniqueMaps = (await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=UniqueMap&language=en').then(r => r.json())).lines;\n const uniqueFlasks = (await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=UniqueFlask&language=en').then(r => r.json())).lines;\n const uniqueJewels = (await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=UniqueJewel&language=en').then(r => r.json())).lines;\n const uniqueArmours = (await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=UniqueArmour&language=en').then(r => r.json())).lines;\n const uniqueWeapons = (await fetch('https://poe.ninja/api/data/itemoverview?league=Delirium&type=UniqueWeapon&language=en').then(r => r.json())).lines;\n const uniqueItems = [].concat(uniqueMaps, uniqueFlasks, uniqueJewels, uniqueAccessories, uniqueArmours, uniqueWeapons)\n .filter(item => !item.links) //both undefined and zero are allowed to cancel out 5 and 6 linked items\n .filter(item => item.name !== 'The Beachhead' || item.mapTier === 15)\n .filter(item => item.name !== 'Mao Kun' || item.mapTier === 4)\n .filter(item => item.name !== \"Poorjoy's Asylum\" || item.mapTier === 3)\n .filter(item => item.name !== \"The Putrid Cloister\" || item.mapTier === 3)\n .filter(item => item.name !== \"The Twilight Temple\" || item.mapTier === 3)\n .filter(item => item.name !== \"Vaults of Atziri\" || item.mapTier === 3)\n\n // single out item\n const cardAndItemDatas = uniqueItems.map(function (uniqueItem, index) {\n const combinedItem = {\n name: uniqueItem.name,\n stackSize: uniqueItem.stackSize,\n itemType: uniqueItem.baseType,\n chaos: Math.round(uniqueItem.chaosValue)\n };\n const matchingUniqueDivCard = uniqueDivCards.find(divCard => divCard.uniqueItem === combinedItem.name);\n if (!matchingUniqueDivCard){\n return false;\n }\n // calculating profit margins\n const divCardStackPrice = Math.round(matchingUniqueDivCard.stackSize * matchingUniqueDivCard.chaos);\n const profitMargin = combinedItem.chaos - divCardStackPrice;\n const cardAndItemData = {\n id: index,\n cardName: matchingUniqueDivCard.name,\n cardChaos: matchingUniqueDivCard.chaos,\n cardStack: matchingUniqueDivCard.stackSize,\n itemName: combinedItem.name,\n itemChaos: combinedItem.chaos,\n itemType: combinedItem.itemType,\n stackChaos: divCardStackPrice,\n profitMargin,\n cardRaw: matchingUniqueDivCard.divCardRaw,\n itemRaw: uniqueItem\n };\n return cardAndItemData;\n // console.log(`By flipping ${matchingUniqueDivCard.name} into ${combinedItem.name} you can make ${Math.round(profitMargin)} chaos.`);\n }).filter(Boolean);\n return cardAndItemDatas;\n}", "title": "" }, { "docid": "5a00ea962d30a0b41c9ffc554481c49e", "score": "0.5062727", "text": "function generateCards(theParent, startHere, dataObject) {\n if (startHere <= 15) {\n theParent.innerHTML = \"\";\n for (let i = startHere; i < startHere + 5; i++) {\n //debugger;\n var colDiv = document.createElement(\"div\");\n colDiv.classList = \"col s12 m6 l4\";\n theParent.appendChild(colDiv);\n var cardDiv = document.createElement(\"div\");\n cardDiv.classList = \"card\";\n colDiv.appendChild(cardDiv);\n var imgDiv = document.createElement(\"div\");\n imgDiv.classList = \"card-image\";\n cardDiv.appendChild(imgDiv);\n var image = document.createElement(\"img\");\n image.src = `https://spoonacular.com/recipeImages/${dataObject.results[i].id}-480x360.jpg`;\n imgDiv.appendChild(image);\n var cardTitle = document.createElement(\"h4\");\n cardTitle.classList = \"card-title\";\n //cardTitle.style = \"font-size:20px\";\n cardTitle.textContent = `${dataObject.results[i].title}`;\n cardDiv.appendChild(cardTitle);\n var contentDiv = document.createElement(\"div\");\n contentDiv.classList = \"card-content\";\n cardDiv.appendChild(contentDiv);\n var servings = document.createElement(\"p\");\n servings.textContent = `Servings: ${dataObject.results[i].servings}`;\n contentDiv.appendChild(servings);\n var minReady = document.createElement(\"p\");\n minReady.textContent = `Ready in : ${dataObject.results[i].readyInMinutes} Minutes`;\n contentDiv.appendChild(minReady);\n\n var addBtn = document.createElement(\"button\");\n addBtn.classList =\n \"btn-floating halfway-fab waves-effect waves-light green eat-me-button\";\n addBtn.dataset.recipeID = dataObject.results[i].id;\n addBtn.innerHTML = `eat`;\n imgDiv.appendChild(addBtn);\n }\n currentRecipeIndex += 5;\n }\n}", "title": "" }, { "docid": "912d62ed16bfa54d288bf82dbb5ea353", "score": "0.5055319", "text": "function parseRecipes(recipeDB) {\n var recipeIngredients = [];\n recipeDB.forEach(function(recipe) {\n recipe.ingredients.forEach(function(ingredient) {\n if (recipeIngredients.indexOf(ingredient) === -1)\n {\n recipeIngredients.push(ingredient);\n }\n })\n })\n return recipeIngredients.sort();\n}", "title": "" }, { "docid": "7025a105147f71151f184034751c8f00", "score": "0.5041287", "text": "function Recipe( asJSON ) {\n this.price = null;\n this.name = null;\n this.ingredients = new Array();\n this.description = null;\n this.refillable = null;\n this.id = null;\n this.picture = null;\n\n /* Handle data coming in from JSON */\n if( asJSON ) {\n this.price = asJSON.price;\n this.name = asJSON.name;\n this.description = asJSON.description;\n this.refillable = asJSON.refillable;\n this.id = asJSON.id;\n this.picture = asJSON.picture;\n\n for(var i in asJSON.ingredients ) {\n this.ingredients.push( new Ingredient( asJSON.ingredients[i] ) );\n }\n }\n\n this.getID = function() { return this.id; }\n this.setID = function(id) { this.id = id; }\n\n this.getPrice = function() { return this.price; }\n this.getName = function() { return this.name; }\n\n this.setPrice = function(price) { this.price = price; return this; }\n this.setName = function(name) { this.name = name; return this; }\n\n this.getDescription = function() { return this.description; }\n this.setDescription = function(descr ) { this.description = descr; return this; }\n\n /* How we add ingredients */\n this.addIngredient = function(ingredient) {\n this.ingredients.push( ingredient ); return this;\n }\n\n /* Remove an ingredient given it's name */\n this.removeIngredient = function(ingredientname ) {\n var foundIngredient = null; // return the ingredient object or a null if not found\n for(var i in this.ingredients ) {\n if( this.ingredients[i].getName() == ingredientname ) {\n foundIngredient = this.ingredients[i];\n this.ingredients.splice(i, 1);\n break;\n }\n }\n return foundIngredient;\n }\n\n this.findIngredient = function( ingredientname ) {\n var foundIngredient = null;\n for( var i in this.ingredients ) {\n if( this.ingredients[i].getName() == ingredientname ) {\n foundIngredient = this.ingredients[i];\n break;\n }\n }\n return foundIngredient;\n }\n\n this.getCalories = function() {\n var totalCalories = 0.0;\n for(var i in this.ingredients ) {\n totalCalories += parseFloat( this.ingredients[i].getCalories() );\n }\n return totalCalories;\n }\n\n this.isRefillable = function() { return this.refillable == 'true'; }\n this.setRefillable = function() { this.refillable = 'true'; return this; }\n this.setNotRefillable = function() { this.refillable = 'false'; return this; }\n\n this.listIngredients = function() { return this.ingredients; }\n}", "title": "" }, { "docid": "9712656e8908f693d6d150d42e41ab9d", "score": "0.5021845", "text": "function renderRecipeInfo(recipeList) {\n\tvar recipeItems = [];\n\t// for each recipe in data.recipes\n\t$.each(recipeList, function (key, recipe) {\n\t\trenderRecipe(recipe, recipeItems);\n\t});\n\n\t$(\"<div>\", {\n\t\tid: \"recipeContainer\",\n\t\thtml: recipeItems.join(\"\")\n\t}).replaceAll(\"#recipeContainer\");\n}", "title": "" }, { "docid": "45caeddc096319ae85fad48ff4a33ed0", "score": "0.50181216", "text": "function buildDogCards(dataArray) {\n\tfor (var i = 0; i < dataArray.length; i++) {\n\t\tvar current = dataArray[i];\n\t\toutputDiv.innerHTML += \"<article class='card'>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<header class='card-header'>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<h3>\" + current.name + \"</h3>\" + \"</header>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div class='card-body'>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<p>\" + current.types[0].type + \"<p>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<p>\" + current.types[0].volumes[0].name + \"</p>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<p>\" + current.types[0].volumes[0].price + \"<p>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"</div></article>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<article class='card'>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<header class='card-header'>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<h3>\" + current.name + \"</h3>\" + \"</header>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div class='card-body'>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<p>\" + current.types[1].type + \"<p>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<p>\" + current.types[1].volumes[1].name + \"</p>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"<p>\" + current.types[1].volumes[1].price + \"<p>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"</div></article>\";\n \t}\n}", "title": "" }, { "docid": "8d0292463ebb6c666d70af4aec740720", "score": "0.5005892", "text": "function finalIngredients(chosenIngredients) {\n var chosenCards = document.querySelector(\"#chosen-ingredients\");\n chosenCards.innerHTML = \"\";\n\n // Loops through array to get different info\n for (i = 0; i < chosenIngredients.length; i++) {\n var price = chosenIngredients[i].price;\n var brand = chosenIngredients[i].brand;\n var name = chosenIngredients[i].name;\n var link = chosenIngredients[i].link;\n var image = chosenIngredients[i].image;\n\n // Chosen Cards added to Modal\n chosenCards.innerHTML += `\n <div class=\"col s6 m3 l2\">\n \n <div class=\"card modal-card checked\">\n <a href=\"${link}\" target=\"_blank\" style=\"display:block; color:black\">\n <div class=\"card-image\">\n <img src=\"${image}\">\n </div>\n <div class=\"card-content\">\n <p class=\"brand\"><b>${brand}</b></p>\n <p class=\"name\">${name}</p>\n <p class=\"price\">${price}</p>\n </div>\n </a>\n <div class=\"card-action center-align\">\n <i class=\"material-icons checkbox-outline\">check_box</i>\n </div>\n </div>\n </div> \n `;\n }\n}", "title": "" }, { "docid": "e2dcd243153adebd19e2bed98dcd9203", "score": "0.50050163", "text": "function renderYummlyIndregients(result) {\n return result.ingredientLines.map((item) => `<li class=\"single-ingredient\">${item}</li>`).join('');\n}", "title": "" }, { "docid": "92084a5c589da6c8121daedfcd0fd68d", "score": "0.50021505", "text": "function CompList(Med) {\n var diva = $(\"<ul></ul>\");\n $(diva).addClass('w3-ul');\n //List of composition\n for (var c = 0; c < Med.comp.length; c++) {\n var lis2 = $(\"<li class='w3-small'></li>\");\n\n $(lis2).append(Med.comp[c].name);\n if (Med.comp[c].amount) {\n $(lis2).append(\" \" + Med.comp[c].amount);\n switch (Med.comp[c].prosent) {\n default: $(lis2).append(\" mg\");\n break;\n case \"TRUE\":\n $(lis2).append(\"%\");\n break;\n }\n\n }\n\n if (Med.comp[c].per != \"\" && Med.comp[c].per) {\n $(lis2).append(\" per \" + Med.comp[c].per);\n }\n //$(lis).append(lis2);\n $(diva).append(lis2);\n }\n return diva;\n}", "title": "" }, { "docid": "c5e4a1892ba57b9fb61e36b1445bfccb", "score": "0.50019896", "text": "function parseCatalogue(catalogue) {\n const newCatalogue = [];\n for (let book in catalogue) {\n let byPosition = catalogue[book].indexOf(\" by \");\n let numPositionStart = catalogue[book].indexOf(\"\\(\");\n let numPositionEnd = catalogue[book].indexOf(\"\\)\");\n\n let title = catalogue[book].substring(0, byPosition);\n let author = catalogue[book].substring(byPosition + 4, numPositionStart - 1);\n let quantity = parseInt(catalogue[book].substring(numPositionStart + 1, numPositionEnd));\n\n newCatalogue.push({title,author,quantity});\n }\n return newCatalogue;\n}", "title": "" }, { "docid": "2178239ed0099ac89a29487311955d86", "score": "0.49834943", "text": "function getCardsInHTML(){\n let deck = document.querySelector(\".deck\");\n const cardsHTML = cards.map(function(card) {\n /*learned about data- and dataset from webinar. I could not find an alternative\n to compare their values as simply calling the index did not work*/\n return `<li class=\"card\" data-outercard=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n });\n /*learned to use join function from udacity webinar on memory game- without it\n cards display with an apostrophe between them*/\n deck.innerHTML = cardsHTML.join('');\n}", "title": "" }, { "docid": "b489dbf64fe85e8daa47479b821889d6", "score": "0.49783525", "text": "function renderFood(foodPair) {\n var appId = \"1efc5cb5\";\n var appKey = \"b93713d669042a8117816b234a336ee5\";\n var foodInput = foodPair;\n var queryURL = `https://api.edamam.com/api/food-database/parser?ingr=${foodInput}&app_id=${appId}&app_key=${appKey}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n })\n .then(function (res) {\n // console.log(res);\n var $cardDiv = $(\"<div>\");\n var $cardImg = $(\"<div>\");\n var $cardContent = $(\"<div>\").addClass(\"card-content\");\n var label = $(\"<span>\").text(res.hints[0].food.label).addClass(\"activator\"); //add id later\n var imgURL = res.hints[0].food.image;\n var img = $(\"<img>\").attr(\"src\", imgURL);\n var icon = $(\"<i>\").addClass(\"material-icons right\").text(\"nutrition facts\");\n var cardReveal = $(\"<div>\").addClass(\"card-reveal\");\n var revealLabel = $(\"<span>\").addClass(\"card-title\");\n var revealIcon = $(\"<i>\").addClass(\"material-icons right\").text(\"close\");\n var nutritionInfo = $(\"<p>\").text(\"Nutritional Info:\");\n var nutritionCard = $(\"<div>\");\n\n var calories = res.hints[0].food.nutrients.ENERC_KAL;\n var protein = res.hints[0].food.nutrients.PROCNT;\n var fiber = res.hints[0].food.nutrients.FIBTG;\n var carbs = res.hints[0].food.nutrients.CHOCDF;\n var fats = res.hints[0].food.nutrients.FAT;\n\n\n $cardDiv.addClass(\"card\");\n // console.log(imgURL);\n if (typeof imgURL === \"string\") {\n var $cardImg = $(\"<div>\");\n var imgURL = res.hints[0].food.image;\n var img = $(\"<img>\").attr(\"src\", imgURL);\n $cardDiv.append($cardImg);\n } else {\n var $cardImg = $(\"<div>\");\n var googleImg = $(\"<img>\");\n var googleLink = $('<a>');\n var googleDiv = $('<div>');\n var food = res.hints[0].food.label.split(' ').join('+');\n googleLink.text(\" See Google\");\n googleImg.attr(\"src\", \"./images/google-it.jpg\");\n googleLink.attr(\"href\", `https://www.google.com/search?q=${food}&rlz=1C1CHBF_enUS882US882&sxsrf=ALeKk02VMbJMBjEP2PYB65uMF5lnpXxx_A:1586523972450&source=lnms&tbm=isch&sa=X&ved=2ahUKEwihtbiu9t3oAhUHCc0KHZnmAw8Q_AUoAnoECA0QBA&biw=1920&bih=1089`);\n $cardImg.append(googleImg);\n $cardDiv.append($cardImg);\n googleDiv.append(googleLink);\n $cardContent.append(googleDiv);\n }\n $cardImg.addClass(\"card-image\");\n // Adds AOS animation to the card\n $cardDiv.attr(\"data-aos\", \"fade-right\");\n $cardDiv.attr(\"data-aos-offset\", \"300\");\n $cardDiv.attr(\"data-aos-duration\", \"1500\");\n label.attr(\"id\", \"card-name\"); \n\n img.addClass('activator');\n\n // Append divs to page\n label.append(icon);\n $cardDiv.append($cardImg);\n $cardDiv.append($cardContent);\n $cardImg.append(img);\n $cardContent.append(label);\n $cardDiv.append(cardReveal);\n cardReveal.append(revealLabel);\n revealLabel.append(revealIcon);\n cardReveal.append(nutritionInfo);\n nutritionInfo.append(nutritionCard);\n nutritionCard.append(\"calories: \" + calories + \" KCAL, protein: \" + protein + \"g, fiber: \" + fiber + \"g, carbs: \" + carbs + \"g, \" + \"fats: \" + fats);\n\n $(\"#food-display\").append($cardDiv);\n })\n .catch(function () {\n console.log(\"sorry no food for you!\");\n });\n }", "title": "" }, { "docid": "0ac9bcaae243faa64cd7b6c1d31063e7", "score": "0.49695036", "text": "function displayResults(responseJson) {\n console.log(responseJson);\n $(\".list\").append(`\n \n <li id=\"${responseJson.id}\">\n <h2>${responseJson.title}</h2>\n <div class=\"short-recipe-container\">\n <img src=\"${responseJson.image}\" \n alt=\"${responseJson.title}\" \n class=\"recipe-image-short\">\n <section class=\"prelimInfo\">\n <p>Serving Size: ${responseJson.servings}</p>\n <p>Made ready in ${responseJson.readyInMinutes} minutes!</p>\n </section>\n </div>\n <div class=\"recipeBody\">\n <section>\n <h3>Ingredients</h3>\n <ul class=\"ingredientsList\">\n </ul>\n </section>\n <section class=\"recipeInstructions\">\n \n </section>\n </div>\n </li>\n `);\n\n\n let ingredients = responseJson.extendedIngredients;\n for (let i = 0; i < ingredients.length; i++) {\n $(`#${responseJson.id} .ingredientsList`).append(`\n <li>\n -${ingredients[i].original}\n </li>\n `);\n }\n let wine = responseJson.winePairing;\n \n if (wine.pairedWines && wine.pairedWines.length > 0) {\n $(`#${responseJson.id} .prelimInfo`).append(`\n <p><span>Wine Pairing:</span> ${wine.pairingText}</p>\n `);\n }\n\n if (responseJson.instructions !== null) {\n $(`#${responseJson.id} .recipeInstructions`).append(`\n <h3>Instructions</h3>\n <p>${responseJson.instructions}</p>\n `);\n } else {\n $(`#${responseJson.id} .recipeInstructions`).append(`\n <h3>Instructions</h3>\n <p>No instructions needed, just mix together!</p>\n `);\n }\n\n $('.results-js').removeClass(\"hidden\");\n}", "title": "" }, { "docid": "b7b0543886380af6e354efec19c6490c", "score": "0.49688998", "text": "function displayCards() {\n\tconst cardsFragment = document.createDocumentFragment();\n\n\tshuffle(CARDS);\n\n\tCARDS.forEach(function(card) {\n\t\tconst iconElem = document.createElement('i');\n\t\ticonElem.classList.add('fa');\n\t\ticonElem.classList.add(card);\n\n\t\tconst cardElem = document.createElement('li');\n\t\tcardElem.setAttribute('data-value', card);\n\t\tcardElem.classList.add('card');\n\t\tcardElem.appendChild(iconElem);\n\n\t\tcardsFragment.appendChild(cardElem);\n\t});\n\n\tdocument.querySelector('.deck').appendChild(cardsFragment);\n}", "title": "" }, { "docid": "f056e537605223d5e7e89af2cb23330f", "score": "0.496458", "text": "function presentHits(hits){\n let recipeList = \"\";\n for(let i = 0; i < hits.length; i ++){\n let recipe = hits[i][\"recipe\"];\n //console.log(recipe);\n let calories = recipe.calories / recipe.yield;\n let recURL = recipe.url;\n let imgSrc = recipe.image;\n let recName = recipe.label;\n let cookTime= recipe.totalTime;\n if (cookTime==0){\n cookTime = \"Unknown\";\n }else{\n cookTime += \" min\";\n }\n\n let innerHtml = \"<div class='recipe'>\";\n innerHtml += \"<img src='\" + imgSrc + \"'>\";\n innerHtml += \"<div class='recipe-text'>\";\n innerHtml += \"<h3 class='recipe-name'>\" + recName + \"</h3>\";\n innerHtml += \"<div class='recipe-specs'>\";\n innerHtml += \"<p>Cook time: \" + cookTime + \"</p>\";\n innerHtml += \"<p>Calories per serving: \" + calories.toFixed(0) + \"</p>\";\n innerHtml += \"</div>\"\n innerHtml += \"<div class='recipe-link'><p><a href='\"+recURL+\"'>See Recipe</a></p></div>\"\n innerHtml += \"</div></div>\"\n\n recipeList += innerHtml;\n }\n document.getElementById(\"search-results\").innerHTML = recipeList;\n}", "title": "" }, { "docid": "ebae0966d584b92b4e6875a6d8dd475b", "score": "0.4963381", "text": "function populateCardList() {\n // creates conatiner for all cards\n var ul = document.createElement( 'ul' );\n ul.id = \"cardList\";\n var container = document.getElementById( 'cardListContainer' ).appendChild( ul );\n if ( selectedCreditCards.length == 0 ) {\n var noMatchesFoundText = document.createElement( 'li' );\n noMatchesFoundText.id = \"noMatchesFoundText\";\n noMatchesFoundText.innerHTML += \"No Matches Found, try broadening your filter\";\n ul.appendChild( noMatchesFoundText );\n }\n this.selectedCreditCards.forEach( function( card ) {\n var li = document.createElement( 'li' );\n li.id = 'li';\n\n var cardContainer = document.createElement( 'div' );\n cardContainer.id = \"cardContainer\";\n\n var cardImageContainer = document.createElement( 'div' );\n cardImageContainer.id = \"cardImageContainer\";\n\n var cardInfoContainer = document.createElement( 'div' );\n cardInfoContainer.id = \"cardInfoContainer\";\n\n //Add image\n var cardImage = document.createElement( 'img' );\n cardImage.id = \"cardImage\";\n cardImage.setAttribute( 'src', card.image );\n\n\n\n //Add info\n var cardInfoList = document.createElement( 'ul' );\n cardInfoList.id = \"cardInfoList\";\n\n var merchant = document.createElement( 'li' );\n merchant.id = \"infoListElement\";\n\n var cardName = document.createElement( 'li' );\n cardName.id = \"infoListElement\";\n\n var tags = document.createElement( 'li' );\n tags.id = \"infoListElement\";\n\n var buttonHolder = document.createElement( 'li' );\n buttonHolder.id = \"infoListElement\";\n\n var detailsButton = document.createElement( 'button' );\n detailsButton.id = card.id;\n\n //creates modal on click for\n detailsButton.onclick = function() {\n eventDetailsClick( card.name );\n var modalWindow = document.getElementById( 'modalWindow' );\n\n // sets title of modal window\n document.getElementById( \"modalCardName\" ).innerHTML = card.name.bold();\n\n // adds features as lists by looping through features array\n document.getElementById( \"modalFeaturesText\" ).innerHTML = \"Features:\".bold() + \"<br>\";\n for ( var i = 0; i < card.features.length; i++ ) {\n document.getElementById( \"modalFeaturesText\" ).innerHTML += card.features[ i ] + \"<br>\";\n }\n\n // loads image into modal\n document.getElementById( \"modalImage\" ).src = card.image;\n\n // shows range of credit scores by grabbing lowest and highest\n document.getElementById( \"modalCreditRange\" ).innerHTML = \"Credit Score Range: \".bold() +\n card.recommended_credit_scores[ 0 ].min +\n \" to \" + card.recommended_credit_scores[ card.recommended_credit_scores.length - 1 ].max;\n document.getElementById( \"modalMerchant\" ).innerHTML = \"Merchant: \".bold() +\n card.merchant;\n\n // gets intro APR from card and presents\n if ( card.intro_apr.does_not_apply == false ) {\n document.getElementById( \"modalIntro\" ).innerHTML = \"Intro APR: \".bold() +\n card.intro_apr.rate + \"% for \" + card.intro_apr.months + \" months\";\n }\n\n // gets regular APR and presents\n if ( card.regular_apr.variable == true ) {\n document.getElementById( \"modalNormal\" ).innerHTML =\n \"Normal APR:\".bold() + \" Variable rate at \" + card.regular_apr.rate + \"%\";\n } else {\n document.getElementById( \"modalNormal\" ).innerHTML =\n \"Normal APR: Non-variable rate at \" + card.regular_apr.rate + \"%\";\n }\n\n // if there is only one fee or rate info\n if ( card.rates_and_fees.length == 1 ) {\n if ( card.rates_and_fees[ 0 ].fee == 0 ) {\n document.getElementById( \"modalRates\" ).innerHTML = \"Rates and Fees:\".bold() + \"No annual fee\";\n // if no caveat, then just run just put in fee like normal\n } else if ( card.rates_and_fees[ 0 ].caveat == \"\" ) {\n document.getElementById( \"modalRates\" ).innerHTML = \"Rates and Fees:\".bold() + \" Annual fee of \" +\n card.rates_and_fees[ 0 ].fee + \".\";\n // sets rates and fee if caveat exists\n } else {\n document.getElementById( \"modalRates\" ).innerHTML = \"Rates and Fees:\".bold() + \" Annual fee of \" +\n card.rates_and_fees[ 0 ].fee + \" and \" + card.rates_and_fees[ 0 ].caveat;\n }\n\n // if more than one element in fee array, present both\n } else {\n // add\n if ( card.rates_and_fees[ 0 ].fee == 0 ) {\n document.getElementById( \"modalRates\" ).innerHTML = \"Rates and Fees:\".bold() + \" No annual fee. \";\n } else if ( card.rates_and_fees[ 0 ].caveat == \"\" ) {\n document.getElementById( \"modalRates\" ).innerHTML = \"Rates and Fees:\".bold() + \" Annual fee of \" +\n card.rates_and_fees[ 0 ].fee + \". \";\n } else {\n document.getElementById( \"modalRates\" ).innerHTML = \"Rates and Fees:\".bold() + \" Annual fee of \" +\n card.rates_and_fees[ 0 ].fee + \" and \" + card.rates_and_fees[ 0 ].caveat + \". \";\n }\n\n\n\n document.getElementById( \"modalRates\" ).innerHTML = document.getElementById( \"modalRates\" ).innerHTML + card.rates_and_fees[ 1 ].name + \" at rate of \" +\n card.rates_and_fees[ 1 ].rate + \" for duration of \" + card.rates_and_fees[ 1 ].duration_months + \" months.\";\n };\n document.getElementById( \"modalApplyButton\" ).onclick = function() {\n var enteredScore = parseInt( prompt( \"Please enter your credit score\" ) );\n if ( enteredScore % 1 === 0 && enteredScore < 851 && enteredScore > 299 ) {\n ga( 'send', 'event',\n 'Apply',\n 'applyClickPass',\n card.name,\n enteredScore\n );\n sendToAPI( card.id, enteredScore );\n } else {\n alert( \"That is not a valid credit score, please enter a non-decimal number between 300 and 850\" );\n ga( 'send', 'event',\n 'Apply',\n 'applyClickFail',\n card.name,\n enteredScore\n );\n }\n\n };\n modalWindow.style.display = \"block\";\n };\n\n buttonHolder.appendChild( detailsButton );\n cardInfoList.appendChild( merchant );\n cardInfoList.appendChild( cardName );\n cardInfoList.appendChild( tags );\n cardInfoList.appendChild( buttonHolder );\n merchant.innerHTML += \"Merchant: \".bold() + card.merchant;\n cardName.innerHTML += \"Name: \".bold() + card.name;\n\n var formattedString = [];\n for ( var i = 0; i < card.tags.length; i++ ) {\n formattedString[ i ] = card.tags[ i ].toString().charAt( 0 ).toUpperCase() + card.tags[ i ].slice( 1 );\n formattedString[ i ] = formattedString[ i ].replace( /_/g, \" \" );\n formattedString[ i ] = \" \" + formattedString[ i ];\n }\n\n // adds tag based on singular or plural\n if ( formattedString.length == 1 ) {\n tags.innerHTML += \"Tag: \".bold() + formattedString + \"<br>\";\n } else {\n tags.innerHTML += \"Tags: \".bold() + formattedString + \"<br>\";\n }\n detailsButton.innerHTML = \"Details\".bold();\n\n\n\n //Append Children\n cardInfoContainer.appendChild( cardInfoList );\n cardImageContainer.appendChild( cardImage );\n cardContainer.appendChild( cardInfoContainer );\n cardContainer.appendChild( cardImageContainer );\n li.appendChild( cardContainer );\n ul.appendChild( li );\n\n\n } )\n}", "title": "" }, { "docid": "df03da827459c640318b2b82a6b1ef6f", "score": "0.49617875", "text": "function assembleCards(cards, min = 0, max = data.length) {\n // empty the div before put something\n cardsDiv.innerHTML = \"\";\n cards.slice(min, max).forEach((current) => {\n let { name, capital, region, flag, population } = current;\n // separate the number in thousands\n population = population.toLocaleString(\"pt-BR\");\n cardsDiv.innerHTML += `\n <div class=\"main__card\">\n <a href=\"detail.html?=${name}\">\n <img alt=\"country ${name}\" src=\"${flag}\"/>\n <div class=\"main__legend\">\n <h3>${name}</h3>\n <ul>\n <li><p>Population:</p><p>${population}</p></li>\n <li><p>Region:</p><p>${region}</p> </li>\n <li><p>Capital:</p><p>${capital}</p> </li>\n </ul>\n </div>\n </a>\n </div>\n `;\n });\n}", "title": "" }, { "docid": "5b2baba85b1f5ff265d2137cde498fbd", "score": "0.4961568", "text": "static getIngredientListFromConsole( numIngredients ) {\r\n let ingredientList = []; \r\n for(var i = 0; i < numIngredients; i++) { //loop numIngredients times\r\n ingredientList.push(readlineSync.question('Enter Ingredient:')); //push user inputted ingredient onto array\r\n }\r\n return ingredientList;\r\n }", "title": "" }, { "docid": "a53de82df546398fe43276c7440863d6", "score": "0.49571994", "text": "function addMealToDOM(dish) {\n const ingredients = [];\n for(let i = 1; i <= 20; i++) {\n if(dish[`strIngredient${i}`]){\n ingredients.push(\n `${dish[`strIngredient${i}`]}-${dish[`strMeasure${i}`]}`\n );\n } else {\n break;\n }\n }\n singleMeal.innerHTML = `\n <div class=\"single-meal\">\n <h1>${dish.strMeal}</h1>\n <img src=\"${dish.strMealThumb}\" alt=\"${dish.strMeal}\"/>\n <div class=\"single-meal-info\">\n <p>${dish.strCategory}</p>\n <p>${dish.strArea}</p>\n </div>\n <div class=\"main\">\n <p>${dish.strInstructions}</p>\n <h2>Ingredients</h2>\n <ul>\n ${ingredients.map((allIngredients) => `<li>${allIngredients}</li>`).join(\"\")}\n </ul>\n </div>\n </div>`\n}", "title": "" }, { "docid": "fb91808154b2d75729e30c312ac86772", "score": "0.4951194", "text": "function displayItem(item){\n let bar = document.getElementById('search');\n bar.value = \"\";\n $('#floatingBody').empty();\n item = item.replace(/ /g, '_');\n var ingredients;\n var measurements;\n\n fetch('https://www.themealdb.com/api/json/v1/1/search.php?s=' + item)\n .then((response) => response.json())\n .then((json) => {\n data = json.meals;\n\n let floatingBody = document.getElementById('floatingBody');\n let darkened = document.createElement('div');\n darkened.id = \"darkened\";\n let itemDisplay = document.createElement('div');\n itemDisplay.id = \"itemDisplay\";\n let closeBtn = document.createElement('button');\n closeBtn.setAttribute('onclick', \"dailySpecial()\");\n closeBtn.innerHTML = \"X\";\n itemDisplay.appendChild(closeBtn);\n\n let gridDiv = document.createElement('div');\n let image = document.createElement('img');\n image.src = data[0].strMealThumb;\n gridDiv.appendChild(image);\n\n let headerDiv = document.createElement('div');\n let header = document.createElement('h1');\n header.id = \"itemHeader\";\n header.innerHTML = data[0].strMeal;\n headerDiv.appendChild(header);\n\n let tags = document.createElement('p');\n tags.innerHTML = \"Tags:\";\n let spanTag = document.createElement('span');\n spanTag.innerHTML = data[0].strTags;\n tags.appendChild(spanTag);\n let pIngredients = document.createElement('p');\n pIngredients.innerHTML = \"Ingredients:\";\n tags.appendChild(pIngredients);\n headerDiv.appendChild(tags);\n\n for (let i = 1; i < 21; i++){\n ingredients = 'strIngredient' + i;\n measurements = 'strMeasure' + i;\n \n if (data[0][ingredients] != \"\"){\n if (data[0][measurements] != null){\n let ingredient = document.createElement('p');\n ingredient.innerHTML = data[0][ingredients];\n \n let measurement = document.createElement('span');\n measurement.innerHTML = \"- \" + data[0][measurements];\n ingredient.appendChild(measurement);\n\n ingredientsList += data[0][ingredients] + \"- \" + data[0][measurements] + ', '\n\n headerDiv.appendChild(ingredient);\n }\n }\n }\n \n gridDiv.appendChild(headerDiv);\n itemDisplay.appendChild(gridDiv);\n\n let instructionHeader = document.createElement('h');\n instructionHeader.innerHTML = \"Instructions:\";\n itemDisplay.appendChild(instructionHeader);\n\n let instructions = document.createElement('p');\n instructions.innerHTML = data[0].strInstructions;\n itemDisplay.appendChild(instructions);\n\n let form = document.createElement('form');\n form.setAttribute('id', 'sendMail');\n form.setAttribute('method', 'post');\n form.setAttribute('action', '/email');\n\n let hiddenName = document.createElement('input');\n hiddenName.type = \"text\";\n hiddenName.id = \"hiddenName\";\n hiddenName.setAttribute('name','hiddenName');\n hiddenName.value = data[0].strMeal;\n\n \n let hiddenIngredients = document.createElement('input');\n hiddenIngredients.type = \"text\";\n hiddenIngredients.id = \"ingredientsInfo\";\n hiddenIngredients.setAttribute('name','ingredientsInfo');\n hiddenIngredients.value = ingredientsList;\n\n let hiddenInstructions = document.createElement('input');\n hiddenInstructions.type = \"text\";\n hiddenInstructions.id = \"instructionInfo\";\n hiddenInstructions.setAttribute('name','instructionInfo');\n hiddenInstructions.value = data[0].strInstructions;\n\n let formHeader = document.createElement('label');\n formHeader.innerHTML = \"Send the recipe to yourself or share with a friend!\";\n formHeader.id = \"emailHeader\";\n\n let email = document.createElement('input');\n email.type = \"text\";\n email.id = \"emailInfo\";\n email.placeholder = \"Enter an Email\"\n email.setAttribute('name','emailInfo');\n email.setAttribute('id','emailInfo');\n\n let submit = document.createElement('input');\n submit.onsubmit = \"return false\";\n submit.id = \"submitMail\";\n submit.type = \"submit\";\n submit.value = \"Get Recipe\";\n\n form.appendChild(hiddenName);\n form.appendChild(hiddenIngredients);\n form.appendChild(hiddenInstructions);\n form.appendChild(formHeader);\n form.appendChild(email);\n form.appendChild(submit);\n itemDisplay.appendChild(form);\n\n let spacer1 = document.createElement('div');\n spacer1.id = \"spacer\";\n itemDisplay.appendChild(spacer1);\n\n darkened.appendChild(itemDisplay);\n floatingBody.appendChild(darkened);\n });\n}", "title": "" }, { "docid": "bc5d73f4adf370d046ccd11225baf22a", "score": "0.49456376", "text": "function GET_CARD_META(card_name, display='horizontal') {\n if (!card_name) return [];\n let card = GET_CARD_INFO(card_name, 'mapped');\n let meta = {\n difficulty: getCardDifficulty_(card),\n };\n meta.bonus_power = 0;\n meta.bonus_energy = 0;\n meta.their_bonus_power = 0;\n meta.their_bonus_energy = 0;\n meta.description = \"No Ability\";\n switch (card.ability_type) {\n case \"Power\":\n [meta.bonus_power, meta.their_bonus_power, meta.description] = getMaxBonusPower(card);\n break;\n case \"Energy\":\n [meta.bonus_energy, meta.their_bonus_energy, meta.description] = getMaxBonusEnergy(card);\n break;\n case \"Card Cost\":\n [meta.bonus_energy, meta.their_bonus_energy, meta.description] = getMaxReducedCost(card);\n // meta.bonus_energy = -meta.bonus_energy; //TODO: fix getMaxReducedCost to return matching information\n // meta.their_bonus_energy = -meta.their_bonus_energy;\n break;\n }\n meta.predicted_energy = card.energy - meta.bonus_energy;\n meta.predicted_power = card.power + meta.bonus_power - meta.their_bonus_power;\n [meta.base_efficiency, meta.predicted_efficiency] =\n getEfficiency_(card.energy, meta.bonus_energy, card.power,\n meta.bonus_power, meta.their_bonus_energy, meta.their_bonus_power,\n meta.difficulty);\n\n switch(display) {\n case 'mapped':\n return meta;\n case 'vertical':\n return [meta.description, meta.predicted_energy, meta.predicted_power, meta.predicted_efficiency, meta.base_efficiency, meta.difficulty,\n card.energy, meta.bonus_energy, meta.their_bonus_energy, card.power, meta.bonus_power, meta.their_bonus_power];\n case 'horizontal':\n default:\n return [[meta.description, meta.predicted_energy, meta.predicted_power, meta.predicted_efficiency, meta.base_efficiency, meta.difficulty,\n card.energy, meta.bonus_energy, meta.their_bonus_energy, card.power, meta.bonus_power, meta.their_bonus_power]];\n }\n}", "title": "" }, { "docid": "7eed532c5e70c164c1a7f2813e9711d8", "score": "0.49450296", "text": "function read_more_less_recipe() {\n var btn = document.getElementById(\"btn\");\n var txt = document.getElementById(\"text\");\n var minText =\"Estimate time: 30min <br>\";\n \n var fullText = \"Estimate time: 30min <br>\"+\n \"<h3>Ingredients:</h3>\"+\n \"<ul>\"+\n \"<li>2 cups plain flour (290g)</li>\"+\n \"<li>1/4 cup sugar or sweetener (60g)</li>\"+\n \"<li>4 teaspoons baking powder</li>\"+\n \"<li>1/4 teaspoon baking soda</li>\"+\n \"<li>1/2 teaspoon salt</li>\"+\n \"<li>1 3/4 cups milk (440ml)</li>\"+\n \"<li>1/4 cup butter (60g)</li>\"+\n \"<li>2 teaspoons pure vanilla extract</li>\"+\n \"<li>1 large egg</li>\"+\n \"</ul><br>\"+\n \"<h3>Instructions:</h3>\"+\n \"<ol>\"+\n \"<li>Combine the flour, sugar, baking powder, baking soda and salt in a large-sized bowl.\"+\n \"Make a well in the centre and add the milk, slightly cooled melted butter, vanilla and egg.</li>\"+\n \"<li>Use a wire whisk to whisk the wet ingredients together first before slowly folding them into \"+\n \"the dry ingredients. Mix together until smooth (there may be a couple of lumps but that's okay).</li>\"+\n \"<li>Set the batter aside and allow to rest while heating up your pan or griddle. </li>\"+\n \"<li>Heat a nonstick pan or griddle over low-medium heat and wipe over with a little\"+\n \"butter to lightly grease pan. Pour ¼ cup of batter onto the pan and spread out gently\"+\n \"into a round shape with the back of your ladle or measuring cup.</li>\"+\n \"<li>When the underside is golden and bubbles begin to appear on the surface,\"+\n \"flip with a spatula and cook until golden. Repeat with remaining batter.</li>\"+\n \"<li>Serve with honey, maple syrup, fruit, ice cream or frozen yoghurt, or enjoy plain!</li>\"+\n \"</ol> <br>\";\n if (btn.value == 'Read More') {\n btn.value = 'Read Less';\n txt.innerHTML = fullText;\n }\n else {\n btn.value = 'Read More';\n txt.innerHTML = minText;\n }\n }", "title": "" }, { "docid": "c3a7fb0d0cd746ee689a83e9933063f7", "score": "0.4939162", "text": "function processingPokeData() {\n usefulData.forEach((el) => {\n if (pokeMatchArray.includes(el.name)) {\n let cardsContainer = document.getElementById(\"cards-container\"); // note the plural, this regards all of them\n let cardContainer = document.createElement(\"div\");\n let cardinfoContainer = document.createElement(\"div\");\n // attributes to be displayed at cardInfo\n let pokeName = document.createElement(\"h2\");\n pokeName.innerText = el.name;\n let pokeNumber = document.createElement(\"h3\");\n pokeNumber.innerText = `#${el.id}`;\n let pokeTypes = document.createElement(\"ul\");\n let pokeAbilities = document.createElement(\"ul\");\n\n cardContainer.classList.add(\"poke\", \"card\");\n cardinfoContainer.classList.add(\"pokeInfo\");\n pokeTypes.classList.add(\"pokeTypes\");\n pokeAbilities.classList.add(\"pokeAbilities\");\n pokeName.classList.add(\"pokeName\");\n pokeNumber.classList.add(\"pokeNumber\");\n\n renderAbilities(el.abilities, pokeAbilities);\n renderImage(el.id, cardContainer);\n renderTypes(el.types, pokeTypes); // it should append to the ul above as li\n\n cardinfoContainer.append(pokeName, pokeNumber, pokeTypes, pokeAbilities); // !IMPORTANT: it renders the whole card with useful infos!\n cardContainer.append(cardinfoContainer);\n cardsContainer.appendChild(cardContainer); // append each card to the \"main\" card container, notice the plural again\n }\n });\n pokeMatchArray = [];\n}", "title": "" }, { "docid": "6f69c29ac2f398ff615360ee6d4936cf", "score": "0.493304", "text": "async function getIngredients() {\n try {\n // store all ingredients in an array\n ingredientArray = []\n\n // get the json data as a string, then parse it\n let drinkObjArray = await readFileAsync(FILENAME2, \"utf8\")\n drinkObjArray = JSON.parse(drinkObjArray)\n // loop through parsed json to get all ingredients and add to array\n for (let drink of drinkObjArray) {\n for (let ingredientCounter = 1; ingredientCounter <= 12; ingredientCounter++) {\n let currentIngredient = \"strIngredient\"\n currentIngredient += ingredientCounter;\n let drinkDetails = drink[\"drinks\"][0];\n // push all unique ingredients to array\n if (drinkDetails[currentIngredient] !== null && drinkDetails[currentIngredient] !== \"\") {\n if ((/rum/i).test(drinkDetails[currentIngredient])) {\n drinkDetails[\"rum\"] = true;\n // if this is true, then ingredient contains the word \"rum\" ignoring case\"\n }\n\n else {\n if (drinkDetails[\"rum\"] !== true) {\n drinkDetails[\"rum\"] = false\n }\n };\n if (((/whiskey/i).test(drinkDetails[currentIngredient])) || ((/scotch/i).test(drinkDetails[currentIngredient])) || ((/bourbon/i).test(drinkDetails[currentIngredient])) || ((/jim beam/i).test(drinkDetails[currentIngredient])) || ((/jack daniels/i).test(drinkDetails[currentIngredient]))) {\n drinkDetails[\"whiskey\"] = true;\n\n }\n\n else {\n if (drinkDetails[\"whiskey\"] !== true) {\n drinkDetails[\"whiskey\"] = false\n };\n }\n if ((/vodka/i).test(drinkDetails[currentIngredient])) {\n drinkDetails[\"vodka\"] = true;\n \n }\n \n else {\n if (drinkDetails[\"vodka\"] !== true) {\n drinkDetails[\"vodka\"] = false\n }\n }; \n if ((/gin/i).test(drinkDetails[currentIngredient]) && !(/ginger/i).test(drinkDetails[currentIngredient])) {\n drinkDetails[\"gin\"] = true;\n }\n \n else {\n if (drinkDetails[\"gin\"] !== true) {\n drinkDetails[\"gin\"] = false\n }\n }; \n if ((/tequila/i).test(drinkDetails[currentIngredient])) {\n drinkDetails[\"tequila\"] = true;\n \n }\n \n else {\n if (drinkDetails[\"tequila\"] !== true) {\n drinkDetails[\"tequila\"] = false\n }\n }; \n }\n }\n }\n\n\n\n // write to a json file. Also title-case the ingredients and write to a file.\n fs.writeFile(\"alcoholic-categories.json\", JSON.stringify(drinkObjArray, null, 2), (err) => { if (err) throw err })\n }\n catch (err) {\n throw err;\n }\n}", "title": "" }, { "docid": "762c9297eb9767869ee73bdc09ede9ce", "score": "0.493193", "text": "function displayDishes() {\n $(\".starters_rating\").html(\"\");\n $(\".mains_rating\").html(\"\");\n $(\".desserts_rating\").html(\"\");\n\n // display starters\n for (let i = 0; i < recipes.starters.length; i++) {\n let recipe = recipes.starters[i];\n let healthLabels = recipe.data.recipe.healthLabels;\n\n let displayedLabels = \"<b>Health Labels: </b>\";\n\n for (let j = 0; j < 3; j++) {\n displayedLabels += \"<br/>\" + healthLabels[j];\n }\n\n $(\".starters_rating\").append(` \n <div class=\"rating_card\">\n <h2>${recipe.name}</h2>\n <img src=\"${recipe.data.recipe.image}\" />\n <p class=\"calories\">${Math.round(\n recipe.data.recipe.calories\n )} calories</p>\n <p class=\"health_labels\">${displayedLabels}</p>\n </div>\n `);\n }\n\n // display mains\n for (let i = 0; i < recipes.mains.length; i++) {\n let recipe = recipes.mains[i];\n let healthLabels = recipe.data.recipe.healthLabels;\n\n let displayedLabels = \"<b>Health Labels: </b>\";\n\n for (let j = 0; j < 3; j++) {\n displayedLabels += \"<br/>\" + healthLabels[j];\n }\n\n $(\".mains_rating\").append(` \n <div class=\"rating_card\">\n <h2>${recipe.name}</h2>\n <img src=\"${recipe.data.recipe.image}\" />\n <p class=\"calories\">${Math.round(\n recipe.data.recipe.calories\n )} calories</p>\n <p class=\"health_labels\">${displayedLabels}</p>\n </div>\n `);\n }\n\n // display desserts\n for (let i = 0; i < recipes.desserts.length; i++) {\n let recipe = recipes.desserts[i];\n let healthLabels = recipe.data.recipe.healthLabels;\n\n let displayedLabels = \"<b>Health Labels: </b>\";\n\n for (let j = 0; j < 3; j++) {\n displayedLabels += \"<br/>\" + healthLabels[j];\n }\n\n $(\".desserts_rating\").append(` \n <div class=\"rating_card\">\n <h2>${recipe.name}</h2>\n <img src=\"${recipe.data.recipe.image}\" />\n <p class=\"calories\">${Math.round(\n recipe.data.recipe.calories\n )} calories</p>\n <p class=\"health_labels\">${displayedLabels}</p>\n </div>\n `);\n }\n }", "title": "" }, { "docid": "55ea4e10865e13e9b2e930594249e221", "score": "0.49269736", "text": "function makeCard (item, number) {\n const decoratedItem = decorateImage(item);\n\n let html = `<div class=\"${CARD_CLASS}\">`;\n html += `<h3 class=\"${NUMBER_CLASS}\">${decoratedItem.level}–${number + 1}/${GLOBALS.count}</h3>`;\n html += `<dl>`;\n html += `<dt>${decoratedItem.name}</dt>`;\n html += `<dd lang=\"ja\">${decoratedItem.symbol}</dd>`;\n if (decoratedItem.reading) {\n html += `<dd lang=\"ja\" class=\"reading\">${decoratedItem.reading}</dd>`;\n }\n if (decoratedItem.radicals) {\n html += `<dd class=\"composing-radicals\">`;\n // Now this breaks vocab since it has radicals only as an array\n // We will eventually need multiple templates but fuck it for now\n if (typeof decoratedItem.radicals === 'object') {\n _.each(_.keys(decoratedItem.radicals), function (key) {\n html += `${key}:${decoratedItem.radicals[key]}<br />`;\n });\n } else { // string\n html += decoratedItem.radicals;\n }\n html += `</dd>`;\n }\n html += `</dl>`;\n html += `</div>`;\n return html;\n }", "title": "" }, { "docid": "18708ee6c4e94aa3abc46829ff0d4f07", "score": "0.492134", "text": "function getCards() {\r\n // Array to hold Cards\r\n var suites = ['Diamonds', 'Spades', 'Hearts', 'Clubs'];\r\n // Array to hold non-numeric card faces \r\n var faceCards = ['J', 'Q', 'K', 'A'];\r\n\r\n // Array to hold Cards\r\n var cards = [];\r\n\r\n // Loop for each Suite\r\n var currentCardIndex = 0;\r\n for (var suite in suites) {\r\n // Loop for numeric cards\r\n for (var i = 2; i <= 10; i++) {\r\n cards.push(createCard(i, suites[suite], currentCardIndex));\r\n currentCardIndex++;\r\n }\r\n // Loop for non-numeric cards\r\n for (var face in faceCards) {\r\n cards.push(createCard(faceCards[face], suites[suite], currentCardIndex));\r\n currentCardIndex++;\r\n }\r\n currentCardIndex = 0;\r\n}\r\n\r\n // Return Array of Card Objects\r\n return cards;\r\n}", "title": "" }, { "docid": "7c5d0d38d8101ed4a5bfc3b68af17494", "score": "0.4921075", "text": "function getIngredients() {\n \n let ingredients;\n\n if (sessionStorage.getItem('addedIngredients') === null) {\n ingredients = [];\n }\n else {\n ingredients = JSON.parse(sessionStorage.getItem('addedIngredients'));\n }\n ingredients.forEach(function(ingredient) {\n // Create elements\n const ingredientContainer = document.createElement('div');\n const input = document.createElement('input');\n const addButton = document.createElement('button');\n const removeButton = document.createElement('button');\n addButton.addEventListener('click', addIngredient);\n removeButton.addEventListener('click', removeIngredient);\n const addIcon = document.createElement('i');\n const deleteIcon = document.createElement('i');\n\n\n // Add class to ingredient container\n ingredientContainer.className = 'ingredient';\n\n // Add properties to input\n input.type = \"text\";\n input.name = ingredient;\n input.required = true;\n input.placeholder = \"Add Ingredient\";\n input.className = 'form-control';\n input.autocomplete = \"off\";\n input.minLength = \"3\";\n input.maxLength = \"50\";\n\n // Add properties to icons\n addIcon.className = 'material-icons right';\n deleteIcon.className = 'material-icons right';\n addIcon.innerHTML = 'add';\n deleteIcon.innerHTML = 'clear';\n\n // Add properties to buttons\n addButton.className = 'add-ingredient btn-success secondary-content';\n removeButton.className = 'delete-ingredient btn-danger secondary-content';\n addButton.type = 'button';\n removeButton.type = 'button';\n\n // Append elements\n addButton.appendChild(addIcon);\n removeButton.appendChild(deleteIcon);\n ingredientContainer.appendChild(input);\n ingredientContainer.appendChild(addButton);\n ingredientContainer.appendChild(removeButton);\n\n ingredientsList.appendChild(ingredientContainer);\n });\n}", "title": "" }, { "docid": "0ea73a62d11d48699fa3b3e0edb54f41", "score": "0.4906654", "text": "function splitRecipe(recipe, splitBy) {\n const lines = recipe.split(\"\\n\");\n\n const newRecipe = [];\n lines.forEach((line) => {\n const isMatch = line.match(INGREDIENT_REGEX);\n if (isMatch && isMatch.length > 0) {\n newRecipe.push(splitIngredient(line, splitBy));\n } else {\n newRecipe.push(line);\n }\n });\n\n return newRecipe.join(\"\\n\");\n}", "title": "" }, { "docid": "2985d34b36e7128faac07ccdddcf5d04", "score": "0.49047267", "text": "getLandsAmounts() {\n var colors = { total: 0, w: 0, u: 0, b: 0, r: 0, g: 0, c: 0 };\n\n this.list.forEach(function(cardEntry) {\n var quantity = cardEntry.quantity;\n let card = db.card(cardEntry.id);\n if (card && quantity > 0) {\n if (\n card.type.indexOf(\"Land\") != -1 ||\n card.type.indexOf(\"land\") != -1\n ) {\n if (card.frame.length < 5) {\n card.frame.forEach(function(c) {\n if (c == 1) {\n colors.w += quantity;\n colors.total += quantity;\n }\n if (c == 2) {\n colors.u += quantity;\n colors.total += quantity;\n }\n if (c == 3) {\n colors.b += quantity;\n colors.total += quantity;\n }\n if (c == 4) {\n colors.r += quantity;\n colors.total += quantity;\n }\n if (c == 5) {\n colors.g += quantity;\n colors.total += quantity;\n }\n if (c == 6) {\n colors.c += quantity;\n colors.total += quantity;\n }\n });\n }\n }\n }\n });\n\n return colors;\n }", "title": "" }, { "docid": "c560a2cd12b73426ce9e3a6408a42298", "score": "0.49030104", "text": "function Recipe( asJSON ) {\n this.price = null;\n this.name = null;\n this.ingredients = new Array();\n this.description = null;\n this.refillable = null;\n this.id = null;\n this.picture = null;\n this.coupon = null;\n\n /* Handle data coming in from JSON */\n if( asJSON ) {\n this.price = asJSON.price;\n this.name = asJSON.name;\n this.description = asJSON.description;\n this.refillable = asJSON.refillable;\n this.id = asJSON.id;\n this.picture = asJSON.picture;\n this.coupon = asJSON.coupon == 'true' ? true : false;\n\n for(var i in asJSON.ingredients ) {\n this.ingredients.push( new Ingredient( asJSON.ingredients[i] ) );\n }\n }\n\n this.getID = function() { return this.id; }\n this.setID = function(id) { this.id = id; }\n\n this.getPrice = function() { return this.price; }\n this.getName = function() { return this.name; }\n\n this.setPrice = function(price) { this.price = price; return this; }\n this.setName = function(name) { this.name = name; return this; }\n\n this.getDescription = function() { return this.description; }\n this.setDescription = function(descr ) { this.description = descr; return this; }\n\n this.supportsCoupon = function() { return this.coupon; }\n this.addCoupon = function() { this.coupon = true; return this; }\n this.removeCoupon = function() { this.coupon = false; return this; }\n\n /* How we add ingredients */\n this.addIngredient = function(ingredient) {\n this.ingredients.push( ingredient ); return this;\n }\n\n /* Remove an ingredient given it's name */\n this.removeIngredient = function(ingredientname ) {\n var foundIngredient = null; // return the ingredient object or a null if not found\n for(var i in this.ingredients ) {\n if( this.ingredients[i].getName() == ingredientname ) {\n foundIngredient = this.ingredients[i];\n this.ingredients.splice(i, 1);\n break;\n }\n }\n return foundIngredient;\n }\n\n this.findIngredient = function( ingredientname ) {\n var foundIngredient = null;\n for( var i in this.ingredients ) {\n if( this.ingredients[i].getName() == ingredientname ) {\n foundIngredient = this.ingredients[i];\n break;\n }\n }\n return foundIngredient;\n }\n\n this.getCalories = function() {\n var totalCalories = 0.0;\n for(var i in this.ingredients ) {\n totalCalories += parseFloat( this.ingredients[i].getCalories() );\n }\n return totalCalories;\n }\n\n this.isRefillable = function() { return this.refillable == 'true'; }\n this.setRefillable = function() { this.refillable = 'true'; return this; }\n this.setNotRefillable = function() { this.refillable = 'false'; return this; }\n\n this.listIngredients = function() { return this.ingredients; }\n}", "title": "" }, { "docid": "48363200088cf4ebef89eb2ac3c38b74", "score": "0.49000332", "text": "function renderSixItems() {\n for (let index2 = 0; index2 < arrayOfFood.length; index2++) {\n arrayOfItems[index2].innerHTML = `${arrayOfFood[index2].name} <br> Ingredients: ${arrayOfFood[index2].ingredients} <br> Price: ${arrayOfFood[index2].price}`;\n // arrayOfIngredientsOfList[index2].textContent = `${arrayOfFood[index2].name} \\n ${arrayOfFood[index2].ingredients} ${arrayOfFood[index2].price}` ;\n // console.log(arrayOfFood[index2].ingredients);\n }\n}", "title": "" }, { "docid": "d66c3b1727f9c2e880669f7780ad60db", "score": "0.48979563", "text": "function makeList(ingredients){\n\tvar docFrag = document.createDocumentFragment(), x =1;\n\n\t$.each(ingredients,function(key,val){\n\n\t\tvar qty = val,\n\t\tname = key,\n\t\tli, span_qty, span_name;\n\n\t\tli = document.createElement('li'), li.id = \"item-\"+x;\n\t\tspan_qty = document.createElement('span'), span_qty.className = \"qty\", span_qty.innerHTML = qty;\n\t\tspan_name = document.createElement('span'), span_name.className = \"name\", span_name.innerHTML = name;\n\t\t\n\t\tli.appendChild(span_qty)\n\t\tli.appendChild(span_name);\n\t\tdocFrag.appendChild(li);\n\t\tx++;\n\t})\n\n\treturn docFrag;\n}", "title": "" }, { "docid": "b741b4f71bd8089ad75657434c9bbce2", "score": "0.4895629", "text": "function createCards(randomizedSymbolList) {\n const fragment = document.createDocumentFragment();\n for (symbol of randomizedSymbolList) {\n const newCard = createCardElement(symbol);\n fragment.appendChild(newCard);\n }\n deck.appendChild(fragment);\n}", "title": "" }, { "docid": "04f9b331e74213293de32ee237f64d8c", "score": "0.48942965", "text": "function generateCardz(theParent, startHere, dataObject) {\n if (startHere <= 15) {\n theParent.innerHTML = \"\";\n mainWindow.classList = \"row\";\n ingredientSearch.classList = \"row hide\";\n for (let i = startHere; i < startHere + 5; i++) {\n //debugger;\n var colDiv = document.createElement(\"div\");\n colDiv.classList = \"col s12 m6 l4\";\n theParent.appendChild(colDiv);\n var cardDiv = document.createElement(\"div\");\n cardDiv.classList = \"card\";\n colDiv.appendChild(cardDiv);\n var imgDiv = document.createElement(\"div\");\n imgDiv.classList = \"card-image\";\n cardDiv.appendChild(imgDiv);\n var image = document.createElement(\"img\");\n image.src = `https://spoonacular.com/recipeImages/${dataObject[i].id}-480x360.jpg`;\n imgDiv.appendChild(image);\n var cardTitle = document.createElement(\"h4\");\n cardTitle.classList = \"card-title\";\n //cardTitle.style = \"font-size:20px\";\n cardTitle.textContent = `${dataObject[i].title}`;\n cardDiv.appendChild(cardTitle);\n var contentDiv = document.createElement(\"div\");\n contentDiv.classList = \"card-content\";\n cardDiv.appendChild(contentDiv);\n var servings = document.createElement(\"p\");\n servings.textContent = `Used ingredients: ${dataObject[i].usedIngredientCount}`;\n contentDiv.appendChild(servings);\n var minReady = document.createElement(\"p\");\n minReady.textContent = `Missed Ingredients : ${dataObject[i].missedIngredientCount}`;\n contentDiv.appendChild(minReady);\n \n var addBtn = document.createElement(\"button\");\n addBtn.classList =\n \"btn-floating halfway-fab waves-effect waves-light green eat-me-button\";\n addBtn.dataset.recipeID = dataObject[i].id;\n addBtn.innerHTML = `eat`;\n imgDiv.appendChild(addBtn);\n }\n currentRecipeIndex += 5;\n }\n }", "title": "" }, { "docid": "5e60af4986ab87d3520fa6d6bcf04d36", "score": "0.48866403", "text": "function getAllCards() {\r\n let li = [];\r\n while (document.getElementById('galart').innerHTML !== '') {\r\n let memID = document.querySelector('.loaded-article').id\r\n let memPrice = document.querySelector('.card_sml_price').innerHTML\r\n memPrice = parseInt(memPrice)\r\n let memContent = document.getElementById('galart').firstChild.innerHTML\r\n document.getElementById('galart').removeChild(document.getElementById(memID))\r\n let obj = {\r\n id: memID,\r\n content: memContent,\r\n price: memPrice\r\n }\r\n li.push(obj)\r\n }\r\n return li\r\n}", "title": "" }, { "docid": "7fe7378e1868e00326820c19f125f12a", "score": "0.48774028", "text": "function getIngredients(ingredients) {\n var queryURL = \"https://api.yummly.com/v1/api/recipe/\" + ingredients + \"?_app_id=26b02ec4&_app_key=1b6cdc7b7ae0b6805b5689898a4a5311\"\n $.ajax({\n url: queryURL,\n method: \"GET\",\n })\n .then(function(response) {\n renderIngredientsToHtml(response);\n })\n}", "title": "" }, { "docid": "a087eb5df1fa13171f83860a955b8f63", "score": "0.4862274", "text": "function showRecipe(num) {\n $(\"#recipes-page\").empty();\n $(\"#restaurants\").empty();\n var queryURLinstr = \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/\" + num + \"/information\"\n \n $.ajax({\n url: queryURLinstr,\n method: \"GET\",\n headers: ({\"X-Mashape-Key\": apiKey}) \n }).then(function(result) {\n var divRecipe = $('<div>');\n var title = $(\"<h5>\");\n //Added heart button for favorites lists\n var heartButton = $('<span id=\"favoritePick\" style=\"font-size: 2em; color: white\"><i class=\"fas fa-heart\"></i></span>'); \n var details = $(\"<p class='lead'>\");\n var ingredList = $(\"<ul>\");\n var steps = $(\"<ol>\");\n\n if (result.analyzedInstructions.length != 0) {\n \n title.text(result.title);\n\n heartButton.attr(\"data-favorite\", result.id);\n details.text(\"Servings: \" + result.servings + \" Preparation time: \" + result.readyInMinutes);\n \n for (var i=0;i<result.extendedIngredients.length;i++) {\n ingredList.append(\"<li>\" + result.extendedIngredients[i].originalString + \"</li>\");\n }\n \n for (var k=0;k<result.analyzedInstructions[0].steps.length;k++) {\n steps.append(\"<li>\" + result.analyzedInstructions[0].steps[k].step + \"</li>\");\n }\n \n if(result.cuisines.length != 0) {\n console.log(\"Cuisines \" + result.cuisines[0]);\n showRestaurants(cityForRestaurants, result.cuisines[0]);\n } else if (result.diets.length != 0) {\n console.log(\"Diets\" + result.diets[0]);\n showRestaurants(cityForRestaurants, result.diets[0]);\n } else {\n title.text(\"Try another recipe to see restaurants\");\n $(\".recipes\").show();\n $(\"#recipes-page\").append(title);\n }\n \n $(\"#recipes-page\").show(); \n divRecipe.append(title, heartButton, details, ingredList, steps);\n $(\"#recipes-page\").append(divRecipe);\n \n } else {\n title.text(\"This recipe is no longer available. Try another one\");\n $(\"#recipes-page\").show();\n $(\"#recipes-page\").append(title);\n } \n console.log(result);\n });\n }", "title": "" }, { "docid": "1ba7b78d271fab37d8a50917cbcc8022", "score": "0.48615423", "text": "function generateEmployeeCards (data) {\n let employeeCards = '';\n for (let i = 0; i < data.length; i++) {\n const currentEmployee = data[i];\n let icon = '';\n let thirdAttribute = '';\n if (currentEmployee.employeeType === 'Manager') {\n icon = `<i class=\"fas fa-mug-hot\"></i>`\n } else if (currentEmployee.employeeType === 'Intern') {\n icon = `<i class=\"fas fa-graduation-cap\"></i>`\n } else if (currentEmployee.employeeType === 'Employee') { \n icon = `<i class=\"fas fa-male\"></i>`\n } else {\n icon = `<i class=\"fas fa-glasses\"></i>`\n }\n if (currentEmployee.employeeType === 'Manager') {\n thirdAttribute = `Office Number: ${currentEmployee.employeeOffice}`\n } else if (currentEmployee.employeeType === 'Intern') {\n thirdAttribute = `School: ${currentEmployee.employeeSchool}`\n } else if (currentEmployee.employeeType === 'Employee') {\n thirdAttribute = `Cubicle Number: ${currentEmployee.employeeCube}`\n } else {\n thirdAttribute = `GitHub: ${currentEmployee.employeeGithub}`\n }\n\n employeeCards += `\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-header\">\n <h3>${currentEmployee.employeeName}</h3>\n <div class='employee-header'>\n ${icon}\n <h5>${currentEmployee.employeeType}</h5>\n </div>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${i+1}</li>\n <li class=\"list-group-item\">Email: ${currentEmployee.employeeEmail}</li>\n <li class=\"list-group-item\">${thirdAttribute}</li>\n </ul>\n </div>`\n }\n return employeeCards\n}", "title": "" }, { "docid": "5f59cb5cda421260be6ddda2b74fd6a1", "score": "0.48545074", "text": "function ketoFriendly(keto) {\n var queryURL =\n \"https://api.edamam.com/search?q=\" +\n keto +\n \"&app_id=8576ed90&app_key=ab55075184c4b008009b866d7c39b885&Health=keto-friendly&to=5\";\n // API call for getting recipe details\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n // console.log(response);\n $(\"#recipeInfo\").empty();\n\n // start rendering the data on the html from here\n for (i = 0; i < response.hits.length; i++) {\n var recipeHeading = $(\"<p>\").text(\n \"Recipe \" + (i + 1) + \": \" + response.hits[i].recipe.label\n );\n $(recipeHeading).addClass(\"title is-4\");\n\n healthLabels = $(\"<p>\").text(\n \"Category: \" + response.hits[i].recipe.healthLabels[0]\n );\n\n var calories = $(\"<p>\").text(\n \"Calories: \" + Math.floor(response.hits[i].recipe.calories)\n );\n\n var recipeImage = $(\"<img>\").attr(\"src\", response.hits[i].recipe.image);\n\n var ingredients = $(\"<p>\").text(\"Ingredients: \");\n $(ingredients).addClass(\"subtitle is-5\");\n\n $(\"#recipeInfo\").append(\n recipeHeading,\n recipeImage,\n healthLabels,\n calories,\n ingredients\n );\n\n //loop for building ingredient list based on the number of ingredients\n for (j = 0; j < response.hits[i].recipe.ingredientLines.length; j++) {\n ingredients = $(\"<p>\").text(response.hits[i].recipe.ingredientLines[j]);\n $(\"#recipeInfo\").append(ingredients);\n }\n\n //building the URL for displaying on HTML\n var urlText = $(\"<p>\").text(\"For recipe directions use this link: \");\n var url = $(\"<a>\").text(response.hits[i].recipe.url);\n $(url).attr(\"href\", response.hits[i].recipe.url);\n $(url).attr(\"target\", \"_blank\");\n\n $(\"#recipeInfo\").append(\"<br>\", urlText, url, \"<br><br><br>\");\n }\n });\n}", "title": "" }, { "docid": "a1cd017f30c991d25084c93c5d5bc03d", "score": "0.4850908", "text": "_generateMarkupIngredient(ing) {\n return `\n <li class=\"recipe__ingredient\">\n <svg class=\"recipe__icon\">\n <use href=\"${icons}#icon-check\"></use>\n </svg>\n <div class=\"recipe__quantity\">${\n //if there is a quantity convert to fraction else leave empty\n ing.quantity ? new Fraction(ing.quantity).toString() : ''\n }</div>\n <div class=\"recipe__description\">\n <span class=\"recipe__unit\">${ing.unit}</span>\n ${ing.description}\n </div>\n </li>\n `;\n }", "title": "" }, { "docid": "e47242cc9d8a839c65e713c743102ac7", "score": "0.48480886", "text": "function CardDeck(){\n\n this.SUIT_NAMES = [\"Spades\",\"Hearts\",\"Diamonds\",\"Clubs\" ];\n\tthis.SUIT_COLORS = [\"black\",\"red\",\"orange\",\"blue\" ];\n\tthis.SUIT_UNICODE_CHARS = [\"\\u2660\",\"\\u2661\",\"\\u2662\",\"\\u2663\" ];\n\tthis.SUIT_HTML_ENTITIES = [\"&spades;\",\"&hearts;\",\"&diams;\",\"&clubs;\"];\n\tthis.SUIT_SYMBOLS = this.SUIT_HTML_ENTITIES ; //[\"\\\\/\",\"o\",\"<>\",\"+\" ];\n\t\n\tthis.CARD_VALUE_NAMES = [\"ACE\", \"KING\", \"QUEEN\", \"JACK\", \"TEN\", \"NINE\", \"EIGHT\", \"SEVEN\", \"SIX\", \"FIVE\", \"FOUR\", \"THREE\", \"TWO\"];\n\tthis.CARD_VALUE_SYMBOLS = [\"A\",\"K\",\"Q\",\"J\", \"10\", \"9\" , \"8\" , \"7\", \"6\", \"5\", \"4\", \"3\", \"2\"];\n\t\n\tthis.CARD_SUIT_SPADE = new CardSuit(this.SUIT_NAMES[0], this.SUIT_COLORS[0], this.SUIT_SYMBOLS[0], this.SUIT_UNICODE_CHARS[0]);\n\tthis.CARD_SUIT_HEART = new CardSuit(this.SUIT_NAMES[1], this.SUIT_COLORS[1], this.SUIT_SYMBOLS[1], this.SUIT_UNICODE_CHARS[1]);\n\tthis.CARD_SUIT_DIAMOND = new CardSuit(this.SUIT_NAMES[2], this.SUIT_COLORS[2], this.SUIT_SYMBOLS[2], this.SUIT_UNICODE_CHARS[2]);\n\tthis.CARD_SUIT_CLUB = new CardSuit(this.SUIT_NAMES[3], this.SUIT_COLORS[3], this.SUIT_SYMBOLS[3], this.SUIT_UNICODE_CHARS[3]);\n\t\n\tthis.CARD_SUITS = [ this.CARD_SUIT_SPADE, this.CARD_SUIT_HEART, this.CARD_SUIT_DIAMOND, this.CARD_SUIT_CLUB ];\n\t\n\tthis.CARD_SUITS_COUNT = this.CARD_SUITS.length;\n\tthis.CARD_VALUES_COUNT = this.CARD_VALUE_NAMES.length;\n\tthis.CARDS_TOTAL_COUNT = this.CARD_SUITS_COUNT * this.CARD_VALUES_COUNT;\n\t\n\tthis.deck = [];\n}", "title": "" }, { "docid": "e695f8bce9ec5490fa6e82f8e13ea29a", "score": "0.48476452", "text": "function unpackStimulusList(stimList) {\n console.log(stimList);\n\n var null_response = $(\"<p>not supplied</p>\");\n\n if (stimList == null) {\n return null_response;\n }\n\n if (stimList.Stimulus == null || stimList.Stimulus.length < 1) {\n return null_response;\n }\n\n var response = $(\"<p></p>\");\n\n jQuery.each(stimList.Stimulus, function(index, stimulus) {\n if (stimulus == null) {\n return false;\n }\n\n console.log(stimulus);\n\n response.append(\"Genre: \" + stimulus.TextGenre + \"<br/>\");\n response.append(\"Type: \" + stimulus.TextType + \"<br/>\");\n response.append(\"Words: \" + stimulus.WordCount + \"<br/>\");\n response.append(\"Descriptor: \" + stimulus.TextDescriptor + \"<br/>\");\n response.append(\"Content: \" + stimulus.Content + \"<br/>\");\n });\n\n return response;\n\n}", "title": "" }, { "docid": "de97e9382cfed47abd713356a816ffcc", "score": "0.48457453", "text": "function displayChiliRecipe(){\n\n\t\t\t\tlocalStorage.getItem(\"chiliRecipe\");\n\t\t\t\tlet recipeServing = chiliRecipe.serves;\n\t\t\t\tlet recipePrepTime = chiliRecipe.preparationTime;\n\t\t\t\tlet recipeCookTime = chiliRecipe.cookingTime;\n\t\t\t\tlet servingSize = getCookie(\"serving quantity\");\n\t\n\t\t\t\tif(servingSize == \"half\"){\n\t\t\t\t\trecipeServing = recipeServing / 2;\n\t\t\t\t\trecipePrepTime = recipePrepTime / 2;\n\t\t\t\t\trecipeCookTime = recipeCookTime / 2;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(servingSize == \"double\"){\n\t\t\t\t\trecipeServing = recipeServing * 2;\n\t\t\t\t\trecipePrepTime = recipePrepTime * 2;\n\t\t\t\t\trecipeCookTime = recipeCookTime * 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdocument.querySelector(\".image > img\").setAttribute(\"src\", chiliRecipe.image);\n\t\t\t\tdocument.querySelector(\".recipe > h1\").innerHTML = chiliRecipe.name;\n\t\t\t\tdocument.querySelector(\"#serves\").innerHTML = recipeServing;\n\t\t\t\tdocument.querySelector(\"#prepTime\").innerHTML = recipePrepTime + \" \" + chiliRecipe.preparationTimeUnit;\n\t\t\t\tdocument.querySelector(\"#cookTime\").innerHTML = recipeCookTime + \" \" + chiliRecipe.cookingTimeUnit;\n\t\t\t\tdocument.querySelector(\"#ingredients\").innerHTML = \"\";\n\t\t\t\tdocument.querySelector(\"#instructions\").innerHTML = \"\";\n\t\t\t\tdocument.querySelector(\"#notes\").innerHTML = \"\";\n\t\t\t\t\n\n\t\t\t\tfor(let i=0; i < chiliRecipe.ingredient.length; i++){\n\t\t\t\t\tlet node = document.createElement(\"li\"); // Create a <li> node\n\t\t\t\t\tlet ingredientNumber = chiliRecipe.ingredientAmount[i];\n\t\t\t\t\t\n\t\t\t\t\tif(servingSize == \"half\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\tingredientNumber = chiliRecipe.ingredientAmount[i] / 2;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(ingredientNumber % 1 != 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet fraction = ingredientNumber;\n\t\t\t\t\t\tlet len = fraction.toString().length - 2;\n\n\t\t\t\t\t\tlet denominator = Math.pow(10, len);\n\t\t\t\t\t\tlet numerator = fraction * denominator;\n\n\t\t\t\t\t\tlet divisor = gcd(numerator,denominator);\n\n\t\t\t\t\t\tnumerator /= divisor;\n\t\t\t\t\t\tdenominator /= divisor;\n\n\t\t\t\t\t\tingredientNumber = Math.floor(numerator) + '/' + Math.floor(denominator);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet textnode = document.createTextNode(ingredientNumber + \" \" + chiliRecipe.ingredientMeasurement[i] + \" \" + chiliRecipe.ingredient[i]); // Create a text node\n\t\t\t\t\tnode.appendChild(textnode); // Append the text to <li>\n\t\t\t\t\tdocument.querySelector(\"#ingredients\").appendChild(node); // Append <li> to <ul> with id=\"myList\"\n\t\t\t\t}\n\n\t\t\t\tfor(let i=0; i < chiliRecipe.instructions.length; i++){\n\t\t\t\t\tlet node = document.createElement(\"li\"); // Create a <li> node\n\t\t\t\t\t\n\t\t\t\t\tlet instructions = chiliRecipe.instructions[i];\n\t\t\t\t\t\n\t\t\t\t\tif (servingSize == \"half\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet findNumber = /\\d+/g;\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet number = instructions.match(findNumber);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(number != null){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(let x = 0; x < number.length; x++){\n\t\t\t\t\t\t\t\tlet newNumber = number[x] / 2;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tinstructions = instructions.replace(number[x], newNumber);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (servingSize == \"double\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet findNumber = /\\d+/g;\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet number = instructions.match(findNumber);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(number != null){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(let x = 0; x < number.length; x++){\n\t\t\t\t\t\t\t\tlet newNumber = number[x] * 2;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tinstructions = instructions.replace(number[x], newNumber);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet textnode = document.createTextNode(instructions); // Create a text node\n\t\t\t\t\tnode.appendChild(textnode); // Append the text to <li>\n\t\t\t\t\tdocument.querySelector(\"#instructions\").appendChild(node); // Append <li> to <ul> with id=\"myList\"\n\t\t\t\t}\n\n\t\t\t\tfor(let i=0; i < chiliRecipe.notes.length; i++){\n\t\t\t\t\tlet node = document.createElement(\"li\"); // Create a <li> node\n\t\t\t\t\t\n\t\t\t\t\tlet notes = chiliRecipe.notes[i];\n\t\t\t\t\t\n\t\t\t\t\tif (servingSize == \"half\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet findNumber = /\\d+/g;\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet number = notes.match(findNumber);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(number != null){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(let x = 0; x < number.length; x++){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tlet newNumber = number[x] / 2;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tnotes = notes.replace(number[x], newNumber);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (servingSize == \"double\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet findNumber = /\\d+/g;\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet number = notes.match(findNumber);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(number != null){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(let x = 0; x < number.length; x++){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tlet newNumber = number[x] * 2;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tnotes = notes.replace(number[x], newNumber);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet textnode = document.createTextNode(notes); // Create a text node\n\t\t\t\t\tnode.appendChild(textnode); // Append the text to <li>\n\t\t\t\t\tdocument.querySelector(\"#notes\").appendChild(node); // Append <li> to <ul> with id=\"myList\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsetCookie(\"current recipe\",\"chili\");\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "24b14b2979870f77b0c31bc7da80c229", "score": "0.4843398", "text": "async getDrinksByIngredient ( ingredient ) {\n\t\t// Search by ingredient\n\t\tconst apiResponse = await fetch( `https://www.thecocktaildb.com/api/json/v1/1/filter.php?i=${ingredient}` );\n\n\t\t// Wait for response then return JSON\n\t\tconst cocktails = await apiResponse.json();\n\n\t\treturn {\n\t\t\tcocktails\n\t\t};\n\t}", "title": "" }, { "docid": "caf67cadd201eff559f50f0be3e8d48a", "score": "0.484236", "text": "function createCards() {\n\tconst cards = document.createDocumentFragment();\n\tfor (const card of cardsList) {\n\t\t// prebacit u funkciju - performance funkcija vs inline coda\n\t\tconst newListItem = document.createElement('li');\n\t\tnewListItem.className = 'card';\n\t\tconst newImage = document.createElement('i');\n\t\tnewImage.className = card;\n\t\tnewListItem.appendChild(newImage);\n\t\tcards.appendChild(newListItem);\n\t}\n\tdeck.appendChild(cards);\n}", "title": "" }, { "docid": "04171ff244c95e8a2f8f74cc76b5f1a0", "score": "0.48378095", "text": "function outputCardNames(){\r\n myCardNames.forEach((name) => {\r\n friendlyName = name.innerText.replace(\"#\",\"T\");\r\n friendlyName = friendlyName.substr(0,friendlyName.indexOf(\" \")) + \" - \" + friendlyName.substr(friendlyName.indexOf(\" \")+1,friendlyName.length);\r\n\r\n outputList = outputList + \"\\n\" + \r\n friendlyName;\r\n })\r\n console.log(outputList);\r\n}", "title": "" }, { "docid": "080bc88df334e7de557187b84b19e0c2", "score": "0.48362014", "text": "function restList(k)\n {\n //Clears any previous content in the area where the Restaurants will be displayed\n $(\"#recipeList\").empty();\n $(\"#recipeList2\").empty();\n $(\"#recipeList3\").empty();\n\n //Assigns the Restaurants results to a variable that the function will use throughout the entire run\n var restResults = k.restaurants;\n \n //Cycles through all the results to create a column for each of their cards\n for (var i = 0; i < 9; i++) {\n \n var rCol = $(\"<div>\").addClass(\"col s3 offset-s1\");\n \n //Grabs the Restaurant name from the result array in the respective position\n var restName = restResults[i].restaurant.name;\n \n //Creates a list item with the Average User Review\n var restReview = $(\"<li>\").text(\"Average User Review: \" + restResults[i].restaurant.user_rating.aggregate_rating + \"/5\");\n \n //Creates the Price Range section before it will be appended\n var pRange = restResults[i].restaurant.price_range;\n var restRange = \"\";\n \n for(var x=1; x<=pRange; x++)\n {\n restRange = restRange + \"$\";\n }\n \n //The rest of the list elements are created before being appended to the card info section\n var costRange = $(\"<li>\").text(\"Price Range: \" + restRange);\n var avCost = $(\"<li>\").text(\"Average Cost for Two: $\" + restResults[i].restaurant.average_cost_for_two);\n var restLocation = $(\"<li>\").text(\"Address: \" + restResults[i].restaurant.location.address + \",\" + restResults[i].restaurant.location.city + \",\" + restResults[i].restaurant.location.zipcode);\n var menuUrl = restResults[i].restaurant.menu_url;\n var restCuisines = $(\"<li>\").text(\"Cuisines: \" + restResults[i].restaurant.cuisines);\n var rLink = $(\"<a>\").attr({\"href\": menuUrl,\"target\":\"_blank\"}).text(\"See the Menu!\");\n var menuLink = $(\"<li>\").append(rLink);\n var infoList = $(\"<ul>\").append(restReview, restCuisines, costRange, avCost, restLocation, menuLink);\n var restImg = restResults[i].restaurant.featured_image;\n\n var rCard = $(\"<div>\").addClass(\"card left\");\n \n //Checks if the restaurant info has a preview image. If not then it sets a placeholder image\n if(restImg != \"\"){\n var rImg = $(\"<img>\").addClass(\"activator\").attr(\"src\", restImg);\n }else{\n var rImg = $(\"<img>\").addClass(\"activator\").attr(\"src\", \"food-placeholder.jpg\");\n };\n \n //Creates the different sections of each card before appending them all together\n var imgDiv = $(\"<div>\").addClass(\"card-image waves-effect waves-block waves-light\").append(rImg);\n var rTitle = $(\"<span>\").addClass(\"card-title activator center pd10\").text(restName);\n var rTitle2 = $(\"<span>\").addClass(\"card-title activator center pd10\").text(restName);\n var rContent = $(\"<div>\").addClass(\"card-content\").append(rTitle2);\n rTitle2.append(infoList);\n var rReveal = $(\"<div>\").addClass(\"card-reveal\").append(rTitle2);\n \n //Puts together the card sections before appending the completed card to its respective column\n rCard.append(imgDiv, rTitle, rContent, rReveal);\n rCol.append(rCard);\n \n //Separates the columns into 3 rows for aesthetic reasons\n if (i <= 2) {\n $(\"#recipeList\").append(rCol);\n } else if(i<=5) {\n $(\"#recipeList2\").append(rCol);\n }else{\n $(\"#recipeList3\").append(rCol);\n }\n }\n }", "title": "" } ]
50a2a60b617d189967bb49e9dff7f5e0
Add integers, wrapping at 2^32. This uses 16bit operations internally to work around bugs in some JS interpreters. //dominictarr: this is 10 years old, so maybe this can be dropped?)
[ { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.0", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" } ]
[ { "docid": "949cd3a4e14f291fe0fb4a2e3e4d96fa", "score": "0.7971375", "text": "function add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "949cd3a4e14f291fe0fb4a2e3e4d96fa", "score": "0.7971375", "text": "function add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "949cd3a4e14f291fe0fb4a2e3e4d96fa", "score": "0.7971375", "text": "function add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.78849316", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "f813ab0278a5f882e34388de039b3287", "score": "0.7884406", "text": "function add32(a, b) {\n\treturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "c152be65d3c4a09dac1213271e0ac722", "score": "0.7854144", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "c152be65d3c4a09dac1213271e0ac722", "score": "0.7854144", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "c152be65d3c4a09dac1213271e0ac722", "score": "0.7854144", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "e31b305a5ec7883db1f0afcfa5f368f1", "score": "0.77906346", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "d5e26f09ee34189741dff253ef1203a3", "score": "0.77469796", "text": "function add32(a, b) {\n\t\t\treturn (a + b) & 0xFFFFFFFF;\n\t\t}", "title": "" }, { "docid": "6e0b409d494bfa13261a5cd22a03fb4b", "score": "0.75755584", "text": "function add32(a, b) {\n // Add 32-bit integers, wrapping at 32 bits\n // Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.\n var lsw = (a & 0xFFFF) + (b & 0xFFFF);\n var msw = (a >> 16) + (b >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "9c8c394724d6a95b1da377aeb8caf501", "score": "0.751082", "text": "function safeAdd_32 (x, y)\n{\n\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\tvar msw = (x >>> 16) + (y >>> 16) + (lsw >>> 16);\n\n\treturn ((msw & 0xFFFF) << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "963b45dcf6bcb5ea6c924a5157db3bc4", "score": "0.73754436", "text": "function safeAdd_32 (x, y)\n\t{\n\t\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t\tvar msw = (x >>> 16) + (y >>> 16) + (lsw >>> 16);\n\n\t\treturn ((msw & 0xFFFF) << 16) | (lsw & 0xFFFF);\n\t}", "title": "" }, { "docid": "8e9a5433513fd43a22bfed2f3ef5a8de", "score": "0.72337806", "text": "function add32bit(x, y)\n {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "018fb2e67ee7dac86fc2f88b504c5767", "score": "0.71432734", "text": "function safeAdd(x,y){var lsw=(x&0xffff)+(y&0xffff);var msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&0xffff;}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "07264425fe213bae54797432f297326c", "score": "0.7110165", "text": "function ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "d5777169487f6c8cf540fd8ebd511d33", "score": "0.7027316", "text": "function ADD64AA(v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "d5777169487f6c8cf540fd8ebd511d33", "score": "0.7027316", "text": "function ADD64AA(v, a, b) {\n var o0 = v[a] + v[b];\n var o1 = v[a + 1] + v[b + 1];\n if (o0 >= 0x100000000) {\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "ccdd347e0429592bc058b5dd31fb19df", "score": "0.702657", "text": "function ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "ccdd347e0429592bc058b5dd31fb19df", "score": "0.702657", "text": "function ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "ccdd347e0429592bc058b5dd31fb19df", "score": "0.702657", "text": "function ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}", "title": "" }, { "docid": "7b32eb0ed83c8615ec4ed41448948a7c", "score": "0.6987444", "text": "function ADD64AA(v, a, b) {\n const o0 = v[a] + v[b];\n let o1 = v[a + 1] + v[b + 1];\n if (o0 >= 4294967296) o1++;\n v[a] = o0;\n v[a + 1] = o1;\n}", "title": "" }, { "docid": "15780bee25ebd93557f824dbe1ee810c", "score": "0.69821703", "text": "function safe_add(x, y)\n\n{\n\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\n return (msw << 16) | (lsw & 0xFFFF);\n\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.6961053", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "1aaf4deba975fd8b9e1fa2a1b56da1eb", "score": "0.6955159", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "0ab544aa85e059136a2a982cf13fe771", "score": "0.69538426", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}", "title": "" }, { "docid": "aefa071f1c437e721b66d31b3fadaa15", "score": "0.6947755", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n }", "title": "" }, { "docid": "aefa071f1c437e721b66d31b3fadaa15", "score": "0.6947755", "text": "function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n }", "title": "" }, { "docid": "047c7e77839858fe3dd1ac6c98804988", "score": "0.6946451", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xffff);\n}", "title": "" }, { "docid": "b00997f42892ede43057550bc6f58742", "score": "0.69400555", "text": "function safe_add(x, y) {\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t return msw << 16 | lsw & 0xFFFF;\n\t}", "title": "" }, { "docid": "0a95104aed43bfbe96464384721d1737", "score": "0.69293165", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "2e147013b922a660462c66b3602d0803", "score": "0.69263864", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.6921812", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.6921812", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.6921812", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.6921812", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.6921812", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "5977ebddaec9281a300fb2afed8e5305", "score": "0.6918781", "text": "function safeAdd(x, y) {\n\t var lsw = (x & 0xffff) + (y & 0xffff);\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t return msw << 16 | lsw & 0xffff;\n\t}", "title": "" }, { "docid": "d9b2cca468c5ea638da27894ba8e5977", "score": "0.69145536", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}", "title": "" }, { "docid": "d9b2cca468c5ea638da27894ba8e5977", "score": "0.69145536", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}", "title": "" }, { "docid": "d9b2cca468c5ea638da27894ba8e5977", "score": "0.69145536", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}", "title": "" }, { "docid": "d9b2cca468c5ea638da27894ba8e5977", "score": "0.69145536", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}", "title": "" }, { "docid": "d9b2cca468c5ea638da27894ba8e5977", "score": "0.69145536", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}", "title": "" }, { "docid": "d9b2cca468c5ea638da27894ba8e5977", "score": "0.69145536", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}", "title": "" }, { "docid": "be91fe1034c83fdc2c486c24b67da7a2", "score": "0.6914428", "text": "function addInt_(x,n) {\n var i,k,c,b;\n x[0]+=n;\n k=x.length;\n c=0;\n for (i=0;i<k;i++) {\n c+=x[i];\n b=0;\n if (c<0) {\n b=-(c>>bpe);\n c+=b*radix;\n }\n x[i]=c & mask;\n c=(c>>bpe)-b;\n if (!c) return; //stop carrying as soon as the carry is zero\n }\n }", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "04d58d535a3c6389521cc699a876cbaf", "score": "0.6911235", "text": "function safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" } ]
1e35ed751b079e57911952de708fd918
(protected) return x s.t. r^x < DV
[ { "docid": "0917058b298b138879582679ce383382", "score": "0.0", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" } ]
[ { "docid": "72909d10e2fb935cfc4b7cfea4df89d6", "score": "0.6147511", "text": "static approxEq(x, y) {\nvar DIFF, EPS, SIZE;\n//--------\nEPS = 5e-5;\nDIFF = Math.abs(x - y);\nSIZE = Math.max(Math.abs(x), Math.abs(y));\nif (SIZE <= 1) {\nreturn DIFF < EPS;\n} else {\nreturn DIFF / SIZE < EPS;\n}\n}", "title": "" }, { "docid": "b339bc70e4caf7c2c62d8882f616f62a", "score": "0.60142255", "text": "function verifSide(actX,i,valX,max)\n{\n return (((actX+(i*25)+valX)<0)||((actX+(i*25)+valX)>=max));\n}", "title": "" }, { "docid": "0d907a1761623c1f76a4a791be1e2e6a", "score": "0.5697616", "text": "function Vypiscislo(x)\n{\n return +x-3\n}", "title": "" }, { "docid": "cbbb0fe892dbbfe5c479a9a9f6d1839d", "score": "0.5671695", "text": "densitateaDeRepartitieCazulRedus(x) {\n\t\t\treturn ( (1 / (Math.sqrt(2 * Math.PI))) * (Math.pow(Math.E, (Math.pow(x, 2) / 2))) );\n\t\t}", "title": "" }, { "docid": "0eddaabee824a0d67724220f6bd0fa1b", "score": "0.5669142", "text": "function d1(S, X, v, r, T){\n\tvar d1;\n\td1 = (Math.log(S / X) + (r + v * v / 2.0) * T) / (v * Math.sqrt(T));\n return d1;\n\n}", "title": "" }, { "docid": "b83fb3291caba3ea4af0cb6f6250a7e5", "score": "0.56457233", "text": "function minV(x) {\r\n var xerg = x[0]; y = xerg;\r\n var lt=x.length;\r\n for (igo = 1; igo < lt; igo++) {\r\n if (x[igo] < xerg) {\r\n xerg = x[igo]; \r\n }\r\n }\r\n y = xerg;\r\n return y;\r\n}", "title": "" }, { "docid": "64a57467202c93e66600b559c24645fc", "score": "0.5633404", "text": "outOfBoundsX(x) {\n return (this.x + x > 400 || this.x + x < 0)\n }", "title": "" }, { "docid": "bad404e92629c2679f852c4e388c9ad7", "score": "0.5632039", "text": "function dens_uniform(x){\n var ret = 0;\n if(a<=x && x<=b){\n ret = 1/(b-a);\n }\n return ret;\n}", "title": "" }, { "docid": "acd2ca1dbb2dde28be0bec043d2cec34", "score": "0.5628032", "text": "function lineEqn(x) {\n return .4 * x + .01;\n}", "title": "" }, { "docid": "6e9f396861a52f976345663c2281430c", "score": "0.55961365", "text": "function erfc(x) {\n var z = Math.abs(x);\n var t = 1 / (1 + z / 2);\n var r = t * Math.exp(-z * z - 1.26551223 + t * (1.00002368 +\n t * (0.37409196 + t * (0.09678418 + t * (-0.18628806 +\n t * (0.27886807 + t * (-1.13520398 + t * (1.48851587 +\n t * (-0.82215223 + t * 0.17087277)))))))));\n return x >= 0 ? r : 2 - r;\n}", "title": "" }, { "docid": "29de7bd1888412496eaf5eb17cd06280", "score": "0.55572623", "text": "function erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = - Math.log((1 - x) * (1 + x)), p;\n\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n\n return p * x;\n}", "title": "" }, { "docid": "36541febf51aceb7ae27961b2c053090", "score": "0.5527094", "text": "function constrain(x,lower,upper) {\n if (x > upper) {\n return upper;\n } else if (x < lower) {\n return lower;\n } else {\n return x;\n }\n }", "title": "" }, { "docid": "60a7338857449c90cc3f7b8591f4dc2e", "score": "0.55221504", "text": "function positive(x) {\r\n return x > 0;\r\n}", "title": "" }, { "docid": "b2fd91403ebb177b2d0fa381bd2a3140", "score": "0.55129987", "text": "function RSADoPrivate(x) {\n if (this.p == null || this.q == null) return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while (xp.compareTo(xq) < 0) {\n xp = xp.add(this.p);\n }return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n }", "title": "" }, { "docid": "43a208265b926fb33d5bf558632e404d", "score": "0.55083215", "text": "get x() {\n return this.r * toFloat;\n }", "title": "" }, { "docid": "65f073e04e2954ab07a1942c7ec8d4a0", "score": "0.54893476", "text": "function e4fn(x) {\n\tvar con, com;\n\tcon = 1.0 + x;\n\tcom = 1.0 - x;\n\treturn (Math.sqrt((Math.pow(con,con))*(Math.pow(com,com))));\n}", "title": "" }, { "docid": "32df53d466e9c008c3d0c045714c7d32", "score": "0.54810077", "text": "calculVitesseX(){\r\n //rajout de 1 facteur\r\n if (this.vitesseXFacteur < this.limiteFacteur){\r\n this.vitesseXFacteur +=1; // faire en fonction de la largeur du terrain\r\n }\r\n else {/*rien car la vitesse ne peux pas depasser la limite*/}\r\n }", "title": "" }, { "docid": "15a31fb624bb9d766861d45dc7e6c77d", "score": "0.54657716", "text": "function RSADoPrivate(x) {\n if (this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while (xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n }", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54591554", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54591554", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "aa06377005bf97181bfda9a5aa226b7d", "score": "0.54527044", "text": "function dNd1(S, X, v, r, T){\n\n return (1.0/Math.sqrt(2.0*Math.PI))*Math.exp(-(d1(S,X,v,r,T)*d1(S,X,v,r,T))/2.0);\n}", "title": "" }, { "docid": "416136f8cf0f1434b65f99e84a2b93e7", "score": "0.5438252", "text": "function pointIsWithinThreshold(dx, x) {\n return dx > x - THRESHOLD && dx < x + THRESHOLD;\n}", "title": "" }, { "docid": "e321a345af3b7a8f82357b7287cec4dd", "score": "0.54308385", "text": "function left_side_X(){\r\n\r\n\tvar imgd = ctx.getImageData(0,0, c.width,c.height);\r\n\t//var pix_array = imgd.data;\r\n\r\n\t//furthest right hand side value (makes the coding a little easier)\r\n\tvar x_val = c.width; \r\n\r\n\tfor(var y = 0; y < c.height; y++){\r\n\t\tfor(var x = 0; x < c.width; x++){\r\n\r\n\t\t\tvar index = (x + y * imgd.width) * 4;\r\n\r\n\t\t\tif(imgd.data[index+0] == 0 &&\r\n\t\t\t\timgd.data[index+1] == 0 &&\r\n\t\t\t\timgd.data[index+2] == 0){\r\n\r\n\t\t\t\tif(x < x_val){\r\n\t\t\t\t\tx_val = x;\r\n\t\t\t\t\t//console.log(\"(left_side_X) x_val is: \" + x_val);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} \r\n\r\n\t//console.log(\"!!!!left_side_X is: \" + x_val);\r\n\r\n\treturn x_val;\r\n\r\n}", "title": "" }, { "docid": "575dafec7e0fa3a60f98582002c0894f", "score": "0.54170394", "text": "function getdX(X0, X1) {\n\treturn ((X1 - X0 + tau/2) % tau + tau) % tau - tau/2\n}", "title": "" }, { "docid": "ed27b80f14f036df73936043ca55b359", "score": "0.53903484", "text": "getVx(path){\n switch (path[this.currentNode][2]) {\n case 'u':\n case 'd':\n return 0;\n case 'l':\n return -1 * this.velocity;\n case 'r':\n return this.velocity;\n case 'ul':\n case 'dl':\n return -1/Math.sqrt(2) * this.velocity;\n case 'ur':\n case 'dr':\n return 1/Math.sqrt(2) * this.velocity;\n }\n }", "title": "" }, { "docid": "0d70ce318531da168a9ab187c6a50c39", "score": "0.5387273", "text": "function g(x)\n{\n var switchlev = 0.1;\n var z;\n\n if (x == 0) return 1;\n if (x == 1) return 0;\n\n var d = 1 - x;\n\n if (Math.abs(d) > switchlev) return (1 - (x * x) + (2 * x * Math.log(x))) / (d * d);\n\n z = d / 3;\n var di = d;\n\n for (var i = 2; i <= 7; i++)\n {\n di *= d;\n z += (2 * di) / ((i+1) * (i+2));\n }\n return z;\n}", "title": "" }, { "docid": "0d70ce318531da168a9ab187c6a50c39", "score": "0.5387273", "text": "function g(x)\n{\n var switchlev = 0.1;\n var z;\n\n if (x == 0) return 1;\n if (x == 1) return 0;\n\n var d = 1 - x;\n\n if (Math.abs(d) > switchlev) return (1 - (x * x) + (2 * x * Math.log(x))) / (d * d);\n\n z = d / 3;\n var di = d;\n\n for (var i = 2; i <= 7; i++)\n {\n di *= d;\n z += (2 * di) / ((i+1) * (i+2));\n }\n return z;\n}", "title": "" }, { "docid": "0aa026a53c1cd126389f78cb932b2cb9", "score": "0.5387258", "text": "function eq_result(eq_id,x,logbase,ignore_range) {\n\t\tif(eq[eq_id]!==undefined) {\n\t\t\tif(x==undefined) {\n\t\t\t\tthis.error = \"X UNDEFINED FOR EQ.\"+eq_id;\n\t\t\t\tif(debug) console.log(this.error); \n\t\t\t\treturn undefined;\n\t\t\t} else if((x<eq[eq_id]['xmin']||x>eq[eq_id]['xmax'])&&(ignore_range!=true)) {\n\t\t\t\tthis.error = \"X OUTSIDE RANGE FOR EQ.\"+eq_id+\" [x: \"+x+\", xmin: \"+eq[eq_id]['xmin']+\", xmax: \"+eq[eq_id]['xmax']+\"]\";\n\t\t\t\tif(debug) console.log(this.error); \n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn loggo(x,eq[eq_id]['args'],logbase);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.error = \"EQUATION NOT FOUND [eq_id: \"+eq_id+\"]\";\n\t\t\tif(debug) console.log(this.error); \n\t\t\treturn undefined;\n\t\t}\n\t}", "title": "" }, { "docid": "2d18aeae5e53e956b60dcaa495719fe4", "score": "0.5376822", "text": "function d2(S, X, v, r, T){\n\tvar d2;\n\td2 = d1(S, X, v, r, T) - v * Math.sqrt(T);\n return d2;\n}", "title": "" }, { "docid": "2fb6557967633ec4171f61b6d5449870", "score": "0.5370307", "text": "function RSADoPrivate(x) {\n\tif (this.p == null || this.q == null)\n\t\treturn x.modPow(this.d, this.n);\n\n\t// TODO: re-calculate any missing CRT params\n\tvar xp = x.mod(this.p).modPow(this.dmp1, this.p);\n\tvar xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n\twhile (xp.compareTo(xq) < 0)\n\t\txp = xp.add(this.p);\n\treturn xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "669bd14d7e5c9734d976385de2b62c2a", "score": "0.53599715", "text": "getRealObstacleValue(k, x) {\n const exponent = 1 / (1 + Math.exp(-1 * k * x));\n return exponent;\n }", "title": "" }, { "docid": "a68d90af85625964eb0975ad6283ebf6", "score": "0.5336955", "text": "getB(x, y) {\n\t\treturn this.get(x, y) > this.threshold + rand(this.thresholdRandWeight);\n\t}", "title": "" }, { "docid": "3b6df4ae52ce5f1126f99d189081f912", "score": "0.53231126", "text": "get x() {\n return this._x / this.scale;\n }", "title": "" }, { "docid": "b0a2ffc90ac87d80d4422b9578cf758b", "score": "0.5321309", "text": "sol() { return this.pos == 0; }", "title": "" }, { "docid": "3d5dc22e977200e5581e5d1b0695f65c", "score": "0.53211063", "text": "_a(){\n\t\t\treturn Math.max(Math.min(0.1*this.B,0.4*this.z),0.04*this.B,3)\n }", "title": "" }, { "docid": "9d2af2aa7a043373cb6a92b2bb95cb28", "score": "0.5319902", "text": "function x(d) { return d.xVal; }", "title": "" }, { "docid": "7c2a951128326df82bb0a6cab00f2683", "score": "0.53193736", "text": "activateVariation(x) {\n return (x + this.maxVariancePerPeriod - 1) / (2 * this.maxVariancePerPeriod);\n }", "title": "" }, { "docid": "7c2a951128326df82bb0a6cab00f2683", "score": "0.53193736", "text": "activateVariation(x) {\n return (x + this.maxVariancePerPeriod - 1) / (2 * this.maxVariancePerPeriod);\n }", "title": "" }, { "docid": "11d98c22419bacd8c91e355a562d79db", "score": "0.5317478", "text": "get x() {\n\t\t\treturn this._x / this.scale;\n\t\t}", "title": "" }, { "docid": "7c3a9a4ef8fe286c35098b7683c4fec3", "score": "0.5302208", "text": "function RSADoPrivate(x) {\n\t if(this.p == null || this.q == null)\n\t return x.modPow(this.d, this.n);\n\n\t // TODO: re-calculate any missing CRT params\n\t var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n\t var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n\t while(xp.compareTo(xq) < 0)\n\t xp = xp.add(this.p);\n\t return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n\t}", "title": "" }, { "docid": "ba9248ee6c38d559c1680d50146248cd", "score": "0.5300299", "text": "grebet(x, y) {\n if ((y < this.y + this.dyb + rad && y > this.y + rad) && x > this.x + rad && x < this.x + this.bred - rad) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "b49d4b9bd0f4c61f6ad7d2138670a389", "score": "0.52837354", "text": "calcF(x) {\n let c1 = (x - this.fx) ** 2;\n let c2 = 2 * (this.fy - this._d);\n let c3 = this.fy ** 2 - this._d ** 2;\n return ((c1 + c3) / c2);\n }", "title": "" }, { "docid": "2307697afa916fc4fd9df3db690edcad", "score": "0.52736735", "text": "function findTrueXCoord(x){\n var xCoord = firstDotXPos + (x * xDistBetweenDots);\n return xCoord;\n}", "title": "" }, { "docid": "c0b12f7bcb87ce9d89671347a08a51d0", "score": "0.5272538", "text": "contains(x, y) {\n return (dist(this.v.x, this.v.y, x, y) <= this.r)\n }", "title": "" }, { "docid": "0c8ae7d54e03b11f521b468139cb7cf8", "score": "0.5263381", "text": "get xMin() {\n return this.xRange.min;\n }", "title": "" }, { "docid": "e915eb7096d4c93739753d4759dca8e1", "score": "0.5246735", "text": "function dnorm(x)\n{\n return Math.exp(-0.5*x*x)/Math.sqrt(2*Math.PI);\n}", "title": "" }, { "docid": "7151b097b69ddb0f1db164ff1febc88e", "score": "0.5244385", "text": "function o(e,r){return !e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "title": "" }, { "docid": "22db350b3b7bbcf3fdece860ca30af04", "score": "0.5242343", "text": "static constrain(v){\r\n while(v<0){v+=1;}\r\n while(v>1){v-=1;}\r\n return v;\r\n }", "title": "" }, { "docid": "108b59eda9008081121ff4ec4c204326", "score": "0.5241453", "text": "function constrain(x, x0, x1) {\r\n return Math.min(Math.max(x, x0), x1);\r\n}", "title": "" }, { "docid": "f8608bff14367a2b36d21d7fe6e63685", "score": "0.523462", "text": "dopusk() {\n\t\tvar ind_out = this.dopusk_out();\n\t\twhile (ind_out >= 0) {\n\t\t\tvar ind_in = this.dopusk_in(ind_out);\n\t\t\tif (ind_in == -1) return false;\n\t\t\tthis.gauss(ind_in, ind_out);\n\t\t\tind_out = this.dopusk_out();\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "e30b40b56cd4c29c948691593d8321b8", "score": "0.52068573", "text": "function dist_func_real(x){\n var ret = 0;\n var addr_down = Math.floor( 100*(x-min_y)/(max_y-min_y) );\n var addr_up = -Math.floor( -100*(x-min_y)/(max_y-min_y) );\n var fract = 100*(x-min_y)/(max_y-min_y) - addr_down;\n\n if(0<=addr_up && addr_down <= 100){\n var d = (addr_down < 0) ? 0 : dist_chart[addr_down];\n var u = (addr_up > 100) ? 1 : dist_chart[addr_up];\n ret = u*fract + d*(1-fract);\n } else if (100 < addr_down) {\n ret = 1;\n }\n return ret;\n}", "title": "" }, { "docid": "d96f9cbd0464f3af8c848cb53f2e91b9", "score": "0.52006364", "text": "function velocity_x (){\n return V * Math.cos(teta);\n }", "title": "" }, { "docid": "bcfb222f24dab67b0dcc2a4c0f7ef771", "score": "0.5199723", "text": "function IV(Flag, S, X){\n \n if (Flag==='c'){\n \n if(S - X > 0){\n return S - X;\n }\n else{\n return 0;\n }\n }\n \n if (Flag==='p'){ \n \n if(X - S > 0){\n return X - S;\n }\n else{\n return 0;\n }\n }\n}", "title": "" }, { "docid": "c0bf07a44c8203465b4de50c7b1eaf69", "score": "0.51899606", "text": "calcFprime(x) {\n return ((x - this.fx) / (this.fy - this._d));\n }", "title": "" }, { "docid": "36dfcae0afdc72a400647efafd5e57c6", "score": "0.518168", "text": "get midX() {\n return this.x + this.ancho * 0.5\n }", "title": "" }, { "docid": "11398e03ac2a9381e5352427ccf000a1", "score": "0.5177187", "text": "check_d_range(space) {\r\n const xd = Math.abs(this.x - space.x);\r\n\r\n if(xd <= this.straight) {\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n }", "title": "" }, { "docid": "3a63b4d43e3c27541fb09f33f0de11b8", "score": "0.5174947", "text": "function dist_uniform(x){\n var ret = 0;\n if(a<=x && x<=b){\n ret = (x-a)/(b-a);\n } else if(b < x) {\n ret = 1;\n }\n return ret;\n}", "title": "" }, { "docid": "43530adf30333d7b2ec4ef3d683c81e9", "score": "0.5162617", "text": "isValidPoint() {\n for (var x=0; x<validPoints.length; x++) {\n if (this.rollValue() === validPoints[x]) {\n return this.rollValue();\n }\n }\n return 0;\n }", "title": "" }, { "docid": "8793e5c799d2a4b1c654b0a0f838eaa8", "score": "0.5149572", "text": "vi() {\n const out = this.vu();\n return (0 - (out & 1)) ^ (out >>> 1);\n }", "title": "" }, { "docid": "6dd56fd94ee1d354cd81f20cfd6e601f", "score": "0.51476717", "text": "densitateaDeRepartitieCazulGeneral(x, mu, sigma) {\n\t\t\treturn ( (1 / (sigma * (Math.sqrt(2 * Math.PI)))) * (Math.pow(Math.E, -(Math.pow((x - mu), 2) / (2 * Math.pow(sigma, 2))))) );\n\t\t}", "title": "" }, { "docid": "5d073408995974891a6a9746c0cb7782", "score": "0.51470804", "text": "Fv(){\n return this.shearReinf ? Math.min(3*Math.pow(this.fm,0.5),150) : Math.min(Math.pow(this.fm,0.5),50)\n }", "title": "" }, { "docid": "874e01ef867ed0342dfb878f1bb74fa0", "score": "0.5146681", "text": "function OdectiTri(x)\n{\n return +x -3;\n}", "title": "" }, { "docid": "f31707bac6aa234bc811db423761db07", "score": "0.514662", "text": "getx()\n\t{\n\t\treturn this.x;\n\t}", "title": "" }, { "docid": "2b278233c4893cfb213917f1a583f260", "score": "0.51389563", "text": "RealX() {\r\n return this.x * tileSize * -1;\r\n }", "title": "" }, { "docid": "d2af3da9b03066c6ace6d9ef256208c2", "score": "0.5109768", "text": "function cx_sx(cx){\n\t\tvar v = getView('cx_sx');\n\t\treturn ((cx-v.dx)/(v.dz));\n\t}", "title": "" }, { "docid": "de3ef443cd409a4f3d2bd0113be08207", "score": "0.5105304", "text": "function rngGtr (lrv, rrv) {\n return (rngComp(lrv, rrv) > 0);\n}", "title": "" }, { "docid": "700d308caf58edd2e05c72c0d53df84f", "score": "0.5103341", "text": "deactivateVariation(x) {\n return x * 2 * this.maxVariancePerPeriod + 1 - this.maxVariancePerPeriod;\n }", "title": "" }, { "docid": "700d308caf58edd2e05c72c0d53df84f", "score": "0.5103341", "text": "deactivateVariation(x) {\n return x * 2 * this.maxVariancePerPeriod + 1 - this.maxVariancePerPeriod;\n }", "title": "" }, { "docid": "9b2fdab5a179228364ce72eebbacb05d", "score": "0.5095084", "text": "function VZ(number){if(number<0) return -1; else return 1;}", "title": "" }, { "docid": "8e2215bfff4cf97628eb996cb8ae0fb8", "score": "0.5092823", "text": "get adjustedX() { return this.x - this.originX }", "title": "" }, { "docid": "012a8651e2457bedea302c25c970deed", "score": "0.50927705", "text": "function validateX(var_x){\n if(var_x < 0){\n console.log('width (negative index) out of boundary!');\n return false;\n } \n if(var_x > oWidth){\n console.log('width is out of bounds!');\n return false;\n } \n return true;\n}", "title": "" }, { "docid": "0b083d4909dcd2fbdd772d87ca8450de", "score": "0.5089615", "text": "_xPx( xLogical ) {\n var val = this.transform.x+xLogical*this.scale.x;\n return !isFinite(val) ? 0+this.transform.x : val;\n }", "title": "" }, { "docid": "cba8d2b24fecb6b967dc97fb0192d800", "score": "0.50892776", "text": "function sc_less(x) {\n for (var i = 1; i < arguments.length; i++) {\n\tif (x >= arguments[i])\n\t return false;\n\tx = arguments[i];\n }\n return true;\n}", "title": "" }, { "docid": "6438be7ce4c2f59dffa43516832d1986", "score": "0.5087693", "text": "function delta(Flag, S, X, v, r, T){\n \n if(Flag==='c'){\n return CND(d1(S, X, v, r, T));\n }\n else{\n return CND(d1(S, X, v, r, T)) - 1;\n }\n}", "title": "" }, { "docid": "a90ce8186359c3d3d138472ed96511f3", "score": "0.50871116", "text": "function findEigenValue(tv, v) {\n if (Math.abs(tv.x) > Math.abs(tv.y)) {\n return tv.x / v.x;\n } else {\n return tv.y / v.y;\n }\n }", "title": "" }, { "docid": "6392af17964cf8c610457e770732992d", "score": "0.508554", "text": "function Ge(t) {\n return t instanceof Vt ? t.version : X.min();\n}", "title": "" }, { "docid": "873725cd980a1a6e576a815b299b8662", "score": "0.50853467", "text": "function x (crosser) {\n return cx + (crosser.in(near) ? -1.5*w-w/2 : 1.5*w-w/2);\n}", "title": "" }, { "docid": "84a6a9f6b370877928eb875ba95d85dd", "score": "0.5079663", "text": "function wX(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,s=Math.min(r,a);n<s;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:a<r?1:0}", "title": "" }, { "docid": "f7b7c19d90560d27d334be7873907015", "score": "0.50780374", "text": "function solution(X, Y, D) {\n // write your code in JavaScript (Node.js 4.0.0)\n\n if(X >= Y){\n \treturn 0;\n }\n\n return Math.ceil((Y - X)/D);\n}", "title": "" }, { "docid": "ef63c6c625427474741cbd9a2cea1cb6", "score": "0.507014", "text": "setInvertX() {\nreturn this.xyzw[0] = -this.xyzw[0];\n}", "title": "" }, { "docid": "e2a1a928ad50801f0105a692c44010c5", "score": "0.50660735", "text": "function trueR() {\n\t// Grab the size of the graph (2nd rect object)\n\tvar rect = document.getElementsByTagName(\"rect\")[1];\n\tvar width = parseInt(rect.getAttribute(\"width\"));\n\tvar height = parseInt(rect.getAttribute(\"height\"));\n\n\t// All points in the graph are class \"nv-point\"\n\tvar points = document.getElementsByClassName(\"nv-point\");\n\tvar x, y;\n\tvar xs = [];\n\tvar ys = [];\n\n\t// Iterate through and use a regex to get the x and y coors\n\tfor (i=0; i<points.length; i++) {\n\t\tx = points[i].getAttribute(\"transform\").split(\",\")[0];\n\t\tx = /(?:\\d*\\.)?\\d+/.exec(x);\n\t\tx = parseFloat(x)/width;\n\n\t\ty = points[i].getAttribute(\"transform\").split(\",\")[1];\n\t\ty = /(?:\\d*\\.)?\\d+/.exec(y);\n\t\ty = parseFloat(y)/height;\n\n\t\txs.push(x);\n\t\tys.push(y);\n\t}\n\n\t// Calculate R value\n\treturn linReg(xs,ys);\n}", "title": "" }, { "docid": "38d523ed44edfece001b70ebfa572669", "score": "0.50616527", "text": "function convex(array, x, y) {\n const N = array.length;\n function convexREC(n) {\n if (n === N)\n return true;\n const p = (y - array[n][1]) / (array[(n + 1) % N][1] - array[n][1]);\n if (array[n][1] > array[(n + 1) % N][1]) {\n if (x - array[n][0] >= p * (array[(n + 1) % N][0] - array[n][0]))\n return convexREC(n + 1);\n else \n return false;\n } \n else if (x - array[n][0] <= p * (array[(n + 1) % N][0] - array[n][0]))\n return convexREC(n + 1);\n else \n return false;\n }\n return convexREC(0);\n }", "title": "" }, { "docid": "d06b86fab6ce703cdaa5c01128bf9c4d", "score": "0.5060629", "text": "entfernungVomUrsprung(){\n let a = this.x;\n let b = this.y;\n let c;\n let py = (a*a) + (b*b);\n c= Math.sqrt(py);\n return c;\n }", "title": "" }, { "docid": "a0e7468597ba23996d0fb839782cd948", "score": "0.50572944", "text": "limitx() { return (this.scale - 1) * this.sizex / 2; }", "title": "" }, { "docid": "da0cef971572a2e8afbc704165062a8d", "score": "0.5044755", "text": "function rngLess (lrv, rrv) {\n return (rngComp(lrv, rrv) < 0);\n}", "title": "" }, { "docid": "7cba25f14833b84d944d8c44556ba108", "score": "0.50437343", "text": "softEdgeNormal(r) { // softness is not 0\n\t\tif(r>0.5) {\n\t\t\tlet r1=1-r;\n\t\t\treturn 1-2*r1*r1;\n\t\t}\n\t\treturn 2*r*r;\n\t\t//return r*r; // good for rendering considering convolution, sharp at the center\n\t\t//return r; // a bit faster than quad? but quality is worse\n\t\t//return (1-Math.cos(Math.PI*r))/2; // easier but slower\n\t}", "title": "" }, { "docid": "dc13f6523f5844f95ffcf80280347b3c", "score": "0.50427943", "text": "function randomDx() {\r\n var velocityX = document.getElementById(\"getVelocityX\").value;\r\n var p = Math.floor(Math.random() * 20 - 10);\r\n //if the value the user enters is equal to the random value, and the the value is an integer between -10 and 10\r\n while(velocityX != p && velocityX % 1 == 0 && velocityX > -10 && velocityX < 10){\r\n velocityX = document.getElementById(\"getVelocityX\").value;\r\n p = Math.floor(Math.random() * 20 - 10);\r\n }\r\n if(velocityX % 1 == 0 && velocityX > -10 && velocityX < 10){\r\n return p;\r\n }\r\n}", "title": "" }, { "docid": "9b2f557b5de384406f96742c149e86be", "score": "0.5037775", "text": "function c_logical(price, range)\n{\n return (price - range[0]) / (range[1] - range[0]);\n}", "title": "" }, { "docid": "e3ecc47fb4153cfcc1d99c7f556f676a", "score": "0.5030103", "text": "Asmin(){\n return 0.0018*this.b*this.h\n }", "title": "" }, { "docid": "6320b205c4e19df89d795e2a92165b55", "score": "0.50239515", "text": "nextValue() {\n let x2, v0, v1, x, u, v;\n while (true) {\n do {\n x = this.randn.nextValue();\n v = 1 + (this.c * x);\n } while (v <= 0);\n v *= v * v;\n x2 = x * x;\n v0 = 1 - (0.331 * x2 * x2);\n v1 = (0.5 * x2) + (this.d * (1 - v + Math.log(v)));\n u = this.randu();\n if (u < v0 || Math.log(u) < v1) {\n break;\n }\n }\n v = (1 / this.beta) * this.d * v;\n if (this.alpha < 1) {\n v *= Math.pow(this.randu(), 1 / this.alpha);\n }\n return this.convertValue(v);\n }", "title": "" }, { "docid": "aa075c6a4588bd94c046dbd1721a337f", "score": "0.50219756", "text": "function o(e,r){return!e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "title": "" }, { "docid": "81224c3f5c17b906ff29690b5445346b", "score": "0.5014595", "text": "get blendValueX() {\n return this._blendValueX;\n }", "title": "" }, { "docid": "6c18a9caf220927f30208dab06fbe3e9", "score": "0.50113016", "text": "function byX(a, b) {\n return b.x - a.x;\n }", "title": "" }, { "docid": "c1fecd387d1b9f5849448d2fe921b5f8", "score": "0.50080395", "text": "x() {\n\t\t\treturn this.data.x;\n\t\t}", "title": "" }, { "docid": "a658f6f017b0513d9e3c492897f53f1b", "score": "0.4999435", "text": "function maybeNegative(x) {\n return (Math.random() > .5) ? x : -x;\n }", "title": "" }, { "docid": "c21b30d633f799421db835a54bf379ee", "score": "0.49974513", "text": "function negative(x) {\n return ((x[x.length-1]>>(bpe-1))&1);\n }", "title": "" }, { "docid": "316a6698dfd62fd1b841408e48a3e789", "score": "0.49961814", "text": "function getBit(){\n return prng() >= 0.5 ? 1 : 0;\n}", "title": "" }, { "docid": "03cc124212135a15f3712b68c650602b", "score": "0.4990891", "text": "function getPVM(x) {\n var ats = x * 0.21;\n return ats;\n}", "title": "" }, { "docid": "38bee11d9db8a6d7097842be0cdc99c0", "score": "0.49880403", "text": "get x()\n\t{\n\t\tif (this._x != null)\n\t\t\treturn this._x;\n\n\t\t/*\n\t\tif (this.isInput)\n\t\t\treturn this.node.posSmooth.x;\n\n\t\treturn this.node.posSmooth.x + this.node.width;\n\t\t*/\n\n\t\treturn this.node.input.plugPositions()[this.isInput ? 'inputs'\n\t\t\t: 'outputs'].filter(o => o.plug === this)[0].x;\n\t}", "title": "" }, { "docid": "34ae388c5c55154c3c4fbaba23b708a1", "score": "0.49862036", "text": "decc() {\n\t\tlet maxvx = 0.0;\n\t\tlet maxvy = 0.0;\n\n\t\tif( this.vx < maxvx ){\n\t\t\tthis.vx += this.dc;\n\t\t} else if( this.vx > maxvx ){\n\t\t\tthis.vx -= this.dc;\n\t\t}\n\n\t\tif( this.vy < maxvy ){\n\t\t\tthis.vy += this.dc;\n\t\t} else if( this.vy > maxvy ){\n\t\t\tthis.vy -= this.dc;\n\t\t}\n\n\t\tif( Math.abs( this.vx ) < 0.001 ) {\n\t\t\tthis.vx = 0;\n\t\t}\n\t\tif( Math.abs( this.vy ) < 0.001 ) {\n\t\t\tthis.vy = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "54074676f09920ed0bc4a3dbbe579e47", "score": "0.49770847", "text": "warning () { return this._ignEllipse.backDist() < this.bounds().xSpacing() }", "title": "" } ]
d953848eb34e748439261eeb3a5d94d7
Renders multiple countries at once
[ { "docid": "ac8db87ee85b6a4b9641dabf6d4c775e", "score": "0.0", "text": "render() {\n // The sorting method\n const countries = this.state.countries.sort((a, b) => (\n b.votes - a.votes\n ));\n const countryComponents = countries.map((country) => (\n <Country\n key={'country-' + country.id}\n id={country.id}\n title={country.title}\n description={country.description}\n url={country.url}\n votes={country.votes}\n submitterAvatarUrl={country.submitterAvatarUrl}\n countryImageUrl={country.countryImageUrl}\n //Pass down the function as a prop\n onVote={this.handleCountryUpVote}\n />\n ));\n return (\n <div className='ui unstackable items'>\n {countryComponents}\n </div>\n );\n }", "title": "" } ]
[ { "docid": "d791c5554a5335b5534b4694deeb56c8", "score": "0.696196", "text": "function displayAllCountries(data) {\r\n\r\n allCountriesNumber = data.length;\r\n\r\n for (var i = 0; i < data.length; i++)\r\n displayCountry(data[i], i);\r\n}", "title": "" }, { "docid": "630b3bb6bf537fa82b905f1a4df7419a", "score": "0.69235915", "text": "function render(){\r\n const countries = document.querySelector('.countries');\r\n countries.innerHTML = \"\";\r\n for(let key in dataset){\r\n if(!searchstring || dataset[key].countryName.toLowerCase().includes(searchstring.toLowerCase())){\r\n let li = document.createElement('li');\r\n li.setAttribute('code', dataset[key].countryCode);\r\n li.setAttribute('active', 'false');\r\n li.innerHTML = `\r\n <img\r\n src=\"https://lipis.github.io/flag-icon-css/flags/4x3/${dataset[key].countryCode.toLowerCase()}.svg\"\r\n alt=\"${dataset[key].countryName}\"\r\n />\r\n\r\n <h2>${dataset[key].countryName}</h2>\r\n `;\r\n countries.append(li);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7d106d59a2a55db7190df2dce7625605", "score": "0.6907009", "text": "function countries (json) {\n // Can this be templated? Does it need to be? This is standard across all pages ...\n }", "title": "" }, { "docid": "94b866b8976b60d89653853b44b47aae", "score": "0.67927414", "text": "function choose_country(countries) {\n htmlContentToAppend = `<option selected value=\"0\">Elige un país</option>`;\n for (country of countries) {\n htmlContentToAppend += `<option value=\"` + country.name + `\">` + country.name + `</option>`;\n }\n\n document.getElementById(\"country\").innerHTML = htmlContentToAppend;\n}", "title": "" }, { "docid": "902fe2e060d20c9721dbd36cb6566774", "score": "0.6719618", "text": "function displayCountryDataInCards(countries) {\r\n let containerForCountryDetails = createDomElement('div', 'country-data-container')\r\n countries.forEach(country => {\r\n containerForCountryDetails.append(createSingleCardForCountry(country));\r\n });\r\n document.body.append(createHeaderForCountryDetails(), containerForCountryDetails);\r\n}", "title": "" }, { "docid": "1766ecd7527fb2d2ec8673d389baa70b", "score": "0.6650455", "text": "function results (countries) {\n\t// Clear List\n\tcountryContainer.innerHTML = '';\n\tcountries.forEach( function(country, index) {\n\t\t// Create Country Container\n\t\tlet container = document.createElement('div');\n\t\tcontainer.classList = 'country';\n\t\t// Create Image and append\n\t\tlet image = new Image(120);\n\t\timage.classList = 'flag';\n\t\timage.src = country.flag;\n\t\tcontainer.appendChild(image);\n\t\t// Create Name\n\t\tlet name = document.createElement('h2');\n\t\tname.classList = 'name';\n\t\tname.innerText = country.name;\n\t\tcontainer.appendChild(name);\n\t\t// Create Info Container\n\t\tlet info = document.createElement('div')\n\t\tinfo.classList = 'info';\n\t\t// Create Capital\n\t\tlet capital = document.createElement('p');\n\t\tcapital.innerHTML = `<strong>Capital:</strong> ${ country.capital }`;\n\t\tinfo.appendChild(capital);\n\t\t// Create TimeZone\n\t\tlet timeZone = document.createElement('p');\n\t\ttimeZone.innerHTML = `<strong>Time Zone:</strong> ${ country.timezones[0] }`;\n\t\tinfo.appendChild(timeZone);\n\t\t// Create Currency\n\t\tlet currency = document.createElement('p');\n\t\tcurrency.innerHTML = `<strong>Currency:</strong> ${ country.currencies[0].code ? country.currencies[0].code : 'n/a'} ${ country.currencies[0].symbol ? country.currencies[0].symbol : '' }`;\n\t\tinfo.appendChild(currency);\n\t\t// Append Info\n\t\tcontainer.appendChild(info);\n\t\t// Append Country to Results container \n\t\tcountryContainer.appendChild(container);\n\t});\n}", "title": "" }, { "docid": "5c09ed098832d8b1948e925bc41d75d0", "score": "0.66418546", "text": "function showCountries(data){\n data.forEach(obj => {\n displayCountries(obj);\n });\n}", "title": "" }, { "docid": "5e93aa158d02180d0edcd94862be3c98", "score": "0.6635712", "text": "function allCountries() {\n\n}", "title": "" }, { "docid": "5e43a8f8fe512523b341af8d4feb0351", "score": "0.6585923", "text": "async function render() {\r\n countries.innerHTML = \"\";\r\n const data = await doGet(state.countryName);\r\n if (data.status === 404) {\r\n renderErrorMessage();\r\n } else {\r\n data.forEach(({ name, capital, population, flag }) => {\r\n createCard(name, capital, population, flag);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "edabc0b524aa55158a75dcfea9460d4f", "score": "0.65755445", "text": "function addCountryNames() {\n console.log(\"country names\")\n MapObj.map.setStyle(worldBaseNames); \n}", "title": "" }, { "docid": "aff47b33e7d8d2bd58223bf34131125c", "score": "0.6557421", "text": "function renderCountries(data) {\r\n for (const q of data) { \r\n const countryUL = document.querySelector('#country-list');\r\n //Create all necessary elements\r\n const countryLi = document.createElement('div'); \r\n const p = document.createElement('p');\r\n const footer = document.createElement('footer');\r\n const br = document.createElement('br');\r\n const hr = document.createElement('hr')\r\n const flag = document.createElement('img');\r\n const region = document.createElement('p');\r\n const country = document.createElement('h5');\r\n const population = document.createElement('p');\r\n const btn = document.createElement(\"button\");\r\n\r\n //Add appropriate classes and ids. Grab data and insert if needed.\r\n countryLi.className = 'card col-10 m-2 div-align'; \r\n p.className = 'mb-0';\r\n region.className = 'mb-0'; \r\n countryLi.dataset.id = q.area; \r\n flag.src = q.flags.png;\r\n flag.height = '50';\r\n flag.width = '50'; \r\n btn.className = 'btn btn-primary'; \r\n\r\n //Grab data and insert it into created elements\r\n if (typeof q.capital != \"undefined\") {\r\n p.innerHTML = \"Capital : \" + q.capital[0];\r\n } else {\r\n p.innerHTML = \"Capital : Not Available\";\r\n } \r\n if (typeof q.capital != \"undefined\") {\r\n region.innerHTML = \"Region : \" + q.region;\r\n } else {\r\n region.innerHTML = \"Region : Not Available\";\r\n } \r\n if (typeof q.country != \"undefined\" || typeof q.country != null) {\r\n country.innerHTML = q.name.common;\r\n } else {\r\n country.innerHTML = \"Not Available\";\r\n }\r\n if (typeof q.flags.png != \"undefined\" || typeof q.flags.png != null) {\r\n flag.innerHTML = q.flags.png;\r\n } else {\r\n flag.innerHTML = \"Not Available\";\r\n } \r\n population.innerHTML = \"Population : \" + q.population; \r\n btn.innerHTML = \"Check Weather\";\r\n btn.addEventListener('click', () => {\r\n getpopupdata(q.name.common);\r\n })\r\n\r\n //Append everything to main container \r\n countryUL.appendChild(countryLi);\r\n countryLi.append(country);\r\n countryLi.append(flag);\r\n countryLi.append(p);\r\n countryLi.append(region);\r\n countryLi.append(population);\r\n countryLi.append(btn);\r\n }\r\n }", "title": "" }, { "docid": "dd26c301fd49fba80fa20ae0f07f28c9", "score": "0.65351117", "text": "function buildAllCountries() {\n // Add elements to DOM\n countryListEl.innerHTML = countryListArr.join('');\n // Reset to 0\n countryListId = 0;\n // Reset current country position\n currentCountryPos = 0;\n // Set the focus to the first list item\n focusFirstCountry();\n }", "title": "" }, { "docid": "da8ecad9c57a28a3745f7c9322dd29ce", "score": "0.64827657", "text": "function displayData(countries) {\n\t$(document).ready(function() {\n\t\t$('.countries').html('')\n\t\tlet countryLength = countries.length\n\t\tfor (let i = 0; i < loadData && i < countryLength; i++) {\n\t\t\tlet name = countries[i].name\n\t\t\tlet population = countries[i].population\n\t\t\tlet region = countries[i].region\n\t\t\tlet capital = countries[i].capital\n\t\t\tlet flag = countries[i].flag\n\n\t\t\t$('.countries').append(` \n\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t<div class=\"flag\">\n\t\t\t\t\t\t\t<img src=\"` + flag + `\" alt=\"Loading Error\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"info\">\n\t\t\t\t\t\t\t<p class=\"name\">` + name + `</p> \n\t\t\t\t\t\t\t<p>Population: <span>` + population + `</span></p>\n\t\t\t\t\t\t\t<p>Region: <span>` + region + `</span></p>\n\t\t\t\t\t\t\t<p>Capital: <span>` + capital + `</span></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`)\n\t\t}\n\t\tloadData = loadData + 12\n\t})\n}", "title": "" }, { "docid": "2ef173f9a0dc5bfc2d1957b7be64498f", "score": "0.64465517", "text": "addCountries(countries) {\n\t\tlet container = document.querySelector('.countries');\n\t\tlet template = document.querySelector('#template').innerHTML;\n\t\tMustache.parse(template);\n\t\tfor(var i = 0; i < countries.length; i++){\n\t\t\tlet country = Mustache.to_html(template, countries[i]);\n\t\t\t// var arr = [];\n\t\t\t// arr.push(country);\n\t\t\tcontainer.innerHTML += country;\n\t\t\t// console.log(arr.length);\n\t\t}\n\t\t// console.log(countries);\n\t}", "title": "" }, { "docid": "9e4067d2031f6e4e2dc3a77b1cfffb4e", "score": "0.6365758", "text": "function loadCountries(countries) {\n for (country of countries) {\n let option = document.createElement('option')\n option.value = country.alpha2Code;\n option.textContent = country.name\n selectEl.appendChild(option);\n }\n}", "title": "" }, { "docid": "b3c2147d76158108584cb79df7bedaf2", "score": "0.6349098", "text": "function updateSelectedCountriesView() {\n var selected_countries = Plex.userMissingFields.selected_countries;\n var countries_view = $('.selected-countries-view');\n\n if (countries_view.length == 0) { return; }\n\n countries_view.html('');\n\n selected_countries.forEach(function(country) {\n countries_view.append(\n \"<div class='single-country'>\" +\n \"<div class='single-country-remove-button' data-country_id='\"+ country.id +\"'>&times;</div>\" +\n \"<div>\"+ country.country_name +\"</div>\" +\n \"</div>\");\n });\n }", "title": "" }, { "docid": "25af4e5b9458bb7f076c5ba78b388f10", "score": "0.6298093", "text": "function countryNames(){\n $.get(\n \"https://codepen.io/pablosv/pen/eWgzwO.js\", // a list of country names\n function(Countries){\n var qty = Object.keys(Countries).length; //quantity of countries\n for(var i = 0; i < qty; i++){\n if (Object.keys(Countries)[i] == myCountry){\n fullname = Countries[Object.keys(Countries)[i]];\n }\n }\n $(\"#country\").html(fullname);\n }, \"json\"\n ); // end get country names\n\n }", "title": "" }, { "docid": "8b41971ffcab225ab6b1b37856804b73", "score": "0.6283031", "text": "function addCountries(countriesArray) {\n let countriesIterations = \"<h3></h3>\"\n for (i = 0; i < mandarinData.countriesSpoken.length; i++) {\n countriesIterations += `<p><li>${mandarinData.countriesSpoken[i]}</li></p>`\n }\n return countriesIterations\n\n}", "title": "" }, { "docid": "4359457a422a93dab6f551cde8511ca1", "score": "0.62651885", "text": "function setCountryInfo(result) {\n capital = result.data[0].capital;\n currency = result.data[0].currencies[0].code;\n countryName = result.data[0].name.replace(/\\s/g, \"+\");\n geoNameID = result.data[0].geonameId;\n iso2 = result.data[0].alpha2Code;\n $(\"#capital\").html(capital);\n $(\"#population\").html(formatPopulation(result.data[0].population));\n $(\"#area\").html(`${formatArea(result.data[0].area)} km<sup>2</sup>`);\n $(\"#continent\").html(result.data[0].region);\n $(\"#subcontinent\").html(result.data[0].subregion);\n $(\"#nativeName\").html(result.data[0].nativeName);\n $(\"#country-flag\").html(`<img src=\"${result.data[0].flag}\">`);\n $(\"#languages\").html(\"\");\n let lang = [];\n for (let i = 0; i < result.data[0].languages.length; i++) {\n lang.push(`${result.data[0].languages[i].name}`);\n }\n lang.join(\",\");\n $(\"#languages\").append(`<span> ${lang}</span>`);\n let bord = [];\n $(\"#borders\").html(\"\");\n for (let i = 0; i < result.data[0].borders.length; i++) {\n bord.push(`${result.data[0].borders[i]}`);\n }\n bord.join(\",\");\n $(\"#borders\").append(`<span> ${bord}</span>`);\n let tz = [];\n $(\"#timeZone\").html(\"\");\n for (let i = 0; i < result.data[0].timezones.length; i++) {\n tz.push(`${result.data[0].timezones[i]}`);\n }\n tz.join(\",\");\n $(\"#timeZone\").append(`<span> ${tz}</span>`);\n}", "title": "" }, { "docid": "91f5139394736679fe8d00e2965ee54f", "score": "0.62582463", "text": "function populateCountry()\n{\n var countryOptions=\"<option value=''>-select country-</option>\";\n for(var id of countryMap.keys())\n {\n countryOptions+=\"<option value='\"+id+\"'>\"+countryMap.get(id)+\"</option>\";\n }\n $(\"#batchCountry\").html(countryOptions);\n}", "title": "" }, { "docid": "659db5033213334aa9065907873cc43c", "score": "0.6215235", "text": "function displayCountry(country, index) {\r\n\r\n /* country container ID */\r\n var id = 'country_id_' + index;\r\n\r\n /* Variables that will be displayed. */\r\n var name = country.name;\r\n var capital = country.capital;\r\n var language = country.languages[0].name;\r\n var area = country.area;\r\n var population = country.population;\r\n var currency = country.currencies[0].name;\r\n var flag = country.flag;\r\n\r\n /* Basic components of html code */\r\n\r\n var countryContainerHtml = $('<div class=\"country-container flex-column\"></div>');\r\n countryContainerHtml.attr('id', id);\r\n countryContainerHtml.attr('data-country-name', name);\r\n\r\n var nameFlagContainerHtml = $('<div class=\"name-flag-container\"></div>');\r\n var countryNameP = $('<p class=\"first-font-style\"></p>').text(name);\r\n var flagAll = $('<img class=\"flag\">');\r\n flagAll.attr('src', flag);\r\n flagAll.attr('alt', name + '.jpg');\r\n\r\n nameFlagContainerHtml.append(countryNameP);\r\n nameFlagContainerHtml.append(flagAll);\r\n\r\n countryContainerHtml.append(nameFlagContainerHtml);\r\n\r\n\r\n var infoContainer = $('<div class=\"info-container flex-column\"></div>');\r\n\r\n\r\n var infoObj = new info(capital, language, area, population, currency);\r\n\r\n /* make object with 5 attrbutes */\r\n for (var i in infoObj) {\r\n\r\n if (infoObj.hasOwnProperty(i)) {\r\n var key = captalize(i + \": \"); \r\n var value = captalize(infoObj[i]);\r\n }\r\n\r\n var infoLine = $('<div class=\"info\"></div>');\r\n var keySpanHTML = $('<span></span>');\r\n var valueSpanHTML = $('<span></span>');\r\n keySpanHTML.text(key);\r\n valueSpanHTML.text(value);\r\n\r\n infoLine.append(keySpanHTML);\r\n infoLine.append(valueSpanHTML);\r\n infoContainer.append(infoLine);\r\n }\r\n countryContainerHtml.append(infoContainer);\r\n $('.all-countries-container').append(countryContainerHtml);\r\n}", "title": "" }, { "docid": "c51b3f75217267861db69c4f127eafd7", "score": "0.6179554", "text": "async function getCountries(){\n\t\tlet url = `https://restcountries.eu/rest/v2/all`;\n\t\tlet response = await fetch(url);\n\t\tlet data = await response.json();\n\t\t\n\t\t// Add countries to drop-down\n\t\tfor (var i = 0; i < data.length; i++){\n\t\t\t$(\"#country\").append(`<option value=${data[i].alpha2Code}> ${data[i].name} </option>`);\n\t\t}\n\t}", "title": "" }, { "docid": "ab1ac82b011be3187bd0a8e8b9b4c5e0", "score": "0.61623806", "text": "function pick(countries) {\n console.log(\"countries length: \"+countries.length) \n var index = Math.floor(Math.random()*248);\n // var index = 72 // Fiji\n // var index = 233 // United States\n Data.num = countries[index];\n Data.countryName = countries[index].name.common;\n console.log(\"loading: \",Data.countryName)\n Data.countryRegion = countries[index].subregion;\n Data.capital = countries[index].capital\n Data.dataSource = geocoder_endpoint+Data.countryName+\".json?types=country&access_token=\"+accessToken+\"\";\n}", "title": "" }, { "docid": "0d8009aa1100b72598707aaece743068", "score": "0.6145153", "text": "function showCountryData(data) {\n // ???\n}", "title": "" }, { "docid": "13397e5d488a7c2dc2be397e040623ec", "score": "0.61345756", "text": "function displayCountries(countries){\n \n //Check control to see if we're on a big or small resolution an choosing the right way to display data \n if (window.matchMedia(\"(max-width: 990px)\").matches) {\n let countriesList = document.getElementById(\"countries-mobile\"); \n let lists = PhoneView(countries)\n countriesList.innerHTML=lists;\n } else {\n let countriesList = document.getElementById(\"countries\");\n let countriesListDetails = document.getElementById(\"countriesDetails\");\n let {lists, listsDetails}=LaptopView(countries)\n countriesList.innerHTML = lists;\n countriesListDetails.innerHTML = listsDetails;\n }\n \n}", "title": "" }, { "docid": "c0e456165312df5aab5fb5f76b50d7ab", "score": "0.6128846", "text": "function getFlags(selectedCountries) {\n const flagContainer = document.querySelector('.flags');\n flagContainer.innerHTML = \"\";\n\n const flagsHTML = selectedCountries.map(country => {\n // Checking if the country name is the same in the native language and in English, if not it prints both names\n if (country.name === country.nativeName) {\n return `\n <div class=\"country\">\n <img src=\"${country.flag}\" alt=\"The flag of ${country.name}\">\n <div class=\"info\">\n <h3>${country.name}</h3>\n <p><span>Capital:</span> ${country.capital}</p>\n <p><span>Region:</span> ${country.subregion}</p>\n </div>\n </div>\n `\n } else {\n return `\n <div class=\"country\">\n <img src=\"${country.flag}\" alt=\"The flag of ${country.name}\">\n <div class=\"info\">\n <h3>${country.name}<br>${country.nativeName}</h3>\n <p><span>Capital:</span> ${country.capital}</p>\n <p><span>Region:</span> ${country.subregion}</p>\n </div>\n </div>\n `\n }\n })\n\n flagContainer.innerHTML = flagsHTML.join(\"\");\n}", "title": "" }, { "docid": "1bebc4602c8e3ed7805fe127f6333fa9", "score": "0.6127649", "text": "function generateCountryOptions() {\n var i = 0;\n $.each(data, function (countryId, country) {\n // create country options\n var option = \"<option value='\" + countryId + \"' \";\n if (i == 0) {\n option += \"selected\";\n }\n option += \">\" + country.name + \"</option>\";\n $(\"#countrySelect\").append(option);\n\n // update years based on country data, show data\n if (i == 0) {\n updateYearOptions(country);\n displaySum(country);\n displayAllData(country);\n }\n i++;\n });\n\n}", "title": "" }, { "docid": "8d490ed74b0e12e285b59715ee14d6ed", "score": "0.6075154", "text": "function displayCountries(country){\n //Main container for the country & info regarding it\n const countryContainer = document.createElement('div');\n countryContainer.classList = 'country-container theme-tone-light';\n\n countryContainer.addEventListener(\"click\", function(){\n //This onClick refers you to more info about chosen country\n moreInfo(country);\n });\n\n //Country flag\n const countryFlag = document.createElement('img');\n countryFlag.src = country.flag;\n countryFlag.alt = country.name;\n //div to hold the quick-facts\n const countryInfoDiv = document.createElement('div');\n countryInfoDiv.classList = 'country-small-info';\n\n //quick facts\n const countryTitle = document.createElement('h2');\n countryTitle.textContent = country.name;\n\n const countryPopulation = document.createElement('p');\n countryPopulation.textContent = \"Population: \" + numberWithCommas(country.population); \n\n const region = document.createElement('p');\n region.textContent = \"Region: \" + country.region;\n\n const capital = document.createElement('p');\n capital.textContent = \"Capital: \" + country.capital;\n\n //end of quick facts\n\n if(changeTheme.children[1].innerHTML === \"Light-Mode\"){\n countryContainer.style.backgroundColor = 'hsl(0, 0%, 100%)';\n textElems = [capital, region, countryPopulation, countryTitle];\n textElems.forEach(el =>{\n el.style.color = 'hsl(200, 15%, 8%)';\n });\n }\n\n //appending all the items to DOM in correct sequence\n countryInfoDiv.appendChild(countryTitle);\n countryInfoDiv.appendChild(countryPopulation);\n countryInfoDiv.appendChild(region);\n countryInfoDiv.appendChild(capital);\n\n\n countryContainer.appendChild(countryFlag);\n countryContainer.appendChild(countryInfoDiv);\n \n results.appendChild(countryContainer);\n\n}", "title": "" }, { "docid": "5d301123c4afb02e7c3c1a4501ac484c", "score": "0.60721576", "text": "renderCountryList() {\n const { countries, noResult, searchTerm } = this.state;\n return (\n <div className=\"allcountries-div\">\n <h1>All countries list!</h1>\n <div className=\"country-desc\">\n <input\n className=\"search-box\"\n type=\"text\"\n placeholder=\"Search Countries...\"\n value={searchTerm}\n onChange={(e) => this.getSearchText(e)}\n onKeyUp={(e) => this.callCountry(e)}\n />\n <i\n className=\"fa fa-times-circle icon fa-lg\"\n aria-hidden=\"false\"\n onClick={() => (searchTerm ? this.clearInput() : null)}\n ></i>\n <button\n id=\"all_countries_list\"\n className=\"rotate-button get-country\"\n onClick={() => this.getAllCountry()}\n >\n Get All Countries!\n </button>\n </div>\n {this.countDisplay()}\n <div className=\"country-data\">\n {countries && countries.length ? (\n countries.map((item) => {\n return (\n <div className=\"country-item\" key={`div${item.alpha3Code}`}>\n <p key={`p${item.alpha3Code}`}>{item.name}</p>\n <img\n className=\"country-img\"\n key={`img${item.alpha3Code}`}\n src={item.flag}\n alt={`flag_image${item.name}`}\n onClick={() => this.getCountryDetails(item)}\n />\n <div className=\"country-details\">\n <p className=\"country-capital\">Capital: {item.capital}</p>\n <p className=\"country-currency\">\n Currency: {item.currencies[0].code}\n {item.currencies[0].symbol}\n </p>\n </div>\n </div>\n );\n })\n ) : (\n <h2>{noResult}</h2>\n )}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "dac9a0425ff64914f8aa9b808c4e6a4a", "score": "0.6043099", "text": "function showCountryData(data) {\n // Add more code from Step 3\n}", "title": "" }, { "docid": "b95a22debe5e5df0c2f385cd2a1e198f", "score": "0.60347176", "text": "function countryInfo(data) {\n data.forEach(country => {\n document.getElementById('countries').innerHTML += `\n <div class='country'>\n <img src=\"${country.flag}\">\n <h1>Name: ${country.name}</h1>\n <h3>Capital: ${country.capital}</h3>\n <button onclick=\"detailsInfo('${country.name}')\">Details</button>\n </div>\n `\n });\n}", "title": "" }, { "docid": "8e9a876c6f1ac10758d45fd57b94ace0", "score": "0.6004016", "text": "renderListProvinces(estados) {\n AddCandidateLocation.renderListProvinces(estados)\n }", "title": "" }, { "docid": "d4ae1ce1f5892b841b7df196f05c0b2f", "score": "0.5997219", "text": "function loadCountries() { \n $.ajax({\n dataType: \"json\",\n url: \"resources/countries-states.json\",\n success: function(data) {\n countries = data;\n var countryList = Object.keys(countries).sort();\n var countrySelect = $('#country');\n for (var i = 0; i < countryList.length; i++) {\n var country = countryList[i];\n if (country != null && country !== '' && isAsciiOnly(country)) {\n countrySelect.append('<option>' + country + '</option>')\n }\n }\n updateRegions(countrySelect.find(':selected').text());\n }\n });\n}", "title": "" }, { "docid": "adc46eaa78485373324c667879006777", "score": "0.59759855", "text": "function showCountry(countryName, countryAverage) \n{\n console.log(countryName + \": \" + countryAverage);\n colors[countryName] = countryAverage;\n \n refreshMap();\n \n}", "title": "" }, { "docid": "dc9da689416887a547d5a11692b57204", "score": "0.59665656", "text": "function Render_Map(data) {\r\n col = getColumn(obj.filter).concat('_');\r\n\r\n //console.log(data);\r\n for (var i = 0; i < data.length; i++) {\r\n var country = undefined;\r\n var val = data[i];\r\n //console.log(val.countrycode);\r\n //console.log(val.countryname);\r\n\r\n //TODO: Error handling\r\n country = document.getElementById(val.countrycode);\r\n\r\n c_id = Object.keys(val)[1];\r\n c_val = Object.values(val)[1];\r\n countries.push({id: val.countrycode});\r\n countries[i][c_id] = c_val;\r\n\r\n //console.log(\"key 1 is: \" + Object.keys(val)[1]);\r\n //console.log(\"value is: \" + Object.values(val)[1]);\r\n //document.getElementsByTagName(\"path\")[i].setAttribute(\"class\",\"tooltip\");\r\n\r\n if (country === undefined || country === null) \r\n continue;\r\n country.style.fill = val.color;\r\n\r\n }\r\n //console.log(\"list is\"+JSON.stringify(country_list))\r\n document\r\n .getElementById('NA')\r\n .style\r\n .fill = val.color;\r\n document\r\n .getElementById('CI')\r\n .style\r\n .fill = val.color;\r\n //console.log(\"countries: \"+ JSON.stringify(countries));\r\n\r\n}", "title": "" }, { "docid": "c4091f7ceaa163d80577a0b91ab54094", "score": "0.5963385", "text": "function getTargetCountry(name){\r\n fetch(`https://restcountries.eu/rest/v2/all`)\r\n .then(res => res.json())\r\n .then(data => { \r\n let country = data.filter(d => d.name.toLowerCase() == name.toLowerCase());\r\n let output = ``;\r\n country.map( c => {\r\n output += `<div class='detail'>\r\n <section class=\"flag\">\r\n <img src=${c.flag} alt=\"${c.name} flag\">\r\n </section>\r\n <section class=\"country-info\">\r\n <h1 class=\"name\">${c.name}</h1>\r\n <div class=\"description\">\r\n <div class='left'>\r\n <p>Native Name: <span id=\"span\">${c.nativeName}<span></p>\r\n <p>Population: <span id=\"span\">${c.population}<span></p>\r\n <p>Region: <span id=\"span\">${c.region}<span></p>\r\n <p>Sub Region: <span id=\"span\">${c.subregion}<span></p>\r\n <p>Capital: <span id=\"span\">${c.capital}<span></p>\r\n </div>\r\n <div class='right'>\r\n <p>Top Level Domain: <span>${c.topLevelDomain}<span></p>\r\n <p>Currencies: <span>${c.currencies[0].name}<span></p>\r\n <p>Languages: <span>${c.languages[0].name}<span></p>\r\n </div> \r\n </div>\r\n <div class='borders'>\r\n <p>Border Countries: </p>\r\n <div class='btns'>\r\n </div>\r\n </div>\r\n </section>\r\n </div>`\r\n \r\n \r\n })\r\n \r\n let countrySection = document.querySelector('.country-data');\r\n countrySection.innerHTML = output; \r\n let btns = document.querySelector('.btns')\r\n let inputArea = document.querySelector('.input-area');\r\n inputArea.classList.add('show-form');\r\n backBtn.style.display = 'flex';\r\n let countryName = data.filter(d => d.name.toLowerCase() == name.toLowerCase());\r\n let borders = countryName[0].borders.slice(0, 3);\r\n let code = data.map( d => d.alpha3Code);\r\n borders.forEach( name => {\r\n let button = document.createElement('button');\r\n button.textContent = data[code.indexOf(name)].name\r\n btns.appendChild(button)\r\n \r\n })\r\n buttons = document.querySelectorAll('button');\r\n buttons.forEach( button => {\r\n button.addEventListener('click', e => {\r\n let country = e.currentTarget.textContent\r\n getTargetCountry(country);\r\n })\r\n } )\r\n\r\n\r\n\r\n }).catch( e => {\r\n let countrySection = document.querySelector('.country-data');\r\n countrySection.innerHTML = `<h1>Unable to Fetch Data</h1>`;\r\n})\r\n}", "title": "" }, { "docid": "5e8166f368ea16305bf9e5519c226291", "score": "0.59580785", "text": "function fetchData() {\r\n fetch('https://restcountries.com/v3.1/all')\r\n .then(resp => resp.json())\r\n .then(data => renderCountries(data))\r\n }", "title": "" }, { "docid": "4b327975ec10ced388fb5a0b17e36182", "score": "0.5957382", "text": "function displayCountry(country) {\n var spans = $('#pays_infos'); //id dans html\n // console.log(span);\n spans.eq(0).text(country.capitale);\n spans.eq(1).text(country.nb_habitants);\n spans.eq(2).text(country.superficie);\n spans.eq(3).text(country.langue);\n $('img.flag').attr('src', country.drapeau);\n}", "title": "" }, { "docid": "9518962677924435dadd2ecb591535a8", "score": "0.5946267", "text": "function drawCountries(mode, event='click') {\n /* Store the selected display mode as the current display mode (this is to support hovering) */\n currentMode = mode;\n /* If the event that triggered this function was a click, store the selected display mode as the active display mode */\n if (event === 'click') activeMode = mode;\n /* If the event was a mouseout (end of hover), revert the mode back to the one selected by a click */\n else if (event === 'mouseout') mode = activeMode;\n /* For all chart tiles (rectangles bounding the charts), remove the \"active\" class (the class that causes a lighter background) */\n $('.chart-tile').removeClass('active');\n /* Add the \"active\" class to this display mode's chart tile */\n $(`#${mode}-chart`).addClass('active');\n /* Remove all country features from the map so they can be redrawn with the new colors */\n countries.clearLayers();\n /* Reset the countries layer, reloading the country data */\n countries = L.geoJSON(countryData, {\n /* For each feature in the layer, set the style: */\n style: function(feature) {\n /* Get the feature's properties */\n let p = feature.properties;\n return {\n /* If the feature's statistic for this theme is not null, use this theme's color ramp to determine the color; otherwise, use white */\n fill: (p[mode] !== null),\n fillColor: (p[mode] !== null ? themes[mode].scale(p[mode]) : null),\n /* Use this theme's opacity ramp to determine opacity */\n fillOpacity: themes[mode].opacity(p[mode]),\n /* Make the feature outlines black and very narrow */\n color: '#000',\n weight: 0.2\n };\n },\n /* For each feature in the layer, bind tooltips and event listeners: */\n onEachFeature: function(feature, layer) {\n /* Get the feature's properties */\n let p = feature.properties;\n /* When the feature is clicked on, hovered over, or no longer hovered over, call makeActive() with the feature's properties and the event's name */\n let timeout;\n layer\n .on('click', function() {\n makeActive('country', p, 'click');\n })\n .on('mouseout', function() {\n featureHoverActive = false;\n clearTimeout(timeout);\n layer.unbindTooltip();\n setTimeout(() => {\n if (!featureHoverActive) makeActive('country', p, 'mouseout');\n }, 240);\n })\n .on('mouseover', function() {\n featureHoverActive = true;\n /* Bind a tooltip to the feature containing the country name, statistic name, statistic, and statistic description */\n layer.bindTooltip(`\n <p>${p.name}</p>\n <p>${themes[mode].title}</p>\n <div style=\"display:flex\">\n <p>${formatStat(p[mode], mode)}</p>\n <p>${themes[mode].stat}</p>\n </div>\n `);\n timeout = setTimeout(function() {\n layer.openTooltip();\n makeActive('country', p, 'mouseover');\n }, 240);\n });\n }\n });\n /* Add the countries layer to the map if it isn't added already */\n countries.addTo(map);\n}", "title": "" }, { "docid": "f3636c55fa57e0ffc84d5f19a12f1fcc", "score": "0.59397435", "text": "renderCountryOptions() {\n \n // return this.state.countries.map((name, iso2) => {\n return this.state.countries.map((name, i) => {\n return <option key={name}>{name}</option> \n });\n}", "title": "" }, { "docid": "cb076b8c49e99bcace05ab20c89986ca", "score": "0.593482", "text": "function getAllCountry()\n {\n var\tdata = {\n 'params' :{\n\n }\n };\n initService.getMethod(data, 'baseInfo/countries')\n .then(function (resault) {\n $scope.countryList = resault.data.content.countries;\n })\n .catch(function (error) {\n\n });\n }", "title": "" }, { "docid": "001da179c46db056bbc1efd28e579123", "score": "0.591884", "text": "function PhoneView(countries){\n let lists=\"\";\n\n\n countries.forEach(country => {\n lists+=\n ` <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id=\"flush-headingOne\">\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#flush-collapseOne\" aria-expanded=\"false\" aria-controls=\"flush-collapseOne\">\n ${country.alpha2Code} \n <br/>\n <br/>\n ${country.name}\n </button>\n </h2>\n <div id=\"flush-collapseOne\" class=\"accordion-collapse collapse\" aria-labelledby=\"flush-headingOne\" data-bs-parent=\"#accordionFlushExample\">\n <div class=\"accordion-body\">\n <img src=\"${country.flag}\" class=\"img-flag mb-2\" alt=\"Flag\">\n <h5 class=\"card-title text-center\">${country.name}</h5>\n <ul>\n <li>Name : ${country.name} </li>\n <li> Native Name : ${country.nativeName} </li>\n <li> Capital : ${country.capital} </li>\n <li> Population : ${country.population} </li>\n <li> Timezones :`\n +country.timezones.map(timezone => `${timezone}`).join(\", \")\n +`</li>\n <li> Currencies :`\n +country.currencies.map(currency => `${currency.code} (${currency.symbol})`).join(\", \")\n +`</li>\n <li> Languages :`\n +country.languages.map(lang => `${lang.name}`).join(\", \")\n +`</li>\n <li> Border countries :`\n +country.borders.map(border => `${border}`).join(\", \")\n +`</li>\n <ul>\n </div>\n </div>\n </div>`;\n\n \n });\n\n return lists\n}", "title": "" }, { "docid": "3adbd569b945d6061fe1af46ddfa5aca", "score": "0.59107476", "text": "function updateRegions(country, regionCount) {\n var regions = countries[country];\n var regionsSlice = regions.slice(0, \n regionCount && regionCount < regions.length ? regionCount : regions.length).sort();\n var regionSelect = $('#region');\n regionSelect.empty();\n for (var i = 0; i < regionsSlice.length; i++) {\n var region = regionsSlice[i];\n if (region != null && region != '' && isAsciiOnly(region)) {\n regionSelect.append('<option>' + region + '</option>');\n }\n }\n}", "title": "" }, { "docid": "b6eb78c3761d1ce42897061ec9a4d6e5", "score": "0.59044313", "text": "async function getCountries() {\n const { data } = await axios.get('http://localhost:3000/countries')\n const countries = data.map((country) => {\n const h2 = document.createElement('h2')\n h2.innerText = country.name\n return h2\n })\n countries.forEach((c) => {\n document.querySelector('#countries').appendChild(c)\n })\n}", "title": "" }, { "docid": "43a821dcec0c7ff91cd23249feffc138", "score": "0.5904377", "text": "function createCountries(){\n countries.forEach((country) => {\n var node = templateCountry.content.querySelector(\".country\");\n var countryNode = node.cloneNode(true);\n\n countryNode.getElementsByTagName(\"span\")[0].innerHTML = country.name;\n \n section1_2.appendChild(countryNode);\n\n $(countryNode.querySelector(\".finish\")).droppable({\n accept: \".\"+country.code,\n drop: function () {\n $(this).addClass(\"correct\");\n $(\".\"+country.code).draggable('destroy');\n changeLocation($(\".\"+country.code).data(\"location\"));\n counting();\n google.charts.setOnLoadCallback(drawChart(country.name));\n }\n });\n\n });\n}", "title": "" }, { "docid": "ba39166ce72495a6cda27abf57bd8205", "score": "0.5903893", "text": "function loadCountries() {\r\n\t var xhttp = new XMLHttpRequest();\r\n\t xhttp.onreadystatechange = function() {\r\n\t\t if (this.readyState == 4 && this.status == 200) {\r\n\t\t \tcountryData = JSON.parse(this.responseText);\r\n\t\t arrCountries.push(countryData.countries);\r\n\r\n\t\t for(i=0;i<arrCountries[0].length;i++){\r\n\t\t \tcountrySelector1.innerHTML +=\r\n\t\t \"<option value = \" + arrCountries[0][i]+ \">\" + arrCountries[0][i] + \"</option>\";\r\n\t\t countrySelector2.innerHTML +=\r\n\t\t \"<option value = \" + arrCountries[0][i] + \">\" + arrCountries[0][i] + \"</option>\";\r\n\t\t }\r\n\t\t }\r\n\t }\r\n\t xhttp.open(\"GET\", \"http://localhost:3001/countries/\", true);\r\n\t xhttp.send();\r\n\t}", "title": "" }, { "docid": "884d31de573f1965e56354d0a511af84", "score": "0.5900267", "text": "function getAllCountry()\n {\n var data = {\n 'params' :{\n\n }\n };\n initService.getMethod(data, 'baseInfo/countries')\n .then(function (resault) {\n $scope.countryList = resault.data.content.countries;\n })\n .catch(function (error) {\n\n });\n }", "title": "" }, { "docid": "4cd8454130fdea4cdd3981037157d899", "score": "0.589872", "text": "function returnAfrica() {\n // Make ajax request\n fetch('https://restcountries.eu/rest/v2/region/africa')\n .then((r) => r.json())\n .then((data) => data.forEach(function(m) {\n document.getElementById('africa').innerHTML += `\n <div class=\"container\" id=\"row-country\">\n <div class=\"row\">\n <div class=\"col-5 d-flex align-items-center\">\n <img src=\"${m[Object.keys(m)[21]]}\" class=\"img-fluid\" alt=\"${m[Object.keys(m)[0]]} flag\">\n </div>\n <div class=\"col-7\">\n <button id=\"close\" onclick=\"closeBtnAfrica()\"><i class=\"fas fa-window-close\"></i></button>\n <h5 class=\"country-title\">${m[Object.keys(m)[0]]}</h5>\n <p class=\"card-text\">\n <ul class=\"basic-info\">\n <li class=\"general-info\"><strong>Capital City:</strong> ${m[Object.keys(m)[5]]}</li>\n <li class=\"general-info\"><strong>Sub-Continent:</strong> ${m[Object.keys(m)[8]]}</li>\n <li class=\"general-info\"><strong>Population:</strong> ${m[Object.keys(m)[9]]}</li>\n </ul>\n </p>\n </div>\n </div>\n \n </div> \n `;\n }));\n}", "title": "" }, { "docid": "13b7d4b0005cad07aff1685e668b8b46", "score": "0.5884051", "text": "function updateCountriesFG () {\n\n countriesFG.clearLayers();\n\n let countriesInfo = countriesInfoFunctions.returnCountriesInfo();\n\n let restCountries = countriesInfo['restCountries'];\n\n let features = countriesInfo['countryBorders']['features'];\n\n for (let i = 0; i < restCountries.length; i++) {\n\n let restIsoA2 = restCountries[i]['alpha2Code'];\n\n for (let j = 0; j < features.length; j++) {\n\n let featuresIsoA2 = features[j]['properties']['iso_a2'];\n let flagImage = `resources/images/flags/${featuresIsoA2.toLowerCase()}.png`;\n\n if (featuresIsoA2 == restIsoA2) {\n\n let flagIcon = L.icon({\n iconUrl: flagImage,\n iconSize: [25, 25],\n iconAnchor: [12.5, 12.5],\n popupAnchor: [0, 0]\n });\n\n let flagPosition = restCountries[i]['latlng'];\n\n let flag = L.marker(flagPosition, {icon: flagIcon});\n\n let name = features[j]['properties']['name'];\n let region = restCountries[i]['region'];\n let subregion = restCountries[i]['subregion'];\n let capital = restCountries[i]['capital'];\n let population = restCountries[i]['population'];\n\n let popupContent = `\n <div class=\"popupContentContainer\">\n <h3 class=\"sectionHeader\"><img class=\"tableImage\" src=${flagImage}> ${name}</h3>\n <div class=\"popupTableContainer\">\n <table class=\"aboutTable fullWidth\">\n <tr>\n <td>Region:</td>\n <td>${region}</td>\n </tr>\n <tr>\n <td>Subregion:</td>\n <td>${subregion}</td>\n </tr>\n <tr>\n <td>Capital:</td>\n <td>${capital}</td>\n </tr>\n <tr>\n <td>Population:</td>\n <td>${numberWithCommas(population)}</td>\n </tr>\n </table>\n </div>\n </div>\n `;\n\n flag.bindPopup(popupContent);\n\n // Open popup on mouseover\n flag.on('mouseover', function () {\n flag.openPopup();\n });\n\n // Make Active Country on Click\n flag.on('click', function (e) {\n\n let countriesInfo = countriesInfoFunctions.returnCountriesInfo();\n\n let homeCountryBorder;\n\n try {\n\n homeCountryBorder = countriesInfo['home']['countryBorder'];\n\n } catch (err) {\n\n homeCountryBorder = false;\n\n }\n\n // Check if selected country is 'home' country. If so, return.\n if (homeCountryBorder) {\n\n let homeCountryName = homeCountryBorder['properties']['name'];\n\n if (homeCountryName == name) {\n\n return;\n\n }\n\n }\n\n let currentCountryBorder;\n\n try {\n\n currentCountryBorder = countriesInfo['current']['countryBorder'];\n\n } catch (err) {\n\n currentCountryBorder = false;\n\n }\n\n // Check if selected country is 'current' country. If so, return. \n if (currentCountryBorder) {\n\n let currentCountryName = currentCountryBorder['properties']['name'];\n\n if (currentCountryName == name) {\n\n return;\n\n }\n\n }\n\n // Pass countryName and lat/lon to 'search'\n let latLon = map.mouseEventToLatLng(e.originalEvent);\n \n let lat = latLon['lat'];\n let lon = latLon['lng'];\n\n $('#countries').trigger('search', [name, lat, lon]);\n \n });\n\n countriesFG.addLayer(flag);\n\n flag._icon.classList.add('flagMarker'); \n\n }\n\n }\n\n }\n\n }", "title": "" }, { "docid": "a1b0b94253a8770d06e705454ad6c2fb", "score": "0.5879619", "text": "@action\n async showCountryInfo(cname) {\n this.countries.forEach((country, index) => {\n if(country.key === cname)\n this.selectedCountryIndex = index\n })\n this.getCovidDataOfSelectedCountry()\n }", "title": "" }, { "docid": "5c39f5dc86b67314839f5e6d9fbf6995", "score": "0.5843157", "text": "function getAllCountries() {\r\n\r\n jQuery.ajax({\r\n url: 'https://restcountries.eu/rest/v2/all?fields=name;capital;currencies;population;area;languages;flag',\r\n dataType: 'json',\r\n type: 'GET',\r\n cache: false,\r\n success: function (dataJSON) {\r\n displayAllCountries(dataJSON);\r\n },\r\n error: function () {\r\n alert('Something went wrong. Refresh the page or visit us later. Thank u');\r\n }\r\n });\r\n}", "title": "" }, { "docid": "fe875d94b56f6280d9dbbde67cef445f", "score": "0.58415437", "text": "function setCountryFeatures() {\n const countryFeatures = L.geoJSON(COUNTRIES, {\n style:function(feature){\n return {\n color: '#1e0f24',\n fillOpacity:0, \n opacity: 0.8,\n weight: 0.5\n }\n },\n onEachFeature: function(feature,layer){\n layer.on('mouseover',function(e) {\n e.target.setStyle({color: '#cc00cc', weight: 1})\n })\n layer.on('mouseout',function(e) {\n e.target.setStyle({color: '#1e0f24', weight: 0.5})\n }) \n }\n })\n .bindPopup(function(layer){\n return `<strong>${layer.feature.properties.name}</strong>`\n })\n .addTo(map);\n\n map.fitBounds(countryFeatures.getBounds(), {\n padding: [-40,-250]\n });\n}", "title": "" }, { "docid": "a2b8c817cd32dea95aea6d4f792e5ded", "score": "0.58313495", "text": "function filterCountries() {\n [...countriesList.children].forEach(el => {\n (cleanStr(el.firstElementChild.dataset.country).includes(cleanStr(search.value)) && cleanStr(el.firstElementChild.dataset.region).includes(cleanStr(name.dataset.region === \"All\" ? \"\" : name.dataset.region))) ? el.classList.remove(\"hidden\") : el.classList.add(\"hidden\");\n });\n }", "title": "" }, { "docid": "8f8406ccdf112cb1291203d5a2aa89c1", "score": "0.5825727", "text": "function countriesLoaded(data) {\n for (var c in data.results) {\n var country = data.results[c];\n var countryItem = $('<li>').attr('class', 'country-item');\n $(countryItem).data('country', country);\n // atach data about each country on the list item holding it\n var countryLink = $(\"<a href='#'>\").text(country.name);\n $(countryLink).data('country', country);\n $(countryLink).on('click', loadTowns);\n // add a button for deleting a country and eventListener on it\n var deleteButton = $('<input/>').attr({\n type: 'button',\n value: 'Delete',\n class: 'delete-country'\n });\n $(deleteButton).on('click', deleteCountry);\n // add a button for editing a country and eventListener on it\n var editButton = $('<input/>').attr({\n type: 'button',\n value: 'Edit',\n class: 'edit-country'\n });\n $(editButton).on('click', editCountry);\n // append created link and buttons to the list item\n countryLink.appendTo(countryItem);\n editButton.appendTo(countryItem);\n deleteButton.appendTo(countryItem);\n // append list iteme to the coountry list\n countryItem.appendTo($(\"#countries-list\"));\n }\n }", "title": "" }, { "docid": "03ff8da25987acefc083601abb2705ae", "score": "0.57931536", "text": "function GetShowCountryOnMap(country) {\n producer.forEach((element) => {\n if (element.dataset.country === country) {\n element.classList.add('country--active');\n } else {\n element.classList.remove('country--active');\n }\n });\n}", "title": "" }, { "docid": "e52a3727e3d04575e5b8ce7ce604aa65", "score": "0.5785036", "text": "function postCountries(data) {\r\n let dataStr = ``;\r\n if (!(data.length === 1)) { // for multiple cards of data.\r\n for (let i = 0; i < data.length; i++) { // traversing and making html of all the elements in array.\r\n const p = fancyNumbers(data[i].population.toString()); // adding comma in population to readability.\r\n dataStr += `\r\n <div class=\"card\">\r\n <a class=\"countryFlag\" href=\"#\" onclick=\"postCountries(searchCountryByFullname('${data[i].name}'))\">\r\n <img class=\"flag inverted\" src=\"${data[i].flag}\" >\r\n </a>\r\n <div class=\"cardDetail\">\r\n <h2>${data[i].name.substr(0, 52)}</h2>\r\n <p>Population: ${p} </p>\r\n <p>Region: ${data[i].region} </p>\r\n <p>Capital: ${data[i].capital} </p>\r\n </div>\r\n </div>`;\r\n }\r\n } else {\r\n const p = fancyNumbers(data[0].population.toString());\r\n let borderBtn = ``; \r\n // traversing all countries on the borders of a specific one. \r\n for (let j = 0; j < data[0].borders.length; j++) { \r\n const countryName = getBorderCountryName(data[0].borders[j]);\r\n borderBtn += `\r\n <button class=\"borderBtn\" type=\"button\" onclick=\"getBorderCountry(this, '${data[0].borders[j]}')\">${countryName.substr(0,15)}</button>\r\n `;\r\n } // adding some extra details in a full card.\r\n dataStr = `\r\n <div class=\"btndiv\"><button class=\"backbtn\" onclick=\"resetPage()\">Back</button></div>\r\n <div class=\"fullCard\">\r\n <img class=\"fullFlag\" src=\"${data[0].flag}\" >\r\n <div class=\"fullDetails\">\r\n <h2>${data[0].name}</h2>\r\n <div class=\"inFullDetails\">\r\n <div class=\"leftDetails\">\r\n <p>Native Name: <span>${data[0].nativeName}</span> </p>\r\n <p>Population: <span> ${p} </span></p>\r\n <p>Region: <span>${data[0].region}</span> </p>\r\n <p>Sub Region: <span>${data[0].subregion}</span> </p>\r\n <p>Capital: <span>${data[0].capital}</span> </p>\r\n </div>\r\n <div class=\"rightDetails\">\r\n <p>Top Level Domain: <span>${data[0].topLevelDomain}</span> </p>\r\n <p>Currencies: <span>${getAll(data[0].currencies)}</span> </p>\r\n <p>Languages: <span>${getAll(data[0].languages)}</span></p>\r\n </div>\r\n </div>\r\n <div class=\"borderBtnDiv\"><p>Border Countries: </p> <div><span>${borderBtn}</span></div></div>\r\n </div>\r\n </div>`;\r\n }\r\n $(\".cardContainer\").html(dataStr);\r\n}", "title": "" }, { "docid": "8f682da262cadb012721da4a9fcbabc3", "score": "0.57794887", "text": "function addCountries(countries, x, y, w, h, rx) {\n // projection used in the geoPath generator\n const projection = d3\n .geoOrthographic()\n // use the size of the svg for the boundaries of the projection\n .fitExtent([[x, y], [x + w, y + h]], countries)\n .rotate([rx, 0, 0]);\n\n // generator function to draw the countries\n const geoPath = d3\n .geoPath()\n .projection(projection);\n\n // generator function to draw the graticule\n const geoGraticule = d3\n .geoGraticule();\n\n // add the elements in a group element\n const group = world.append('g');\n // before the path elements describing the countries draw a path element for the graticule\n group\n .append('path')\n .attr('d', geoPath(geoGraticule()))\n .attr('stroke', 'hsl(220, 80%, 25%)')\n .attr('fill', 'hsl(220, 80%, 20%)');\n\n // for each feature of the countries object add a path element\n group\n .selectAll('path.country')\n .data(countries.features)\n .enter()\n .append('path')\n .attr('class', 'country')\n .attr('stroke', 'hsl(220, 90%, 30%)')\n .attr('stroke-width', '0.1')\n .attr('fill', 'hsl(215, 80%, 60%)')\n .attr('d', geoPath)\n // specify a title describing the name of the country\n .append('title')\n .text(({ name }) => name);\n}", "title": "" }, { "docid": "49317e43de0d4564a0990c788b9f78e2", "score": "0.5772646", "text": "function renderButtons() {\n $(\"#domGifButtons\").empty(); // Deletes the countries prior to adding new countries (otherwise repeat buttons)\n \n for (var i = 0; i < countries.length; i++) { // Loops through the array of countries\n var button = $(\"<button>\"); // create button tag\n button.addClass(\"btn btn-primary\"); // add Bootstrap button classes \n button.addClass(\"countryButton\"); // add countryButton class for clicks\n button.attr(\"data-name\", countries[i]); // give button data-name attr of country of that index\n button.text(countries[i]); // make the button text the country of that index\n $(\"#domGifButtons\").append(button); // display buttons in HTML container\n };\n}", "title": "" }, { "docid": "20203f5a5b3739e420df92bf0fe2ae8c", "score": "0.5758409", "text": "function render() {\n // console.log(regions);\n // console.log(regions.johto[0]);\n\n $('#region-results').empty();\n for(const location of regions[currentRegion]){\n let listLoc = (\"<li>\" + location + \"</li>\");\n $('#region-results').append(listLoc);\n }\n}", "title": "" }, { "docid": "bbe6c634709b5fd8d827e2cdedd4c243", "score": "0.5757529", "text": "function loadCountries(countriesArray) {\n\n const $divTable = $(`<div id=\"divTable\">`);\n const $tableCountries = $(`<table id=\"countryTable\">`);\n $tableCountries.append(`<h5>Supported Countries</h5>`);\n $(\"#countries-article\").append($divTable);\n $divTable.append($tableCountries);\n countriesArray.forEach((countries) => {\n $tableCountries.append(`<li id=\"tableList\">${countries.name}</li>`).sort();\n });\n }", "title": "" }, { "docid": "d3a18e1d632610efe3ef378c2b07b2e6", "score": "0.57373416", "text": "async getAllCountries(){\n\t\tif(this.state.countryList.length > 0) return;\n\t\tawait fetch(API_ROOT.concat(\"country/getAll\"))\n\t\t\t.then( result => {\n\t\t\t\treturn result.json();\n\t\t\t})\n\t\t\t.then( jsonResult => {\n\t\t\t\tthis.setState({countryList: jsonResult});\n\t\t\t\tthis.populateCountries();\n\t\t\t\t//console.log(this.state.countryList);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.log(\"No countries data found:\\n\" + error);\n\t\t\t});\n\t}", "title": "" }, { "docid": "3d9f11d3037d29b48cdc8f74ca880206", "score": "0.57357186", "text": "render() {\n const { error } = this.state;\n let countries = this.state.countries\n .map(c => {\n return (\n <Country\n flag={c.flag}\n name={c.name}\n capital={c.capital}\n currencies={c.currencies}\n region={c.region}\n population={c.population}\n />\n );\n });\n\n let continentes = this.state.continentes\n .map(s => {\n return (\n <Continentes\n region={s.region}\n />\n );\n });\n\n return (\n\n <div>\n <div className=\"col-12\">\n <h3>Consultar Pais:</h3>\n </div>\n <div className=\"form-group row\">\n <div className=\"col-12\">\n <input type=\"text\" className=\"form-control\" placeholder=\"Escriba el nombre del pais...\" onChange={e => this.onChange(e)}/>\n </div>\n <div className=\"col-12\">\n <h3>Seleccionar Continente:</h3>\n </div>\n <div className=\"col-12\">\n <select name=\"continente\" className=\"form-control\" onChange={c => this.onChange_continentes(c)}>\n <option>--Seleccione continente--</option>\n {continentes}\n </select>\n </div>\n </div>\n\n <table className=\"table table-striped\">\n <thead>\n <tr>\n <th>Bandera</th>\n <th>Pais</th>\n <th>Capital</th>\n <th>Moneda</th>\n <th>Continente</th>\n <th>Población</th>\n </tr>\n </thead>\n <tbody>\n {countries}\n </tbody>\n </table>\n </div>\n );\n }", "title": "" }, { "docid": "f9dd6fc278da1f1125866764d6653173", "score": "0.5735312", "text": "function getCountries()\n\t{\n\t\t$rootScope.enableLoader();\n var data = \n {\n \"token\" : 1,\n \"topicId\" : parseInt($scope.selTopic.topic_id),\n \"subTopicId\": parseInt($scope.selTopic.sub_topic_id)\n }\n\t\tvar p = geoService.getGeo(data);\n\t\tp.then(function(response)\n\t\t{\n\t\t\t$scope.countries = response.data.countries;\n if($scope.countries.length>0)\n {\n $scope.getstates($scope.countries[0]);\n }\n else\n {\n $scope.noDataForTopic = true;\n $rootScope.disableLoader();\n }\n\t\t},\n\t\tfunction(error)\n\t\t{\n\t\t\t$rootScope.disableLoader();\n\t\t});\n\t}", "title": "" }, { "docid": "6cacd552e06d260697fb36911ee6b22f", "score": "0.57300276", "text": "function filterCountries(code) {\n allData.forEach((d) => {\n console.log(code);\n if (d.Continent == code) {\n makeList(d.ISO, d.CountryName);\n }\n }\n )\n document.getElementById('countryList').innerHTML = infoList;\n infoList = null;\n }", "title": "" }, { "docid": "437652d3ff00670ba1466988cdde43b0", "score": "0.5729548", "text": "function getSelectedCountries() {\n var selected = \"\";\n console.log(map.dataProvider.areas);\n for(var i = 0; i < map.dataProvider.areas.length; i++) {\n if(map.dataProvider.areas[i].showAsSelected)\n selected = map.dataProvider.areas[i].title;\n }\n for(var i = 0; i < map.dataProvider.areas.length; i++) {\n if(map.dataProvider.areas[i].showAsSelected)\n map.dataProvider.areas[i].showAsSelected = false;\n }\n return selected;\n}", "title": "" }, { "docid": "988f016e78a38fda66a84b47024c283b", "score": "0.57154095", "text": "function loadCountryCodes() {\n $('select[name=\"gatewayapi[cc]\"], #recipient_cc').gwapiMobileCc();\n }", "title": "" }, { "docid": "a5d3f21558615a4b68b8b8f1eb66c9b8", "score": "0.57022464", "text": "getCountryList() {\n const url = `${this.apiUrl}countries/list`;\n return this.http.get(url);\n }", "title": "" }, { "docid": "4cbc8cf5605cf0e81eab7c4ad68a2db8", "score": "0.5700735", "text": "function getRandomCountry(){\r\n\r\n\tvar fade_container = document.getElementById('random_country')\r\n\tfade_container.style.opacity = '0'\r\n\r\n\r\n\t\tconst country_list = ['Luxembourg', 'Chad', 'Tanzania', 'Malawi', 'Comoros', 'Benin', 'Timor-Leste', 'Poland', 'Liechtenstein', 'Djibouti', 'Afghanistan', 'Lithuania', 'Tonga', 'Suriname', 'Iraq', 'Russian%20Federation', 'Honduras', 'Sri%20Lanka', 'Netherlands', 'Ghana', 'Saint-Barthélemy', 'Macao', 'Bulgaria', 'Tokelau', 'Japan', 'Bermuda', 'Tunisia', 'Sweden', 'Spain', 'Malta', 'Indonesia', 'Croatia', 'Venezuela', 'Jamaica', 'Saudi%20Arabia', 'Philippines', 'Mauritius', 'Lesotho', 'Algeria', 'Switzerland', 'Oman', 'Mauritania', 'Liberia', 'Eritrea', 'Jersey', 'Colombia', 'Belarus', 'Slovenia', 'Georgia', 'Finland', 'Turkmenistan', 'Lebanon', 'Antarctica', 'Samoa', 'Portugal', 'Monaco', 'Israel', 'Egypt', 'Cuba', 'Tuvalu', 'Andorra', 'Sierra%20Leone', 'France', 'Bolivia', 'Belize', 'Ukraine', 'Bahrain', 'Albania', 'Zimbabwe', 'Nigeria', 'Iceland', 'France', 'Fiji', 'Maldives', 'Cyprus', 'Turkey', 'Burundi', 'Aruba', 'Nepal', 'Qatar', 'Swaziland', 'Mayotte', 'Cambodia', 'Western%20Sahara', 'Namibia', 'Moldova', 'Martinique', 'Kiribati', 'Gabon', 'Ecuador', 'Mongolia', 'Viet%20Nam', 'Slovakia', 'Equatorial%20Guinea', 'Palestinian%20Territory', 'Latvia', 'Chile', 'Antigua%20and%20Barbuda', 'Mali', 'Guinea-Bissau', 'Thailand', 'Myanmar', 'Mozambique', 'Montenegro', 'Taiwan', 'Gambia', 'Australia', 'Morocco', 'Malaysia', 'Kyrgyzstan', 'Hungary', 'Guadeloupe', 'South%20Sudan', 'Mexico', 'Ireland', 'Central%20African%20Republic', 'Botswana', 'Somalia', 'Togo', 'Sudan', 'Palau', 'United%20Arab%20Emirates', 'Libya', 'Czech%20Republic', 'Paraguay', 'Nicaragua', 'Vanuatu', 'Papua%20New%20Guinea', 'Norway', 'Niger', 'Iran', 'Grenada', 'Argentina', 'Uganda', 'Syria', 'Montserrat', 'Kazakhstan', 'Belgium', 'Pakistan', 'El%20Salvador', 'Uzbekistan', 'Micronesia', 'Italy', 'Brazil', 'Angola', 'Canada', 'Bahamas', 'Guinea', 'Azerbaijan', 'Senegal', 'Denmark', 'Netherlands', 'Guyana', 'Bhutan', 'Ethiopia', 'Austria', 'Guernsey', 'Gibraltar', 'Barbados', 'Bangladesh', 'Zambia', 'Kuwait', 'Haiti', 'Macedonia', 'Estonia', 'Cape%20Verde', 'South%20Africa', 'Panama', 'Costa%20Rica', 'Singapore', 'India', 'Yemen', 'Guam', 'Germany', 'Guatemala', 'Armenia', 'Anguilla', 'Jordan', 'Greenland', 'Burkina%20Faso', 'Serbia', 'Rwanda', 'Pitcairn', 'Dominica', 'Cameroon', 'Greece', 'Seychelles', 'Romania', 'New%20Zealand', 'Madagascar', 'Kenya', 'Uruguay', 'Tajikistan', 'Peru', 'Nauru']\r\n\r\n\r\n\t\tvar country_random_from_list = country_list[Math.floor(Math.random()*country_list.length)]\r\n\t\tvar api_url = 'https://api.covid19api.com/live/country' + '/' + country_random_from_list\r\n\t\tconsole.log(api_url)\r\n\t\tvar xmlHttp = new XMLHttpRequest()\r\n\t xmlHttp.onreadystatechange = function() { \r\n\t if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\r\n\t var res = JSON.parse(this.responseText)\r\n\r\n\t \t\r\n\t \tvar country_data = res.slice(-1).pop()\r\n\r\n\t \tvar country = country_data.Country\r\n\t \tvar cases = country_data.Confirmed.toLocaleString()\r\n\t \tvar deaths = country_data.Deaths.toLocaleString()\r\n\t \tvar recovered = country_data.Recovered.toLocaleString()\r\n\r\n\r\n\r\n\t \tdocument.getElementById('rnd_country').innerHTML = country\r\n\t \tdocument.getElementById('rnd_country_data').innerHTML = cases + ' Cases <br>' + \r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t deaths + ' Deaths <br>' + \r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t recovered + ' Recovered'\r\n\t \tfade_container.style.opacity = '1'\r\n\t }\r\n\t xmlHttp.open(\"GET\", api_url, true); // true for asynchronous \r\n\t xmlHttp.send();\r\n }", "title": "" }, { "docid": "5f7a11c8c7e5caffc8aa44acc9119a48", "score": "0.56998533", "text": "function addDataToSelect(){\n\n /**\n * Add countries to the select\n */\n Object.keys(countriesAllData).forEach(function(countryName) {\n var countryData = countriesAllData[countryName][countriesAllData[countryName].length-1],\n active = countryData.confirmed - countryData.deaths - countryData.recovered,\n countryStatsHTML = '<div class=\"country\" data-value=\"'+countryName+'\">'+countryName+'<div class=\"stats\"><div class=\"c\">C: <span class=\"couC\">'+countryData.confirmed+'</span></div><div class=\"a\">A: <span class=\"couA\">'+active+'</span></div><div class=\"d\">D: <span class=\"couD\">'+countryData.deaths+'</span></div><div class=\"r\">R: <span class=\"couR\">'+countryData.recovered+'</span></div></div></div>';\n $('#countries-select').append(countryStatsHTML);\n });\n\n /**\n * Sort countries by cases\n */\n countriesSort($('.sort.selected').attr('data-sort'));\n}", "title": "" }, { "docid": "ce18c8186ab2cdfd7e942b8bd9272e20", "score": "0.5687025", "text": "function wrangleCountryCodes(data) {\n\t\t\t\t\n\t\t\t\tvis.countryCodes = d3.nest()\n\t\t\t\t\t.key(function(d) { return d['ISO 3166-1 2 Letter Code']; })\n\t\t\t\t\t.map(data);\n\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "f71f56ebc80a329afbf3df0f36daf80f", "score": "0.5684378", "text": "function populateCountries() {\n\n /* make a fragment of HTML code containing\n * all the countries as <OPTION> tags */\n var fragment = '<option value=\"empty\">Choose a country</option>';\n $.each(countries.sort(), function(key, country) {\n fragment += '<option value=\"' + country + '\">' + country + '</option>';\n });\n\n /* insert the HTML fragment in the DOM */\n $('#countries').append(fragment);\n\n /* watches the #countries dropwdon, when the\n country changes, fires the map to the new selected country coords. */\n $('#countries').change(function() {\n /* the name of the current country from the dropdown*/\n var country = $('#countries').val();\n /* moves map to the new coords. */\n map.setCenter(new google.maps.LatLng(coords[country]['lat'], coords[country]['long']));\n });\n}", "title": "" }, { "docid": "99d64411f7c72b6d401e91d8a223a5cc", "score": "0.5681046", "text": "function getCountries() {\n $.ajax(\"https://www.liferay.com/api/jsonws/country/get-countries/\")\n .done(function (data) {\n $(data).each(function (index, country) {\n $('#countries').append('<option value=\"' + country.a2 + '\"> ' + country.nameCurrentValue + '</option>')\n })\n })\n }", "title": "" }, { "docid": "3938ab315419919d5e2108c7649f9a50", "score": "0.56761783", "text": "function getCountryByCode(e){\n if(e.target.classList.contains('border-country-btn')){\n \n mainSection.style.display='none';\n singleCountrySection.style.display='block';\n \n const borderCountryName= e.target.textContent.toLowerCase();\n countryApi.getCountryData(`alpha/${borderCountryName}`)\n .then((data)=>{\n console.log(data)\n ui.renderSingleCountry(data);\n })\n }\n\n\n\n\n // https://restcountries.eu/rest/v2/alpha/col\n }", "title": "" }, { "docid": "65c8a6627726d2e37ec68832ec23a929", "score": "0.56713766", "text": "function submitChoice(){\n\n for(var x in maps) {\n var map = maps[x];\n for (var i in map.dataProvider.areas) {\n var area = map.dataProvider.areas[i];\n //disable selection for each country\n area.selectable = false;\n area.rollOverColor= \"#CDCDCD\";\n area.rollOverOutlineColor= \"#666666\";\n if (area.id==countryToPick) {\n index=i;\n }\n }\n }\n //color the wrong country picked\n c.showAsSelected = true;\n c.selectedColor=\"#FF0000\";\n\n //color the correct country picked, overwrites the above if they are the same\n map.dataProvider.areas[index].showAsSelected = true;\n map.dataProvider.areas[index].selectedColor=\"#00FF00\";\n\n map.validateData();\n\n}", "title": "" }, { "docid": "158d64d68a9857477a052b8f28f4f6fa", "score": "0.5667823", "text": "function drawCities(cities) {\n for (var i = 0; i < cities.length; i++) {\n cities[i].draw();\n }\n}", "title": "" }, { "docid": "ad04d853b7bf4ccebf6a58f59ed69f40", "score": "0.56655407", "text": "function select(countries) {\r\n // lista regiona\r\n let tmp = countries.map((country) => country.region);\r\n let myOptions = [...new Set(tmp)];\r\n\r\n // za neke zemlje region = \"\"\r\n // menjamo prazno polje sa \"Other/Unspecified\"\r\n let options = myOptions.filter((option) => option.length > 0);\r\n options.push(\"Other/Unspecified\");\r\n\r\n // pravimo selectMenu\r\n const selectMenu = document.createElement(\"select\");\r\n selectDiv.append(selectMenu);\r\n\r\n const defaultOption = document.createElement(\"option\");\r\n defaultOption.value = \"-1\";\r\n defaultOption.selected = true;\r\n defaultOption.disabled = true;\r\n defaultOption.hidden = true;\r\n defaultOption.textContent = \"Choose region\";\r\n\r\n selectMenu.append(defaultOption);\r\n\r\n // ubacujemo opcije\r\n options.forEach((option) => {\r\n const opt = document.createElement(\"option\");\r\n opt.value = option;\r\n opt.textContent = option;\r\n selectMenu.appendChild(opt);\r\n });\r\n\r\n // u noRegion niz ubacujemo zemlje koje nemaju region\r\n let noRegion = countries.filter((country) => country.region === \"\");\r\n\r\n // listener\r\n selectMenu.addEventListener(\"change\", function (e) {\r\n // pomocni niz regionalDisplay\r\n let regionalDisplay = [];\r\n main.innerHTML = \"\";\r\n\r\n // forEach-ujemo zemlje za vrednost inputa\r\n countries.forEach(function (country) {\r\n if (selectMenu.value === country.region) {\r\n regionalDisplay.push(country);\r\n } else if (selectMenu.value === \"Other/Unspecified\") {\r\n // ako je izabrana vrednost \"Other/Unspecified\"\r\n // noRegion niz guramo u regionalDisplay\r\n regionalDisplay = [...noRegion];\r\n }\r\n });\r\n\r\n // pozivamo Countries funkciju i prosledjujemo regionalDisplay niz\r\n main.append(...Countries(regionalDisplay));\r\n\r\n // za slucaj da regionalDisplay niz ima samo jednu zemlju:\r\n singleCountryDisplay(regionalDisplay);\r\n\r\n // stavljamo da je currentCountries = regionalDisplay-u\r\n currentCountries = regionalDisplay;\r\n // i filteredCountries preuzima currentCountries zbog filtriranja i sortiranja\r\n filteredCountries = [...currentCountries];\r\n });\r\n}", "title": "" }, { "docid": "dd5d197819b53434754e8047d9f158ec", "score": "0.56565005", "text": "function constructCityOptions(cities) {\n if (cities.length > 0) {\n var text = \"\";\n cities.forEach((x) => text += \"<option value='\" + x.item.countryCode + \"-\" + x.item.city + \"'>\" + x.item.city + \", \" + x.item.country + \"</option>\");\n $(\".cities-select > select\").html(text);\n setCityOptionDisplay(true); \n } else {\n setCityOptionDisplay(false);\n }\n \n}", "title": "" }, { "docid": "71293ba721b2789afe303b6bc79edc01", "score": "0.5653404", "text": "function buildCanada() {buildMap(country_maps[\"Canada\"], \"Canada\");}", "title": "" }, { "docid": "2661d7d6dc21dfc41f551f0f0def799f", "score": "0.56422895", "text": "function updateSelectedCountry(country) {\r\n \tif (country) {\r\n \t\tcountry = country.split(' ').join('-');\r\n \t}\r\n worldBarVis.updateCountry(country);\r\n worldMapVis.updateSelectedCountryInMap(country);\r\n worldLineChartVis.updateSelectedCountryInLineChart(country);\r\n }", "title": "" }, { "docid": "f363ff0a8e804b7ecb58a588392cfbd1", "score": "0.5637439", "text": "function addCountries() {\n\t\tvar countrySelect = $(\"#countrySelect\")\n\t\t$.get(\"data/countrycodes.json\")\n\t\t\t.then(function (data) {\n\t\t\t\tdata.forEach(function (value, index) {\n\t\t\t\t\tcountrySelect.append(\"<option value='\" + value.Code.toLowerCase() + \"'>\" + value.Name + \"</option>\" )\n\t\t\t\t})\n\t\t\t\t$('select').material_select();\n\t\t\t})\n\t}", "title": "" }, { "docid": "81598a9caa8809590e874c87030b2c2b", "score": "0.5635509", "text": "function selectCountry() {\n let countrySelected = document.getElementById(\"countrySelector\").value;\n displayCountry.textContent = countrySelected;\n\n // displaying state dropdown default values and disabling if country is changes\n if (stateSelector.childElementCount > 1) {\n stateSelector.length = 1;\n\n let optState = document.createElement(\"options\");\n optState.value = \"default\";\n optState.disabled = true;\n optState.textContent = \"Select State\";\n stateSelector.selectedIndex = 0;\n stateSelector.appendChild(optState);\n displayState.textContent = null;\n }\n\n // displaying city dropdown default values and disabling if country is changes\n if (citySelector.childElementCount > 1) {\n citySelector.length = 1;\n\n let optCity = document.createElement(\"options\");\n optCity.value = \"default\";\n optCity.disabled = true;\n optCity.textContent = \"Select City\";\n citySelector.selectedIndex = 0;\n citySelector.appendChild(optCity);\n citySelector.disabled = true;\n displayCity.textContent = null;\n }\n\n // generating states based on selected country\n generateStates(countrySelected);\n}", "title": "" }, { "docid": "21b6f66b607dd7e1e12c84f515f32105", "score": "0.5628347", "text": "static getRegions (req, res) {\n var list = countryList.getNameList();\n console.log('Fetching all countries with codes');\n res.status(200).send(list);\n }", "title": "" }, { "docid": "16026d6b0fe28c38f1ba8f34c06fb44e", "score": "0.5624607", "text": "function displayCountryScreen() {\n countryScreen.style.display = 'grid';\n document.getElementById('country-num-pieces').textContent = mission.numPieces;\n document.getElementById('country-plastic-type').textContent = mission.plasticType;\n document.getElementById('country-button-1').textContent = mission.countries.country1;\n document.getElementById('country-button-2').textContent = mission.countries.country2;\n document.getElementById('country-button-3').textContent = mission.countries.country3;\n document.getElementById('country-button-4').textContent = mission.countries.country4;\n document.getElementById('country-button-5').textContent = mission.countries.country5;\n document.getElementById('country-button-6').textContent = mission.countries.country6\n}", "title": "" }, { "docid": "141879f51be8237d6f6751659c78887d", "score": "0.5621504", "text": "function displayLocations() {\n for(var i = 0; i < myLocations.length; i++) {\n myLocations[i].render();\n }\n}", "title": "" }, { "docid": "134e9e395009ce02627c4bb717cebbe2", "score": "0.56124914", "text": "function displayCounties()\n{\n var optionsArr=[]; // declare an empty array to hold options...that are to be added\n var countyArr=[];\n\n var selectCounty=document.getElementById('selectCounty');\n\n /* determine the counties for each region and create option menu elements for them */\n if('Dublin' == teamRegion)\n {\n countyArr=['DN'];\n\n optionsArr=addOptionToSelect(countyArr);\n }\n else if('North Leinster' == teamRegion)\n {\n countyArr=['LH','MH','KE','WH','LD','CN','MN'];\n\n optionsArr=addOptionToSelect(countyArr);\n }\n else if('South Leinster' == teamRegion)\n {\n countyArr=['WW','WX','LS','KK','CW','OY'];\n\n optionsArr=addOptionToSelect(countyArr);\n }\n else if('North West'==teamRegion)\n {\n countyArr=['LM','SO','RN','MO','GY','DL'];\n\n optionsArr=addOptionToSelect(countyArr);\n }\n else if('South West'==teamRegion)\n {\n countyArr=['TY','WD','CE','LK','CK','KY'];\n\n optionsArr=addOptionToSelect(countyArr);\n }\n else\n {\n countyArr=['DN','LH','MH','KE','WH','LD','CN','MN','WW','WX','LS','KK','CW','OY','TY','WD','CE','LK','CK','KY','LM','SO','RN','MO','GY','DL'];\n\n optionsArr=addOptionToSelect(countyArr);\n }\n\n /* add the options to the select menu */\n for(var i=0; i<optionsArr.length;i++)\n {\n selectCounty.add(optionsArr[i]);\n }\n}", "title": "" }, { "docid": "98438885fba1d397010fe5b2b0155084", "score": "0.56101537", "text": "render() {\n\t\tconst {selectedCountries} = this.state;\n\n\t\tconst mapCountries = country.map((country) => (\n\t\t\t<path\n\t\t\t\tkey={country.id}\n\t\t\t\td={country.shape}\n\t\t\t\tstyle={\n\t\t\t\t\tthis.props.theme === 'dark'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tfill: selectedCountries[country.id]\n\t\t\t\t\t\t\t\t\t? '#4479E9'\n\t\t\t\t\t\t\t\t\t: 'white',\n\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\tstroke: '#ccc',\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tfill: selectedCountries[country.id]\n\t\t\t\t\t\t\t\t\t? '#dd6b20'\n\t\t\t\t\t\t\t\t\t: '#1F2028',\n\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\tstroke: '#ccc',\n\t\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tonClick={() => this.toggleCountry(country)}\n\t\t\t/>\n\t\t));\n\t\treturn (\n\t\t\t<div className='mapSVG'>\n\t\t\t\t<svg\n\t\t\t\t\tclassName='worldSVG'\n\t\t\t\t\txmlns='http://www.w3.org/2000/svg'\n\t\t\t\t\theight='400'\n\t\t\t\t\twidth='800'\n\t\t\t\t\tviewBox='0 0 2000 1001'\n\t\t\t\t\tref={this.mapSvg}>\n\t\t\t\t\t{mapCountries}\n\t\t\t\t</svg>\n\n\t\t\t\t{/**Controles para poder hacer zoom,zoomIn,... */}\n\t\t\t\t<div className='mapsWorldControl'>\n\t\t\t\t\t<button className='icon' ref={this.zoomIn}>\n\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<button className='icon' ref={this.zoomOut}>\n\t\t\t\t\t\t<ZoomOut />\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<button className='icon' ref={this.zoomReset}>\n\t\t\t\t\t\t<ZoomReset />\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "0601292d04ce4d665d2f5b3148a0285f", "score": "0.5604978", "text": "function getDetails() {\n fetch('https://restcountries.eu/rest/v2/name/' + `x`)\n .then((res) => res.json())\n .then((data) => {\n let output = '<h2 style=\"align:center;\">Data</h2>';\n data.forEach(function (country) {\n output += `\n <div class=\"card\">\n <a href=\"countrydetails.html?countryname=\"+(${country.name})><img src=\"${country.flag}\" class=\"img1\" alt=\"Avatar\" style=\"width:100%\"></a>\n <div class=\"container2\">\n <h4 id=\"heading3\"><b>${country.name}</b></h4>\n </div>\n </div>\n `;\n });\n document.getElementById('container1').innerHTML = output;\n })\n}", "title": "" }, { "docid": "4e7ebff82a2ce361f8406ebc4a7805af", "score": "0.56004095", "text": "function loadCountryOption() {\n var country = d3.select(\"#country\");\n var countryNames = tableData.map(row => row.country).filter((value, index, self) => self.indexOf(value) === index);\n countryNames.forEach((countryName) => {\n var option = country.append(\"option\");\n option.text(countryName);\n });\n}", "title": "" }, { "docid": "8bd50b4ccb81225c3ed6c7519981e932", "score": "0.5595429", "text": "function showLocationCountry(response) {\n let currentcountry = response.data.sys.country;\n\n let currentlocationcountry = document.querySelector(\".country\");\n currentlocationcountry.innerHTML = currentcountry;\n}", "title": "" }, { "docid": "e8ff1d7f3460e5c10a89ff8f7bb40f29", "score": "0.55945414", "text": "function getCountries(){\n request('get','/countries',null)\n .then(res=>{\n $(\".country\").html('');\n $(\".country\").append(\"<option value='' selected>Country</option>\");\n res.forEach(country => {\n $(\".country\").append('<option value=\"'+country.id+'\">'+country.name+'</option>');\n });\n $(\".country option[value='94']\").attr('selected',true);\n });\n }", "title": "" }, { "docid": "42baa37785068d42d4eb72b9289ae746", "score": "0.5586027", "text": "function showDataForCountry(iso_a2) {\n console.log(iso_a2 + \" clicked\")\n fetch('data/stats_regions_' + iso_a2 + '.json')\n .then(data => data.json()\n .then(json => {\n console.log(json);\n const detailsHtml = createDataForCountryAsHtml(json.name, json.encryption);\n $('#country-details').html(detailsHtml);\n }));\n}", "title": "" }, { "docid": "1d36d4edc614e08ada348810a77bcbda", "score": "0.55792", "text": "function showNames() {\n \n if (countryNames.style.display === \"block\") {\n countryNames.style.display = \"none\";\n } else {\n countryNames.style.display = \"block\";\n }\n }", "title": "" }, { "docid": "17d0d0f662021a185c71fa856165c96b", "score": "0.55715936", "text": "function generateStates(selectedCountry) {\n let stateSelector = document.getElementById(\"stateSelector\");\n\n for (let x = 0; x < totalCountries; x++) {\n if (selectedCountry === countrylist[x].name) {\n // check whether the country has a state or not\n if (countrylist[x].hasOwnProperty(\"states\")) {\n stateSelector.disabled = false;\n for (let y = 0; y < Object.keys(countrylist[x].states).length; y++) {\n // generating state options for state dropdown\n let optState = document.createElement(\"option\");\n optState.value = Object.keys(countrylist[x].states)[y];\n optState.textContent = Object.keys(countrylist[x].states)[y];\n stateSelector.appendChild(optState);\n }\n } else {\n // disabling state if there is no state for a selected country\n stateSelector.disabled = true;\n citySelector.disabled = true;\n citySelector.length = 1;\n\n let optState = document.createElement(\"options\");\n optState.value = \"default\";\n optState.textContent = \"Select State\";\n stateSelector.selectedIndex = 0;\n stateSelector.appendChild(optState);\n displayState.textContent = null;\n\n let optCity = document.createElement(\"options\");\n optCity.value = \"default\";\n optCity.textContent = \"Select City\";\n citySelector.selectedIndex = 0;\n citySelector.appendChild(optCity);\n displayCity.textContent = null;\n }\n }\n }\n}", "title": "" }, { "docid": "7061689a0aaf4bfc840d4db265fcd82a", "score": "0.5568619", "text": "function displayCountry(url) {\r\n ///API for Country using rapid API\r\n fetch(\"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/reference/v1.0/countries/en-US\", {\r\n \"method\": \"GET\",\r\n \"headers\": {\r\n \"x-rapidapi-host\": \"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com\",\r\n \"x-rapidapi-key\": \"83a5b67dddmsh07cead2188694edp17cffajsnb7ded68ff6bf\"\r\n }\r\n }).then(response => response.json())\r\n .then(response => {\r\n console.log(response.Countries);\r\n /////Function to fill Selected items\r\n fillList(response.Countries);\r\n })\r\n .catch(err => {\r\n console.error(err);\r\n });\r\n\r\n}", "title": "" }, { "docid": "99f2200001811ef31518bc6aa1f2ce78", "score": "0.55348676", "text": "function displayCountries(data){\n data.forEach(element => {\n console.log(element.name)\n let p = document.createElement(\"p\")\n let div = document.createElement(\"div\")\n countriesContainer.appendChild(div)\n p.innerHTML = `${element.name}`\n p.className =\"col-2\"\n\n let img = document.createElement(\"img\")\n img.className = \"col-12\"\n img.src = `${element.flag}`\n div.appendChild(img)\n div.appendChild(p)\n div.className = \"country-card col-3\" \n\n });\n \n\n}", "title": "" }, { "docid": "18a6f14782847220d1e4375cc03819b4", "score": "0.5524715", "text": "function setCountryList() {\n var select = document.getElementById(\"selectCountry\");\n for (var i = 0; i < countryList.length; i++) {\n var opt = countryList[i];\n var el = document.createElement(\"option\");\n el.textContent = opt;\n el.value = opt;\n select.appendChild(el);\n }\n }", "title": "" }, { "docid": "a0448dac6b82e7249538dd7f24121197", "score": "0.552419", "text": "async function fetchCountry(num) {\n const url = 'https://restcountries.eu/rest/v2/all?fields=name';\n let response = await fetch(`${url}`);\n const res = await response.json();\n let countryName = res[num].name;\n let newResponse = await fetch(`https://restcountries.eu/rest/v2/name/${countryName}?fullText=true`);\n const countryInfo = await newResponse.json();\n let img = `<img style=\"width:80px; height: 50px;\" src=\"${countryInfo[0].flag}\"/>`;\n cont = `\n \n <ul class=\"elemList\">\n <li>name: ${countryInfo[0].name}</li>\n <li> nativeName: ${countryInfo[0].nativeName}</li>\n <li>capital: ${countryInfo[0].capital}</li>\n <li>population: ${countryInfo[0].population}</li>\n <li>flag: ${img}</li>\n </ul>\n \n `;\n return cont;\n }", "title": "" }, { "docid": "ba03c5e2b5bffdc02e6235bbe922a8ff", "score": "0.55225945", "text": "function onEachState(countryBorder, layer) {\n //fill color on geojson layer\n layer.options.fillColor = countryBorder.properties.color;\n const countryName = countryBorder.properties.ADMIN;\n //will show total sales of each country when country is clicked\n const totalSales = countryBorder.properties.totalSales;\n //info on popup when country is clicked\n layer.bindPopup(`${countryName} Total Sales:\n $${Math.round(totalSales)} `);\n }", "title": "" }, { "docid": "7e8c5fab65c68471a8f97de5d6b51b19", "score": "0.55165005", "text": "function getCountryList() {\n return userApiClient.get('country')\n}", "title": "" }, { "docid": "4415a4eb2b6375c01212de607b5e5d89", "score": "0.5511528", "text": "function closeCountry(country) {\n // deselect country on map and list\n $(\"svg#map-svg path[data-country=\" + country + \"], ul#country-pick li#li-\" + country).each(function () {\n if (this.localName == \"path\") $(this).css(\"fill\", normal_country_color)[0].dataset.active = -1;\n else $(this).attr(\"style\", \"\")[0].dataset.active = -1;\n });\n\n var index = active_countries.indexOf(country);\n\n // if it was the second, simply removes it\n if (index === 1) {\n active_countries[1] = \"\";\n active_countries_colors[1] = null;\n\n $(\"#country-title-2\").empty().append(\"<span class=\\\"add-country\\\" onclick=\\\"switchCountryState(2)\\\">+ add country</span>\");\n\n // remove from stadium chart\n current_attendance[2] = current_attendance[3] = empty_attendance;\n\n // remove stadium legend\n changeLegend(\"delete\");\n no_countries_mode = 0;\n\n // fetches current form state and updates bar chart\n formChange();\n }\n\n // if it's the first, and the second's defined, moves the second to its place\n else if (index === 0 && $(\"#country-title-2\").children().length > 1) {\n $(\"#pc-left-top [data-country=\" + active_countries[1] + \"]\").each(function () {\n if (this.localName == \"path\")\n $(this).attr(\"data-active\", 0).css(\"fill\", country_colors[active_countries[no_countries_mode]].active[active_countries_colors[1]]);\n\n else\n $(this).attr(\"data-active\", 0).css({\n \"background-color\": country_colors[active_countries[no_countries_mode]].active[active_countries_colors[1]],\n \"color\": textcolor(country_colors[active_countries[no_countries_mode]].active[active_countries_colors[1]])\n });\n });\n active_countries = active_countries.slice(1,2).concat([\"\"]);\n active_countries_colors = active_countries_colors.slice(1,2).concat([null]);\n\n $(\"#country-title-1\").empty().append($(\"#country-title-2\").children());\n $(\"#country-title-2\").empty().append(\"<span class=\\\"add-country\\\" onclick=\\\"switchCountryState(2)\\\">+ add country</span>\");\n\n // remove from stadium chart\n current_attendance = current_attendance.slice(2,4).concat([empty_attendance,empty_attendance]);\n\n // remove legend\n changeLegend(\"delete\");\n no_countries_mode = 0;\n changeLegend(\"\", active_countries[0]);\n\n // fetches current form state and updates bar chart\n formChange();\n }\n\n // if it's the first and only, removes it\n else {\n active_countries[0] = \"\";\n active_countries_colors[0] = null;\n\n $(\"#country-title-1\").empty().append(\"<span class=\\\"suggestion\\\">Select a country above...</span>\");\n $(\"#country-title-2\").empty().append(\"<span class=\\\"suggestion inactive\\\">+ add country</span>\");\n\n // remove from stadium chart\n current_attendance[0] = current_attendance[1] = empty_attendance;\n\n // remove legend\n changeLegend(\"delete\");\n $(\"#stadium #legend\").fadeOut(500);\n no_countries_mode = 0;\n\n // remove bar chart\n updatePlayersBarChart(\"total-gpm\", \"delete\");\n }\n\n udpateStadium();\n updateScatterplot();\n updateSpiderChart();\n updateHappinessChart();\n\n setTimeout(function () {\n $(\".player-bar-rect-nt:nth-of-type(1)\").trigger(\"mouseover\");\n $(\".player-bar-rect-nt:nth-of-type(1)\").trigger(\"click\");\n }, 500);\n updateGauge();\n}", "title": "" }, { "docid": "1feb7cb5ac75efbe069d0101c7db93c2", "score": "0.55058825", "text": "function allCountries(name) {\r\n\tvar cC = document.getElementById(\"results_Cont\"),\r\n\t\trightPanel = cC.firstElementChild.lastElementChild;\r\n\r\n\tvar listI_Cont = document.createElement(\"DIV\"),\r\n\t\tlistI = document.createElement(\"H6\"),\r\n\t\tlistI_Node = document.createTextNode(name);\r\n\t\r\n\tlistI.appendChild(listI_Node);\r\n\tlistI.setAttribute(\"style\", \"width: 100%; height: 22px; margin: auto; position: relative; display: inline; font: 700 20px/22px Droid Sans, Helvetica, sans-serif; vertical-align: middle;\"); \r\n\r\n\tlistI_Cont.appendChild(listI);\r\n\tlistI_Cont.setAttribute(\"style\", \"width: 100%; height: 24px; margin: auto; position: relative; display: block; padding: 4px 0; border-bottom: 1px solid Gray; border-top: 1px solid Gray; vertical-align: middle;\");\r\n\tlistArr.indexOf(name) !== -1 ? listI_Cont.className = \"haveBeen\" : listI_Cont.className = \"haventBeen\";\r\n\r\n\tif (listI_Cont.className === \"haveBeen\") {\r\n\t\tvar tripType_Img = document.createElement(\"IMG\"),\r\n\t\t\timg_Path,\r\n\t\t\tkeyK = name + \"Trip\";\r\n\t\t\t\t// console.log(keyK);\r\n\t\t\r\n\t\ttripType_Img.setAttribute(\"style\", \"display: inline; position: absolute; right: 5%; top: 1%; height: 98%; width: auto; margin: auto 15% auto auto; vertical-align: middle;\");\r\n\r\n\t\tif (tripsObj[keyK][\"type\"] === \"Travel Log\") {\r\n\t\t\timg_Path = countryObject + \".svg\";\r\n\t\t\ttripType_Img.setAttribute(\"src\", \"../Graphics/Trip_Log.png\");\r\n\t\t\tlistI_Cont.insertBefore(tripType_Img, listI_Cont.childNodes[1]);\r\n\t\t} else if (tripsObj[keyK][\"type\"] === \"Travel Itinerary\") {\r\n\t\t\ttripType_Img.setAttribute(\"src\", \"../Graphics/Itinerary_Plan.png\");\r\n\t\t\tlistI_Cont.insertBefore(tripType_Img, listI_Cont.childNodes[1]);\r\n\t\t}\r\n\t}\r\n\trightPanel.appendChild(listI_Cont);\r\n}", "title": "" } ]
b729dcbb60a2e72d96dc54762d824115
defaults vars Game building functions
[ { "docid": "ca3557e36a8e9058d76ba18c1d2f05c2", "score": "0.68795526", "text": "function build_game() {\n\t//update_engine();\n\tbuild_header();\n\tbuild_objects();\n\tbuild_main();\n\tbuild_screen();\n\tbuild_screen_manager();\n\tbuild_screen_draw();\n\tbuild_analyse_event();\n\tbuild_engine_functions();\n\tcreate_makefile();\n\n}", "title": "" } ]
[ { "docid": "6f0b4a794222febe09db84dedc81d922", "score": "0.6853064", "text": "buildGameEnvironment() {}", "title": "" }, { "docid": "74e52c02f332eb0ddb0ab985326854ee", "score": "0.6384329", "text": "function setupGame() {\r\n\r\n}", "title": "" }, { "docid": "2043452f1630378945c1d757dc4e3d2f", "score": "0.6371076", "text": "function setUpGameArea()\n{\n\n}", "title": "" }, { "docid": "da827454ee9cd4f229cfc9849fc9b685", "score": "0.6279057", "text": "function Game_Variables(){this.initialize.apply(this,arguments);}", "title": "" }, { "docid": "d71c12b1a567bcdd90ce64033eb9bad8", "score": "0.62618494", "text": "defaultGamePieceInit() {\r\n\t\t//Create the game pieces from the UI settings\r\n\t\tthis.initPlayer1Pieces();\r\n\t\tthis.initPlayer2Pieces();\r\n\t\t//Load the pieces into the regions\r\n\t\tthis.populateRegions();\r\n\t}", "title": "" }, { "docid": "695b16ed2137732fa80e558cf6c42167", "score": "0.6256725", "text": "function initGame() {\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n}", "title": "" }, { "docid": "f1b1f5793a8f14997924af597c2bb236", "score": "0.6249117", "text": "function defaultValues() {\n setGameIsRunning(false);\n setPlayerHealth(defaultPlayerHealth);\n setMonsterHealth(defaultMonsterHealth);\n setShowModel(false);\n setGameLogs([])\n setTimer(defaultTimer);\n }", "title": "" }, { "docid": "36248953a38103afe28accb6d36bbc40", "score": "0.62412345", "text": "function newGame(){\n if(options.reset==undefined) {\n options.reset=\"\"\n return;\n }\n values.boss=1;\n values.zone=0;\n stats.highestBoss=0;\n loadBoss();\n resetAssignedClones();\n resetPlayer();\n resetRebirth();\n lockAllButtons();\n resetMine();\n resetFarm(); \n resetWarehouse();\n resetArena();\n save();\n}", "title": "" }, { "docid": "748f0024d2a385ed4250044ab469b29d", "score": "0.6180406", "text": "function parseParameters ( parameters ) {\n\t\t\n\t\t// Numeric & boolean values\n\t\tif (parameters.mode === \"default\") {\n\t\t\tscope.sizeX = parameters.sizeX || BUILDING_DEFAULT_SIZE_X;\n\t\t\tscope.sizeZ = parameters.sizeZ || BUILDING_DEFAULT_SIZE_Y;\n\t\t\tscope.windowRepetition = parameters.windowRepetition || BUILDING_DEFAULT_WINDOW_REPETITION;\n\t\t\tscope.probabilityNextFloorDifferentShape = parameters.probabilityNextFloorDifferentShape || BUILDING_DEFAULT_PROBABILITY_NEXT_FLOOR_DIFFERENT_SHAPE;\n\t\t\tscope.posX = parameters.posX || BUILDING_DEFAULT_POS_X;\n\t\t\tscope.posZ = parameters.posZ || BUILDING_DEFAULT_POS_Y;\n\t\t\tscope.height = parameters.height || BUILDING_DEFAULT_HEIGHT;\n\t\t\tscope.floorHeight = parameters.floorHeight || BUILDING_DEFAULT_FLOOR_HEIGHT;\n\t\t\tscope.windowsSeparation = parameters.windowsSeparation || BUILDING_DEFAULT_WINDOWS_SEPARATION;\n\t\t\tminSolidWidth = parameters.minSolidWidth || BUILDING_DEFAULT_MIN_SOLID_WIDTH;\n\t\t\tmaxSolidWidth = parameters.maxSolidWidth || BUILDING_DEFAULT_MAX_SOLID_WIDTH;\n\t\t\tscope.textureWall = parameters.textureWall || DEFAULT_BUILDING_WALL_TEXTURE_PATH;\n\t\t\tscope.textureRoof = parameters.textureRoof || DEFAULT_BUILDING_ROOF_TEXTURE_PATH;\n\t\t}\n\t\telse {\n\t\t\tscope.sizeX = parameters.sizeX || THREE.BuildingUtils.randomBetween(25,250);\n\t\t\tscope.sizeZ = parameters.sizeZ || THREE.BuildingUtils.randomBetween(25,250);\n\t\t\t// Even in random mode we want the default value for Window Repetition. This is because the default value is \"random\"\n\t\t\tscope.windowRepetition = parameters.windowRepetition || BUILDING_DEFAULT_WINDOW_REPETITION;\n\t\t\tscope.probabilityNextFloorDifferentShape = parameters.probabilityNextFloorDifferentShape || THREE.BuildingUtils.randomBetween(.05,.25);\n\t\t\tscope.posX = parameters.posX || BUILDING_DEFAULT_POS_X;\n\t\t\tscope.posZ = parameters.posZ || BUILDING_DEFAULT_POS_Y;\n\t\t\tscope.floorHeight = parameters.floorHeight || THREE.BuildingUtils.randomBetween(7,13);\n\t\t\tscope.height = parameters.height || scope.floorHeight * THREE.BuildingUtils.randomBetween(1,15);\n\t\t\tscope.windowsSeparation = parameters.windowsSeparation || THREE.BuildingUtils.randomBetween(4,8);\n\t\t\tminSolidWidth = parameters.minSolidWidth || BUILDING_DEFAULT_MIN_SOLID_WIDTH;\n\t\t\tmaxSolidWidth = parameters.maxSolidWidth || BUILDING_DEFAULT_MAX_SOLID_WIDTH;\n\t\t\tscope.textureWall = parameters.textureWall || getRandomBuildingWallTexture();\n\t\t\tscope.textureRoof = parameters.textureRoof || getRandomBuildingRoofTexture();\n\t\t\t\n\t\t\tif (parameters.windowsGroup !== undefined) {\n\t\t\t\tscope.windowsGroup = parameters.windowsGroup;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tscope.windowsGroup = (THREE.Math.random16() < .5) ? \"pairs\" : \"normal\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Roof\n\t\t// Set and empty array to make the following code more simple\n\t\tif (parameters.roof === undefined) {\n\t\t\tparameters.roof = [];\n\t\t}\n\t\t\n\t\tif (parameters.roof.wallHeightProportion !== undefined)\n\t\t\tscope.roofWallProportion = parameters.roof.wallHeightProportion;\n\t\telse {\n\t\t\tif (parameters.mode === \"default\") {\n\t\t\t\tscope.roofWallProportion = BUILDING_DEFAULT_ROOF_WALL_PROPORTION;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tscope.roofWallProportion = THREE.BuildingUtils.randomBetween(.2,.6);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (parameters.roof.objects === undefined) {\n\t\t\tif (parameters.mode === \"default\") parameters.roof.objects = BUILDING_DEFAULT_ROOF_ELEMENTS;\n\t\t\telse parameters.roof.objects = getRandomRoofObjects();\n\t\t}\n\t\t\n\t\t\n\t\t// Windows\n\t\tif (parameters.windows === undefined) {\n\t\t\tparameters.windows = [];\n\t\t}\n\t\t\n\t\tif (parameters.windows.length === 0) {\n\t\t\tif (parameters.mode === \"default\") parameters.windows = BUILDING_DEFAULT_WINDOWS;\n\t\t\telse parameters.windows = getRandomWindows();\n\t\t}\n\t\t\n\t\t\n\t\t// Floors\n\t\tif (parameters.floors === undefined) {\n\t\t\tif (parameters.mode === \"default\") {\n\t\t\t\tparameters.floors = new Array({\n\t\t\t\t\t\"windows\": BUILDING_DEFAULT_FIRST_FLOOR_WINDOWS\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tparameters.floors = new Array({\n\t\t\t\t\t\"windows\": getRandomFirstFloorWindows()\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (parameters.floors[0].floorHeight === undefined) {\n\t\t\tif (parameters.mode === \"default\") parameters.floors[0].floorHeight = BUILDING_DEFAULT_FLOOR_HEIGHT;\n\t\t\telse parameters.floors[0].floorHeight = THREE.BuildingUtils.randomBetween(scope.floorHeight,scope.floorHeight*1.5);\n\t\t}\n\t\tif (parameters.floors[0].windowsSeparation === undefined) {\n\t\t\tif (parameters.mode === \"default\") parameters.floors[0].windowsSeparation = BUILDING_DEFAULT_WINDOWS_SEPARATION;\n\t\t\telse parameters.floors[0].windowsSeparation = THREE.BuildingUtils.randomBetween(scope.windowsSeparation,scope.windowsSeparation*2);\n\t\t}\n\t\tparameters.floors[0].windowsGroup = \"normal\";\n\t}", "title": "" }, { "docid": "35e0bb5b0eec76789272e713c84aa921", "score": "0.6179018", "text": "function buildLevel(){\n\tGenerateMap();\n\tbuildWall();\n\tPlayer.resetPlayer();\n}", "title": "" }, { "docid": "33a3d4e8760e1db51233bcf5664fd6c1", "score": "0.61642575", "text": "function resestAllGameSettings()\n{\n // Reset game stats\n level_currentLevel = 1;\n level_currentScore = 0;\n level_highScore = 0;\n level_totalFilledTiles = 0;\n level_totalEmptyTiles = (MAP_TILE_HEIGHT - (2 * MAP_BORDER_THICKNESS)) * (MAP_TILE_WIDTH - (2 * MAP_BORDER_THICKNESS));\n isGamePaused = false;\n isPlayerMovementDisabled = false;\n isCharacterDeadAlready = false;\n\n isBallMovementDisabled = false;\n isPlayerMovementDisabled = false;\n isGamePaused = false;\n isCharacterDeadAlready = false;\n isCharInDangerZone = false;\n isSoundEffectsEnabled = true;\n\n level_numberOfBalls = 0;\n level_playerLives = 0;\n level_currentLevel = 0;\n level_percentComplete = 0.0;\n level_targetPercentComplete = 0.0;\n level_totalFilledTiles = 0;\n level_totalEmptyTiles = 0;\n level_currentScore = 0;\n level_highScore = 0;\n \n showMuteXIcon(isSoundMuted);\n\n // Reset the character tween if it is in progress\n if (playerTween != null && playerTween.isRunning)\n {\n playerTween.stop();\n }\n\n allBallXVelocities = [];\n allBallYVelocities = [];\n endangeredTiles = [];\n}", "title": "" }, { "docid": "106ede0ae69ba718634b40a38ed366a4", "score": "0.61630213", "text": "build(){\n this._predefinedBuild()// for the static proerties to be assigned\n }", "title": "" }, { "docid": "789ff33dc7abe37cc1137667406f2b81", "score": "0.6128566", "text": "setupNewGame() {\r\n this.board = this.initBoard(this.size);\r\n this.score = 0;\r\n this.won = false;\r\n this.over = false;\r\n this.moveArray = [];\r\n this.winArray = [];\r\n this.loseArray = [];\r\n this.addRanNumber();\r\n this.addRanNumber();\r\n }", "title": "" }, { "docid": "f8575e941143c22eb393bf0f97e96e47", "score": "0.6115104", "text": "function init() {\n gamePlay = false;\n move_0 = [];\n move_1 = [];\n activePlayer = 1;\n move_current = 0;\n spanDesign();\n}", "title": "" }, { "docid": "2f08a1de1df9df7876c5d4804f6a9328", "score": "0.6095022", "text": "function resetVars () {\n\t\tusername = new String();\n\t\tuser_exists = false;\n\t\tcurrent_urlsafe_key = new String();\n\t\topen_games = null;\n\t\tdice_operation = new String();\n\t\tnumber_of_tiles = new String();\n\t\tcontinue_game_present = false;\n\t\tajax_callback_resolve = new Function()\n\t\tgoogle_callback_resolve = new Function()\n\t\topen_games = new Array();\n\t\t$game_selection_shell = new Object();\n\t\t$game_selection_form = new Object();\n\t\t$dice_operation = new Object();\n\t\t$number_of_tiles = new Object();\n\t\t$addition_button = new Object();\n\t\t$multiplication_button = new Object();\n\t\t$nine_button = new Object();\n\t\t$twelve_button = new Object();\n\t\t$new_game_button = new Object();\n\t\t$radio_buttons_collection = new Object();\n\t\t$continue_game_button = new Object();\n\t}", "title": "" }, { "docid": "b6bb826f3c6a3e44c3a123797713b652", "score": "0.6090694", "text": "function buildStartBuilding() {\n\tcreateBuilding(canvasH / 100 * 80);\n\tcreateBuilding(canvasH / 100 * 60);\n\tcreateBuilding(canvasH / 100 * 50);\n}", "title": "" }, { "docid": "83f130d08ce11a78268bb2bb8f9eee99", "score": "0.60770714", "text": "function newBuild() {\n\t//Prepare clean build\n\tnewBuildObject();\n\tinitTraits();\n\tinitGear();\n\t//Prepare any data\n\tswitchToTraits();\n}", "title": "" }, { "docid": "16d2ef78e877d9dd344b71bfdc04d18e", "score": "0.6074317", "text": "function SetupBuildings(x: float, z: float, w: float, l: float, h: float, sub: float, color: int){\n\t// var street_meshes = new List.<GameObject>();\n\tSetupBuildings(x,z,w,l,h,sub,color, new List.<GameObject>());\n}", "title": "" }, { "docid": "4f81993a8a8226ca6041f32bef9658fa", "score": "0.60601777", "text": "initGame() {\n this.grid = [...Array(this.height)].map(x=>Array(this.width).fill(this.states.NONE));\n this.currentPlayer = this.states.PLAYER1;\n this.gameover = false;\n }", "title": "" }, { "docid": "33a1f6dc4d929f91f7eb0e7c2adad3f8", "score": "0.6046048", "text": "function init_gamestatus() {\n\tvars.numLives = 5;\n\tvars.frogsHome = 0;\n\tvars.checkH1 = false;\n\tvars.checkH2 = false;\n\tvars.checkH3 = false;\n\tvars.checkH4 = false;\n\tvars.checkH5 = false;\n\tvars.frogDead = false;\n\tvars.deathTime = 0;\n\tvars.gameOver = false;\n}", "title": "" }, { "docid": "5ddebd8994310528ddc9066f919f82e4", "score": "0.60309446", "text": "function buildGame() {\n\n console.log(\"Building the game!\");\n\n //Filling any completed answer\n _.each($scope.activityData.questions, function (question, key, list) {\n if ($scope.activityData.questions[key].userChoice !== \"\") {\n //Filling the answer key\n $scope.checkboxes[key][$scope.activityData.questions[key].userChoice].gotoAndPlay(\"onselect\");\n }\n });\n\n //Checking for already answered questions\n if (!$scope.activityData.newGame) {\n checkAnswers();\n }\n }", "title": "" }, { "docid": "aab22c1175d337074d7699696b459eb9", "score": "0.60295075", "text": "function setting() {\n speed = 1;\n level = 1;\n score = 50;\n numberMonsterShow = 0;\n BEST = 50;\n boom = 3;\n stop = 3;\n heart = 5;\n\n isBoom = false;\n isStop = false;\n isPause = false;\n isRun = true;\n lastStop = false;\n lastUpdateTime = Date.now();\n listBlood = new Array();\n}", "title": "" }, { "docid": "89a02f6db0ab6e6434d25a222802a541", "score": "0.6011861", "text": "function autobuild_bots() {\n for (var pn = 1; pn < num_players; pn++) {\n autobuild(pn, draft.players[pn].in_color);\n }\n Print_collection();\n return;\n}", "title": "" }, { "docid": "6552fb60aede2df5839be46dd9801cfc", "score": "0.6011215", "text": "function setupGame(){\n // The game\n agentPosition = new Point(0, 0);\n\n widthWindow = width;\n heightWindow = height;\n\n agentLifePositionX = widthWindow - sizeForAgentBarLife;\n agentLifePositionY = heightWindow - sizeForAgentBarLife;\n\n enemyLifePositionX = sizeForAgentBarLife;\n enemyLifePositionY = heightWindow - sizeForAgentBarLife;\n\n blockSizeX = (widthWindow / columns);\n blockSizeY = (heightWindow / rows);\n}", "title": "" }, { "docid": "b78ca61910e3ba3135e9c1b75ace9378", "score": "0.59906507", "text": "function initializeGame(){\n\t\tdisplayGame();\n\t\tgetGameSettings();\n\t\tinitializeGameInfo();\n\t\tcreateGrid();\n\t\tloadGame();\n\t}", "title": "" }, { "docid": "76da72c9d13a665422799929946e78c2", "score": "0.59905916", "text": "function GameStart(){\r\n CreateMap(); \r\n CreateSnake(); \r\n CreateFruit();\r\n}", "title": "" }, { "docid": "8413a48f38898e88f5f83be1305332fb", "score": "0.59717476", "text": "function initGame() {\r\n firstGreeting();\r\n renderPowerUps();\r\n renderSmiley(SMILEY)\r\n gGame.shownCount = 0;\r\n gGame.isOn = true;\r\n gGame.isFirsMine = false;\r\n gBoard = buildBoard(gLevel.SIZE);\r\n setMines(gBoard);\r\n showNeighbours(gBoard);\r\n renderBoard(gBoard, '.game-board');\r\n}", "title": "" }, { "docid": "53a9ee836ed3665fa64405e26be43739", "score": "0.5967657", "text": "function initGame(){\n UI.markContainerElementsWithGameConfigName(GameLogic.getGameName());\n injectChoiceElements();\n registerComputerVsComputerEventHandler();\n }", "title": "" }, { "docid": "8236603bc0ec63fe68009a65c6121107", "score": "0.5910253", "text": "function gameInit() {\n // used to initialize variables in this module's closure\n if(logging()) console.log(\" wCanvas,width: \" + wCanvas.width);\n graphicsInit(this);\n scoreCanvasInit();\n nextToMove = 0;\n\n}", "title": "" }, { "docid": "7cab81bd3e5c95aaa2bae4dac9bc1693", "score": "0.5909443", "text": "function setUpGame(){\n\t\t//Create deck at start of game\n\t\tcreateDeck();\n\t\t//Create player and dealer at start of game\n\t\tcreatePlayers();\n\t\t//Display player's funds at the start of the game\n\t\tplayerFunds();\n\t\t//Disable some of the non needed buttons at the start\n\t\tstartButtons();\n\t\t//Resets game outcome\n\t\tresetOutcome();\n\t\t//Displays deck size at the start\n\t\tdisplayDeck();\n\t}", "title": "" }, { "docid": "19175ef8cd10745e0eb4c749d8d2e729", "score": "0.590274", "text": "function Main()\n{\n\n game = new Phaser.Game(gWidth, gHeight, Phaser.CANVAS, '', { preload: preload, create: create, update: update });\n\n\n /**\n *\n * Global variables\n *\n */\n\n game.global = {\n mail: '',\n rank:0,\n score: 0,\n best_score: 0,\n currentLevel:0,\n currentLogo:0,\n displayedLogos: [],\n currentProgress:0,\n answer_delay:0\n };\n\n\n // adding all the game screens\n game.state.add(\"GameTitle\", gameTitle);\n game.state.add(\"LevelSelect\", levelSelect);\n game.state.add(\"PlayLevelSolo\", playLevelSolo); \n game.state.add(\"ScoreScreen\", scoreScreen);\n game.state.add(\"Ranking\", ranking);\n\n // Start the first screen (chargement en cours)\n game.state.start(\"GameTitle\");\n}", "title": "" }, { "docid": "8f2bf7566026fc57d8aee05fec55c3b5", "score": "0.5897352", "text": "function create ()\n\t{\n\t\tmain_game.level.create();\n\t\tmain_game.mirror.create();\n\t\tmain_game.missile.create();\n\t\tfor(var i = 0; i < main_game.robot_amount; i++)\n\t\t{\n\t\t\tmain_game.robots[i].create();\n\t\t}\n\t\tmain_game.ace.create();\n\t\tmain_game.hud.create();\n\t\tmain_game.soundtrack.create();\n\t}", "title": "" }, { "docid": "113b2d947943eaa57d45160a27e0e800", "score": "0.5887578", "text": "function defineGameSettings() {\n\tcommon_food_color = document.getElementById(\"favcolor_com\").value;\n\tepic_food_color = document.getElementById(\"favcolor_ep\").value;\n\tlegendary_food_color = document.getElementById(\"favcolor_leg\").value;\n\tfood_remain = document.getElementById(\"rangeBallsInput\").value;\n\tfood_remian_ingame = food_remain;\n\tfoodForLabel=food_remain;\n\tnumberOfMonsters = document.getElementById(\"rangeMonstersInput\").value;\n\ttimeForGame = document.getElementById(\"num_seconds\").value;\n\tif(timeForGame<60){\n\t\ttimeForGame=60;\n\t}\n\tshow_hourglass = parseInt(timeForGame / 2);\n\tshow_medkit = parseInt(timeForGame / 4);\n\tlet tempUp = document.getElementById(\"key_up\").value;\n\tlet tempDown = document.getElementById(\"key_down\").value;\n\tlet tempRight = document.getElementById(\"key_right\").value;\n\tlet tempLeft = document.getElementById(\"key_left\").value;\n\tlet up = \"ArrowUp\";\n\tlet down = \"ArrowDown\";\n\tlet right = \"ArrowRight\";\n\tlet left = \"ArrowLeft\";\n\tif (up.localeCompare(tempUp) == 0 || tempUp == \"\") {\n\t\tupwardsKey = 38;\n\t}\n\tif (down.localeCompare(tempDown) == 0 || tempDown == \"\") {\n\t\tdownwardsKey = 40;\n\t}\n\tif (right.localeCompare(tempRight) == 0 || tempRight == \"\") {\n\t\trightKey = 39;\n\t}\n\tif (left.localeCompare(tempLeft) == 0 || tempLeft == \"\") {\n\t\tleftKey = 37;\n\t}\n}", "title": "" }, { "docid": "dda6384102bc53afe3b024b3fc90571d", "score": "0.58826387", "text": "function initGame(){\n initVar();\n loadLayout();\n drawLowBar(title_film);\n timmer();\n teclado();\n}", "title": "" }, { "docid": "24120befc2696a8f1134fe112f40e173", "score": "0.5873", "text": "function CreateGlobalVars() {\n //Global variables\n _game.global = {\n playerName: null,\n visitedScenes: {}\n }\n\n //Global groups\n _game.mediaGroup = _game.add.group();\n _game.uiGroup = _game.add.group();\n\n //Global managers\n _game.global.gameManager = new GameManager();\n _game.global.soundManager = new SoundManager(_game);\n _game.global.databaseManager = new DatabaseManager(_game);\n\n //Constants\n _game.global.constants = {};\n\n //Filter refresh interval\n _game.global.constants.FILTER_REFRESH_INTERVAL = 10;\n\n //Video timestsamp check interval in ms\n _game.global.constants.VIDEO_CHECK_INTERVAL = 150;\n\n //Image information viewing constants\n _game.global.constants.INFO_VIEW_MARGIN = 50; \n _game.global.constants.INFO_VIEW_HEIGHT = _game.height - _game.global.constants.INFO_VIEW_MARGIN*2;\n _game.global.constants.SCROLLBAR_DIM = [30, _game.global.constants.INFO_VIEW_HEIGHT]; \n _game.global.constants.INFO_VIEW_WIDTH = _game.width - _game.global.constants.INFO_VIEW_MARGIN*2 - _game.global.constants.SCROLLBAR_DIM[0]; \n _game.global.constants.SCROLLBAR_POS = [_game.width - _game.global.constants.INFO_VIEW_MARGIN - _game.global.constants.SCROLLBAR_DIM[0], \n _game.global.constants.INFO_VIEW_MARGIN];\n _game.global.constants.SCROLLBAR_STROKEWIDTH = 2;\n _game.global.constants.INFO_OVERLAY_COLOR = 0x000000;\n _game.global.constants.INFO_OVERLAY_OPACITY = 0.7;\n _game.global.constants.SCROLLBAR_WHEEL_SENSITIVITY = 10;\n\n //Subtitle constants\n _game.global.constants.SUBTITLE_Y_POS = 620;\n _game.global.constants.SUBTITLE_SPACING = 5;\n\n //Transition constants\n _game.global.constants.TRANSITION_COLOR = 0x000000;\n}", "title": "" }, { "docid": "663a39b6cd1145f3ee30252b693f8c7e", "score": "0.5872787", "text": "function newGame() {\n let newGameState = gameState.createInitialGameState();\n gameState.gameBoard = newGameState.board;\n gameState.openPositions = newGameState.openMoves;\n $('.board-piece').empty();\n getSettings();\n }", "title": "" }, { "docid": "73e4850f5c25d9a7d8ff3cfedc50a0b7", "score": "0.5868825", "text": "function initGame() {\n\tcreateBoard();\n\tcreateStars();\n\tinitCounters();\n\taddListeners();\n\tshowTimer();\n}", "title": "" }, { "docid": "894eba8a81d5594a3675cdf5f9e7e364", "score": "0.58670205", "text": "function initGame() {\r\n gGame = true;\r\n gSeconds = 0;\r\n changeSmileyState(GAME_ON);\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n renderLives();\r\n}", "title": "" }, { "docid": "4dc7835954c6444a32283c471928f6ea", "score": "0.5862226", "text": "function basicGame() {\n GEEK_MODE = false;\n show(\"game-options\");\n hide(\"game-menu\");\n}", "title": "" }, { "docid": "8658c92bbd5d9fc4ea6f1e896c4eb824", "score": "0.5858564", "text": "function myGame() {\r\n\r\n\tthis.solo_mode = false;\r\n\r\n\tthis.auto_wait = false;\r\n\r\n\tthis.auto_step = false;\r\n\r\n\tthis.observer = false;\r\n\r\n\tthis.minPlayers = 1;\r\n\r\n\tthis.maxPlayers = 1000;\r\n}", "title": "" }, { "docid": "a8234e2eabb878fe3cc43d5226c8dce1", "score": "0.585822", "text": "function createGame(){\r\n\tplayerData.swipe = false;\r\n\tswipeArrow.alpha = txtInstruction.alpha = 0;\r\n\t\r\n\tcreateBeer();\r\n\tupdateStat();\r\n\tanimateBeerDrop(true);\r\n}", "title": "" }, { "docid": "a21dc56d28d8076ec3c75776368f87fe", "score": "0.58462083", "text": "function buildGameButton(){\n\t//main\n\tbtnStart.cursor = \"pointer\";\n\tbtnStart.addEventListener(\"mousedown\", function(evt) {\n\t\tplaySound('soundClick',false);\n\t\tcreateGame();\n\t});\n\t\n\tbtnReplay.cursor = \"pointer\";\n\tbtnReplay.addEventListener(\"mousedown\", function(evt) {\n\t\tplaySound('soundClick',false);\n\t\tcreateGame();\n\t});\n\t\n\tbtnBackMain.cursor = \"pointer\";\n\tbtnBackMain.addEventListener(\"mousedown\", function(evt) {\n\t\tplaySound('soundClick',false);\n\t\tgoPage('main');\n\t});\n\t\n\tbtnShare.cursor = \"pointer\";\n\tbtnShare.addEventListener(\"mousedown\", function(evt) {\n\t\ttoggleShare(true);\n\t});\n\t\n\tbtnBack.cursor = \"pointer\";\n\tbtnBack.addEventListener(\"mousedown\", function(evt) {\n\t\ttoggleShare(false);\n\t});\n\t\n\tbtnFb.cursor = \"pointer\";\n\tbtnFb.addEventListener(\"click\", function(evt) {\n\t\tshare('facebook');\n\t});\n\tbtnTwitter.cursor = \"pointer\";\n\tbtnTwitter.addEventListener(\"click\", function(evt) {\n\t\tshare('twitter');\n\t});\n\tbtnGoogle.cursor = \"pointer\";\n\tbtnGoogle.addEventListener(\"click\", function(evt) {\n\t\tshare('google');\n\t});\n}", "title": "" }, { "docid": "e1570101574503406cd1bf488b002782", "score": "0.58453", "text": "function setUpGame() {\n initializeVariables();\n handleDOMItems();\n}", "title": "" }, { "docid": "29b96ac71edad1282d4a25e9e3e826ae", "score": "0.584266", "text": "function initGame() {\n for (let i = 0; i < settings.defaultObs; i++) {\n orbs.push(new Orb(settings))\n }\n\n}", "title": "" }, { "docid": "882c1d4523f5bacd71f884063117916b", "score": "0.580704", "text": "function buildWorld() {\n if (library.grid_width != undefined && library.grid_height != undefined)\n drawGrid(library.grid_width, library.grid_height);\n if (!library.bg_colour) {\n stage.setBackgroundColor(getColour(library.background));\n }\n\n}", "title": "" }, { "docid": "ff0ebe156a4705513e73ca1b488722c8", "score": "0.58027864", "text": "function initGame(){\n\n myShip.ship.show();\n // boss.element.hide();\n\n bg1X = 0;\n bg2X = 0;\n score = 0;\n $('.score').html(score + ' PTS');\n\n $('.container').css({'background-color':'rgb(255, 255, 255, 0)'});\n $('.gameSpace').show();\n $('.infosLayer').show();\n $('.overlay').css({'opacity':0});\n $('.overlay h2').css({'top':'600px'});\n $('.winner').css({'opacity':0});\n $('.winner h2').css({'top':'620px'});\n\n $('.level').stop();\n $('.level').css({'width':'100%', 'opacity':1});\n $('.level').removeClass('level1').removeClass('level2').removeClass('level3').removeClass('level0');\n $('.level').addClass('level4');\n\n myShip.ship.css({'background-position-y':-750});\n myShip.posY = 225;\n myShip.posX = -150;\n // myShip.ship.css({'top':'225px'});\n $('.spaceship').css({'top':'225px'});\n myShip.ship.css({'left':'-150px'});\n myShip.ship.removeClass('power');\n myShip.health = 4;\n myShip.power = 0;\n\n ammunitions.forEach(function(oneShot){\n oneShot.strenght = 10;\n });\n\n $('.shot').css({'display':'none', 'width':'10px', 'height':'4px'}).addClass('armed');\n\n superPower = 0;\n\n bossInvincible = true;\n\n $('.boss').css({'display':'none', 'left':'1000px', 'top':'-250px'});\n $('.boss').css({'background-position-y':'-1250px', 'background-position-x':'0px'});\n $('.boss .eye').css({'display':'none'});\n boss.posX = 1000;\n boss.posY = -250;\n boss.health = 200;\n\n $('.bossBar').css({'display':'none'});\n $('.bossLevel').css({'width': '100%'});\n\n $('.powerBar').css({'display':'none'});\n}", "title": "" }, { "docid": "9458a3719fc29d20b5d0e2bf78ec20a2", "score": "0.57969224", "text": "function initGame() {\n //Initialize our character.\n pullCharacterInfo();\n updateLocation(\"Town Center\");\n initChat();\n }", "title": "" }, { "docid": "7f6ca5e9a2ab8960a9786c2b269bd9a4", "score": "0.57834774", "text": "function initializeGame() {\n\n //set value to the goalNumber\n goalNumber = Math.floor(Math.random() * 101 + 19);\n\n // set values to each crystal\n crystal1 = Math.floor(Math.random() * 11 + 1);\n crystal2 = Math.floor(Math.random() * 11 + 1);\n crystal3 = Math.floor(Math.random() * 11 + 1);\n crystal4 = Math.floor(Math.random() * 11 + 1);\n}", "title": "" }, { "docid": "35c480a47069649b8edffdb33b1afe20", "score": "0.57827085", "text": "function mainGame() {\r\n fill(999); // White\r\n locationManager();\r\n inventory();\r\n bottomHoverText();\r\n}", "title": "" }, { "docid": "a1017cd748c68649fbc642e12709704c", "score": "0.5772738", "text": "function initGlobalVariables() {\n association = {}; //Hier wird die Legende gespeichert\n incomingCalls = {}; //speichert Infos ueber Eingehende Verbindungen\n outgoingCalls = {}; //speichert Infos ueber ausgehende Verbindungen\n\n gardenRadius = 6; //Groesse der Gaerten\n\n buildingsHashMap = {}; //Hashmap fuer Gebaeude: mapt Gebaeude-ID mit dem Objekt\n\n GARDEN_WIDTH = (6 + 6 * Math.sin(Math.PI / 6)) / Math.cos(Math.PI / 6);\n GARDEN_DEPTH = 6 + 6 * Math.sin(Math.PI / 6);\n\n jsonOfNodes = {}; //man greift erst auf die x-Position zu, dann auf die z-Position, dann bekommt man den Knoten\n\n graph = {};\n nodeHashMap = {};\n nodeID = 0;\n\n logScaling = {};\n}", "title": "" }, { "docid": "690beab975784cc8309ca7341b9aaf06", "score": "0.57611495", "text": "function newGame(that) {\n let type = that.test_type.value;\n let length = type === \"0\" ? that.time_length.value : that.word_length.value;\n if (type === \"\") {\n type = defOpt[0].toString();\n }\n if (length === \"\") {\n length = defOpt[1].toString();\n }\n Game.resetStats;\n inGame = false;\n clicked = false;\n gameTypingField.value = \"\";\n Game.editGameData(type, length);\n DOMFunctions.setSettings(type, length);\n Game.initialiseArray();\n DOMFunctions.showArray(Game.gameWords);\n DOMFunctions.changeGameProgress(\"\");\n}", "title": "" }, { "docid": "07bbb629987a1ccafe927cfd8974f293", "score": "0.5760065", "text": "function newGame() {\n\n currency = 100;\n level = 1;\n game = new Game();\n init();\n}", "title": "" }, { "docid": "b403d980fab6a62868c01d3e934fef78", "score": "0.575983", "text": "function setUpGame() {\n if (bombLocation === treasureLocation) {\n setUpGame();\n }\n return;\n}", "title": "" }, { "docid": "90ed199d3a3d6f739de0cde83a66a2b6", "score": "0.57570964", "text": "function initBuilding(aBuilding, namePrefix) {\n if (aBuilding._height == undefined) {\n var dimensions = [\"height\", \"width\", \"color\"];\n for (var i = 3; i--;) {\n var dim = dimensions[i];\n aBuilding[\"_\" + dim] = getDrawnDimValue(aBuilding, dim);\n if (logScaling[dim]) {\n aBuilding[\"_\" + dim] = scaleLogarithmically(aBuilding, dim);\n }\n }\n if (aBuilding.buildings != undefined && aBuilding.buildings[0] == undefined) {\n aBuilding.buildings = undefined;\n }\n aBuilding._centerPosition = [0, aBuilding._height / 2, 0];\n var theLeftGarden = garden(true, aBuilding, outgoingCalls[aBuilding[association.name]]);\n var theRightGarden = garden(false, aBuilding, incomingCalls[aBuilding[association.name]]);\n aBuilding[\"_leftGarden\"] = theLeftGarden;\n aBuilding[\"_rightGarden\"] = theRightGarden;\n if (aBuilding[association[\"height\"]] != undefined) {\n updateExtrema(aBuilding._width, aBuilding._height, aBuilding._color);\n } else {\n aBuilding[association.name] = namePrefix;\n }\n buildingsHashMap[aBuilding[association.name]] = aBuilding;\n aBuilding._isRemoved = false;\n aBuilding._numOfActivatedConnections = 0;\n }\n}", "title": "" }, { "docid": "e337972126ca1c5baa7ff448b9d1c963", "score": "0.5750688", "text": "building(args) {\n return this.createGameObject(\"Building\", building_1.Building, args);\n }", "title": "" }, { "docid": "a492c7f2ec2e3b182199c63d2b86330c", "score": "0.5747276", "text": "_setUpGame() {\n switch (this.difficulty) {\n case 'easy':\n this.GameService.init(10);\n break;\n case 'medium':\n this.GameService.init(20);\n break;\n case 'hard':\n this.GameService.init(40);\n break;\n case 'extra hard':\n this.GameService.init(100);\n break;\n default:\n this.GameService.createCards(20);\n break;\n }\n }", "title": "" }, { "docid": "41dc20d8a437a5de494e0dbd9225b00f", "score": "0.57413894", "text": "lauchGame() {\n\t\tif(this.isFull()) {\n\t\t\tthis.status = 2;\n\t\t\tthis.initGame();\n\t\t\tthis.initBoard();\n\t\t}\n\t}", "title": "" }, { "docid": "e3743092ef740e75671b9f9d1199cc1d", "score": "0.5740764", "text": "function setUpGame(gn) {\n return {\n name: gn,\n players: 0\n }\n}", "title": "" }, { "docid": "0191a5c1973d41481a8d7edd61672ea9", "score": "0.57392365", "text": "create () {\n /****game.var adds a new \"class variable\" to game state, like in other languages****/\n\n //the number of winning line to finish animating before displaying win screen\n \n game.linesToAnimate = 0\n\n //used for ai minimax\n game.human = \"x\";\n game.ai = \"o\";\n\n //init the background image\n var background = game.add.sprite(game.world.centerX, game.world.centerY, 'background');\n background.anchor.set(0.5);\n background.width = game.screenWidth;\n background.height = 700;\n\n //used for displaying squares scaled to size\n game.squareSize = 115\n //the size of the board, i.e nxn board, 3x3 for tictactoe\n game.n = 3\n //flags for turn and win status\n game.isXTurn = true\n game.isDraw = false\n game.turns = 0\n\n //the top left coordinate to place the whole board at, we will make game\n //not hardcoded in the furture to center the board, but I believe we need jQuery\n //to get window size and I didn't feel like learning that right now\n game.startingX = game.screenWidth/2 - ((game.cache.getImage('square').width* game.n) / 2)\n game.startingY = 115\n //intialize waiting status to false, update accordingly later if multiplayer\n game.waiting = false\n\n //record of the pieces that have been placed\n game.placedPieces = []\n\n //asign functions ot the game object, so they can be called by the client\n this.assignFunctions()\n\n //used to display the previous placed peice, i.e hilight the square\n //that was last placed a peice in\n game.cursorSquares = []\n for (var i=0; i < game.n; i++) {\n game.cursorSquares[i]=new Array(game.n)\n }\n\n for (var i=0; i < game.n; i++)\n {\n for (var j=0; j < game.n; j++)\n {\n game.cursorSquares[i][j] = game.addSprite(game.startingX + i*game.squareSize, game.startingY + j*game.squareSize, 'redsquare')\n game.cursorSquares[i][j].alpha = 0\n }\n }\n\n //create an internal representation of the board as a 2D array\n game.board = game.makeBoardAsArray(game.n)\n //create the board on screen and makes each square clickable\n game.makeBoardOnScreen()\n //add messages that display turn status, connection statuses\n this.addTexts()\n //used to track double clicks\n game.previousPiece = \"\"\n\n //folloowing logic is for multiplayer games\n if(game.singleplayer || game.vsAi)\n return\n //if this is the first play against an opponent, create a new player on the server\n game.startMultiplayer()\n\n }", "title": "" }, { "docid": "2c26bbb5a2241ffda90a2b3536620c7b", "score": "0.5737436", "text": "resetGame() {\n\n\t\t\t\t// Background\n\n\t\t\t\tgameObject.components.background.x = 0;\n\t\t\t\tgameObject.components.background.y1 = 0;\n\t\t\t\tgameObject.components.background.y2 = -canvasHeight;\n\t\t\t\tgameObject.components.background.started = false;\n\n\t\t\t\t// Player\n\n\t\t\t\tgameObject.components.player.x = canvasWidth * .5 - 30;\n\t\t\t\tgameObject.components.player.y = canvasHeight * 1.1;\n\t\t\t\tgameObject.components.player.allowPlayer = false;\n\t\t\t\tgameObject.components.player.movingUp = false;\n\t\t\t\tgameObject.components.player.movingDown = false;\n\t\t\t\tgameObject.components.player.movingRight = false;\n\t\t\t\tgameObject.components.player.movingLeft = false;\n\t\t\t\tgameObject.components.player.shooting = false;\n\t\t\t\tgameObject.components.player.speed = 1;\n\t\t\t\tgameObject.components.player.lives = 3;\n\t\t\t\tgameObject.components.player.invincible = false;\n\t\t\t\tgameObject.components.player.hitPoints = 1;\n\t\t\t\tgameObject.components.player.score = 0;\n\t\t\t\tgameObject.components.player.deathAnimationCanDraw = true;\n\t\t\t\tgameObject.components.player.shots = [];\n\t\t\t\tgameObject.components.player.shotType = 1;\n\t\t\t\tgameObject.components.player.collisionCircle.x = canvasWidth * .5;\n\t\t\t\tgameObject.components.player.collisionCircle.y =\n\t\t\t\tcanvasHeight * 1.1\t+ 30;\n\n\t\t\t\t// Power ups\n\n\t\t\t\tgameObject.components.powerUps.list = [];\n\t\t\t\tgameObject.components.powerUps.spawnInterval = 30000;\n\n\t\t\t\t// Enemies\n\n\t\t\t\tgameObject.components.enemies.list = [];\n\t\t\t\tgameObject.components.enemies.bosses = [];\n\t\t\t\tgameObject.components.enemies.shots = [];\n\t\t\t\tgameObject.components.enemies.spawnInterval = 6000;\n\n\t\t\t\t// States\n\n\t\t\t\tgameObject.state.inTransition = false;\n\t\t\t\tgameObject.state.started = false;\n\t\t\t\tgameObject.state.finished = false;\n\n\t\t\t\tgameObject.state.level1.started = false;\n\t\t\t\tgameObject.state.level1.bossStarted = false;\n\t\t\t\tgameObject.state.level1.bossFinished = false;\n\t\t\t\tgameObject.state.level1.inVictory = false;\n\t\t\t\tgameObject.state.level1.finished = false;\n\t\t\t\t\n\t\t\t\tgameObject.state.level2.started = false;\n\t\t\t\tgameObject.state.level2.bossStarted = false;\n\t\t\t\tgameObject.state.level2.bossFinished = false;\n\t\t\t\tgameObject.state.level2.inVictory = false;\n\t\t\t\tgameObject.state.level2.finished = false;\n\n\t\t\t\tgameObject.state.victory.intervalReferenceTime = 0;\n\n\t\t\t\t// Audio reset\n\n\t\t\t\tgameObject.audio.currentStereo.pan.value = 0;\n\t\t\t\tgameObject.audio.currentStereoValue = 0\n\n\t\t\t}", "title": "" }, { "docid": "27dba22166482684122e47b3bca23fff", "score": "0.5736004", "text": "function gameSettings(){\n\tthis.playerNames = [];\n\tthis.profession = \"\";\n\tthis.startMoney = 1500;\n\tthis.startMonth = \"\";\n}", "title": "" }, { "docid": "be7bc9a1846cb065928c0076ae0840e3", "score": "0.5735481", "text": "function Game() {}", "title": "" }, { "docid": "9d4641be9d343226a1b2fa86924e07a1", "score": "0.5728575", "text": "function setUpGame ( data ){\n\t$(\"#playAgain\").css(\"visibility\",\"hidden\")\n\t//check to make if the word has a valid definition, if not search again\n\tif (words[0].definition.total === 0){\n\t\tgetWords ()\n\t}\n\telse {\n\n\t\thiddenWord = words[0].word; \n\t\tnumGuesses = 7; \n\t\tnumSpaces = hiddenWord.length, \n\t\tguy = {\n\t\t\t\t6: \"head\", \n\t\t\t\t5: \"torso\",\n\t\t\t\t4: \"arm-right\", \n\t\t\t\t3: \"arm\",\n\t\t\t\t2: \"leg-right\", \n\t\t\t\t1: \"leg\"\n\t\t\t}\n\t\tconsole.log(hiddenWord)\n\t\tdrawBlanks (); \n\t\tupdateGuesses ();\n\n\t}\n}", "title": "" }, { "docid": "f4aab8bec657095bd13e62fdfb8297a6", "score": "0.5727093", "text": "function setUpGame() {\n // this should be changed if game should persist after refresh\n $.post(`${rootDir}/game/reset`, (data) => {\n createTopButtons(data);\n createGrid(data.numRows, data.numCols);\n });\n}", "title": "" }, { "docid": "9bdc0efd423c86d90d054d8473b0a0bd", "score": "0.57201684", "text": "function init() {\n // document.oncontextmenu = function() {return false;} //disable the right click context menu.\n \n gGame.isGameOver = false;\n gGame.isGameOn = false;\n\n gGame.flagedBombsCount = 0;\n gGame.markedCellsCount = 0;\n gGame.bombedCellsCount = 0;\n gGame.amountOfBombs = 0;\n gGame.safeClickCount = 3;\n gGame.areaHintCount = 3;\n\n gGame.health = LEVELS[gGame.levelIdx].health;\n gGame.isFirstClick = true;\n gGame.isAreaHint = false;\n gGame.isManualMinePosMod = false;\n gGame.isManualPosOn = false;\n\n gTimeParts.miliSec = 0;\n gTimeParts.sec = 0;\n gTimeParts.min = 0;\n gTimeParts.milSecStr = '00';\n gTimeParts.secondsStr= '00';\n gTimeParts.minutesStr = '00';\n \n clearInterval(gGame.timerInterval);\n gGame.timerInterval = null;\n\n gGame.bestTime = (localStorage.getItem(gGame.level+'BestTime'))? gGame.bestTime : Infinity;\n\n gGame.board = creatBoard(gGame.boardSize);\n renderBoard(gGame.board);\n renderHealth();\n\n document.querySelector('.game-container .game-statuse').innerText = GAME_ON;\n document.querySelector('.game-container .hint-buttons .safe-button span').innerText = gGame.safeClickCount;\n document.querySelector('.game-container .hint-buttons .hint-area-button span').innerText = gGame.areaHintCount;\n document.querySelector('.game-container .high-score h3 span').innerText = (gGame.bestTimeStr)? gGame.bestTimeStr : 'There is no best time..';\n document.querySelector('.game-container .stopwatch span').innerText = '00:00:00';\n\n gPrevStates = [];\n gCurrStateIdx = -1;\n gGame.playCount = 0;\n setNewState();\n}", "title": "" }, { "docid": "2f1fd8b0a1550cb74ff1f8301645027b", "score": "0.5713583", "text": "function buildAWall(player){\r\n\tdocument.getElementById('wall' + player).style.visibility = 'visible';\r\n\tGAME.BONUS_HANDLER.buildAWall = player;\r\n}", "title": "" }, { "docid": "f744b95e193c44a04fb73062ec14f16d", "score": "0.57095885", "text": "build(){\n this._predefinedBuild()\n }", "title": "" }, { "docid": "f744b95e193c44a04fb73062ec14f16d", "score": "0.57095885", "text": "build(){\n this._predefinedBuild()\n }", "title": "" }, { "docid": "f744b95e193c44a04fb73062ec14f16d", "score": "0.57095885", "text": "build(){\n this._predefinedBuild()\n }", "title": "" }, { "docid": "81ae68eb9ade89bce5de5ef6c4453ead", "score": "0.5705953", "text": "function set_up_game() {\n\t'use strict';\n\n\tlevel = 1;\n\tgameSequence = \"\";\n\tuserSequence = \"\";\n\n\t$(\"#startGame\").hide();\n\t$(\"#memoryDino\").hide();\n\t$(\"#gameMode\").show();\n\t$(\"#gameInfo\").hide();\n\n}", "title": "" }, { "docid": "0ed820c57a600b46dd25b530801d5ab1", "score": "0.5702368", "text": "function gameSetup(mode) {\n switch (mode) {\n case \"Easy\":\n maxPairs = 6; // value checked against pairsMatched value to determine if game has been won \n cardsLength = 12; // sets max amount of cards generated \n cardsPerGame = 'col-3'; // sets layout of cards \n columnStyle = 'game-mode-easy'; // calls from DOM what to be used in the gameBuild function\n time = 60000; // time for countdown timer \n startTime = '60s'; //always 60s, only card amount differs between difficulty\n break;\n case \"Medium\":\n maxPairs = 9;\n cardsLength = 18;\n cardsPerGame = 'col-2';\n columnStyle = 'game-mode-medium';\n time = 60000;\n startTime = '60s';\n break;\n case \"Hard\":\n maxPairs = 12;\n cardsLength = 24;\n cardsPerGame = 'col-2';\n columnStyle = 'game-mode-hard';\n time = 60000;\n startTime = '60s';\n break;\n }\n }", "title": "" }, { "docid": "9b48dfca48e4d8dc550af3da635a036e", "score": "0.5694368", "text": "constructor() {\n this.kCrossSprite = 'assets/conditionalDemo/Cross.png';\n this.kCircleSprite = 'assets/conditionalDemo/Circle.png';\n this.kFont = 'assets/fonts/Consolas-24';\n this.mMaxPlayerNum = 2;\n this.mTurnType = 'conditional';\n this.mNumBoxPerRow = 3;\n \n this.mMatrixRenderables = null; // Renderables for the boxes\n this.mCurAction = null;\n this.mCurActionRen = null;\n this.mActionsArr = null; // 3 * 3 actions\n this.mActionsRens = null;\n this.mParameters = null;\n \n this.mIsGameCompleted = false;\n \n this.mCamera = null;\n this.mTurnSystem = null;\n this.mCurrentPlayer = null;\n this.mInstruction = null;\n this.mWinner = null;\n }", "title": "" }, { "docid": "c7d8578253e1a4a88a0e2e79e0d432d0", "score": "0.56922084", "text": "function initGame(){\n window.game = GameRunner();\n}", "title": "" }, { "docid": "cc6a14f34cd103ad4972de8660470c61", "score": "0.5690823", "text": "function initGame() {\n initUI();\n setWinsAndLosses();\n}", "title": "" }, { "docid": "787fba6ec4df675970944e1e0819465e", "score": "0.56875724", "text": "function newGame() {\n\tcreateSaveTable()\n\tProcessScene('arcselect');\n}", "title": "" }, { "docid": "2b7ec8e5520da69ffd8c6e9b46fa489f", "score": "0.5680522", "text": "function defaultSetUp() {\n const livesElement = document.querySelectorAll('.life');\n for (lifeElement of livesElement) {\n lifeElement.style.display = 'inline-block';\n }\n document.querySelector(\".win-game\").setAttribute(\"data-win\",false);\n document.querySelector(\".game-continue\").style.display = \"none\";\n document.querySelector(\".game-over\").style.display = \"none\";\n document.querySelector(\".win-game\").style.display = \"none\";\n //set level to 1;\n document.querySelector(\".levelNum\").innerText = 1;\n document.querySelector(\"#play-again\").innerText = \"Continue\";\n\n\n\n\n}", "title": "" }, { "docid": "a5fb91ad81e879cecc69d00451dc2c3c", "score": "0.5679619", "text": "assignFunctions()\n {\n game.completeDraw = this.completeDraw\n game.showSprites = this.showSprites\n game.showLine = this.showLine\n game.makeBoardOnScreen = this.makeBoardOnScreen;\n game.switchTurn = this.switchTurn;\n game.placePiece = this.placePiece\n game.makeBoardAsArray = this.makeBoardAsArray\n game.addSprite = this.addSprite\n game.displayDraw = this.displayDraw\n game.displayWinner = this.displayWinner\n game.saveBoard = this.saveBoard\n game.isOver = this.isOver\n game.printBoard = this.printBoard\n game.updateBoard = this.updateBoard\n game.assignID = this.assignID\n game.assignRoom = this.assignRoom\n game.startMatch = this.startMatch\n game.synchronizeTurn = this.synchronizeTurn\n game.restartMatch = this.restartMatch\n game.askForRematch = this.askForRematch\n game.updateTurnStatus = this.updateTurnStatus\n game.convertIndexesToCoords = this.convertIndexesToCoords\n game.addSpriteNoScale = this.addSpriteNoScale\n game.drawWinningLine = this.drawWinningLine\n\n game.minimax = this.minimax\n game.gameIsWon = this.gameIsWon\n game.emptyIndexies = this.emptyIndexies\n game.convertRandMove = this.convertRandMove\n game.convertMove = this.convertMove\n game.placePieceAt = this.placePieceAt\n game.boardToArray = this.boardToArray\n game.spliceBoard = this.spliceBoard\n game.aiMakesMove = this.aiMakesMove\n }", "title": "" }, { "docid": "a0e7b9931a8309f1e261a93c57db1709", "score": "0.567208", "text": "function newGame() {\n gameOver=false;\n createCanvas(windowWidth,windowHeight);\n background(\"#ffff00\");\n // Setting up variables for target width, height and number of decoys\n numDecoys = random(100,200);\n // Randomized variable used for target and decoy sizes\n s = random(0.5,1.5);\n\n // Draws decoys\n drawDecoy();\n\n // Draws target\n drawTarget();\n\n // Wanted Poster (target indication) UI element\n wantedPoster();\n\n // Setting up target random movement at game over screen\n timeX = random(0,1000);\n timeY = random(0,1000);\n}", "title": "" }, { "docid": "1423e6c721b8a8b741d6c84834713244", "score": "0.56693196", "text": "function newGame() {\n\t//Regenerate grid\n\tif (main_grid.unit_container.children.length > 0) main_grid.unit_container.removeChildren();\n\tmain_grid.grid = generate2dGrid(main_grid);\n\tif (next_grid.unit_container.children.length > 0) next_grid.unit_container.removeChildren();\n\tnext_grid.grid = generate2dGrid(next_grid);\n\n\t//Generate shape_next ids\n\tfor (var n = 0; n < next_shape_generate; n++) {\n\t\tif (n > next_shape.length - 1) {\n\t\t\tnext_shape.push(Math.floor((Math.random() * Shapes.length) + 0));\n\t\t} else {\n\t\t\tnext_shape[n] = Math.floor((Math.random() * Shapes.length) + 0);\n\t\t}\n\t}\n\n\t//Set active shape\n\tc_block_obj = new Shapes[next_shape[0]](Math.floor(main_grid.width/2), main_grid.height);\n\tshiftPreview(next_shape, next_grid);\n\n\t//Spawn shape into main_grid\n\tdrawShape(main_grid, -1, c_block_obj);\n\tblock_present = true;\n\n\t//Reset vars\n\tstats = {\n\t\tscore: 0,\t\t\t\t\t//current score\n\t\tlevel: 1,\t\t\t\t\t//current level\n\t\tbase_level: 1,\t\t\t\t//starting level\n\t\ttotal_lines: 0,\t\t\t\t//total number of lines cleared the game\n\t\tconsec_clears: 0,\t\t\t//number of non-stop consecutive clears\n\t\tconsec_tetris: 0,\t\t\t//number of tetrises in a row\n\t\tconsec_t_spin_mini: 0,\t\t//number of t-spin mini clear in a row (no wall-kick)\n\t\tconsec_t_spin_combo: 0\t\t//number of t-spin clears in a row (wall-kick)\n\t};\n\n\telapsed_time = 0;\t\t\t\t\t\t//elapsed time from start of game\n\tgravity_time = 1 / gravity;\t\t\t\t//cooldown time for gravity to happen\n\tc_gravity_timer = gravity_time;\t\t\t//countdown timer for gravity to happen\n\tc_drop_timer = 0;\t\t\t\t\t\t//countdown timer to next drop\n\tisSet = false;\t\t\t\t\t\t\t//if tetromino is already at setting position\n\tc_set_timer = 0;\t\t\t\t\t\t//set countdown timer\n\tpaused = false;\n}", "title": "" }, { "docid": "6d2ca2f52f5262e7a395546ea0237181", "score": "0.56664413", "text": "function initializeVariables() {\n // have computer pick a number between 19-120\n targetScore = 19 + Math.floor(Math.random() * 102);\n // pick random gem values between 1-12\n blueValue = 1 + Math.floor(Math.random() * 12);\n pinkValue = 1 + Math.floor(Math.random() * 12);\n orangeValue = 1 + Math.floor(Math.random() * 12);\n purpleValue = 1 + Math.floor(Math.random() * 12);\n // set initial value of user's ongoing gem selections sum to 0\n yourScore = 0;\n // update the html for the game board *\n $(\"#wins\").html(`<p> wins: ${wins} </p>`);\n $(\"#losses\").html(`<p> Losses: ${losses}</p>`);\n $(\"#start\").html(`<p> Target Score: ${targetScore}`);\n $(\"#score\").html(`<p> Your Score: ${yourScore} </p>`);\n consoleLogVariables();\n }", "title": "" }, { "docid": "9fe25cbc97767945d318bc19026bb2fd", "score": "0.5666281", "text": "start(){\n console.log(this.gamestate)\n if(this.gamestate !== GAMESTATE.MENU &&\n this.gamestate !==GAMESTATE.RESET) return;\n\n this.grains = buildLevel(this,level1);\n \n this.gameObjects = [\n this.mashpaddle, this.hop\n ]\n\n this.gamestate = GAMESTATE.RUNNING;\n }", "title": "" }, { "docid": "927f5b639a0ec06ba1b978926ce3cf0c", "score": "0.5665576", "text": "resetGame() {\n this.setBoard();\n this.whoseTurn = 1;\n this.canCastle = { '-1': [true, true], '1': [true, true] };\n this.enpassant = [];\n this.promotion = { '-1': -5, '1': 5 };\n this.kingPosition = { '-1': [7, 4], '1': [0, 4] };\n this.kingChecked = { '-1': false, '1': false };\n this.isBlocked = true;\n }", "title": "" }, { "docid": "a8e0ece615f2f22c0170708d63560aaa", "score": "0.5662566", "text": "function initGame() {\n showOrHideScreen(startScreen, 'none', finishScreen, 'none');\n boardScreen.style.display = 'block';\n finishScreen.classList.remove('screen-win-tie');\n finishScreen.classList.remove('screen-win-one');\n finishScreen.classList.remove('screen-win-two');\n playerOne.classList.remove('active');\n playerTwo.classList.remove('active');\n playerOne.classList.add('active');\n activePlayer = 1;\n round = 0;\n\n for (var i = 0; i < box.length; i++) {\n box[i].classList.remove('box-filled-1');\n box[i].classList.remove('box-filled-2');\n box[i].style.backgroundImage = 'none'\n }\n }", "title": "" }, { "docid": "22848343484a9016336ad8aeba72cfcf", "score": "0.56604326", "text": "function loadGame() {\n game.createBoard();\n for (let i = 0; i < numObstacles; i += 1) {\n game.obstacles('obstacle');\n }\n\n blackBelt.add();\n redBelt.add();\n blueBelt.add();\n greenBelt.add();\n yellowBelt.add();\n player1.add();\n player2.add();\n combat1.add();\n combat2.add();\n combat3.add();\n combat4.add();\n scroll.add();\n setPlayerData('#player-1', player1);\n setPlayerData('#player-2', player2);\n $('.player1').addClass('active');\n}", "title": "" }, { "docid": "682a4e291fa29ec9c579f3862e81f07f", "score": "0.5658356", "text": "function newGame() {\n\n level = 0;\n gamePattern = [];\n startedGame = false;\n\n}", "title": "" }, { "docid": "9589b085229eb59fe8935c5ce7afa41d", "score": "0.56561536", "text": "build() {\n\t\treturn this.gameState;\n\t}", "title": "" }, { "docid": "5139880b6dd842ee4f78ab88c566a2d6", "score": "0.5652465", "text": "function setupGame(){\r\n debugando = setInterval(debugar, 100);\r\n\r\n var aranha = $(\"#aranha\");\r\n criarInseto(aranha, 800, 700, moverParaEsquerda, moverParaCima);\r\n\r\n var ladybug = $(\"#ladybug\");\r\n criarInseto(ladybug, 300, 250, moverParaDireita, moverParaCima);\r\n\r\n var dengue = $(\"#dengue\");\r\n criarInseto(dengue, 450, 650, moverParaEsquerda, moverParaBaixo);\r\n\r\n var mosquito = $(\"#mosquito\");\r\n criarInseto(mosquito, 150, 550, moverParaDireita, moverParaCima);\r\n\r\n var besouro = $(\"#besouro\");\r\n criarInseto(besouro, 250, 350, moverParaEsquerda, moverParaCima);\r\n //$(\"#mydiv\").css({top: 200, left: 200, position:'absolute'});\r\n\r\n $(\"#telaFinal\").hide();\r\n $(avatar).css(\"left\", posXAvatar);\r\n $(avatar).css(\"top\", posYAvatar);\r\n $(avatar).hide();\r\n $( \"#info\" ).hide();\r\n }", "title": "" }, { "docid": "6d108dd0831d55aab35dd6a2c5ca2df8", "score": "0.56511855", "text": "function onld() {\r\n game = new Game(\"holder\");\r\n}", "title": "" }, { "docid": "464d986b5c91edadec9da7327dea9848", "score": "0.5649508", "text": "constructor(){\n this.gridSize = 3; \n this.score = 0; \n this.highScore = 0;\n this.gameScore = 128;\n this.isGameWon = false;\n }", "title": "" }, { "docid": "7b13f3109a10fbda11ef0ef509e2bc42", "score": "0.5648454", "text": "static initBoards() {\r\n if (this.initFlag) {\r\n console.warn('Boards already initialized!');\r\n } else {\r\n this.initFlag = true;\r\n }\r\n\r\n for (let i = 0; i <= 7; i++) {\r\n for (let j = 0; j <= 7; j++) {\r\n this.gameboard[i][j] = TILE.EMPTY;\r\n this.stabTracker[i][j] = STATUS.STABLE;\r\n }\r\n }\r\n\r\n this.setDifficulty('easy');\r\n }", "title": "" }, { "docid": "5018b44d8ad09992812c32ea45a8dd38", "score": "0.5638877", "text": "function gameSetup() {\n state = \"play\";\n background(218, 184, 136);\n displayBoard();\n generatePlayBoard();\n if (mode === \"against computer\") {\n currentMove = \"white\";\n turnState = \"human\";\n }\n else if (mode === \"against human\") {\n currentMove = \"white\";\n turnState = \"human\";\n }\n}", "title": "" }, { "docid": "5fa550787496b88fb8aff00cae495324", "score": "0.5636198", "text": "function gamePageInit() {\r\n restartGame()\r\n fadeOut(controls, 0);\r\n disableControlBnts();\r\n TweenMax.set([player1Details, player2Details], { autoAlpha: 0 });\r\n TweenMax.set(player1Hand, { autoAlpha: 0 });\r\n TweenMax.set(player2Hand, { autoAlpha: 0 });\r\n TweenMax.set(msgInfo, { autoAlpha: 0, scale: 0.4 });\r\n TweenMax.set(msgChooseHand, { autoAlpha: 0, scale: 0.4 });\r\n TweenMax.set(msgNumbers, { autoAlpha: 0, scale: 0.4 });\r\n TweenMax.set(bigWinIcon, { autoAlpha: 0, scale: 0.4 });\r\n TweenMax.set(bigLoseIcon, { autoAlpha: 0, scale: 0.4 });\r\n TweenMax.set(bigDrawIcon, { autoAlpha: 0, scale: 0.4 });\r\n TweenMax.set(endGameMsg, { autoAlpha: 0 });\r\n\r\n playTurn(true);\r\n\r\n player1Name.textContent = game.player1.userName;\r\n player1Img.src = `./img/avatars/${game.player1.avatarImg}.png`;\r\n\r\n player2Name.textContent = game.player2.userName;\r\n player2Img.src = `./img/avatars/${game.player2.avatarImg}.png`;\r\n\r\n if (handsIdleAnim.length === 0) {\r\n startHandIdleAnim();\r\n }\r\n}", "title": "" }, { "docid": "c5cf402101aac4992e0388fe9f12b54e", "score": "0.5634881", "text": "function initGame() {\n\n\t\t// setup each room in the game, each room contains doors, walls, and notes\n\t\tlet rD, roomsData;\n\t\trD = roomsData = [\n\t\t\t/**\n\t\t\t8888888b. .d8888b. \n\t\t\t888 Y88b d88P Y88b \n\t\t\t888 888 888 888 \n\t\t\t888 d88P .d88b. .d88b. 88888b.d88b. 888 888 \n\t\t\t8888888P\" d88\"\"88b d88\"\"88b 888 \"888 \"88b 888 888 \n\t\t\t888 T88b 888 888 888 888 888 888 888 888 888 \n\t\t\t888 T88b Y88..88P Y88..88P 888 888 888 Y88b d88P \n\t\t\t888 T88b \"Y88P\" \"Y88P\" 888 888 888 \"Y8888P\" \n\t\t\t*/\n\t\t\t{\t\n\t\t\t\tfloorsData: [\n\t\t\t\t\t{ fw: 50, fh: 50, fd: 0.0001, fm: 0, x: 0, y: 0, z: 25, rx: -90, ry: 0, rz: 0,\n\t\t\t\t\tfloorTexture: './img/floor-wood-min.jpg', u: 2, v: 1 }\n\t\t\t\t],\n\t\t\t\tdoorsData: [\n\t\t\t\t\t{ dw: 8, dh: 11, dd: 0.5, df: 0.5, dm: 10, dld: 0.66, x: 0, y: 0, z: 0, rx: 0, ry: 0, rz: 0,\n\t\t\t\t\tanswer: Game.CORRECT_ANSWER,\n\t\t\t\t\tfrontTexture: './img/door-face-front-min.jpg',\n\t\t\t\t\tsideTexture: './img/door-face-side-min.jpg',\n\t\t\t\t\thandleModel: './model/door-handle.json',\n\t\t\t\t\thandleTexture: './img/door-handle-min.jpg' },\n\t\t\t\t\t{ dw: 8, dh: 11, dd: 0.5, df: 0.5, dm: 10, dld: 0.66, x: 20, y: 0, z: 0, rx: 0, ry: 0, rz: 0,\n\t\t\t\t\tanswer: Game.WRONG_ANSWER,\n\t\t\t\t\tfrontTexture: './img/door-face-front-min.jpg',\n\t\t\t\t\tsideTexture: './img/door-face-side-min.jpg',\n\t\t\t\t\thandleModel: './model/door-handle.json',\n\t\t\t\t\thandleTexture: './img/door-handle-min.jpg' }\n\t\t\t\t],\n\t\t\t\twallsData: [\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: 0, y: 0, z: 0, rX: 0, rY: 0, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return [room.doors[0], room.doors[1]]; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: 25, y: 0, z: 25, rX: 0, rY: 90, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return []; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: 0, y: 0, z: 50, rX: 0, rY: 0, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return []; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: -25, y: 0, z: 25, rX: 0, rY: 90, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return []; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t],\n\t\t\t\tnotesData: [ \n\t\t\t\t\t{ w: 5, h: 3, d: 0.001, x: 0, y: 8, z: 49, rX: 0, rY: 0, rZ: 0,\n\t\t\t\t\t\tfileName: 'note1.png' }\n\t\t\t\t],\n\t\t\t\tcheckExitConditionFunc: function() {\n\t\t\t\t\tgame.exitConditions( { boundary: { x: [-25, 25], y: [0, 20], z: [0, 50] } } );\n\t\t\t\t},\n\t\t\t\tpreviousFunc: function() {\n\t\t\t\t},\n\t\t\t\tresetFunc: function() {\n\t\t\t\t\tgame.exitRoom( { answer: Game.WRONG_ANSWER, position: { x: 20, y: 0, z: 10 }, rotation: { rx: 0, ry: 180 } } );\n\t\t\t\t},\n\t\t\t\tnextFunc: function() {\n\t\t\t\t\tgame.exitRoom( { answer: Game.CORRECT_ANSWER, position: { x: 0, y: 0, z: 40 } } );\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t8888888b. d888 \n\t\t\t888 Y88b d8888 \n\t\t\t888 888 888 \n\t\t\t888 d88P .d88b. .d88b. 88888b.d88b. 888 \n\t\t\t8888888P\" d88\"\"88b d88\"\"88b 888 \"888 \"88b 888 \n\t\t\t888 T88b 888 888 888 888 888 888 888 888 \n\t\t\t888 T88b Y88..88P Y88..88P 888 888 888 888 \n\t\t\t888 T88b \"Y88P\" \"Y88P\" 888 888 888 8888888 \n\t\t\t*/\n\t\t\t{\t\n\t\t\t\tfloorsData: [\n\t\t\t\t\t{ fw: 50, fh: 50, fd: 0.0001, fm: 0, x: 0, y: 0, z: 25, rx: -90, ry: 0, rz: 0,\n\t\t\t\t\tfloorTexture: './img/floor-wood-min.jpg', u: 2, v: 1 }\n\t\t\t\t],\n\t\t\t\tdoorsData: [\n\t\t\t\t\t{ dw: 8, dh: 11, dd: 0.5, df: 0.5, dm: 10, dld: 0.66, x: 0, y: 0, z: 0, rx: 0, ry: 0, rz: 0,\n\t\t\t\t\tanswer: Game.CORRECT_ANSWER,\n\t\t\t\t\tfrontTexture: './img/door-face-front-min.jpg',\n\t\t\t\t\tsideTexture: './img/door-face-side-min.jpg',\n\t\t\t\t\thandleModel: './model/door-handle.json',\n\t\t\t\t\thandleTexture: './img/door-handle-min.jpg' },\n\t\t\t\t\t{ dw: 8, dh: 11, dd: 0.5, df: 0.5, dm: 10, dld: 0.66, x: 0, y: 0, z: 50, rx: 0, ry: 180, rz: 0,\n\t\t\t\t\tanswer: Game.PREVIOUS_ROOM,\n\t\t\t\t\tfrontTexture: './img/door-face-front-min.jpg',\n\t\t\t\t\tsideTexture: './img/door-face-side-min.jpg',\n\t\t\t\t\thandleModel: './model/door-handle.json',\n\t\t\t\t\thandleTexture: './img/door-handle-min.jpg' }\n\t\t\t\t],\n\t\t\t\twallsData: [\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: 0, y: 0, z: 0, rX: 0, rY: 0, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return [room.doors[0]]; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: 25, y: 0, z: 25, rX: 0, rY: 90, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return []; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: 0, y: 0, z: 50, rX: 0, rY: 0, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return [room.doors[1]]; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t\t{ w: 50, h: 20, d: 1, m: 0, x: -25, y: 0, z: 25, rX: 0, rY: 90, rZ: 0,\n\t\t\t\t\t\tgetDoors: function( room ) { return []; },\n\t\t\t\t\t\twallTexture: './img/wallpaper-min.jpg', u: 2, v: 1 },\n\t\t\t\t],\n\t\t\t\tnotesData: [\n\t\t\t\t\t{ w: 3, h: 5, d: 0.001, x: -24, y: 8, z: 25, rX: 0, rY: 90, rZ: 0,\n\t\t\t\t\t\tfileName: 'note2.png' },\n\t\t\t\t\t{ w: 11, h: 11, d: 0.001, x: +15, y: 8, z: 49, rX: 0, rY: 0, rZ: 0,\n\t\t\t\t\t\tfileName: 'news-min.jpg' },\n\t\t\t\t],\n\t\t\t\tcheckExitConditionFunc: function() {\n\t\t\t\t\tgame.exitConditions( { boundary: { x: [-25, 25], y: [0, 20], z: [0, 50] } } );\n\t\t\t\t},\n\t\t\t\tpreviousFunc: function() {\n\t\t\t\t\tgame.exitRoom( { answer: Game.PREVIOUS_ROOM, position: { x: 0, y: 0, z: 10 } } \t\t\t\t\n) ;\n\t\t\t\t},\n\t\t\t\tresetFunc: function() {\n\t\t\t\t},\n\t\t\t\tnextFunc: function() {\n\t\t\t\t\tgame.win();\n\t\t\t\t}\n\t\t\t},\n\t\t];\n\t\tgame.NUM_ROOMS = rD.length;\n\t\tgame.rooms = [];\n\t\t// start all rooms with complete values === false\n\t\tfor ( let r = 0; r < game.NUM_ROOMS; ++r ) {\n\t\t\tgame.rooms.push( false );\n\t\t}\n\t\t// window.cancelAnimationFrame( game.stopGameLoop ) can be called to stopGameLoop\n\t\t// \tthe main requestAnimationFrame() loop\n\t\tgame.stopGameLoop = 0;\n\t\t// lock input logic\n\t\tgame.inputLocked = true;\n\t\tgame.lockInput = function() { game.inputLocked = true; };\n\t\tgame.unlockInput = function() { game.inputLocked = false; };\n\t\t// setup the player\n\t\tgame.player = createPlayer( { eyeRadius: 3, eyeMass: 10, eyeLinearDamping: 0.99, eyeOpacity: 0.1, eyeStartPos: { x: 0, y: 0, z: 25 } } );\n\t\t// start game on it's initial room\n\t\tgame.currRoom = 0;\n\t\t// game begins each room's reset logic and then rooms's run their own reset logic\n\t\tgame.startRoomReset = function() {\n\t\t\t// dim the scene, dimmer calls room.reset() on opacity: 1 && room.state === CORRECT/WRONG_ANSWER\n\t\t\tdimmer.set( 1 );\n\t\t\tgame.lockInput();\n\t\t};\n\t\t// finish the current room's reset based on the door player exited from\n\t\tgame.finishRoomReset = function() {\n\t\t\tlet room = game.room;\n\t\t\tif ( room.state === Game.PREVIOUS_ROOM ) {\n\t\t\t\troom.previous();\n\t\t\t}\n\t\t\tif ( room.state === Game.WRONG_ANSWER ) {\n\t\t\t\troom.reset();\n\t\t\t}\n\t\t\tif ( room.state === Game.CORRECT_ANSWER ) {\n\t\t\t\troom.next();\n\t\t\t}\n\t\t};\n\t\t// open all doors of the current room and flag it as 'completed' true\n\t\tgame.openDoors = function() {\n\t\t\t// open all doors for current room\n\t\t\tfor ( let i = 0; i < game.room.doors.length; ++i ) {\n\t\t\t\tgame.room.doors[i].body.open();\n\t\t\t}\n\t\t\t// flag current room for all doors open\n\t\t\tgame.rooms[game.currRoom] = true;\n\t\t};\n\t\t// on creating room, player polls until it is fully loaded\n\t\tgame.pollForRoomLoaded = function() {\n\t\t\tif ( game.room.isLoaded ) {\n\t\t\t\tclearInterval( game.intervalID );\n\t\t\t\t// show room once all textures and objects loaded\n\t\t\t\tdimmer.set( 0 );\n\t\t\t\tgame.unlockInput();\n\t\t\t\t// if room already solved or has no notes, open doors\n\t\t\t\tif ( game.rooms[game.currRoom] || game.room.readCount === game.room.NUM_NOTES ) {\n\t\t\t\t\tgame.openDoors();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// create a room given a room number\n\t\tgame.createRoom = function( roomNumber ) {\n\n\t\t\tlet room = {}, r = roomNumber;\n\t\t\troom.state = Game.NO_ANSWER;\n\t\t\t// textures and objects loaded starts at 0\n\t\t\troom.stuffsLoaded = 0;\n\t\t\t// for each texture/obj loaded, up count and check if everything loaded\n\t\t\troom.loadedStuffs = function() {\n\t\t\t\troom.stuffsLoaded++;\n\t\t\t}\n\t\t\t// check if all of this room's textures & objects loaded\n\t\t\troom.isLoaded = function() {\n\t\t\t\treturn room.stuffsLoaded === room.NUM_STUFFS;\n\t\t\t}\n\t\t\n\t\t\t// create floor\n\t\t\tlet fD = rD[r].floorsData;\n\t\t\troom.NUM_FLOORS = fD.length;\n\t\t\troom.floors = [];\n\t\t\tfor ( let i = 0; i < room.NUM_FLOORS; ++i ) {\n\t\t\t\troom.floors.push( createFloor( room, {\n\t\t\t\t\tfloorWidth: fD[i].fw, floorHeight: fD[i].fh, floorDepth: fD[i].fd, floorMass: fD[i].fm,\n\t\t\t\t\tfloorPosition: { x: fD[i].x, y: fD[i].y, z: fD[i].z },\n\t\t\t\t\tfloorRotation: { rx: fD[i].rx, ry: fD[i].ry, rz: fD[i].rz },\n\t\t\t\t\tfloorTexture: fD[i].floorTexture, u: fD[i].u, v: fD[i].v\n\t\t\t\t} ) );\n\t\t\t}\n\t\t\t// create doors\n\t\t\tlet dD = rD[r].doorsData;\n\t\t\troom.NUM_DOORS = dD.length;\n\t\t\troom.doors = [];\n\t\t\tfor ( let i = 0; i < room.NUM_DOORS; ++i ) {\n\t\t\t\troom.doors.push( createDoor( room, {\n\t\t\t\t\t\tdoorWidth: dD[i].dw, doorHeight: dD[i].dh, doorDepth: dD[i].dd,\n\t\t\t\t\t\tdoorOffset: dD[i].df, doorMass: dD[i].dm, doorLinearDamping: dD[i].dld,\n\t\t\t\t\t\tdoorPosition: { x : dD[i].x, y : dD[i].y, z : dD[i].z },\n\t\t\t\t\t\tdoorRotation: { x: dD[i].rx, y: dD[i].ry, z: dD[i].rz },\n\t\t\t\t\t\tdoorAnswer: dD[i].answer,\n\t\t\t\t\t\tdoorFaceFrontTexture: dD[i].frontTexture,\n\t\t\t\t\t\tdoorFaceSideTexture: dD[i].sideTexture,\n\t\t\t\t\t\tdoorHandleModel: dD[i].handleModel,\n\t\t\t\t\t\tdoorHandleTexture:dD[i].handleTexture \n\t\t\t\t} ) );\n\t\t\t}\n\t\t\t// create walls\n\t\t\tlet wD = rD[r].wallsData;\n\t\t\troom.NUM_WALLS = wD.length;\n\t\t\troom.walls = [];\n\t\t\tfor ( let i = 0; i < room.NUM_WALLS; ++i ) {\n\t\t\t\troom.walls.push( createWall( room, {\n\t\t\t\t\t\twallWidth: wD[i].w, wallHeight: wD[i].h, wallDepth: wD[i].d,\n\t\t\t\t\t\twallPosition: { x: wD[i].x, y: wD[i].y, z: wD[i].z },\n\t\t\t\t\t\twallRotation: { x: wD[i].rX, y: wD[i].rY, z: wD[i].rZ },\n\t\t\t\t\t\twallMass: wD[i].m,\n\t\t\t\t\t\tgetWallDoors: wD[i].getDoors,\n\t\t\t\t\t\twallTexture: wD[i].wallTexture, u: wD[i].u, v: wD[i].v\n\t\t\t\t} ) );\n\t\t\t}\n\t\t\t// create notes\n\t\t\tlet nD = rD[r].notesData;\n\t\t\troom.NUM_NOTES = nD.length;\n\t\t\troom.notes = []\n\t\t\troom.readCount = 0;\n\t\t\tfor ( let i = 0; i < room.NUM_NOTES; ++i ) {\n\t\t\t\troom.notes.push( createNote( room, {\n\t\t\t\t\t\tnoteWidth: nD[i].w, noteHeight: nD[i].h, noteDepth: nD[i].d,\n\t\t\t\t\t\tx: nD[i].x, y: nD[i].y, z: nD[i].z,\n\t\t\t\t\t\trX: nD[i].rX, rY: nD[i].rY, rZ: nD[i].rZ,\n\t\t\t\t\t\tfileName: nD[i].fileName\n\t\t\t\t} ) );\n\t\t\t}\n\t\t\t// check if player has exited room through a door\n\t\t\troom.checkExitCondition = rD[r].checkExitConditionFunc;\n\t\t\t// go to previous room logic\n\t\t\troom.previous = rD[r].previousFunc;\n\t\t\t// reset room logic\n\t\t\troom.reset = rD[r].resetFunc;\n\t\t\t// go to next room logic\n\t\t\troom.next = rD[r].nextFunc;\n\t\t\t// count all models and textures that should be loaded\n\t\t\troom.NUM_STUFFS = rD[r].floorsData.length + rD[r].doorsData.length*4 + rD[r].notesData.length;\n\t\t\tfor ( let i = 0; i < rD[r].wallsData.length; ++i ) {\n\t\t\t\tif ( rD[r].wallsData[i].getDoors(room).length ) {\n\t\t\t\t\troom.NUM_STUFFS += rD[r].wallsData[i].getDoors(room).length*4 + 2;\n\t\t\t\t} else {\n\t\t\t\t\troom.NUM_STUFFS++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// poll until everything is loaded and player can begin exploring room\n\t\t\tgame.intervalID = window.setInterval( game.pollForRoomLoaded, 500 );\n\n\t\t\treturn room;\n\t\t};\n\t\t// init the first room\n\t\tgame.room = game.createRoom( game.currRoom );\n\t\t// destroy room's bodies and meshes before a new one can be created\n\t\tgame.destroyRoom = function() {\n\t\t\t// destroy floor\n\t\t\tfor ( let i = 0; i < game.room.NUM_FLOORS; ++i ) {\n\t\t\t\tdeleteMesh( game.room.floors[i] );\n\t\t\t\tdeleteBody( game.room.floors[i].body );\n\t\t\t\tdeleteFloor( game.room.floors[i] );\n\t\t\t}\n\t\t\t// destroy doors\n\t\t\tfor ( let i = 0; i < game.room.NUM_DOORS; ++i ) {\n\t\t\t\tdeleteMesh( game.room.doors[i].handle );\n\t\t\t\tdeleteMesh( game.room.doors[i] );\n\t\t\t\tdeleteBody( game.room.doors[i].body );\n\t\t\t\tdeleteDoor( game.room.doors[i] );\n\t\t\t}\n\t\t\t// destroy walls\n\t\t\tfor ( let i = 0; i < game.room.NUM_WALLS; ++i ) {\n\t\t\t\tdeleteMesh( game.room.walls[i] );\n\t\t\t\tdeleteBody( game.room.walls[i].body );\n\t\t\t\tdeleteWall( game.room.walls[i] );\n\t\t\t}\n\t\t\t// destroy notes\n\t\t\tfor ( let i = 0; i < game.room.NUM_NOTES; ++i ) {\n\t\t\t\tdeleteMesh( game.room.notes[i] );\n\t\t\t\tdeleteNote( game.room.notes[i] );\n\t\t\t}\n\t\t\t// delete pick objects and set size to 0\n\t\t\tdeletePickObjects();\n\t\t\t// set all loaded textures and objects to 0\n\t\t\tgame.room.loadedStuffs = 0;\n\t\t};\n\t\t// handler for exit room conditions\n\t\tgame.exitConditions = function( ops ) {\n\t\t\tlet xmin = ops.boundary.x[0], xmax = ops.boundary.x[1], ymin = ops.boundary.y[0], ymax = ops.boundary.y[1], zmin = ops.boundary.z[0], zmax = ops.boundary.z[1];\n\t\t\tlet player = game.player, room = game.room;\n\t\t\t// generally, best way to do this is to check for the closest door\n\t\t\t//\tto the player on exit and grab the ca/wa from that door.\n\t\t\tif ( player.position.x < xmin || player.position.x > xmax ||\n\t\t\t\tplayer.position.y < ymin || player.position.y > ymax ||\n\t\t\t\tplayer.position.z < zmin || player.position.z > zmax\n\t\t\t) {\n\t\t\t\t// get the closest door to player\n\t\t\t\tlet closest = { door: room.doors[0], d: player.position.distanceTo( room.doors[0].position ) };\n\t\t\t\tfor ( let i = 1; i < room.doors.length; ++i ) {\n\t\t\t\t\tlet dist = player.position.distanceTo( room.doors[i].position );\n\t\t\t\t\tclosest = ( closest.d < dist )? closest : { door: room.doors[i], d: dist };\n\t\t\t\t}\n\t\t\t\t// set the room state to the closest door's answer\n\t\t\t\troom.state = closest.door.answer;\n\t\t\t}\n\t\t}\n\t\t// handler for exiting room\n\t\tgame.exitRoom = function( ops ) {\n\t\t\tlet answer = ops.answer, x = ops.position.x, y = ops.position.y, z = ops.position.z;\n\t\t\tlet rx = ops.rotation? ops.rotation.rx*THREE.Math.DEG2RAD : 0;\n\t\t\tlet ry = ops.rotation? ops.rotation.ry*THREE.Math.DEG2RAD : 0;\n\n\t\t\t// remove all bodies and meshes in current room\n\t\t\tgame.destroyRoom();\n\t\t\t// player moving to next room based on door answer\n\t\t\tif ( answer === Game.CORRECT_ANSWER ) { game.currRoom++; }\n\t\t\tif ( answer === Game.WRONG_ANSWER ) {}\n\t\t\tif ( answer === Game.PREVIOUS_ROOM ) { game.currRoom--; }\n\t\t\t// create the new room\n\t\t\tgame.room = game.createRoom( game.currRoom );\n\t\t\t// reset player BODY's position for this room\n\t\t\tgame.player.body.position.set( x, y + game.player.height, z );\n\t\t\t// reset player's rotation (players may start at weird positions)\n\t\t\trotX -= rx; targetRotationX -= rx;\n\t\t\trotY -= ry; targetRotationY -= ry;\n\t\t}\n\t\t// win the game, great job!\n\t\tgame.win = function() {\n\t\t\thud.show( 'end-min.jpg', { width: '100vw', height: '100vh', time: '3s' } );\n\t\t}\n\n\t}", "title": "" }, { "docid": "7472d4855467a0bf0aeb158872c3da91", "score": "0.5632644", "text": "function _default() {\n _classCallCheck(this, _default);\n\n this._currentOptions = [\"Host Game\", \"Join Game\"];\n }", "title": "" }, { "docid": "80ed6cbe2645f38043a430c0e6b621aa", "score": "0.56307995", "text": "function game() {\r\n dessinerSerpent();\r\n dessinerPomme();\r\n detectionCollition();\r\n verifMangerPomme();\r\n gestionVieSerpent();\r\n gestionAffichageBonus();\r\n }", "title": "" }, { "docid": "f0343c729db142c2af03189f0023a899", "score": "0.56283915", "text": "function Game_Troop(){this.initialize.apply(this,arguments);}", "title": "" }, { "docid": "4c46b52dec612cfd346098273e91dc46", "score": "0.562638", "text": "setGameParameters(minLive, maxLive, minBirth, maxBirth) {\n this.gameMaterial.defines = {\n MIN_LIVE: minLive,\n MAX_LIVE: maxLive,\n MIN_BIRTH: minBirth,\n MAX_BIRTH: maxBirth\n };\n\n this.gameMaterial.needsUpdate = true;\n // We could keep going here, but it\n // makes more sense to restart.\n const state = this.randomizeBoard();\n this.textures = this.createTextures();\n this.setState(state);\n }", "title": "" }, { "docid": "f819ad076f71819e3b50a639037838a7", "score": "0.56262386", "text": "function newGame() {\n\twin = false;\n\telementsCreation();\n\teventCreation();\n\tShowScore();\n}", "title": "" }, { "docid": "2af2cea86c02272cf29ef95518809e04", "score": "0.56247383", "text": "function Game() {\n\n this.showWelcomeForm();\n this.win = false;\n\n this.countOfAllBoxes = 0;\n this.grid = null;\n this.storages = [];\n this.character = null;\n\n}", "title": "" }, { "docid": "978244fff1c8e0914d5e4e7b02ac85a8", "score": "0.56229556", "text": "function newGame() {\n\n}", "title": "" } ]